on master help sign in
First lot of source files and paper
commitdc0c198f0ca1aad56093f50409971c10d0fe304b authorEdwin Brady <eb@cs.st-andrews.ac.uk> dateWed 14 Sep 2011, 17:59 (15 years ago) parent6aac1a9
21 files changed+9195
LICENSE+32 impl-paper/Makefile+41 impl-paper/acmtrans.bst+1770 impl-paper/acmtrans2m.cls+1460 impl-paper/comments.sty+29 impl-paper/conclusions.tex+3 impl-paper/impldtp.tex+95 impl-paper/intro.tex+12 impl-paper/library.ltx+325 impl-paper/literature.bib+3836 impl-paper/macros.ltx+1060 impl-paper/overview.tex+11 miniidris.cabal+26 src/Core.hs+151 src/Evaluate.hs+72 src/Main.hs+5 src/Parser.hs+103 src/ProofState.hs+8 src/Test.hs+11 src/Typecheck.hs+134 src/test.mi+11
LICENSEnew file+32
@@ -0,0 +1,32 @@
1+Copyright (c) 2006-2010 Edwin Brady
2+ School of Computer Science, University of St Andrews
3+All rights reserved.
4+
5+This code is derived from software written by Edwin Brady
6+(eb@cs.st-andrews.ac.uk).
7+
8+Redistribution and use in source and binary forms, with or without
9+modification, are permitted provided that the following conditions
10+are met:
11+1. Redistributions of source code must retain the above copyright
12+ notice, this list of conditions and the following disclaimer.
13+2. Redistributions in binary form must reproduce the above copyright
14+ notice, this list of conditions and the following disclaimer in the
15+ documentation and/or other materials provided with the distribution.
16+3. None of the names of the copyright holders may be used to endorse
17+ or promote products derived from this software without specific
18+ prior written permission.
19+
20+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ``AS IS'' AND ANY
21+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23+PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE
24+LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25+CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
27+BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28+WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
29+OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
30+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31+
32+*** End of disclaimer. ***
impl-paper/Makefilenew file+41
@@ -0,0 +1,41 @@
1+PAPER = impldtp
2+
3+all: ${PAPER}.pdf
4+
5+TEXFILES = ${PAPER}.tex intro.tex conclusions.tex overview.tex
6+
7+DIAGS =
8+
9+SOURCES = ${TEXFILES} ${DIAGS} macros.ltx literature.bib
10+
11+DITAA = java -jar ~/Downloads/ditaa.jar
12+
13+${PAPER}.pdf: ${SOURCES}
14+# dvipdf ${PAPER}.dvi
15+ pdflatex ${PAPER}
16+ -bibtex ${PAPER}
17+ -pdflatex ${PAPER}
18+ -pdflatex ${PAPER}
19+
20+${PAPER}.ps: ${PAPER}.dvi
21+ dvips -o ${PAPER}.ps ${PAPER}
22+
23+${PAPER}.dvi: $(SOURCES)
24+ -latex ${PAPER}
25+ -bibtex ${PAPER}
26+ -latex ${PAPER}
27+ -latex ${PAPER}
28+
29+progress: .PHONY
30+ wc -w ${TEXFILES}
31+
32+%.png : %.diag
33+ $(DITAA) -o -E $<
34+
35+todropbox: .PHONY
36+ cp ${SOURCES} ~/Dropbox/TeX/ImplDTP/
37+
38+fromdropbox: .PHONY
39+ cp ~/Dropbox/TeX/ImplDTP/* .
40+
41+.PHONY:
impl-paper/acmtrans.bstnew file+1770
@@ -0,0 +1,1770 @@
1+% "ACM Transactions" BibTeX style, acmtrans.bst
2+% for BibTeX version 0.99c, LaTeX version 3.141
3+% Revised 28-MARCH-1996
4+% Revised 30-JUNE-1995
5+% Revised 15-JAN-1996
6+% $Header: acmtrans.bst,v 1.2 96/01/17 09:05:38 boyland Exp $
7+%
8+% Hacked by John T. Boyland at University of California, Berkeley
9+% (with assistance by John R. Hauser)
10+% Hacked by Andrew W. Appel and Rebecca L. Davies at Princeton University,
11+% based on a "chicago.bst" by Glenn Paulley at U. Waterloo,
12+% which was based on "newapa.bst" found at ymir.claremont.edu.
13+%
14+% Citation format: [author-last-name year]
15+% [author-last-name and author-last-name year]
16+% [author-last-name, author-last-name, and author-last-name year]
17+% [author-last-name et al. year]
18+% [author-last-name]
19+% author-last-name [year]
20+% [author-last-name and author-last-name]
21+% [author-last-name et al.]
22+% [year] or [year,year]
23+% year or year,year
24+%
25+% Reference list ordering: alphabetical by author or whatever passes
26+% for author in the absence of one.
27+%
28+% This BibTeX style has support for abbreviated author lists and for
29+% year-only citations. This is done by having the citations
30+% actually look like
31+%
32+% \citeauthoryear{full-author-info}{abbrev-author-info}{year}
33+%
34+% The LaTeX style has to have the following (or similar)
35+%
36+% \let\@internalcite\cite
37+% \def\fullcite{\def\citeauthoryear##1##2##3{##1, ##3}\@internalcite}
38+% \def\fullciteA{\def\citeauthoryear##1##2##3{##1}\@internalcite}
39+% \def\shortcite{\def\citeauthoryear##1##2##3{##2, ##3}\@internalcite}
40+% \def\shortciteA{\def\citeauthoryear##1##2##3{##2}\@internalcite}
41+% \def\citeyear{\def\citeauthoryear##1##2##3{##3}\@internalcite}
42+%
43+% These TeX macro definitions are found in acmtrans.sty. Additional
44+% commands to manipulate different components of a citation can be defined
45+% so that, for example, you can list author's names without parentheses
46+% if using a citation as a noun or object in a sentence.
47+%
48+% Features of acmtrans.bst:
49+% ========================
50+%
51+% - all authors appear last name first.
52+% - all pages are listed xx-xx, (no pp.) and are at the end of the reference
53+% - publishers are identified as publisher, address
54+% - conferences papers (inproceedings) may give city of conference,
55+% date of conference, and journal that the proceedings appear in.
56+% - months abbreviated to max four letters (eg. Mar.)
57+% - volume of a series indicated after the title of the series
58+% - editors appear after edited title and are identified by a trailing "Eds."
59+% not in parentheses. Editor names are not given in small caps.
60+% (unless there is no author line)
61+% - names terminated with a period even if there is no first name.
62+% - editions are indicated trailing after the work, not in parentheses.
63+% - "et al." citations have a protected period to avoid bad spacing (jrh)
64+% - "address" required when publisher given
65+% - series (roman) and volume are in a sentence separate from (book-)title
66+%
67+%
68+% Features of chicago.bst:
69+% =======================
70+%
71+% - full names used in citations, but abbreviated citations are available
72+% (see above)
73+% - if an entry has a "month", then the month and year are also printed
74+% as part of that bibitem.
75+% - all conjunctions use "and" instead of "\&"
76+% - major modification from Chicago Manual of Style (13th ed.) is that
77+% only the first author in a reference appears last name first-
78+% additional authors appear as J. Q. Public.
79+% - pages are listed as "pp. xx-xx" in all entry types except
80+% article entries.
81+% - book, inbook, and manual use "location: publisher" (or organization)
82+% for address and publisher. All other types list publishers separately.
83+% - "pp." are used to identify page numbers for all entry types except
84+% articles.
85+% - organization is used as a citation label if neither author nor editor
86+% is present (for manuals).
87+% - "et al." is used for long author and editor lists, or when "others"
88+% is used.
89+%
90+% Modifications and bug fixes from newapa.bst:
91+% ===========================================
92+%
93+% - added month, year to bib entries if month is present
94+% - fixed bug with In proceedings, added necessary comma after title
95+% - all conjunctions changed to "and" from "\&"
96+% - fixed bug with author labels in my.full.label: "et al." now is
97+% generated when "others" is an author name
98+% - major modification from Chicago Manual of Style (13th ed.) is that
99+% only the first author in a reference appears last name first-
100+% additional authors appear as J. Q. Public.
101+% - pages are listed as "pp. xx-xx" in all entry types except
102+% article entries. Unnecessary (IMHO) "()" around page numbers
103+% were removed, and page numbers now don't end with a period.
104+% - created chicago.sty for use with this bibstyle (required).
105+% - fixed bugs in FUNCTION {format.vol.num.pages} for missing volume,
106+% number, and /or pages. Renamed to format.jour.vol.
107+% - fixed bug in formatting booktitles: additional period an error if
108+% book has a volume.
109+% - fixed bug: editors usually given redundant period before next clause
110+% (format.editors.dot) removed.
111+% - added label support for organizations, if both author and editor
112+% are missing (from alpha.bst). If organization is too long, then
113+% the key field is used for abbreviated citations.
114+% - In proceedings or books of several volumes, no comma was written
115+% between the "Volume x" and the page numbers (this was intentional
116+% in newapa.bst). Fixed.
117+% - Some journals may not have volumes/numbers, only month/year (eg.
118+% IEEE Computer). Fixed bug in article style that assumed volume/number
119+% was always present.
120+%
121+% Original documentation for newapa.sty:
122+% =====================================
123+%
124+% This version was made by modifying the master file made by
125+% Oren Patashnik (PATASHNIK@SCORE.STANFORD.EDU), and the 'named' BibTeX
126+% style of Peter F. Patel-Schneider.
127+%
128+% Copyright (C) 1985, all rights reserved.
129+% Copying of this file is authorized only if either
130+% (1) you make absolutely no changes to your copy, including name, or
131+% (2) if you do make changes, you name it something other than 'newapa.bst'.
132+% There are undoubtably bugs in this style. If you make bug fixes,
133+% improvements, etc. please let me know. My e-mail address is:
134+% spencer@cgrg.ohio.state.edu or 71160.3141@compuserve.com
135+%
136+% This style was made from 'plain.bst', 'named.bst', and 'apalike.bst',
137+% with lots of tweaking to make it look like APA style, along with tips
138+% from Young Ryu and Brian Reiser's modifications of 'apalike.bst'.
139+
140+ENTRY
141+ { address
142+ author
143+ booktitle
144+ chapter
145+ city % jtb: added
146+ date % jtb: added
147+ edition
148+ editor
149+ howpublished
150+ institution
151+ journal
152+ key
153+ month
154+ note
155+ number
156+ organization
157+ pages
158+ publisher
159+ school
160+ series
161+ title
162+ type
163+ volume
164+ year
165+ }
166+ {}
167+ { label.year extra.label sort.year sort.label }
168+
169+INTEGERS { output.state before.all mid.sentence after.sentence after.block }
170+
171+FUNCTION {init.state.consts}
172+{ #0 'before.all :=
173+ #1 'mid.sentence :=
174+ #2 'after.sentence :=
175+ #3 'after.block :=
176+}
177+
178+STRINGS { s t u }
179+
180+FUNCTION {output.nonnull}
181+{ 's :=
182+ output.state mid.sentence =
183+ { ", " * write$ }
184+ { output.state after.block =
185+ { add.period$ write$
186+ newline$
187+ "\newblock " write$
188+ }
189+ { output.state before.all =
190+ 'write$
191+ { add.period$ " " * write$ }
192+ if$
193+ }
194+ if$
195+ mid.sentence 'output.state :=
196+ }
197+ if$
198+ s
199+}
200+
201+% Use a colon to separate output. Used only for address/publisher
202+% combination in book/inbook types, address/institution for manuals,
203+% and organization:publisher for proceedings (inproceedings).
204+%
205+FUNCTION {output.nonnull.colon}
206+{ 's :=
207+ output.state mid.sentence =
208+ { ": " * write$ }
209+ { output.state after.block =
210+ { add.period$ write$
211+ newline$
212+ "\newblock " write$
213+ }
214+ { output.state before.all =
215+ 'write$
216+ { add.period$ " " * write$ }
217+ if$
218+ }
219+ if$
220+ mid.sentence 'output.state :=
221+ }
222+ if$
223+ s
224+}
225+
226+FUNCTION {output}
227+{ duplicate$ empty$
228+ 'pop$
229+ 'output.nonnull
230+ if$
231+}
232+
233+FUNCTION {output.colon}
234+{ duplicate$ empty$
235+ 'pop$
236+ 'output.nonnull.colon
237+ if$
238+}
239+
240+FUNCTION {output.check}
241+{ 't :=
242+ duplicate$ empty$
243+ { pop$ "empty " t * " in " * cite$ * warning$ }
244+ 'output.nonnull
245+ if$
246+}
247+
248+FUNCTION {output.check.colon}
249+{ 't :=
250+ duplicate$ empty$
251+ { pop$ "empty " t * " in " * cite$ * warning$ }
252+ 'output.nonnull.colon
253+ if$
254+}
255+
256+FUNCTION {output.year.check}
257+{ year empty$
258+ { "empty year in " cite$ * warning$ }
259+ { write$
260+ " " year * extra.label *
261+ mid.sentence 'output.state :=
262+ }
263+ if$
264+}
265+
266+
267+FUNCTION {fin.entry}
268+{ add.period$
269+ write$
270+ newline$
271+}
272+
273+FUNCTION {new.block}
274+{ output.state before.all =
275+ 'skip$
276+ { after.block 'output.state := }
277+ if$
278+}
279+
280+FUNCTION {new.sentence}
281+{ output.state after.block =
282+ 'skip$
283+ { output.state before.all =
284+ 'skip$
285+ { after.sentence 'output.state := }
286+ if$
287+ }
288+ if$
289+}
290+
291+FUNCTION {not}
292+{ { #0 }
293+ { #1 }
294+ if$
295+}
296+
297+FUNCTION {and}
298+{ 'skip$
299+ { pop$ #0 }
300+ if$
301+}
302+
303+FUNCTION {or}
304+{ { pop$ #1 }
305+ 'skip$
306+ if$
307+}
308+
309+FUNCTION {new.block.checka}
310+{ empty$
311+ 'skip$
312+ 'new.block
313+ if$
314+}
315+
316+FUNCTION {new.block.checkb}
317+{ empty$
318+ swap$ empty$
319+ and
320+ 'skip$
321+ 'new.block
322+ if$
323+}
324+
325+FUNCTION {new.sentence.checka}
326+{ empty$
327+ 'skip$
328+ 'new.sentence
329+ if$
330+}
331+
332+FUNCTION {new.sentence.checkb}
333+{ empty$
334+ swap$ empty$
335+ and
336+ 'skip$
337+ 'new.sentence
338+ if$
339+}
340+
341+FUNCTION {field.or.null}
342+{ duplicate$ empty$
343+ { pop$ "" }
344+ 'skip$
345+ if$
346+}
347+
348+%
349+% Emphasize the top string on the stack.
350+%
351+FUNCTION {emphasize}
352+{ duplicate$ empty$
353+ { pop$ "" }
354+ { "{\em " swap$ * "}" * }
355+ if$
356+}
357+
358+%
359+% Emphasize the top string on the stack, but add a trailing space.
360+%
361+FUNCTION {emphasize.space}
362+{ duplicate$ empty$
363+ { pop$ "" }
364+ { "{\em " swap$ * "\/}" * }
365+ if$
366+}
367+
368+%
369+% Emphasize the top string on stack, add a trailing comma and space.
370+%
371+FUNCTION {emphasize.comma}
372+{ duplicate$ empty$
373+ { pop$ "" }
374+ { "{\em " swap$ * ",\/}" * }
375+ if$
376+}
377+
378+INTEGERS { nameptr namesleft numnames }
379+%
380+% Format bibliographical entries with the first author last name first,
381+% and subsequent authors with initials followed by last name.
382+% All names are formatted in this routine.
383+%
384+
385+FUNCTION {format.names}
386+{ 's :=
387+ #1 'nameptr := % nameptr = 1;
388+ s num.names$ 'numnames := % numnames = num.name$(s);
389+ numnames 'namesleft :=
390+ { namesleft #0 > }
391+
392+ { nameptr #1 =
393+ {"{\sc " s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ * "}" * 't := }
394+ {"{\sc " s nameptr "{vv~}{ll}{, jj}{, f.}" format.name$ * "}" * 't := }
395+ if$
396+ nameptr #1 >
397+ { namesleft #1 >
398+ { ", " * t * }
399+ { numnames #2 >
400+ { "," * }
401+ 'skip$
402+ if$
403+ t "{\sc others}" =
404+ { " {\sc et~al\mbox{.}}" * } % jrh: avoid spacing problems
405+ { " {\sc and} " * t * } % from Chicago Manual of Style
406+ if$
407+ }
408+ if$
409+ }
410+ 't
411+ if$
412+ nameptr #1 + 'nameptr := % nameptr += 1;
413+ namesleft #1 - 'namesleft := % namesleft =- 1;
414+ }
415+ while$
416+}
417+
418+FUNCTION {my.full.label}
419+{ 's :=
420+ #1 'nameptr := % nameptr = 1;
421+ s num.names$ 'numnames := % numnames = num.name$(s);
422+ numnames 'namesleft :=
423+ { namesleft #0 > }
424+
425+ { s nameptr "{vv~}{ll}" format.name$ 't := % get the next name
426+ nameptr #1 >
427+ { namesleft #1 >
428+ { ", " * t * }
429+ { numnames #2 >
430+ { "," * }
431+ 'skip$
432+ if$
433+ t "others" =
434+ { " et~al\mbox{.}" * } % jrh: avoid spacing problems
435+ { " and " * t * } % from Chicago Manual of Style
436+ if$
437+ }
438+ if$
439+ }
440+ 't
441+ if$
442+ nameptr #1 + 'nameptr := % nameptr += 1;
443+ namesleft #1 - 'namesleft := % namesleft =- 1;
444+ }
445+ while$
446+
447+}
448+
449+FUNCTION {format.names.fml}
450+%
451+% Format names in "familiar" format, with first initial followed by
452+% last name. Like format.names, ALL names are formatted.
453+% jtb: The names are NOT put in small caps
454+%
455+{ 's :=
456+ #1 'nameptr := % nameptr = 1;
457+ s num.names$ 'numnames := % numnames = num.name$(s);
458+ numnames 'namesleft :=
459+ { namesleft #0 > }
460+
461+ { "{" s nameptr "{f.~}{vv~}{ll}{, jj}" format.name$ * "}" * 't :=
462+
463+ nameptr #1 >
464+ { namesleft #1 >
465+ { ", " * t * }
466+ { numnames #2 >
467+ { "," * }
468+ 'skip$
469+ if$
470+ t "{others}" =
471+ { " {et~al\mbox{.}}" * }
472+ { " {and} " * t * }
473+% { " {\&} " * t * }
474+ if$
475+ }
476+ if$
477+ }
478+ 't
479+ if$
480+ nameptr #1 + 'nameptr := % nameptr += 1;
481+ namesleft #1 - 'namesleft := % namesleft =- 1;
482+ }
483+ while$
484+}
485+
486+FUNCTION {format.authors}
487+{ author empty$
488+ { "" }
489+ { author format.names add.period$} % jtb: add period if none before
490+ if$
491+}
492+
493+FUNCTION {format.key}
494+{ empty$
495+ { key field.or.null }
496+ { "" }
497+ if$
498+}
499+
500+%
501+% Format editor names for use in the "in" types: inbook, incollection,
502+% inproceedings: first initial, then last names. When editors are the
503+% LABEL for an entry, then format.editor is used which lists editors
504+% by last name first.
505+%
506+FUNCTION {format.editors.fml}
507+{ editor empty$
508+ { "" }
509+ { editor format.names.fml
510+ editor num.names$ #1 >
511+ { ", Eds." * } % jtb: removed parentheses
512+ { ", Ed." * } % jtb: removed parentheses
513+ if$
514+ }
515+ if$
516+}
517+
518+%
519+% Format editor names for use in labels, last names first.
520+%
521+FUNCTION {format.editors}
522+{ editor empty$
523+ { "" }
524+ { editor format.names
525+ editor num.names$ #1 >
526+ { ", Eds." * } % jtb: removed parentheses
527+ { ", Ed." * } % jtb: removed parentheses
528+ if$
529+ }
530+ if$
531+}
532+
533+FUNCTION {format.title}
534+{ title empty$
535+ { "" }
536+ { title "t" change.case$ }
537+ if$
538+}
539+
540+% Note that the APA style requres case changes
541+% in article titles. The following does not
542+% change cases. If you perfer it, uncomment the
543+% following and comment out the above.
544+
545+%FUNCTION {format.title}
546+%{ title empty$
547+% { "" }
548+% { title }
549+% if$
550+%}
551+
552+FUNCTION {n.dashify}
553+{ 't :=
554+ ""
555+ { t empty$ not }
556+ { t #1 #1 substring$ "-" =
557+ { t #1 #2 substring$ "--" = not
558+ { "--" *
559+ t #2 global.max$ substring$ 't :=
560+ }
561+ { { t #1 #1 substring$ "-" = }
562+ { "-" *
563+ t #2 global.max$ substring$ 't :=
564+ }
565+ while$
566+ }
567+ if$
568+ }
569+ { t #1 #1 substring$ *
570+ t #2 global.max$ substring$ 't :=
571+ }
572+ if$
573+ }
574+ while$
575+}
576+
577+FUNCTION {format.btitle}
578+{ edition empty$
579+ { title emphasize }
580+ { title empty$
581+ { title emphasize } % jtb: what is this supposed to do ?!?
582+ { "{\em " title * "\/}, " * edition * " ed." * } % jtb: no parens for ed.
583+ if$
584+ }
585+ if$
586+}
587+
588+FUNCTION {format.emphasize.booktitle}
589+{ edition empty$
590+ { booktitle emphasize }
591+ { booktitle empty$
592+ { booktitle emphasize } % jtb: what is this supposed to do ?!?
593+ { "{\em " booktitle * "\/}, " * edition * " ed." * } % jtb: no ()s for ed.
594+ if$
595+ }
596+ if$
597+ }
598+
599+% jtb: if the preceding string (the title of the conference) is non-empty,
600+% jtb: append the location, otherwise leave empty (so as to trigger the
601+% jtb: error message in output.check
602+FUNCTION {format.city}
603+{ duplicate$ empty$
604+ { }
605+ { city empty$
606+ { date empty$
607+ { }
608+ { " (" * date * ")" * }
609+ if$
610+ }
611+ { date empty$
612+ { " (" * city * ")" * }
613+ { " (" * city * ", " * date * ")" * }
614+ if$
615+ }
616+ if$
617+ }
618+ if$
619+}
620+
621+FUNCTION {tie.or.space.connect}
622+{ duplicate$ text.length$ #3 <
623+ { "~" }
624+ { " " }
625+ if$
626+ swap$ * *
627+}
628+
629+FUNCTION {either.or.check}
630+{ empty$
631+ 'pop$
632+ { "can't use both " swap$ * " fields in " * cite$ * warning$ }
633+ if$
634+}
635+
636+% jtb: If there is a series, this is added and the volume trails after it.
637+% jtb: Otherwise, "Vol" is Capitalized.
638+FUNCTION {format.bvolume}
639+{ volume empty$
640+ { "" }
641+ { series empty$
642+ { "Vol." volume tie.or.space.connect}
643+ { series ", " * "vol." volume tie.or.space.connect *}
644+ if$
645+ "volume and number" number either.or.check
646+ }
647+ if$
648+}
649+
650+FUNCTION {format.number.series}
651+{ volume empty$
652+ { number empty$
653+ { series field.or.null }
654+ { output.state mid.sentence =
655+ { "Number" } % gnp - changed to mixed case always
656+ { "Number" }
657+ if$
658+ number tie.or.space.connect
659+ series empty$
660+ { "there's a number but no series in " cite$ * warning$ }
661+ { " in " * series * }
662+ if$
663+ }
664+ if$
665+ }
666+ { "" }
667+ if$
668+}
669+
670+INTEGERS { multiresult }
671+
672+FUNCTION {multi.page.check}
673+{ 't :=
674+ #0 'multiresult :=
675+ { multiresult not
676+ t empty$ not
677+ and
678+ }
679+ { t #1 #1 substring$
680+ duplicate$ "-" =
681+ swap$ duplicate$ "," =
682+ swap$ "+" =
683+ or or
684+ { #1 'multiresult := }
685+ { t #2 global.max$ substring$ 't := }
686+ if$
687+ }
688+ while$
689+ multiresult
690+}
691+
692+FUNCTION {format.pages}
693+{ pages empty$
694+ { "" }
695+ { pages multi.page.check
696+ { pages n.dashify } % gnp - removed () % jtb: removed pp.
697+ { pages }
698+ if$
699+ }
700+ if$
701+}
702+
703+% By Young (and Spencer)
704+% GNP - fixed bugs with missing volume, number, and/or pages
705+%
706+% Format journal, volume, number, pages for article types.
707+%
708+FUNCTION {format.jour.vol}
709+{ journal empty$
710+ { "no journal in " cite$ * warning$
711+ "" }
712+ { journal emphasize.space }
713+ if$
714+ number empty$
715+ { volume empty$
716+ { "no number and no volume in " cite$ * warning$
717+ "" * }
718+ { "~{\em " * Volume * "}" * }
719+ if$
720+ }
721+ { volume empty$
722+ {"no volume for " cite$ * warning$
723+ "~" * number * }
724+ { "~" *
725+ volume emphasize.comma
726+ "~" * number * * }
727+ if$
728+ month empty$
729+ {}
730+ {" (" * month * ")" *}
731+ if$
732+ }
733+ if$
734+ pages empty$
735+ {"page numbers missing in " cite$ * warning$
736+ "" * } % gnp - place a null string on the stack for output
737+ { duplicate$ empty$
738+ { pop$ format.pages }
739+ { ", " * pages n.dashify * } % gnp - removed pp. for articles
740+ if$
741+ }
742+ if$
743+}
744+
745+FUNCTION {format.chapter.pages}
746+{ chapter empty$
747+ 'format.pages
748+ { type empty$
749+ { "Chapter" } % gnp - changed to mixed case
750+ { type "t" change.case$ }
751+ if$
752+ chapter tie.or.space.connect
753+ pages empty$
754+ {"page numbers missing in " cite$ * warning$} % gnp - added check
755+ { ", " * format.pages * }
756+ if$
757+ }
758+ if$
759+}
760+
761+% jtb: format for collections or proceedings not appearing in a journal
762+FUNCTION {format.in.emphasize.booktitle}
763+{ booktitle empty$
764+ { "" }
765+ { "In " format.emphasize.booktitle * }
766+ if$
767+}
768+
769+% jtb: format for proceedings appearing in a journal
770+FUNCTION {format.in.booktitle}
771+{ booktitle empty$
772+ { "" }
773+ { "In " booktitle * }
774+ if$
775+}
776+
777+FUNCTION {format.in.ed.booktitle}
778+{ booktitle empty$
779+ { "" }
780+ { editor empty$
781+ { "In " format.emphasize.booktitle * }
782+ % jtb: swapped editor location
783+ { "In " format.emphasize.booktitle * ", " * format.editors.fml * }
784+ if$
785+ }
786+ if$
787+}
788+
789+FUNCTION {format.thesis.type}
790+{ type empty$
791+ 'skip$
792+% {pop$
793+ {{ "" }
794+ type "t" change.case$}
795+ if$
796+}
797+
798+FUNCTION {format.tr.number}
799+{ type empty$
800+ { "Tech. Rep." }
801+ 'type
802+ if$
803+ number empty$
804+ { "t" change.case$ }
805+ { number tie.or.space.connect }
806+ if$
807+}
808+
809+FUNCTION {format.article.crossref}
810+{ "See"
811+ "\citeN{" * crossref * "}" *
812+}
813+
814+FUNCTION {format.crossref.editor}
815+{ editor #1 "{vv~}{ll}" format.name$
816+ editor num.names$ duplicate$
817+ #2 >
818+ { pop$ " et~al\mbox{.}" * } % jrh: avoid spacing problems
819+ { #2 <
820+ 'skip$
821+ { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
822+ { " et~al\mbox{.}" * } % jrh: avoid spacing problems
823+ { " and " * editor #2 "{vv~}{ll}" format.name$ * }
824+ if$
825+ }
826+ if$
827+ }
828+ if$
829+}
830+
831+FUNCTION {format.book.crossref}
832+{ volume empty$
833+ { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
834+ "In "
835+ }
836+ { "Volume" volume tie.or.space.connect % gnp - changed to mixed case
837+ " of " *
838+ }
839+ if$
840+ editor empty$
841+ editor field.or.null author field.or.null =
842+ or
843+ { key empty$
844+ { series empty$
845+ { "need editor, key, or series for " cite$ * " to crossref " *
846+ crossref * warning$
847+ "" *
848+ }
849+ { "{\em " * series * "\/}" * }
850+ if$
851+ }
852+ { key * }
853+ if$
854+ }
855+ { format.crossref.editor * }
856+ if$
857+ " \citeN{" * crossref * "}" *
858+}
859+
860+FUNCTION {format.incoll.inproc.crossref}
861+{ "See"
862+ " \citeN{" * crossref * "}" *
863+}
864+
865+% format.lab.names:
866+%
867+% determines "short" names for the abbreviated author information.
868+% "Long" labels are created in calc.label, using the routine my.full.label
869+% to format author and editor fields.
870+%
871+% There are 4 cases for labels. (n=3 in the example)
872+% a) one author Foo
873+% b) one to n Foo, Bar and Baz
874+% c) use of "and others" Foo, Bar et al.
875+% d) more than n Foo et al.
876+%
877+FUNCTION {format.lab.names}
878+{ 's :=
879+ s num.names$ 'numnames :=
880+ numnames #2 > % change number to number of others allowed before
881+ % forcing "et al".
882+ { s #1 "{vv~}{ll}" format.name$ " et~al\mbox{.}" * } % jrh: \mbox{} added
883+ {
884+ numnames #1 - 'namesleft :=
885+ #2 'nameptr :=
886+ s #1 "{vv~}{ll}" format.name$
887+ { namesleft #0 > }
888+ { nameptr numnames =
889+ { s nameptr "{ff }{vv }{ll}{ jj}" format.name$ "others" =
890+ { " et~al\mbox{.}" * } % jrh: avoid spacing problems
891+ { " and " * s nameptr "{vv~}{ll}" format.name$ * }
892+ if$
893+ }
894+ { ", " * s nameptr "{vv~}{ll}" format.name$ * }
895+ if$
896+ nameptr #1 + 'nameptr :=
897+ namesleft #1 - 'namesleft :=
898+ }
899+ while$
900+ }
901+ if$
902+}
903+
904+FUNCTION {author.key.label}
905+{ author empty$
906+ { key empty$
907+ { "no key, author in " cite$ * warning$
908+ cite$ #1 #3 substring$ }
909+ 'key
910+ if$
911+ }
912+ { author format.lab.names }
913+ if$
914+}
915+
916+FUNCTION {editor.key.label}
917+{ editor empty$
918+ { key empty$
919+ { "no key, editor in " cite$ * warning$
920+ cite$ #1 #3 substring$ }
921+ 'key
922+ if$
923+ }
924+ { editor format.lab.names }
925+ if$
926+}
927+
928+FUNCTION {author.key.organization.label}
929+%
930+% added - gnp. Provide label formatting by organization if author is null.
931+%
932+{ author empty$
933+ { organization empty$
934+ { key empty$
935+ { "no key, author or organization in " cite$ * warning$
936+ cite$ #1 #3 substring$ }
937+ 'key
938+ if$
939+ }
940+ { organization }
941+ if$
942+ }
943+ { author format.lab.names }
944+ if$
945+}
946+
947+FUNCTION {editor.key.organization.label}
948+%
949+% added - gnp. Provide label formatting by organization if editor is null.
950+%
951+{ editor empty$
952+ { organization empty$
953+ { key empty$
954+ { "no key, editor or organization in " cite$ * warning$
955+ cite$ #1 #3 substring$ }
956+ 'key
957+ if$
958+ }
959+ { organization }
960+ if$
961+ }
962+ { editor format.lab.names }
963+ if$
964+}
965+
966+FUNCTION {author.editor.key.label}
967+{ author empty$
968+ { editor empty$
969+ { key empty$
970+ { "no key, author, or editor in " cite$ * warning$
971+ cite$ #1 #3 substring$ }
972+ 'key
973+ if$
974+ }
975+ { editor format.lab.names }
976+ if$
977+ }
978+ { author format.lab.names }
979+ if$
980+}
981+
982+FUNCTION {calc.label}
983+%
984+% Changed - GNP. See also author.organization.sort, editor.organization.sort
985+% Form label for BibTeX entry. The classification of which fields are used
986+% for which type of entry (book, inbook, etc.) are taken from alpha.bst.
987+% The change here from newapa is to also include organization as a
988+% citation label if author or editor is missing.
989+%
990+{ type$ "book" =
991+ type$ "inbook" =
992+ or
993+ 'author.editor.key.label
994+ { type$ "proceedings" =
995+ 'editor.key.organization.label
996+ { type$ "manual" =
997+ 'author.key.organization.label
998+ 'author.key.label
999+ if$
1000+ }
1001+ if$
1002+ }
1003+ if$
1004+
1005+ author empty$ % generate the full label citation information.
1006+ { editor empty$
1007+ { organization empty$
1008+ { "no author, editor, or organization in " cite$ * warning$
1009+ "??" }
1010+ { organization }
1011+ if$
1012+ }
1013+ { editor my.full.label }
1014+ if$
1015+ }
1016+ { author my.full.label }
1017+ if$
1018+
1019+% leave label on the stack, to be popped when required.
1020+
1021+ "}{" * swap$ * "}{" *
1022+% year field.or.null purify$ #-1 #4 substring$ *
1023+%
1024+% save the year for sort processing afterwards (adding a, b, c, etc.)
1025+%
1026+ year field.or.null purify$ #-1 #4 substring$
1027+ 'label.year :=
1028+}
1029+
1030+FUNCTION {output.bibitem}
1031+{ newline$
1032+
1033+ "\bibitem[\protect\citeauthoryear{" write$
1034+ calc.label write$
1035+ sort.year write$
1036+ "}]{" write$
1037+
1038+ cite$ write$
1039+ "}" write$
1040+ newline$
1041+ ""
1042+ before.all 'output.state :=
1043+}
1044+
1045+FUNCTION {article}
1046+{ output.bibitem
1047+ format.authors
1048+ "author" output.check
1049+ author format.key output % added
1050+ output.year.check % added
1051+ new.block
1052+ format.title
1053+ "title" output.check
1054+ new.block
1055+ crossref missing$
1056+ { format.jour.vol output
1057+ }
1058+ { format.article.crossref output.nonnull
1059+ format.pages output
1060+ }
1061+ if$
1062+ new.block
1063+ note output
1064+ fin.entry
1065+}
1066+
1067+FUNCTION {book}
1068+{ output.bibitem
1069+ author empty$
1070+ { format.editors
1071+ "author and editor" output.check }
1072+ { format.authors
1073+ output.nonnull
1074+ crossref missing$
1075+ { "author and editor" editor either.or.check }
1076+ 'skip$
1077+ if$
1078+ }
1079+ if$
1080+ output.year.check % added
1081+ new.block
1082+ format.btitle
1083+ "title" output.check
1084+ crossref missing$
1085+ { new.sentence % jtb: start a new sentence for series/volume
1086+ format.bvolume output
1087+ new.block
1088+ format.number.series output
1089+ new.sentence
1090+ publisher "publisher" output.check
1091+ address "address" output.check % jtb: require address
1092+ }
1093+ { new.block
1094+ format.book.crossref output.nonnull
1095+ }
1096+ if$
1097+ new.block
1098+ note output
1099+ fin.entry
1100+}
1101+
1102+FUNCTION {booklet}
1103+{ output.bibitem
1104+ format.authors output
1105+ author format.key output % added
1106+ output.year.check % added
1107+ new.block
1108+ format.title
1109+ "title" output.check
1110+ new.block
1111+ howpublished output
1112+ address output
1113+ new.block
1114+ note output
1115+ fin.entry
1116+}
1117+
1118+FUNCTION {inbook}
1119+{ output.bibitem
1120+ author empty$
1121+ { format.editors
1122+ "author and editor" output.check
1123+ }
1124+ { format.authors output.nonnull
1125+ crossref missing$
1126+ { "author and editor" editor either.or.check }
1127+ 'skip$
1128+ if$
1129+ }
1130+ if$
1131+ output.year.check % added
1132+ new.block
1133+ format.btitle
1134+ "title" output.check
1135+ crossref missing$
1136+ { new.sentence % jtb: start a new sentence for series/volume
1137+ format.bvolume output
1138+ new.block
1139+ format.number.series output
1140+ new.sentence
1141+ publisher "publisher" output.check
1142+ address "address" output.check % jtb: require address
1143+ format.chapter.pages
1144+ "chapter and pages" output.check % jtb: moved from before publisher
1145+ }
1146+ { format.chapter.pages "chapter and pages" output.check
1147+ new.block
1148+ format.book.crossref output.nonnull
1149+ }
1150+ if$
1151+ new.block
1152+ note output
1153+ fin.entry
1154+}
1155+
1156+FUNCTION {incollection}
1157+{ output.bibitem
1158+ format.authors
1159+ "author" output.check
1160+ author format.key output % added
1161+ output.year.check % added
1162+ new.block
1163+ format.title
1164+ "title" output.check
1165+ new.block
1166+ crossref missing$
1167+ { format.in.ed.booktitle
1168+ "booktitle" output.check
1169+ new.sentence % jtb: start a new sentence for series/volume
1170+ format.bvolume output
1171+ format.number.series output
1172+ new.sentence
1173+ publisher "publisher" output.check
1174+ address "address" output.check % jtb: require address
1175+ format.chapter.pages output % gnp - was special.output.nonnull
1176+% left out comma before page numbers
1177+ % jtb: moved from before publisher
1178+ }
1179+ { format.incoll.inproc.crossref
1180+ output.nonnull
1181+ format.chapter.pages output
1182+ }
1183+ if$
1184+ new.block
1185+ note output
1186+ fin.entry
1187+}
1188+
1189+FUNCTION {inproceedings}
1190+{ output.bibitem
1191+ format.authors
1192+ "author" output.check
1193+ author format.key output % added
1194+ output.year.check % added
1195+ new.block
1196+ format.title
1197+ "title" output.check
1198+ new.block
1199+ crossref missing$
1200+ { journal missing$ % jtb: proceedings appearing in journals
1201+ { format.in.emphasize.booktitle format.city "booktitle" output.check
1202+ format.editors.fml output
1203+ new.sentence % jtb: start a new sentence for series/volume
1204+ format.bvolume output
1205+ format.number.series output
1206+ new.sentence
1207+ organization output
1208+ publisher "publisher" output.check % jtb: require publisher (?)
1209+ address "address" output.check % jtb: require address
1210+ format.pages output % jtb: moved from before publisher
1211+ }
1212+ % jtb: new:
1213+ { format.in.booktitle format.city "booktitle" output.check
1214+ format.editors.fml output
1215+ new.sentence
1216+ format.jour.vol output
1217+ }
1218+ if$
1219+ }
1220+ { format.incoll.inproc.crossref output.nonnull
1221+ format.pages output
1222+ }
1223+ if$
1224+ new.block
1225+ note output
1226+ fin.entry
1227+}
1228+
1229+FUNCTION {conference} { inproceedings }
1230+
1231+FUNCTION {manual}
1232+{ output.bibitem
1233+ author empty$
1234+ { editor empty$
1235+ { organization "organization" output.check
1236+ organization format.key output } % if all else fails, use key
1237+ { format.editors "author and editor" output.check }
1238+ if$
1239+ }
1240+ { format.authors output.nonnull }
1241+ if$
1242+ output.year.check % added
1243+ new.block
1244+ format.btitle
1245+ "title" output.check
1246+ organization address new.block.checkb
1247+ % jtb: back to normal style: organization, address
1248+ organization "organization" output.check
1249+ address output
1250+ new.block
1251+ note output
1252+ fin.entry
1253+}
1254+
1255+FUNCTION {mastersthesis}
1256+{ output.bibitem
1257+ format.authors
1258+ "author" output.check
1259+ author format.key output % added
1260+ output.year.check % added
1261+ new.block
1262+ format.title
1263+ "title" output.check
1264+ new.block
1265+ "M.S.\ thesis" format.thesis.type output.nonnull
1266+ school "school" output.check
1267+ address output
1268+ new.block
1269+ note output
1270+ fin.entry
1271+}
1272+
1273+FUNCTION {misc}
1274+{ output.bibitem
1275+ format.authors output
1276+ author format.key output % added
1277+ output.year.check % added
1278+ title howpublished new.block.checkb
1279+ format.title output
1280+ new.block
1281+ howpublished output
1282+ new.block
1283+ note output
1284+ fin.entry
1285+}
1286+
1287+FUNCTION {phdthesis}
1288+{ output.bibitem
1289+ format.authors
1290+ "author" output.check
1291+ author format.key output % added
1292+ output.year.check % added
1293+ new.block
1294+ format.title
1295+ "title" output.check
1296+ new.block
1297+ format.thesis.type "Ph.D. thesis" output.nonnull
1298+ school "school" output.check
1299+ address output
1300+ new.block
1301+ note output
1302+ fin.entry
1303+}
1304+
1305+FUNCTION {proceedings}
1306+{ output.bibitem
1307+ editor empty$
1308+ { organization output
1309+ organization format.key output } % gnp - changed from author format.key
1310+ { format.editors output.nonnull }
1311+ if$
1312+% author format.key output % gnp - removed (should be either
1313+% editor or organization
1314+ output.year.check % added (newapa)
1315+ new.block
1316+ format.btitle format.city "title" output.check % jtb: added city
1317+ new.sentence
1318+ format.bvolume output
1319+ format.number.series output
1320+ new.sentence
1321+ organization output
1322+ % jtb: normal order: publisher, address
1323+ publisher output
1324+ address output
1325+ new.block
1326+ note output
1327+ fin.entry
1328+}
1329+
1330+FUNCTION {techreport}
1331+{ output.bibitem
1332+ format.authors
1333+ "author" output.check
1334+ author format.key output % added
1335+ output.year.check % added
1336+ new.block
1337+ format.title
1338+ "title" output.check
1339+ new.block
1340+ format.tr.number output % jtb: moved month ...
1341+ institution "institution" output.check
1342+ address output
1343+ new.sentence
1344+ month output % jtb: ... to here (no parens)
1345+ new.block
1346+ note output
1347+ fin.entry
1348+}
1349+
1350+FUNCTION {unpublished}
1351+{ output.bibitem
1352+ format.authors
1353+ "author" output.check
1354+ author format.key output % added
1355+ output.year.check % added
1356+ new.block
1357+ format.title
1358+ "title" output.check
1359+ new.block
1360+ note "note" output.check
1361+ fin.entry
1362+}
1363+
1364+FUNCTION {default.type} { misc }
1365+
1366+MACRO {jan} {"Jan."}
1367+
1368+MACRO {feb} {"Feb."}
1369+
1370+MACRO {mar} {"Mar."} % jtb: corrected: was "March"
1371+
1372+MACRO {apr} {"Apr."} % jtb: corrected: was "April"
1373+
1374+MACRO {may} {"May"}
1375+
1376+MACRO {jun} {"June"}
1377+
1378+MACRO {jul} {"July"}
1379+
1380+MACRO {aug} {"Aug."}
1381+
1382+MACRO {sep} {"Sept."}
1383+
1384+MACRO {oct} {"Oct."}
1385+
1386+MACRO {nov} {"Nov."}
1387+
1388+MACRO {dec} {"Dec."}
1389+
1390+MACRO {acmcs} {"ACM Comput. Surv."}
1391+
1392+MACRO {acmlett} {"ACM Lett. Program. Lang. Syst."}
1393+
1394+MACRO {acta} {"Acta Inf."}
1395+
1396+MACRO {ai} {"Artificial Intelligence"}
1397+
1398+MACRO {al} {"Ada Lett."}
1399+
1400+MACRO {acr} {"Adv. Comput. Res."}
1401+
1402+MACRO {bit} {"Bit"}
1403+
1404+MACRO {cacm} {"Commun. ACM"}
1405+
1406+MACRO {cj} {"Comput. J."}
1407+
1408+MACRO {cn} {"Comput. Netw."}
1409+
1410+MACRO {cl} {"Comput. Lang."}
1411+
1412+MACRO {ibmjrd} {"IBM J. Res. and Development"}
1413+
1414+MACRO {ibmsj} {"IBM Systems Journal"}
1415+
1416+MACRO {ict} {"Inf. Contr."}
1417+
1418+MACRO {ieebcs} {"IEE/BCS Softw. Eng. J."}
1419+
1420+MACRO {ieees} {"IEEE Softw."}
1421+
1422+MACRO {ieeese} {"IEEE Trans. Softw. Eng."}
1423+
1424+MACRO {ieeetc} {"IEEE Trans. Comput."}
1425+
1426+MACRO {ieeetcad}
1427+ {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
1428+
1429+MACRO {ieeetpds} {"IEEE Trans. Parall. Distrib. Syst."}
1430+
1431+MACRO {ieeetit} {"IEEE Trans. Inf. Theory"}
1432+
1433+MACRO {ipl} {"Inf. Process. Lett."}
1434+
1435+MACRO {icp} {"Inf. Comput."}
1436+
1437+MACRO {ist} {"Inf. Softw. Tech."}
1438+
1439+MACRO {ijsa} {"Int. J. Supercomput. Appl."}
1440+
1441+MACRO {ijpp} {"Int. J. Parallel Program."}
1442+
1443+MACRO {jlp} {"J. Logic Program."}
1444+
1445+MACRO {jfp} {"J. Funct. Program."}
1446+
1447+MACRO {jcss} {"J. Comput. Syst. Sci."}
1448+
1449+MACRO {jsmrp} {"J. Softw. Maint. Res. Pract."}
1450+
1451+MACRO {jss} {"J. Syst. Softw."}
1452+
1453+MACRO {jlc} {"J. Logic and Comput."}
1454+
1455+MACRO {jlsc} {"J. Lisp Symb. Comput."}
1456+
1457+MACRO {lpls} {"Lett. Program. Lang. Syst."}
1458+
1459+MACRO {mor} {"Math. Oper. Res."}
1460+
1461+MACRO {mscs} {"Math. Struct. Comput. Sci."}
1462+
1463+MACRO {mst} {"Math. Syst. Theor."} % jtb: was Math. Syst. Theory
1464+ % jtb: (if you ask me, I prefer the old way)
1465+MACRO {ngc} {"New Gen. Comput."}
1466+
1467+MACRO {scp} {"Sci. Comput. Program."}
1468+
1469+MACRO {sicomp} {"SIAM J. Comput."}
1470+
1471+MACRO {spe} {"Softw. Pract. Exper."}
1472+
1473+MACRO {tocs} {"ACM Trans. Comput. Syst."}
1474+
1475+MACRO {tods} {"ACM Trans. Database Syst."}
1476+
1477+MACRO {tog} {"ACM Trans. Graphics"}
1478+
1479+MACRO {toms} {"ACM Trans. Math. Softw."}
1480+
1481+MACRO {toois} {"ACM Trans. Office Inf. Syst."}
1482+
1483+MACRO {toplas} {"ACM Trans. Program. Lang. Syst."}
1484+
1485+MACRO {tocl} {"ACM Trans. On Comp. Logic"}
1486+
1487+MACRO {tcs} {"Theor. Comput. Sci."} % jtb: was Theor. Comp. Sci.
1488+
1489+MACRO {tr} {"Tech. Rep."}
1490+
1491+READ
1492+
1493+FUNCTION {sortify}
1494+{ purify$
1495+ "l" change.case$
1496+}
1497+
1498+INTEGERS { len }
1499+
1500+FUNCTION {chop.word}
1501+{ 's :=
1502+ 'len :=
1503+ s #1 len substring$ =
1504+ { s len #1 + global.max$ substring$ }
1505+ 's
1506+ if$
1507+}
1508+
1509+
1510+
1511+FUNCTION {sort.format.names}
1512+{ 's :=
1513+ #1 'nameptr :=
1514+ ""
1515+ s num.names$ 'numnames :=
1516+ numnames 'namesleft :=
1517+ { namesleft #0 > }
1518+ { nameptr #1 >
1519+ { " " * }
1520+ 'skip$
1521+ if$
1522+ s nameptr "{vv{ } }{ll{ }}{ f{ }}{ jj{ }}" format.name$ 't :=
1523+ nameptr numnames = t "others" = and
1524+ { " et~al" * }
1525+ { t sortify * }
1526+ if$
1527+ nameptr #1 + 'nameptr :=
1528+ namesleft #1 - 'namesleft :=
1529+ }
1530+ while$
1531+}
1532+
1533+FUNCTION {sort.format.title}
1534+{ 't :=
1535+ "A " #2
1536+ "An " #3
1537+ "The " #4 t chop.word
1538+ chop.word
1539+ chop.word
1540+ sortify
1541+ #1 global.max$ substring$
1542+}
1543+
1544+FUNCTION {author.sort}
1545+{ author empty$
1546+ { key empty$
1547+ { "to sort, need author or key in " cite$ * warning$
1548+ "" }
1549+ { key sortify }
1550+ if$
1551+ }
1552+ { author sort.format.names }
1553+ if$
1554+}
1555+
1556+FUNCTION {editor.sort}
1557+{ editor empty$
1558+ { key empty$
1559+ { "to sort, need editor or key in " cite$ * warning$
1560+ ""
1561+ }
1562+ { key sortify }
1563+ if$
1564+ }
1565+ { editor sort.format.names }
1566+ if$
1567+}
1568+
1569+FUNCTION {author.editor.sort}
1570+{ author empty$
1571+ { "missing author in " cite$ * warning$
1572+ editor empty$
1573+ { key empty$
1574+ { "to sort, need author, editor, or key in " cite$ * warning$
1575+ ""
1576+ }
1577+ { key sortify }
1578+ if$
1579+ }
1580+ { editor sort.format.names }
1581+ if$
1582+ }
1583+ { author sort.format.names }
1584+ if$
1585+}
1586+
1587+FUNCTION {author.organization.sort}
1588+%
1589+% added - GNP. Stack author or organization for sorting (from alpha.bst).
1590+% Unlike alpha.bst, we need entire names, not abbreviations
1591+%
1592+{ author empty$
1593+ { organization empty$
1594+ { key empty$
1595+ { "to sort, need author, organization, or key in " cite$ * warning$
1596+ ""
1597+ }
1598+ { key sortify }
1599+ if$
1600+ }
1601+ { organization sortify }
1602+ if$
1603+ }
1604+ { author sort.format.names }
1605+ if$
1606+}
1607+
1608+FUNCTION {editor.organization.sort}
1609+%
1610+% added - GNP. Stack editor or organization for sorting (from alpha.bst).
1611+% Unlike alpha.bst, we need entire names, not abbreviations
1612+%
1613+{ editor empty$
1614+ { organization empty$
1615+ { key empty$
1616+ { "to sort, need editor, organization, or key in " cite$ * warning$
1617+ ""
1618+ }
1619+ { key sortify }
1620+ if$
1621+ }
1622+ { organization sortify }
1623+ if$
1624+ }
1625+ { editor sort.format.names }
1626+ if$
1627+}
1628+
1629+FUNCTION {presort}
1630+%
1631+% Presort creates the bibentry's label via a call to calc.label, and then
1632+% sorts the entries based on entry type. Chicago.bst adds support for
1633+% including organizations as the sort key; the following is stolen from
1634+% alpha.bst.
1635+%
1636+{ calc.label sortify % recalculate bibitem label
1637+ year field.or.null purify$ #-1 #4 substring$ * % add year
1638+ " "
1639+ *
1640+ type$ "book" =
1641+ type$ "inbook" =
1642+ or
1643+ 'author.editor.sort
1644+ { type$ "proceedings" =
1645+ 'editor.organization.sort
1646+ { type$ "manual" =
1647+ 'author.organization.sort
1648+ 'author.sort
1649+ if$
1650+ }
1651+ if$
1652+ }
1653+ if$
1654+ #1 entry.max$ substring$ % added for newapa
1655+ 'sort.label := % added for newapa
1656+ sort.label % added for newapa
1657+ *
1658+ " "
1659+ *
1660+ title field.or.null
1661+ sort.format.title
1662+ *
1663+ #1 entry.max$ substring$
1664+ 'sort.key$ :=
1665+}
1666+
1667+ITERATE {presort}
1668+
1669+SORT % by label, year, author/editor, title
1670+
1671+STRINGS { last.label next.extra }
1672+
1673+INTEGERS { last.extra.num }
1674+
1675+FUNCTION {initialize.extra.label.stuff}
1676+{ #0 int.to.chr$ 'last.label :=
1677+ "" 'next.extra :=
1678+ #0 'last.extra.num :=
1679+}
1680+
1681+FUNCTION {forward.pass}
1682+%
1683+% Pass through all entries, comparing current entry to last one.
1684+% Need to concatenate year to the stack (done by calc.label) to determine
1685+% if two entries are the same (see presort)
1686+%
1687+{ last.label
1688+ calc.label year field.or.null purify$ #-1 #4 substring$ * % add year
1689+ #1 entry.max$ substring$ = % are they equal?
1690+ { last.extra.num #1 + 'last.extra.num :=
1691+ last.extra.num int.to.chr$ 'extra.label :=
1692+ }
1693+ { "a" chr.to.int$ 'last.extra.num :=
1694+ "" 'extra.label :=
1695+ calc.label year field.or.null purify$ #-1 #4 substring$ * % add year
1696+ #1 entry.max$ substring$ 'last.label := % assign to last.label
1697+ }
1698+ if$
1699+}
1700+
1701+FUNCTION {reverse.pass}
1702+{ next.extra "b" =
1703+ { "a" 'extra.label := }
1704+ 'skip$
1705+ if$
1706+ label.year extra.label * 'sort.year :=
1707+ extra.label 'next.extra :=
1708+}
1709+
1710+EXECUTE {initialize.extra.label.stuff}
1711+
1712+ITERATE {forward.pass}
1713+
1714+REVERSE {reverse.pass}
1715+
1716+FUNCTION {bib.sort.order}
1717+{ sort.label
1718+ " "
1719+ *
1720+ year field.or.null sortify
1721+ *
1722+ " "
1723+ *
1724+ title field.or.null
1725+ sort.format.title
1726+ *
1727+ #1 entry.max$ substring$
1728+ 'sort.key$ :=
1729+}
1730+
1731+ITERATE {bib.sort.order}
1732+
1733+SORT % by sort.label, year, title --- giving final bib. order.
1734+
1735+FUNCTION {begin.bib}
1736+
1737+{ preamble$ empty$
1738+ 'skip$
1739+ { preamble$ write$ newline$ }
1740+ if$
1741+ "\begin{thebibliography}{}" write$ newline$
1742+}
1743+
1744+
1745+EXECUTE {begin.bib}
1746+
1747+EXECUTE {init.state.consts}
1748+
1749+ITERATE {call.type$}
1750+
1751+FUNCTION {end.bib}
1752+{ newline$
1753+ "\end{thebibliography}" write$ newline$
1754+}
1755+
1756+EXECUTE {end.bib}
1757+
1758+
1759+
1760+
1761+
1762+
1763+
1764+
1765+
1766+
1767+
1768+
1769+
1770+
impl-paper/acmtrans2m.clsnew file+1460
@@ -0,0 +1,1460 @@
1+% latex2e by nr 7/3/96
2+% acmtrans.cls revised 4/19/96
3+% revised again 31-JAN-1996 (see end of file)
4+% revised 5-14-1997 :
5+% Don't use sans-serif font in categories and descriptors
6+% include latexsym by default
7+% Define longpage and shortpage
8+% Adjusted from the acmtrans2e.cls file to the needs of ACM TOCL by
9+% Marco Aiello on June 14, 2000.
10+% Further changes made by Frederic Goualard on Sep. 27, 2000
11+% to take care of the indentation problem in the bibliography
12+% arising without the use of the hyperref package.
13+% Modularization to adapt to the needs of JACM, TOCL,
14+% TODAES, TODS, TOGS, TOMS, AND TOPLAS, by Marco Aiello on
15+% June 2001.
16+% Here is the basic framework that is needed to convert your paper
17+% into ACM Transactions format and bibliographic format. For a tutorial
18+% introduction, see ``instructions.tex'' (compile it with LaTeX) that
19+% accompanies the distribution of this style file.
20+%
21+% -> \documentclass{acmtrans2m}
22+% -> \markboth{}{}
23+% takes 2 arguments and it is for the left- and right-page headers:
24+% the first set of braces is assigned for author's name(s)
25+% and
26+% the second set of braces is assigned for the title
27+% (if the title is too long, contraction may be needed
28+% -> \title{}
29+% if the title is too long, it can be separated by \\
30+% -> \author{}
31+% author1 \\ author1 affiliation
32+% \and
33+% author2 \\ author2 affiliation
34+% -> \begin{abstract}
35+% -> \end{abstract}
36+%
37+% -> \category{}{}{}
38+% takes 3 arguments for the Computing Reviews Classification Scheme.
39+% ex: \category{D.3.3}{Programming Languages}{Language Constructs and
40+% Features}[data types and structures]
41+% the last argument, in square brackets, is optional.
42+% -> \terms{} (ex: \terms{Human Factors, Languages})
43+% -> \keywords{} (in alphabetical order \keywords{document processing, sequences,
44+% string searching, subsequences, substrings})
45+% -> \begin{document}
46+%
47+% -> \begin{bottomstuff}
48+% similar to \thanks
49+% for authors' addresses; research/grant statements
50+% -> \end{bottomstuff}
51+% -> \maketitle
52+%
53+% Now you can start the body of the paper; your figures, tables and
54+% use all the latex constructs.
55+%
56+% -> \begin{acks}
57+% acknowledgements
58+% -> \end{acks}
59+%
60+% -> \bibliographystyle{acmtrans}
61+% -> \bibliography{mybib_file}
62+%
63+% ****
64+% If your paper has been accepted with a separate (electronic only)
65+% appendix, you need to add the following control sequence:
66+%
67+%
68+% body of appendix
69+%!!!!!! \appendixhead has be cut into two: \appendixhead and \elecappendix
70+%!!!!!! See end of file. (jtb)
71+%
72+% -> \end{document}
73+%
74+% Do not worry about the other definitions in this style file
75+% Remember to compile: latex, bibtex, latex latex
76+%
77+% Bibliographic cite forms needed:
78+%
79+% \cite{key}
80+% which produces citations with author list and year.
81+% eg. [Brown 1978; Jarke, et al. 1985]
82+% \citeA{key}
83+% which produces citations with only the author list.
84+% eg. [Brown; Jarke, et al.]
85+% \citeN{key}
86+% which produces citations with the author list and year, but
87+% can be used as nouns in a sentence; no brackets appear around
88+% the author names, but only around the year.
89+% eg. Shneiderman [1978] states that......
90+% \citeN should only be used for a single citation.
91+% \citeNN{refkey1,refkey2} for author [ref1year; ref2year]
92+% \citeyear{key}
93+% which produces the year information only, within brackets.
94+%
95+% Abbreviated author lists use the ``et al.'' construct.
96+%
97+% The above are examples of required ACM bibliographic cite formats needed.
98+% *******************
99+% Here is the complete list of cite forms from the chicago bibliographic style
100+%
101+% \cite{key}
102+% which produces citations with abbreviated author list and year.
103+% \citeNP{key}
104+% which produces citations with abbreviated author list and year.
105+% \citeA{key}
106+% which produces only the abbreviated author list.
107+% \citeANP{key}
108+% which produces only the abbreviated author list.
109+% \citeN{key}
110+% which produces the abbreviated author list and year, with only the
111+% year in parentheses. Use with only one citation.
112+% \citeyear{key}
113+% which produces the year information only, within parentheses.
114+% \citeyearNP{key}
115+% which produces the year information only.
116+%
117+% Abbreviated author lists use the ``et al.'' construct.
118+%
119+% `NP' means `no parentheses'
120+%
121+
122+\NeedsTeXFormat{LaTeX2e}
123+\ProvidesClass{acmtrans2m} [1996/07/03 ACM Transactions class based on <23 April 96>]
124+\RequirePackage{latexsym}
125+%aiellom{
126+\RequirePackage{url}
127+
128+% Do not change the following! Use the appropriate acmtocl, acmtods, ... option
129+\def\@acmVolume{V} %the volume
130+\def\@acmNumber{N} %the number
131+\def\@acmYear{YY} %the last two digits of the year,
132+\def\@acmMonth{Month} %the month
133+\def\@journalName{ACM Journal Name} %the name of the ACM journal
134+\def\@journalNameShort{jn} %the acronym of the ACM journal
135+\def\@permissionCodeOne{0000-0000} %the permission code of the ACM journal
136+\def\@permissionCodeTwo{0000} %the permission code of the ACM journal part 2
137+\def\@pageCode{\acmPageCode} %the first page of the article in 4 digits
138+
139+
140+\newif\if@acmjacm
141+\newif\if@acmtocl
142+\newif\if@acmtodaes
143+\newif\if@acmtods
144+\newif\if@acmtogs
145+\newif\if@acmtoms
146+\newif\if@acmtoplas
147+
148+\DeclareOption{acmnow}{
149+ \typeout{}
150+ \typeout{Directly generating the Month and Year for footers from the clock.}
151+ \def\@acmYear{\yearTwoDigits}
152+ \def\@acmMonth{\monthWord}
153+}
154+
155+\DeclareOption{acmjacm}{
156+ \typeout{}
157+ \typeout{Using ACM, JACM's option: 2001/06/01 by Marco Aiello et al.}
158+ \typeout{}
159+ %\global\@acmjacmfalse
160+ \global\@acmtoclfalse
161+ \global\@acmtodaesfalse
162+ \global\@acmtodsfalse
163+ \global\@acmtogsfalse
164+ \global\@acmtomsfalse
165+ \global\@acmtoplasfalse
166+ \global\@acmjacmtrue
167+ \def\@journalName{Journal of the ACM}
168+ \def\@journalNameShort{jacm}
169+ \def\@permissionCodeOne{0004-5411}
170+ \def\@permissionCodeTwo{0100}
171+}
172+
173+\DeclareOption{acmtocl}{
174+ \typeout{}
175+ \typeout{Using ACM, TOCL's option: 2001/06/01 by Marco Aiello et al.}
176+ \typeout{}
177+ \global\@acmjacmfalse
178+ \global\@acmtoclfalse
179+ \global\@acmtodaesfalse
180+ \global\@acmtodsfalse
181+ \global\@acmtogsfalse
182+ \global\@acmtomsfalse
183+ \global\@acmtoplasfalse
184+ \global\@acmtocltrue
185+ \def\@journalName{ACM Transactions on Computational Logic}
186+ \def\@journalNameShort{tocl}
187+ \def\@permissionCodeOne{1529-3785}
188+ \def\@permissionCodeTwo{0700}
189+}
190+
191+\DeclareOption{acmtodaes}{
192+ \typeout{}
193+ \typeout{Using ACM, TODAES option: 2001/06/01 by Marco Aiello et al.}
194+ \typeout{}
195+ \global\@acmjacmfalse
196+ \global\@acmtoclfalse
197+ %\global\@acmtodaesfalse
198+ \global\@acmtodsfalse
199+ \global\@acmtogsfalse
200+ \global\@acmtomsfalse
201+ \global\@acmtoplasfalse
202+ \global\@acmtodaestrue
203+ \def\@journalName{ACM Transactions on Design Automation of Electronic Systems}
204+ \def\@journalNameShort{todaes}
205+ \def\@permissionCodeOne{1084-4309}
206+ \def\@permissionCodeTwo{0400}
207+}
208+
209+\DeclareOption{acmtods}{
210+ \typeout{}
211+ \typeout{Using ACM, TODS's option: 2001/06/01 by Marco Aiello et al.}
212+ \typeout{}
213+ \global\@acmjacmfalse
214+ \global\@acmtoclfalse
215+ \global\@acmtodaesfalse
216+ %\global\@acmtodsfalse
217+ \global\@acmtogsfalse
218+ \global\@acmtomsfalse
219+ \global\@acmtoplasfalse
220+ \global\@acmtodstrue
221+ \def\@journalName{ACM Transactions on Database Systems}
222+ \def\@journalNameShort{tods}
223+ \def\@permissionCodeOne{0362-5915}
224+ \def\@permissionCodeTwo{0300}
225+}
226+
227+\DeclareOption{acmtogs}{
228+ \typeout{}
229+ \typeout{Using ACM, TOGS's option: 2001/06/01 by Marco Aiello et al.}
230+ \typeout{}
231+ \global\@acmjacmfalse
232+ \global\@acmtoclfalse
233+ \global\@acmtodaesfalse
234+ \global\@acmtodsfalse
235+ %\global\@acmtogsfalse
236+ \global\@acmtomsfalse
237+ \global\@acmtoplasfalse
238+ \global\@acmtogstrue
239+ \def\@journalName{ACM Transactions on Graphics}
240+ \def\@journalNameShort{togs}
241+ \def\@permissionCodeOne{0730-0301}
242+ \def\@permissionCodeTwo{0100}
243+}
244+
245+\DeclareOption{acmtoms}{
246+ \typeout{}
247+ \typeout{Using ACM, TOMS's option: 2001/06/01 by Marco Aiello et al.}
248+ \typeout{}
249+ \global\@acmjacmfalse
250+ \global\@acmtoclfalse
251+ \global\@acmtodaesfalse
252+ \global\@acmtodsfalse
253+ \global\@acmtogsfalse
254+ %\global\@acmtomsfalse
255+ \global\@acmtoplasfalse
256+ \global\@acmtomstrue
257+ \def\@journalName{ACM Transactions on Mathematical Software}
258+ \def\@journalNameShort{toms}
259+ \def\@permissionCodeOne{0098-3500}
260+ \def\@permissionCodeTwo{1200}
261+}
262+
263+\DeclareOption{acmtoplas}{
264+ \typeout{}
265+ \typeout{Using ACM, TOPLAS option: 2001/06/01 by Marco Aiello et al.}
266+ \typeout{}
267+ \global\@acmjacmfalse
268+ \global\@acmtoclfalse
269+ \global\@acmtodaesfalse
270+ \global\@acmtodsfalse
271+ \global\@acmtogsfalse
272+ \global\@acmtomsfalse
273+ %\global\@acmtoplasfalse
274+ \global\@acmtoplastrue
275+ \def\@journalName{ACM Transactions on Programming Languages and Systems}
276+ \def\@journalNameShort{toplas}
277+ \def\@permissionCodeOne{0164-0925}
278+ \def\@permissionCodeTwo{0500}
279+}
280+%}aiellom
281+
282+
283+
284+\if@compatibility\else
285+\DeclareOption{a4paper}
286+ {\setlength\paperheight {297mm}%
287+ \setlength\paperwidth {210mm}%
288+ \def\special@paper{210mm,297mm}}
289+\DeclareOption{a5paper}
290+ {\setlength\paperheight {210mm}%
291+ \setlength\paperwidth {148mm}%
292+ \def\special@paper{148mm,210mm}}
293+\DeclareOption{b5paper}
294+ {\setlength\paperheight {250mm}%
295+ \setlength\paperwidth {176mm}%
296+ \setlength\voffset {-15mm}%
297+ \setlength\hoffset {-20mm}%
298+ \def\special@paper{176mm,250mm}}
299+\DeclareOption{letterpaper}
300+ {\setlength\paperheight {11in}%
301+ \setlength\paperwidth {8.5in}%
302+ \def\special@paper{8.5in,11in}}
303+\DeclareOption{legalpaper}
304+ {\setlength\paperheight {14in}%
305+ \setlength\paperwidth {8.5in}%
306+ \def\special@paper{8.5in,14in}}
307+\DeclareOption{executivepaper}
308+ {\setlength\paperheight {10.5in}%
309+ \setlength\paperwidth {7.25in}%
310+ \def\special@paper{7.25in,10.5in}}
311+\DeclareOption{landscape}
312+ {\setlength\@tempdima {\paperheight}%
313+ \setlength\paperheight {\paperwidth}%
314+ \setlength\paperwidth {\@tempdima}}
315+\fi
316+
317+\DeclareOption{checkMargin}{\setlength\overfullrule{5pt}}
318+\DeclareOption{final}{\setlength\overfullrule{0pt}}
319+
320+\DeclareOption{oneside}{\@twosidefalse \@mparswitchfalse}
321+\DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue}
322+
323+\DeclareOption{10pt}{\def\@ptsize{0}} %needed for amssymbols.sty
324+\DeclareOption{11pt}{\ClassError{acmtrans}{11pt style not supported}
325+ {ACM transactions documents can be set in 10pt only}}
326+\DeclareOption{12pt}{\ClassError{acmtrans}{11pt style not supported}
327+ {ACM transactions documents can be set in 10pt only}}
328+\newif\if@hyperref
329+\DeclareOption{hyperref}{%
330+ \def\pages{\pageref{@firstpg}--\pageref{@lastpg}}%
331+ \def\mypage{\thepage}%
332+ \def\@getpagenum#1#2#3#4{#2}%
333+ \def\pdfinfo#1#2{\pdfmark{pdfmark=/DOCINFO,Title=#1,Author=#2}}
334+ \global\@hyperreftrue
335+ }
336+\DeclareOption{nohyperref}{
337+ \def\pages{\pageref{@firstpg}--\pageref{@lastpg}}%
338+ \def\@getpagenum#1#2{#2}%
339+ \def\mypage{\thepage}%
340+ \def\pdfinfo#1#2{}%
341+ \def\pdfbookmark#1#2{}%
342+ \global\@hyperreffalse
343+ }
344+\DeclareOption{notfinal}{
345+ \def\pages{BD}%
346+ \def\mypage{TBD}%
347+ \def\@getpagenum#1#2{#2}%
348+ \def\pdfinfo#1#2{}%
349+ \def\pdfbookmark#1#2{}%
350+ }
351+\DeclareOption{omitline}{\def\@abstractbottom{\relax}}
352+\DeclareOption{dontomitline}{\def\@abstractbottom{\if@acmjacm\else\hbox{\vrule height .2pt width 30pc}\fi}}
353+\ExecuteOptions{twoside,notfinal,10pt,dontomitline,nohyperref,letterpaper} % defaults
354+
355+
356+
357+\ProcessOptions
358+
359+%{aiellom to automatize the issue specific data
360+\def\acmVolume#1{\def\@acmVolume{#1}}
361+\def\acmNumber#1{\def\@acmNumber{#1}}
362+\def\acmYear#1{\def\@acmYear{#1}}
363+\def\acmMonth#1{\def\@acmMonth{#1}}
364+
365+
366+% Command to get the year from the system and display the last two digits
367+\newcommand{\ignoretwo}[2]{}
368+\newcommand{\yearTwoDigits}{\expandafter\ignoretwo\the\year}
369+%To transform the month number in its name in English
370+\newcommand{\monthWord}{\ifnum\the\month=1 January\fi\ifnum\the\month=2 February\fi\ifnum\the\month=3 March\fi\ifnum\the\month=4 April\fi\ifnum\the\month=5 May\fi\ifnum\the\month=6 June\fi\ifnum\the\month=7 July\fi\ifnum\the\month=8 August\fi\ifnum\the\month=9 September\fi\ifnum\the\month=10 October\fi\ifnum\the\month=11 November\fi\ifnum\the\month=12 December\fi}
371+% overright the \@setref definition, so that if a reference is undefined
372+% then it returns a number 0 and then the usual double boldface
373+% question marks ??
374+% this is necessary for the \acmPageCode command, otherwise it gives an error
375+% everytime the aux file is not there
376+\def\@setref#1#2#3{%
377+ \ifx#1\relax
378+ \number 0\relax
379+ \protect\G@refundefinedtrue
380+ \nfss@text{\reset@font\bfseries ??}%
381+ \@latex@warning{Reference `#3' on page \thepage \space undefined}%
382+ \else
383+ \expandafter#2#1\null
384+ \fi}
385+%make the code a four digits string based on the first page number
386+\newcommand{\acmPageCode}{\bgroup
387+ \newcount\c@tempo
388+ \setcounter{tempo}{\number\pageref{@firstpg}}\ifnum \c@tempo<1000 0\fi\ifnum \c@tempo<100 0\fi\ifnum \c@tempo<10 0\fi\ifnum \c@tempo<1 0\fi\pageref{@firstpg}
389+ \egroup
390+}
391+%}aiellom
392+
393+
394+
395+\lineskip 1pt \normallineskip 1pt
396+\def\baselinestretch{1}
397+
398+\renewcommand\normalsize{%
399+ \@setfontsize\normalsize\@xpt\@xiipt
400+ \abovedisplayskip 6pt plus2pt minus1pt\belowdisplayskip \abovedisplayskip
401+ \abovedisplayshortskip 6pt plus0pt minus 3pt
402+ \belowdisplayshortskip 6pt plus0pt minus3pt\let\@listi\@listI}
403+
404+\newcommand\small{%
405+ \@setfontsize\small\@ixpt{11pt}%
406+ \abovedisplayskip 5pt plus 2pt minus 1pt\belowdisplayskip \abovedisplayskip
407+ \abovedisplayshortskip 5pt plus0pt minus2pt\belowdisplayshortskip 5pt plus0pt
408+ minus 2pt
409+ \def\@listi{\leftmargin\leftmargini \topsep 5pt plus 2pt minus 1pt\parsep 0pt
410+ plus .7pt
411+ \itemsep 1.6pt plus .8pt}}
412+\newcommand\footnotesize{%
413+% \@setfontsize\footnotesize\@viiipt{10pt}
414+ \@setsize\footnotesize{10pt}\viiipt\@viiipt
415+ \abovedisplayskip 4pt plus 1pt minus 0pt\belowdisplayskip \abovedisplayskip
416+ \abovedisplayshortskip 4pt plus 0pt minus 1pt\belowdisplayshortskip 4pt plus
417+ 0pt minus 1pt
418+ \def\@listi{\leftmargin\leftmargini \topsep 4pt plus 1pt minus
419+ 0pt\parsep 0pt plus .5pt
420+ \itemsep 1pt plus .7pt}}
421+
422+\newcommand\scriptsize{\@setfontsize\scriptsize\@viipt\@viiipt}
423+\newcommand\tiny{\@setfontsize\tiny\@vpt\@vipt}
424+\newcommand\large{\@setfontsize\large\@xiipt{14}}
425+\newcommand\Large{\@setfontsize\Large\@xivpt{18}}
426+\newcommand\LARGE{\@setfontsize\LARGE\@xviipt{20}}
427+\newcommand\huge{\@setfontsize\huge\@xxpt{25}}
428+\newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
429+
430+\normalsize
431+
432+ \oddsidemargin .75in \evensidemargin .75in \marginparwidth .5in
433+ \marginparsep .125in
434+ \topmargin .25in \headheight 12pt\headsep 16pt
435+ %% not in latex2e \footheight 10pt
436+ \footskip 15pt
437+
438+\textheight 47pc \textwidth 30pc \columnsep 10pt \columnseprule 0pt
439+% next five lines added by K.R. Apt, March 20, 01
440+\advance\textheight-2.6pt
441+\newdimen\normaltextheight
442+\setlength\normaltextheight{\textheight}
443+%\renewcommand\rmdefault{pnc}
444+%\renewcommand\sfdefault{phv}
445+
446+
447+\footnotesep 7pt
448+\skip\footins 15pt plus 4pt minus 3pt
449+\floatsep 12pt plus 2pt minus 2pt
450+\textfloatsep \floatsep
451+\intextsep 1pc plus 1pc
452+%%% not in 2e %% \@maxsep 1pc
453+%%% not in 2e %% \@dblmaxsep 20pt
454+\dblfloatsep 12pt plus 2pt minus 2pt
455+\dbltextfloatsep 20pt plus 2pt minus 4pt
456+\@fptop 0pt plus 1fil \@fpsep 1pc plus 2fil \@fpbot 0pt plus 1fil
457+\@dblfptop 0pt plus 1fil \@dblfpsep 8pt plus 2fil \@dblfpbot 0pt plus 1fil
458+\marginparpush 6pt
459+
460+\parskip 0pt plus .1pt \parindent 10pt \partopsep 0pt
461+\@lowpenalty 51 \@medpenalty 151 \@highpenalty 301
462+\@beginparpenalty -\@lowpenalty \@endparpenalty -\@lowpenalty \@itempenalty
463+-\@lowpenalty
464+
465+
466+\def\part{\@ucheadtrue
467+ \@startsection{part}{9}{\z@}{-10pt plus -4pt minus
468+ -2pt}{4pt}{\reset@font\normalsize\sffamily}}
469+\def\section{\@ucheadtrue
470+ \@startsection{section}{1}{\z@}{-10pt plus -4pt minus
471+ -2pt}{4pt}{\reset@font\normalsize\sffamily}}
472+\def\subsection{\@ucheadfalse
473+ \@startsection{subsection}{2}{\z@}{-8pt plus -2pt minus
474+ -1pt}{4pt}{\reset@font\normalsize\sffamily}}
475+\def\subsubsection{\@ucheadfalse
476+ \@startsection{subsubsection}{3}{\parindent}{6pt plus
477+1pt}{-5pt}{\reset@font\normalsize\itshape}}
478+\def\paragraph{\@ucheadfalse
479+ \@startsection{paragraph}{3}{\parindent}{6pt plus
480+1pt}{-5pt}{\reset@font\normalsize\itshape}}
481+
482+\renewcommand{\@seccntformat}[1]{\textup{\csname the#1\endcsname}}
483+
484+\gdef\@period{.}
485+\def\@trivlist{\@topsepadd\topsep
486+\if@noskipsec \gdef\@period{}\leavevmode\gdef\@period{.}\fi
487+ \ifvmode \advance\@topsepadd\partopsep \else \unskip\par\fi
488+ \if@inlabel \@noparitemtrue \@noparlisttrue
489+ \else \@noparlistfalse \@topsep\@topsepadd \fi
490+ \advance\@topsep \parskip
491+ \leftskip\z@\rightskip\@rightskip \parfillskip\@flushglue
492+ \@setpar{\if@newlist\else{\@@par}\fi} \global\@newlisttrue
493+\@outerparskip\parskip}
494+
495+
496+\def\@startsection#1#2#3#4#5#6{%
497+ \if@noskipsec \leavevmode \fi
498+ \par
499+ \@tempskipa #4\relax
500+ \@afterindenttrue
501+ \ifdim \@tempskipa <\z@
502+ \@tempskipa -\@tempskipa \@afterindentfalse
503+ \fi
504+ \if@nobreak
505+ \everypar{}%
506+ \else
507+ \addpenalty\@secpenalty\addvspace\@tempskipa
508+ \fi
509+ \@ifstar
510+ {\@ssect{#3}{#4}{#5}{#6}}%
511+ {\@dblarg{\@sect{#1}{#2}{#3}{#4}{#5}{#6}}}}
512+\def\@sect#1#2#3#4#5#6[#7]#8{%
513+ \ifnum #2>\c@secnumdepth
514+ \let\@svsec\@empty
515+ \else
516+ \refstepcounter{#1}%
517+ \if@uchead%
518+ \protected@edef\@svsec{\@seccntformat{#1}.\quad\relax}%
519+ \else%
520+ \protected@edef\@svsec{\@seccntformat{#1}\quad\relax}%
521+ \fi%
522+ \fi
523+ \@tempskipa #5\relax
524+ \ifdim \@tempskipa>\z@
525+ \begingroup
526+ #6{%
527+ \@hangfrom{\hskip #3\relax\@svsec}%
528+ \interlinepenalty \@M \if@uchead\MakeUppercase{#8}\else#8\fi \@@par}%
529+ \endgroup
530+ \csname #1mark\endcsname{#7}%
531+ \addcontentsline{toc}{#1}{%
532+ \ifnum #2>\c@secnumdepth \else
533+ \protect\numberline{\csname the#1\endcsname}%
534+ \fi
535+ #7}%
536+ \else
537+ \def\@svsechd{%
538+ #6{\hskip #3\relax
539+ \@svsec \if@uchead\Makeuppercase{#8}\else#8\fi}%
540+ \csname #1mark\endcsname{#7}%
541+ \addcontentsline{toc}{#1}{%
542+ \ifnum #2>\c@secnumdepth \else
543+ \protect\numberline{\csname the#1\endcsname}%
544+ \fi
545+ #7}}%
546+ \fi
547+ \@xsect{#5}}
548+
549+\def\@xsect#1{\@tempskipa #1\relax
550+ \ifdim \@tempskipa>\z@
551+ \par \nobreak
552+ \vskip \@tempskipa
553+ \@afterheading
554+ \else \global\@nobreakfalse \global\@noskipsectrue
555+ \everypar{\if@noskipsec \global\@noskipsecfalse
556+ \clubpenalty\@M \hskip -\parindent
557+ \begingroup \@svsechd\@period \endgroup \unskip
558+ \hskip -#1
559+ \else \clubpenalty \@clubpenalty
560+ \everypar{}\fi}\fi\ignorespaces}
561+\newif\if@uchead\@ucheadfalse
562+
563+
564+\setcounter{secnumdepth}{3}
565+\newcounter{secnumbookdepth}
566+\setcounter{secnumbookdepth}{3}
567+
568+\newfont{\apbf}{cmbx9}
569+
570+\def\@withappendix#1{App--\number #1}
571+
572+\newcommand{\elecappendix}{
573+}
574+
575+\def\appenheader{\global\@topnum\z@ \global\@botroom \textheight \begin{figure}
576+\newfont{\sc}{cmcsc10}
577+\parindent\z@
578+\hbox{}
579+\vskip -\textfloatsep
580+\vskip 11pt
581+\hrule height .2pt width 30pc
582+\vskip 2pt\rule{0pt}{10pt}\ignorespaces}
583+\def\endappenheader{\end{figure}\gdef\appendixhead{}}
584+
585+\def\@appsec{}
586+
587+\def\appendix{\par
588+ \setcounter{section}{0}
589+ \setcounter{subsection}{0}
590+ \def\@appsec{APPENDIX }
591+ \def\thesection{\Alph{section}}
592+ \def\theHsection{\Alph{section}}}
593+
594+
595+
596+\labelsep 5pt
597+\settowidth{\leftmargini}{(9)} \addtolength\leftmargini\labelsep
598+\settowidth{\leftmarginii}{(b)} \addtolength\leftmarginii\labelsep
599+\leftmarginiii \leftmarginii
600+\leftmarginiv \leftmarginii
601+\leftmarginv \leftmarginii
602+\leftmarginvi \leftmarginii
603+\leftmargin\leftmargini
604+\labelwidth\leftmargini\advance\labelwidth-\labelsep
605+\def\@listI{\leftmargin\leftmargini \parsep 0pt plus 1pt\topsep 6pt plus 2pt
606+minus 2pt\itemsep 2pt plus 1pt minus .5pt}
607+\let\@listi\@listI
608+\@listi
609+\def\@listii{\leftmargin\leftmarginii
610+ \labelwidth\leftmarginii\advance\labelwidth-\labelsep
611+ \topsep 0pt plus 1pt
612+ \parsep 0pt plus .5pt
613+ \itemsep \parsep}
614+\def\@listiii{\leftmargin\leftmarginiii
615+ \labelwidth\leftmarginiii\advance\labelwidth-\labelsep
616+ \topsep 0pt plus 1pt
617+ \parsep 0pt plus .5pt
618+ \itemsep \parsep}
619+\def\@listiv{\leftmargin\leftmarginiv
620+ \labelwidth\leftmarginiv\advance\labelwidth-\labelsep}
621+\def\@listv{\leftmargin\leftmarginv
622+ \labelwidth\leftmarginv\advance\labelwidth-\labelsep}
623+\def\@listvi{\leftmargin\leftmarginvi
624+ \labelwidth\leftmarginvi\advance\labelwidth-\labelsep}
625+
626+
627+
628+
629+\def\enumerate{\ifnum \@enumdepth >3 \@toodeep\else
630+ \advance\@enumdepth \@ne
631+ \edef\@enumctr{enum\romannumeral\the\@enumdepth}\list
632+ {\csname label\@enumctr\endcsname}{\usecounter
633+ {\@enumctr}\def\makelabel##1{##1\hss}}\fi}
634+\def\longenum{\ifnum \@enumdepth >3 \@toodeep\else
635+ \advance\@enumdepth \@ne
636+ \edef\@enumctr{enum\romannumeral\the\@enumdepth}\list
637+ {\csname label\@enumctr\endcsname}{\usecounter
638+ {\@enumctr}\labelwidth\z@}\fi}
639+%\leftmargin\z@ \itemindent\parindent}\fi} - this indents each item in enumerate
640+\let\endlongenum\endlist
641+%%--------------------CHANGED: always roman parentheses. dave ---------------%%
642+\def\labelenumi{{\rm (}\arabic{enumi}\/{\rm )}}
643+\def\theenumi{\arabic{enumi}}
644+\def\labelenumii{{\rm (}\alph{enumii}\rm{)}}
645+\def\theenumii{\alph{enumii}}
646+\def\p@enumii{\theenumi}
647+\def\labelenumiii{\roman{enumiii}.}
648+\def\theenumiii{\roman{enumiii}}
649+\def\p@enumiii{\theenumi{\rm (}\theenumii{\rm )}}
650+\def\labelenumiv{\Alph{enumiv}.}
651+\def\theenumiv{\Alph{enumiv}}
652+\def\p@enumiv{\p@enumiii\theenumiii}
653+
654+\def\p@enumiv{\p@enumiii\theenumiii}
655+
656+\def\itemize{\list{---\hskip -\labelsep}{\settowidth
657+ {\leftmargin}{---}\labelwidth\leftmargin
658+ \addtolength{\labelwidth}{-\labelsep}}}
659+\let\enditemize\endlist
660+\def\longitem{\list{---}{\labelwidth\z@
661+ \leftmargin\z@ \itemindent\parindent \advance\itemindent\labelsep}}
662+\let\endlongitem\endlist
663+\def\verse{\let\\=\@centercr
664+ \list{}{\leftmargin 2pc
665+ \itemindent -1.5em\listparindent \itemindent
666+ \rightmargin\leftmargin\advance\leftmargin 1.5em}\item[]}
667+\let\endverse\endlist
668+\def\quotation{\list{}{\leftmargin 2pc \listparindent .5em
669+ \itemindent\listparindent
670+ \rightmargin\leftmargin \parsep 0pt plus 1pt}\item[]}
671+\let\endquotation=\endlist
672+\def\quote{\list{}{\leftmargin 2pc \rightmargin\leftmargin}\item[]}
673+\let\endquote=\endlist
674+
675+\def\description{\list{}{\listparindent\parindent\labelwidth\z@
676+ \leftmargin\z@ \itemindent\parindent\advance\itemindent\labelsep
677+ \def\makelabel##1{\it ##1.}}}
678+\let\enddescription\endlist
679+
680+\def\describe#1{\list{}{\listparindent\parindent\settowidth{\labelwidth}{#1}\leftmargin
681+ \labelwidth\addtolength\leftmargin\labelsep\def\makelabel##1{##1\hfil}}}
682+\let\enddescribe\endlist
683+
684+ \def\program{\ifx\@currsize\normalsize\small \else \rm \fi\tabbing}
685+ \let\endprogram\endtabbing
686+ \def\@begintheorem#1#2{\trivlist \item[\hskip 10pt\hskip
687+ \labelsep{\sc{#1}\hskip 5pt\relax #2.}] \itshape}
688+ % aiellom{: this is what makes the theorem environment with names
689+ % ABOVE #1 is the word example, corollary, etc.
690+ % #2 is the number
691+ % \def\@opargbegintheorem#1#2#3{\trivlist
692+ % \item[\hskip 10pt \hskip \labelsep{\sc #1\savebox\@tempboxa{#3}\ifdim
693+ % \wd\@tempboxa>\z@ \hskip 5pt\relax \box\@tempboxa\fi.}] \itshape}
694+ % is been changed to
695+ % #1 is the word theorem, lemma, etc.
696+ % #2 is the number
697+ % #3 is the name of the theorem, lemma, etc.
698+ \def\@opargbegintheorem#1#2#3{\trivlist
699+ \item[\hskip 10pt \hskip
700+\labelsep{\sc{#1}\savebox\@tempboxa{\sc{#3}}\ifdim
701+ \wd\@tempboxa>\z@ \hskip 5pt\relax \sc{#2} \box\@tempboxa\fi.}]
702+\itshape}
703+ % aiellom}
704+
705+
706+
707+\newif\if@qeded\global\@qededfalse
708+\def\proof{\global\@qededfalse\@ifnextchar[{\@xproof}{\@proof}}
709+\def\endproof{\if@qeded\else\qed\fi\endtrivlist}
710+\def\qed{\unskip\kern 10pt{\unitlength1pt\linethickness{.4pt}\framebox(6,6){}}
711+\global\@qededtrue}
712+\def\@proof{\trivlist \item[\hskip 10pt\hskip
713+ \labelsep{\sc Proof.}]\ignorespaces}
714+\def\@xproof[#1]{\trivlist \item[\hskip 10pt\hskip
715+ \labelsep{\sc Proof #1.}]\ignorespaces}
716+
717+\def\newdef#1#2{\expandafter\@ifdefinable\csname #1\endcsname
718+{\@definecounter{#1}\expandafter\xdef\csname
719+the#1\endcsname{\@thmcounter{#1}}\global
720+ \@namedef{#1}{\@defthm{#1}{#2}}\global
721+ \@namedef{end#1}{\@endtheorem}}}
722+\def\@defthm#1#2{\refstepcounter
723+ {#1}\@ifnextchar[{\@ydefthm{#1}{#2}}{\@xdefthm{#1}{#2}}}
724+\def\@xdefthm#1#2{\@begindef{#2}{\csname the#1\endcsname}\ignorespaces}
725+\def\@ydefthm#1#2[#3]{\trivlist \item[\hskip 10pt\hskip
726+ \labelsep{\it #2\savebox\@tempboxa{#3}\ifdim
727+ \wd\@tempboxa>\z@ \ \box\@tempboxa\fi.}]\ignorespaces}
728+\def\@begindef#1#2{\trivlist \item[\hskip 10pt\hskip
729+ \labelsep{\it #1\ \rm #2.}]}
730+
731+\def\theequation{\arabic{equation}}
732+
733+\def\titlepage{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn
734+ \else \newpage \fi \thispagestyle{empty}\c@page\z@}
735+\def\endtitlepage{\if@restonecol\twocolumn \else \newpage \fi}
736+
737+\arraycolsep 2.5pt \tabcolsep 6pt \arrayrulewidth .4pt \doublerulesep 2pt
738+\tabbingsep \labelsep
739+
740+\skip\@mpfootins = \skip\footins
741+\fboxsep = 3pt \fboxrule = .4pt
742+
743+\newcounter{part}
744+\newcounter{section}
745+\newcounter{subsection}[section]
746+\newcounter{subsubsection}[subsection]
747+\newcounter{paragraph}[subsubsection]
748+
749+\def\thepart{\Roman{part}}
750+\def\thesection {\arabic{section}}
751+\def\thesubsection {\thesection.\arabic{subsection}}
752+\def\thesubsubsection {\thesubsection.\arabic{subsubsection}}
753+\def\theparagraph {\thesubsubsection.\arabic{paragraph}}
754+
755+\def\@pnumwidth{1.55em}
756+\def\@tocrmarg {2.55em}
757+\def\@dotsep{4.5}
758+\setcounter{tocdepth}{3}
759+
760+\def\tableofcontents{\section*{Contents\@mkboth{CONTENTS}{CONTENTS}}
761+ \@starttoc{toc}}
762+\def\l@part#1#2{\addpenalty{\@secpenalty}
763+ \addvspace{2.25em plus 1pt} \begingroup
764+ \@tempdima 3em \parindent \z@ \rightskip \@pnumwidth \parfillskip
765+-\@pnumwidth
766+ {\large \bf \leavevmode #1\hfil \hbox to\@pnumwidth{\hss #2}}\par
767+ \nobreak \endgroup}
768+\def\l@section#1#2{\addpenalty{\@secpenalty} \addvspace{1.0em plus 1pt}
769+\@tempdima 1.5em \begingroup
770+ \parindent \z@ \rightskip \@pnumwidth
771+ \parfillskip -\@pnumwidth
772+ \bf \leavevmode #1\hfil \hbox to\@pnumwidth{\hss #2}\par
773+ \endgroup}
774+\def\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
775+\def\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
776+\def\listoffigures{\section*{List of Figures\@mkboth
777+ {LIST OF FIGURES}{LIST OF FIGURES}}\@starttoc{lof}}
778+\def\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
779+\def\listoftables{\section*{List of Tables\@mkboth
780+ {LIST OF TABLES}{LIST OF TABLES}}\@starttoc{lot}}
781+\let\l@table\l@figure
782+
783+
784+\def\thebibliography#1{\par\footnotesize
785+\@ucheadfalse
786+\@startsection{subsection}{2}{\z@}{16pt plus 2pt minus
787+ 1pt}{2pt}{\sf}*{REFERENCES}%
788+\list{\arabic{enumi}.}{%
789+ \settowidth{\labelwidth}{99.}%
790+ \leftmargin\labelwidth
791+ \advance\leftmargin\labelsep \topsep \z@ \parsep 0pt plus .1pt
792+ \itemsep \parsep
793+ \usecounter{enumi}}%
794+ \def\newblock{\hskip .11em plus .33em minus .07em}
795+ \sloppy
796+ \widowpenalty=4500
797+ \clubpenalty=4500
798+ \sfcode`\.=1000\relax}
799+\let\endthebibliography=\endlist
800+
801+
802+\newif\if@restonecol
803+\def\theindex{\@restonecoltrue\if@twocolumn\@restonecolfalse\fi
804+\columnseprule \z@
805+\columnsep 35pt\twocolumn[\section*{Index}]
806+ \@mkboth{INDEX}{INDEX}\thispagestyle{plain}\parindent\z@
807+ \parskip\z@ plus .3pt\relax\let\item\@idxitem}
808+\def\@idxitem{\par\hangindent 40pt}
809+\def\subitem{\par\hangindent 40pt \hspace*{20pt}}
810+\def\subsubitem{\par\hangindent 40pt \hspace*{30pt}}
811+\def\endtheindex{\if@restonecol\onecolumn\else\clearpage\fi}
812+\def\indexspace{\par \vskip 10pt plus 5pt minus 3pt\relax}
813+
814+\def\footnoterule{\kern-3\p@
815+ \hrule \@height 0.2\p@ \@width 47\p@
816+ \kern 2.6\p@
817+}
818+
819+\long\def\@makefntext#1{\parindent 1em\noindent
820+ $^{\@thefnmark}$#1}
821+
822+
823+\setcounter{topnumber}{3}
824+\def\topfraction{.99}
825+\setcounter{bottomnumber}{1}
826+\def\bottomfraction{.5}
827+\setcounter{totalnumber}{3}
828+\def\textfraction{.01}
829+\def\floatpagefraction{.85}
830+\setcounter{dbltopnumber}{2}
831+\def\dbltopfraction{.7}
832+\def\dblfloatpagefraction{.5}
833+
834+\long\def\@makecaption#1#2{\vskip 1pc \setbox\@tempboxa\hbox{#1.\hskip
835+1em\relax #2}
836+ \ifdim \wd\@tempboxa >\hsize #1. #2\par \else \hbox
837+to\hsize{\hfil\box\@tempboxa\hfil}
838+ \fi}
839+
840+\def\nocaption{\refstepcounter\@captype \par
841+ \vskip 1pc \hbox to\hsize{\hfil \footnotesize Figure \thefigure
842+ \hfil}}
843+
844+
845+\newcounter{figure}
846+\def\thefigure{\@arabic\c@figure}
847+\def\fps@figure{tbp}
848+\def\ftype@figure{1}
849+\def\ext@figure{lof}
850+\def\fnum@figure{Fig.\ \thefigure}
851+\def\figure{\let\normalsize\footnotesize \normalsize \@float{figure}}
852+\let\endfigure\end@float
853+\@namedef{figure*}{\@dblfloat{figure}}
854+\@namedef{endfigure*}{\end@dblfloat}
855+
856+\newcounter{table}
857+\def\thetable{\@Roman\c@table}
858+\def\fps@table{tbp}
859+\def\ftype@table{2}
860+\def\ext@table{lot}
861+\def\fnum@table{Table \thetable}
862+\def\table{\let\normalsize\footnotesize \normalsize\@float{table}}
863+\let\endtable\end@float
864+\@namedef{table*}{\@dblfloat{table}}
865+\@namedef{endtable*}{\end@dblfloat}
866+\def\acmtable#1{\@narrowfig #1\relax
867+ \let\caption\@atcap \let\nocaption\@atnocap
868+ \def\@tmpnf{}\@ifnextchar[{\@xntab}{\@ntab}}
869+\def\endacmtable{\hbox to \textwidth{\hfil
870+\vbox{\hsize \@narrowfig
871+\box\@nfcapbox
872+{\baselineskip 4pt \hbox{\vrule height .4pt width \hsize}}
873+\vskip -1pt
874+\box\@nfigbox\vskip -1pt
875+{\baselineskip 4pt \hbox{\vrule height .4pt width \hsize}}}\hfil}
876+\end@float}
877+\def\@xntab[#1]{\def\@tmpnf{[#1]}\@ntab}
878+\def\@ntab{\expandafter\table\@tmpnf
879+ \setbox\@nfigbox\vbox\bgroup
880+ \hsize \@narrowfig \@parboxrestore}
881+\def\@atmakecap #1#2{\setbox\@tempboxa\hbox{#1.\hskip 1em\relax #2}
882+ \ifdim \wd\@tempboxa >\hsize \sloppy #1.\hskip 1em\relax #2 \par \else \hbox
883+to\hsize{\hfil\box\@tempboxa\hfil}
884+ \fi}
885+\def\@atcap{\par\egroup\refstepcounter\@captype
886+ \@dblarg{\@atcapx\@captype}}
887+\long\def\@atcapx#1[#2]#3{\setbox\@nfcapbox\vbox {\hsize \wd\@nfigbox
888+ \@parboxrestore
889+ \@atmakecap{\csname fnum@#1\endcsname}{\ignorespaces #3}\par}}
890+\def\@atnocap{\egroup \refstepcounter\@captype
891+ \setbox\@nfcapbox\vbox {\hsize \wd\@nfigbox
892+ \hbox to\hsize{\hfil \footnotesize Table \thetable\hfil}}}
893+
894+%
895+%% Narrow figures
896+%
897+\def\narrowfig#1{\@narrowfig #1\relax
898+ \let\caption\@nfcap \let\nocaption\@nfnocap
899+ \def\@tmpnf{}\@ifnextchar[{\@xnfig}{\@nfig}}
900+\def\endnarrowfig{\hbox to \textwidth{\if@nfeven
901+ \box\@nfcapbox\hfil\box\@nfigbox
902+ \else \box\@nfigbox\hfil\box\@nfcapbox\fi}\end@float}
903+\def\@xnfig[#1]{\def\@tmpnf{[#1]}\@nfig}
904+\def\@nfig{\expandafter\figure\@tmpnf
905+ \setbox\@nfigbox\vbox\bgroup
906+ \hsize \@narrowfig \@parboxrestore}
907+\def\@nfmakecap #1#2{\setbox\@tempboxa\hbox{#1.\hskip 1em\relax #2}
908+ \ifdim \wd\@tempboxa >\hsize \sloppy #1.\hskip 1em\relax #2 \par \else \hbox
909+to\hsize{\if@nfeven\else\hfil\fi\box\@tempboxa\if@nfeven\hfil\fi}
910+ \fi}
911+\def\@nfcap{\par\egroup\refstepcounter\@captype
912+ \@dblarg{\@nfcapx\@captype}}
913+\long\def\@nfcapx#1[#2]#3{\@seteven
914+ \setbox\@nfcapbox\vbox to \ht\@nfigbox
915+ {\hsize \textwidth \advance\hsize -2pc \advance\hsize -\wd\@nfigbox
916+ \@parboxrestore
917+ \vfil
918+ \@nfmakecap{\csname fnum@#1\endcsname}{\ignorespaces #3}\par
919+ \vfil}}
920+\def\@nfnocap{\egroup \refstepcounter\@captype \@seteven
921+ \setbox\@nfcapbox\vbox to \ht\@nfigbox
922+ {\hsize \textwidth \advance\hsize -2pc \advance\hsize -\wd\@nfigbox
923+ \@parboxrestore
924+ \vfil
925+ \hbox to\hsize{\if@nfeven\else\hfil\fi
926+ \footnotesize Figure \thefigure
927+ \if@nfeven\hfil\fi}
928+ \vfil}}
929+\def\@seteven{\@nfeventrue
930+ \@ifundefined{r@@nf\thefigure}{}{%
931+ \edef\@tmpnf{\csname r@@nf\thefigure\endcsname}%
932+ \edef\@tmpnf{\expandafter\@getpagenum\@tmpnf}%
933+ \ifodd\@tmpnf\relax\@nfevenfalse\fi}%
934+\label{@nf\thefigure}\edef\@tmpnfx{\if@nfeven e\else o\fi}
935+\edef\@tmpnf{\write\@unused {\noexpand\ifodd \noexpand\c@page
936+ \noexpand\if \@tmpnfx e\noexpand\@nfmsg{\thefigure} \noexpand\fi
937+ \noexpand\else
938+ \noexpand\if \@tmpnfx o\noexpand\@nfmsg{\thefigure}\noexpand\fi
939+ \noexpand\fi }}\@tmpnf}
940+\def\@nfmsg#1{Bad narrowfig: Figure #1 on page \thepage}
941+
942+\newdimen\@narrowfig
943+\newbox\@nfigbox
944+\newbox\@nfcapbox
945+\newif\if@nfeven
946+
947+\def\and{\\ and\\}
948+\def\maketitle{\newpage \thispagestyle{titlepage}\par
949+ \begingroup \lineskip = \z@\null \vskip -30pt\relax
950+ \parindent\z@ \LARGE {\raggedright \hyphenpenalty\@M
951+ %\sf \@title \par
952+ \@title \par
953+ \global\firstfoot %aiellom
954+ \global\runningfoot %aiellom
955+}
956+\label{@firstpg}
957+{ \vskip 13.5pt\relax \normalsize \sf %vskip 13.5pt between title and author
958+ \begingroup \addtolength{\baselineskip}{2pt}
959+ \@author\par \vskip -2pt
960+ \endgroup }
961+ {\ifx \@categories\@empty
962+ \else
963+ \baselineskip 17pt\relax
964+ \if@acmjacm\else\hbox{\vrule height .2pt width 30pc}\fi%to eliminate the lines for jacm
965+ }
966+ \vskip 8.5pt \footnotesize \box\@abstract \vskip 4pt\relax %vskip8.5 space above abstract
967+ {\def\and{\unskip\/{\rm ; }}
968+ Categories and Subject Descriptors: \@categories \fi}\par\vskip 4pt\relax
969+ \box\@terms \vskip 4pt\relax
970+ \box\@keywords \par
971+ {\baselineskip 14pt\relax
972+ \@abstractbottom
973+ }
974+ \vskip 23pt\relax
975+ \endgroup
976+\let\maketitle\relax
977+ % \gdef\@author{}\gdef\@title{}
978+ \gdef\@categories{}}
979+
980+
981+\newbox\@abstract
982+\newbox\@terms
983+\newbox\@keywords
984+\def\abstract{\global\setbox\@abstract=\vbox\bgroup \everypar{}
985+ \footnotesize \hsize 30pc \parindent 10pt \noindent
986+ \rule{0pt}{10pt}\ignorespaces}
987+\def\endabstract{\egroup}
988+
989+\def\terms#1{\setbox\@terms=\vbox{\everypar{}
990+ \footnotesize \hsize 30pc \parindent 0pt \noindent
991+ General Terms: \ignorespaces #1}}
992+\def\keywords#1{\setbox\@keywords=\vbox{\everypar{}
993+ \footnotesize \hsize 30pc \parindent 0pt \noindent
994+ Additional Key Words and Phrases: \ignorespaces #1}
995+}
996+
997+\def\category#1#2#3{\@ifnextchar
998+ [{\@category{#1}{#2}{#3}}{\@xcategory{#1}{#2}{#3}}}
999+\def\@category#1#2#3[#4]{\edef\@tempa{\ifx \@categories\@empty
1000+ \else ; \fi}{\def\protect{\noexpand\protect
1001+ \noexpand}\def\and{\noexpand\and}\xdef\@categories{\@categories\@tempa #1
1002+[{\bf #2}]:
1003+ #3\kern\z@---\hskip\z@{\it #4}}}}
1004+\def\@xcategory#1#2#3{\edef\@tempa{\ifx \@categories\@empty \else ;
1005+\fi}{\def\protect{\noexpand\protect\noexpand}\def\and{\noexpand
1006+ \and}\xdef\@categories{\@categories\@tempa #1 [{\bf #2}]: #3}}}
1007+\def\@categories{}
1008+\def\bottomstuff{\global\@topnum\z@ \global\@botroom \textheight \begin{figure}
1009+\parindent\z@
1010+\hbox{}
1011+\vskip -\textfloatsep
1012+\vskip 10pt
1013+\hrule height .2pt width 30pc
1014+\vskip 2pt\rule{0pt}{10pt}\ignorespaces}
1015+\def\endbottomstuff{\permission\end{figure}\gdef\permission{}}
1016+
1017+\newenvironment{ackslike}[1]
1018+ {\par \footnotesize
1019+ \@ucheadfalse
1020+ \@startsection{subsection}{2}{\z@}{-16pt plus -2pt minus -1pt}{2pt}{\sf}*
1021+ {\uppercase{#1}}\par\normalsize
1022+ \pdfbookmark{Acknowledgments}{Ack}
1023+ }
1024+ {\par}
1025+\newenvironment{acks}{\begin{ackslike}{ACKNOWLEDGMENTS}}{\end{ackslike}}
1026+
1027+\def\received{\par\footnotesize\addvspace{18pt plus 0pt minus
1028+4pt}\parindent\z@}
1029+%the line below replaced by the line that follows (K.R. Apt, July 11, 2000
1030+%\def\endreceived{\label{@lastpg}\hskip-2pt\par}
1031+\def\endreceived{\label{@lastpg}\hskip-2pt\par\normalsize}
1032+
1033+\mark{{}{}}
1034+
1035+\def\ps@myheadings{\let\@mkboth\@gobbletwo
1036+\def\@oddhead{\hbox{}\hfill \small\sf \rightmark\hskip
1037+19pt{\Large$\cdot$}\hskip 17pt\mypage}
1038+\def\@oddfoot{\hbox{}\hfill\tiny\@runningfoot}
1039+\def\@evenhead{\small\sf\mypage \hskip 17pt{\Large$\cdot$}\hskip 19pt\leftmark\hfill \hbox{}}
1040+\def\@evenfoot{\tiny\@runningfoot\hfill\hbox{}}
1041+\def\sectionmark##1{}\def\subsectionmark##1{}}
1042+\def\@runningfoot{}
1043+\def\runningfoot{\def\@runningfoot{\@journalName, Vol.\ \@acmVolume, No.\ \@acmNumber, \@acmMonth\ 20\@acmYear.}}
1044+\def\@firstfoot{}
1045+\def\firstfoot{\def\@firstfoot{\@journalName, Vol.\ \@acmVolume, No.\ \@acmNumber, \@acmMonth\ 20\@acmYear, Pages \pages.}}
1046+\def\ps@titlepage{\let\@mkboth\@gobbletwo
1047+\def\@oddhead{}\def\@oddfoot{\hbox{}\hfill
1048+\tiny\@firstfoot}\def\@evenhead{}\def\@evenfoot{\tiny\@firstfoot\hfill\hbox{}}}
1049+
1050+\def\today{\ifcase\month\or
1051+ January\or February\or March\or April\or May\or June\or
1052+ July\or August\or September\or October\or November\or December\fi
1053+ \space\number\day, \number\year}
1054+\def\@marrayclassiv{\@addtopreamble{$\displaystyle \@nextchar$}}
1055+\def\@marrayclassz{\ifcase \@lastchclass \@acolampacol \or \@ampacol \or
1056+ \or \or \@addamp \or
1057+ \@acolampacol \or \@firstampfalse \@acol \fi
1058+\edef\@preamble{\@preamble
1059+ \ifcase \@chnum
1060+ \hfil$\relax\displaystyle\@sharp$\hfil \or $\relax\displaystyle\@sharp$\hfil
1061+ \or \hfil$\relax\displaystyle\@sharp$\fi}}
1062+\def\marray{\arraycolsep 2.5pt\let\@acol\@arrayacol \let\@classz\@marrayclassz
1063+ \let\@classiv\@marrayclassiv \let\\\@arraycr\def\@halignto{}\@tabarray}
1064+\def\endmarray{\crcr\egroup\egroup}
1065+
1066+
1067+\ps@myheadings \pagenumbering{arabic} \onecolumn
1068+
1069+%-----------------------BIBLIOGRAPHY STUFF-------------------------
1070+% this is adapted (November 1993) by Andrew Appel and Rebecca Davies from
1071+%
1072+%%% filename = "chicago.sty",
1073+%%% version = "4", % MODIFIED!
1074+%%% date = "31 August 1992",
1075+%%% time = "09:42:44 199",
1076+%%% author = "Glenn Paulley",
1077+%%% address = "Data Structuring Group
1078+%%% Department of Computer Science
1079+%%% University of Waterloo
1080+%%% Waterloo, Ontario, Canada
1081+%%% N2L 3G1",
1082+%%% telephone = "(519) 885-1211",
1083+%%% FAX = "(519) 885-1208",
1084+%%% email = "gnpaulle@bluebox.uwaterloo.ca",
1085+
1086+%%% ====================================================================
1087+%
1088+% this file: Modification of chicago.sty for new ACM bibliography
1089+% style, which is similar (but not identical) to the ``Chicago'' style.
1090+%
1091+% chicago.sty: Style file for use with bibtex style chicago.bst, for
1092+% bibliographies formatted according to the 13th Edition of the Chicago
1093+% Manual of Style.
1094+%
1095+% 'newapa.bst' was made from 'plain.bst', 'named.bst', and 'apalike.bst',
1096+% with lots of tweaking to make it look like APA style, along with tips
1097+% from Young Ryu and Brian Reiser's modifications of 'apalike.bst'.
1098+% newapa.sty formed the basis of this style, chicago.sty. Author-date
1099+% references in newapa.bst formed the basis for chicago.bst. Chicagoa.bst
1100+% supports annotations.
1101+%
1102+% Version 4 (August, 1992):
1103+% - fixed chicago.bst and chicagoa.bst to handle long author lists in
1104+% sorting
1105+% - fixed chicago.bst and chicagoa.bst so that missing page numbers in
1106+% ``article'' entries are handled correctly
1107+% - modified chicago.sty to format entries with 2nd and subsequent lines
1108+% indented.
1109+%
1110+% Citation format: (author-last-name year)
1111+% (author-last-name and author-last-name year)
1112+% (author-last-name et al. year)
1113+% (author-last-name)
1114+% author-last-name
1115+% author-last-name (year)
1116+% (author-last-name and author-last-name)
1117+% (author-last-name et al.)
1118+% (year) or (year,year)
1119+% year or year,year
1120+%
1121+% Reference list ordering: alphabetical by author or whatever passes
1122+% for author in the absence of one.
1123+%
1124+% This BibTeX style has support for abbreviated author lists and for
1125+% year-only citations. This is done by having the citations
1126+% actually look like
1127+%
1128+% \citeauthoryear{full-author-info}{abbrev-author-info}{year}
1129+%
1130+% The LaTeX style has to have the following (or similar)
1131+%
1132+% \let\@internalcite\cite
1133+% \def\fullcite{\def\citeauthoryear##1##2##3{##1, ##3}\@internalcite}
1134+% \def\fullciteA{\def\citeauthoryear##1##2##3{##1}\@internalcite}
1135+% \def\shortcite{\def\citeauthoryear##1##2##3{##2, ##3}\@internalcite}
1136+% \def\shortciteA{\def\citeauthoryear##1##2##3{##2}\@internalcite}
1137+% \def\citeyear{\def\citeauthoryear##1##2##3{##3}\@internalcite}
1138+%
1139+%
1140+% -------------------------------------------------------------------------
1141+%
1142+% Citation macros.
1143+%
1144+\let\@internalcite\cite
1145+
1146+\def\cite{\def\@citeseppen{-1000}%
1147+ \def\@cite##1##2{[##1\if@tempswa , ##2\fi]}%
1148+ \def\citeauthoryear##1##2##3{##2 ##3}\@internalcite}
1149+\def\citeXNP#1#2{%
1150+ \def\@cite@label{#2}%
1151+ \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
1152+ \def\citeauthoryear##1##2##3{\@cite@label}\@internalcite{#1}}
1153+% \def\@citeseppen{-1000}%
1154+% \def\@cite@label{#1}
1155+% \def\@cite##1##2{\if@tempswa ##2\fi}%
1156+% \def\citeauthoryear##1##2##3{##2 ##3}\@internalcite}
1157+\def\citeNP{\def\@citeseppen{-1000}%
1158+ \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
1159+ \def\citeauthoryear##1##2##3{##2 ##3}\@internalcite}
1160+\def\citeN{\def\@citeseppen{-1000}%
1161+ \def\@cite##1##2{##1\if@tempswa , ##2]\else{]}\fi}%
1162+ \def\citeauthoryear##1##2##3{##2 [##3}\@citedata}
1163+\def\shortcite#1{\citeyear{#1}}
1164+\def\citeS#1{[\citeANP{#1} \citeyearNP{#1}]}
1165+\def\citeNS#1{\citeANP{#1} \citeyear{#1}}
1166+\def\citeNPS#1{\citeANP{#1} \citeyearNP{#1}}
1167+%testing year,year
1168+\def\citeNN{\def\@citeseppen{-1000}%
1169+ \def\@cite##1##2{[##1\if@tempswa , ##2\fi]}%
1170+ \def\citeauthoryear##1##2##3{##3}\@citedata}
1171+
1172+\def\citeA{\def\@citeseppen{-1000}%
1173+ \def\@cite##1##2{[##1\if@tempswa , ##2\fi]}%
1174+ \def\citeauthoryear##1##2##3{##2}\@internalcite}
1175+\def\citeANP{\def\@citeseppen{-1000}%
1176+ \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
1177+ \def\citeauthoryear##1##2##3{##2}\@internalcite}
1178+
1179+\def\citeyear{\def\@citeseppen{-1000}%
1180+ \def\@cite##1##2{[##1\if@tempswa , ##2\fi]}%
1181+ \def\citeauthoryear##1##2##3{##3}\@citedata}
1182+\def\citeyearNP{\def\@citeseppen{-1000}%
1183+ \def\@cite##1##2{##1\if@tempswa , ##2\fi}%
1184+ \def\citeauthoryear##1##2##3{##3}\@citedata}
1185+
1186+%
1187+% \@citedata and \@citedatax:
1188+%
1189+% Place commas in-between citations in the same \citeyear, \citeyearNP,
1190+% or \citeN command.
1191+% Use something like \citeN{ref1,ref2,ref3} and \citeN{ref4} for a list.
1192+%
1193+\def\@citedata{%
1194+ \@ifnextchar [{\@tempswatrue\@citedatax}%
1195+ {\@tempswafalse\@citedatax[]}%
1196+}
1197+
1198+\def\@citedatax[#1]#2{%
1199+\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi%
1200+ \def\@citea{}\@cite{\@for\@citeb:=#2\do%
1201+ {\@citea\def\@citea{; }\@ifundefined% by Young
1202+ {b@\@citeb}{{\bf ?}%
1203+ \@warning{Citation `\@citeb' on page \thepage \space undefined}}%
1204+{\csname b@\@citeb\endcsname}}}{#1}}%
1205+
1206+% don't box citations, separate with ; and a space
1207+% also, make the penalty between citations negative: a good place to break.
1208+%
1209+\def\@citex[#1]#2{%
1210+\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi%
1211+ \def\@citea{}\@cite{\@for\@citeb:=#2\do%
1212+ {\@citea\def\@citea{; }\@ifundefined% by Young
1213+ {b@\@citeb}{{\bf ?}%
1214+ \@warning{Citation `\@citeb' on page \thepage \space undefined}}%
1215+{\csname b@\@citeb\endcsname}}}{#1}}%
1216+
1217+% (from apalike.sty)
1218+% No labels in the bibliography.
1219+%
1220+\def\@biblabel#1{}
1221+
1222+% (from apalike.sty)
1223+% Set length of hanging indentation for bibliography entries.
1224+%
1225+\newlength{\bibhang}
1226+\setlength{\bibhang}{2em}
1227+
1228+% Indent second and subsequent lines of bibliographic entries. Stolen
1229+% from openbib.sty: \newblock is set to {}.
1230+
1231+\newdimen\bibindent
1232+\bibindent=1em
1233+\@ifundefined{refname}%
1234+ {\@ifundefined{chapter}%
1235+ {\newcommand{\refname}{\footnotesize REFERENCES}}%
1236+ {\newcommand{\refname}{\footnotesize BIBLIOGRAPHY}}%
1237+ }%
1238+ {}%
1239+\@ifundefined{chapter}%
1240+ {\def\thebibliography#1{\footnotesize \section*{\refname\@mkboth
1241+ {\uppercase{\refname}}{\uppercase{\refname}}}\list
1242+ {[\arabic{enumi}]}{
1243+ \settowidth\labelwidth{[#1]}
1244+ \leftmargin\labelwidth
1245+ \advance\leftmargin\labelsep
1246+ \advance\leftmargin\bibindent
1247+ \itemindent -\bibindent
1248+ \listparindent \itemindent
1249+ \parsep \z@
1250+ \usecounter{enumi}}
1251+ \def\newblock{}
1252+ \sloppy
1253+ \sfcode`\.=1000\relax}}
1254+ {\def\thebibliography#1{\footnotesize \chapter*{\refname\@mkboth
1255+ {\uppercase{\refname}}{\uppercase{\refname}}}\list
1256+ {[\arabic{enumi}]}{\settowidth\labelwidth{[#1]}
1257+ \leftmargin\labelwidth
1258+ \advance\leftmargin\labelsep
1259+ \advance\leftmargin\bibindent
1260+ \itemindent -\bibindent
1261+ \listparindent \itemindent
1262+ \parsep \z@
1263+ \usecounter{enumi}}
1264+ \def\newblock{}
1265+ \sloppy
1266+ \sfcode`\.=1000\relax}}
1267+
1268+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1269+
1270+% fixes to acm trans macro package
1271+% 31-JAN-1996
1272+% John Tang Boyland
1273+
1274+% newdef need to take the optional parameters of newtheorem
1275+\def\newdef#1{\@ifnextchar[{\@xnewdef{#1}}{\@ynewdef{#1}}}
1276+\def\@xnewdef#1[#2]#3{\newtheorem{italic@#1}[#2]{{\em #3}}\@newdef{#1}}
1277+\def\@ynewdef#1#2{\@ifnextchar[{\@xynewdef{#1}{#2}}{\@yynewdef{#1}{#2}}}
1278+\def\@xynewdef#1#2[#3]{\newtheorem{italic@#1}{{\em #2}}[#3]\@newdef{#1}}
1279+\def\@yynewdef#1#2{\newtheorem{italic@#1}{{\em #2}}\@newdef{#1}}
1280+% and now fix up definition, to change body to use roman font:
1281+\def\@newdef#1{\newenvironment{#1}{\@ifnextchar[{\@xstartdef{#1}}{\@ystartdef{#1}}}{\end{italic@#1}}}
1282+%changed by K.R. Apt on Sep. 27, 2000. It was: \def\@xstartdef#1[#2]{\begin{italic@#1}[#2]\rm}
1283+\def\@xstartdef#1[#2]{\begin{italic@#1}[{\em #2}]\rm}
1284+\def\@ystartdef#1{\begin{italic@#1}\rm}
1285+
1286+% footers produced too small (vpt), when ACM typsets them at 7.5pt (!).
1287+% A better compromise is viipt.
1288+\def\@oddfoot{\hbox{}\hfill\scriptsize\@runningfoot}
1289+\def\@evenfoot{\scriptsize\@runningfoot\hfill\hbox{}}
1290+
1291+% first footer was set to (vpt), when ACM typesets them at 6.5pt (!).
1292+% A better compromise is vipt.
1293+\def\firstfootsize{\@setsize\firstfootsize{7pt}\vipt\@vipt}
1294+\def\ps@titlepage{\let\@mkboth\@gobbletwo
1295+\def\@oddhead{}\def\@oddfoot{\hbox{}\hfill\firstfootsize\@firstfoot}%
1296+\def\@evenhead{}\def\@evenfoot{\firstfootsize\@firstfoot\hfill\hbox{}}}
1297+
1298+% new permission statement
1299+\long\def\permission{\par
1300+% linebreaks added to conform to the current style
1301+Permission to make digital/hard copy of all or part of this material without
1302+fee
1303+for personal or classroom use
1304+provided that the copies are not made or distributed for profit
1305+or commercial advantage, the ACM copyright/server notice, the title of the
1306+publication, and its date appear, and notice is given that copying is by
1307+permission of the ACM, Inc. To copy
1308+otherwise, to republish, to post on servers, or to redistribute to lists
1309+requires prior specific
1310+permission and/or a fee.\par
1311+\copyright\ 20\@acmYear\
1312+ACM \@permissionCodeOne/20\@acmYear/\@permissionCodeTwo-\@pageCode\$5.00 % aiellom
1313+}
1314+
1315+% make sure \permission doesn't get trashed
1316+\def\endbottomstuff{\permission\end{figure}}
1317+
1318+% alternate way of using citeyear
1319+% \def\shortcite#1{\citeyear{#1}
1320+% enumerations and longenums are wrong
1321+% 1. the second line in a paragraph of an enumerations in theorems
1322+% (or other trivlists) doesn't line up under the first
1323+% 1. the second line of a longenum doesn't properly wrap around
1324+% back to the left margin.
1325+
1326+% the original definition of \@listI doesn't set labelwidth
1327+\def\@listI{\leftmargin\leftmargini
1328+ \labelwidth\leftmargini\advance\labelwidth-\labelsep
1329+ \parsep 0pt plus 1pt
1330+ \topsep 6pt plus 2pt minus 2pt
1331+ \itemsep 2pt plus 1pt minus .5pt}
1332+\let\@listi\@listI
1333+\@listi
1334+
1335+% add set of \labelwidth and \itemindent
1336+\def\longenum{\ifnum \@enumdepth >3 \@toodeep\else
1337+ \advance\@enumdepth \@ne
1338+ \edef\@enumctr{enum\romannumeral\the\@enumdepth}\list
1339+ {\csname label\@enumctr\endcsname}{\usecounter
1340+ {\@enumctr}\labelwidth\z@\leftmargin\z@
1341+ \itemindent\parindent \advance\itemindent\labelsep}\fi}
1342+
1343+% split electronic appendix into two parts:
1344+
1345+
1346+%aiellom{
1347+\def\appendixhead#1{\appendix
1348+\section*{ELECTRONIC APPENDIX}
1349+The electronic appendix for this article can be accessed in
1350+ the ACM Digital Library by visiting the following URL:$\;$
1351+ \url{http://www.acm.org/pubs/citations/journals/}{\tt \@journalNameShort /20\@acmYear-\@acmVolume-\@acmNumber/p\pageref{@firstpg}-#1}.
1352+% \quad \href{http://www.acm.org/tocl}{{\small http://www.acm.org/tocl} }
1353+}
1354+%aiellom}
1355+
1356+\long\def\elecappendix{
1357+\clearpage
1358+\makeatletter
1359+\pagenumbering{withappendix}
1360+\makeatother
1361+\appendix
1362+\par\noindent{\sc This document is the online-only appendix to:}\hfill \vskip 1em
1363+{\vbox{\Large\sf \parindent0pt\@title{}}}\vskip .5em
1364+\vbox{\sf \parindent0pt\@author{}}\vskip .5em\noindent
1365+\vskip 10pt\noindent
1366+{\firstfootsize
1367+\@journalName, Vol.\ \@acmVolume, No.\ \@acmNumber, \@acmMonth\ 20\@acmYear, Pages \pages.}
1368+\vskip 11pt\noindent
1369+\hrule height .2pt
1370+\par
1371+\bottomstuff
1372+\endbottomstuff
1373+}
1374+
1375+% provide for a single acknowledgment
1376+\def\ack{ \par \footnotesize
1377+\@ucheadfalse
1378+\@startsection{subsection}{2}{\z@}{-16pt plus -2pt minus
1379+ -1pt}{2pt}{\sf}*{ACKNOWLEDGMENT}\par\normalsize
1380+\pdfbookmark{Acknowledgment}{Ack}
1381+}
1382+\def\endack{\par}
1383+
1384+% provide both spellings of Acknowledgment(s)
1385+\let\acknowledgments\acks
1386+\let\endacknowledgments\endacks
1387+\let\acknowledgment\ack
1388+\let\endacknowledgment\endack
1389+
1390+\newcommand{\longpage}{\enlargethispage{\baselineskip}}
1391+\newcommand{\shortpage}{\enlargethispage{-\baselineskip}}
1392+
1393+
1394+% Don't indent bibliography and
1395+% override \refname (which sets fontsize):
1396+\def\thebibliography#1{
1397+ \footnotesize\section*{\footnotesize\sf{REFERENCES}\@mkboth
1398+ {\uppercase{\refname}}{\uppercase{\refname}}}%
1399+ \pdfbookmark{References}{Ref}
1400+ \list
1401+ {\@biblabel{\arabic{enumiv}}}{%
1402+ %\settowidth\labelwidth{[#1]}
1403+ \labelwidth 0pt
1404+ \leftmargin \bibindent
1405+ \labelsep 0pt
1406+ \if@hyperref
1407+ \itemindent -\bibindent
1408+ \fi
1409+ \listparindent -\bibindent
1410+ \labelsep -\bibindent
1411+ \usecounter{enumiv}%
1412+ \let\p@enumiv\@empty
1413+ \def\theenumiv{\arabic{enumiv}}}%
1414+ \def\newblock{\hskip .11em plus.33em minus.07em}%
1415+ \sloppy
1416+ \clubpenalty=4500
1417+ \widowpenalty=4500
1418+ \frenchspacing}
1419+\def\endthebibliography{%
1420+ \def\@noitemerr{\@warning{Empty `thebibliography' environment}}%
1421+ \endlist}
1422+\def\@lbibitem[#1]#2{\item[]\if@filesw
1423+ {\def\protect##1{\string ##1\space}\immediate
1424+ \write\@auxout{\string\bibcite{#2}{#1}}}\fi\hskip-1em\ignorespaces}
1425+% Fix cite so it doesn't repeat author lists in citations:
1426+
1427+\def\cite{\def\@citeseppen{-1000}%
1428+ \def\@cite##1##2{[##1\if@tempswa , ##2\fi]}%
1429+ \let\@lastauthor=\@noauthor
1430+ \let\citeauthoryear=\citeauthoryear@no@repeats\@internalcite}
1431+ %\def\citeauthoryear##1##2##3{##2 ##3}\@internalcite
1432+
1433+\def\@noauthor={\relax}
1434+\let\@lastauthor=\@noauthor
1435+\let\@currauthor=\@noauthor
1436+
1437+\def\citeauthoryear@no@repeats#1#2#3{%
1438+ \def\@currauthor{\csname @author #1\endcsname}%
1439+ \ifx\@lastauthor\@currauthor{#3}\else{#2 #3}\fi%
1440+ \let\@lastauthor=\@currauthor}
1441+
1442+\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
1443+\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
1444+\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
1445+\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
1446+\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
1447+\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
1448+\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
1449+\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
1450+\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}
1451+
1452+
1453+\if@hyperref
1454+ \let\pdfbookmark=\relax
1455+ \RequirePackage[pdfmark]{hyperref}
1456+\fi
1457+
1458+% \renewcommand{\thefootnote}{\arabic{footnote}\hspace{-3pt}}
1459+
1460+
impl-paper/comments.stynew file+29
@@ -0,0 +1,29 @@
1+% $id$
2+% KH: created comments style file to allow alternative versions of a document.
3+
4+% \newcommand{\red}[1]{#1}
5+
6+\usepackage{color}
7+\definecolor{BrickRed}{cmyk}{0, .89, .5, 0}
8+\newcommand{\red}{\color{BrickRed}}
9+
10+\newcommand{\eucommentary}[1]{\(\spadesuit\){\red{\textbf{EC Commentary}: \emph{#1}}\(\spadesuit\)}}
11+\newcommand{\euevaluation}[2]{\(\spadesuit\){\red{\textbf{Evaluation Criteria ({#1})}: \emph{#2}}\(\spadesuit\)}}
12+
13+\newcommand{\comment}[2]{\(\spadesuit\){\bf #1: }{\rm \sf #2}\(\spadesuit\)}
14+\newcommand{\draftpage}{\newpage}
15+
16+\newcommand{\FIXME}[1]{[\textbf{FIXME}: #1]}
17+
18+%\newcommand{\FIXME}[1]{\wibble}
19+\newcommand{\nocomments}{
20+\renewcommand{\eucommentary}[1]{}
21+\renewcommand{\euevaluation}[2]{}
22+\renewcommand{\comment}[2]{}
23+\renewcommand{\draftpage}{}
24+\renewcommand{\FIXME}[1]{}
25+}
26+
27+\DeclareOption{final}{\nocomments}
28+\DeclareOption{draft}{}
29+\ProcessOptions*
impl-paper/conclusions.texnew file+3
@@ -0,0 +1,3 @@
1+\section{Related Work}
2+
3+\section{Conclusion}
impl-paper/impldtp.texnew file+95
@@ -0,0 +1,95 @@
1+%\documentclass{llncs}
2+\documentclass[acmtoplas]{acmtrans2m}
3+
4+\usepackage[draft]{comments}
5+%\usepackage[final]{comments}
6+% \newcommand{\comment}[2]{[#1: #2]}
7+\newcommand{\khcomment}[1]{\comment{KH}{#1}}
8+\newcommand{\ebcomment}[1]{\comment{EB}{#1}}
9+
10+\usepackage{epsfig}
11+\usepackage{path}
12+\usepackage{url}
13+\usepackage{amsmath,amssymb}
14+\usepackage{fancyvrb}
15+
16+\newenvironment{template}{\sffamily}
17+
18+\usepackage{graphics,epsfig}
19+\usepackage{stmaryrd}
20+
21+\input{./macros.ltx}
22+\input{./library.ltx}
23+
24+\NatPackage
25+\FinPackage
26+
27+\newcounter{per}
28+\setcounter{per}{1}
29+
30+\newcommand{\Ivor}{\textsc{Ivor}}
31+\newcommand{\Idris}{\textsc{Idris}}
32+\newcommand{\Funl}{\textsc{Funl}}
33+\newcommand{\Agda}{\textsc{Agda}}
34+\newcommand{\LamPi}{$\lambda_\Pi$}
35+
36+\newcommand{\perule}[1]{\vspace*{0.1cm}\noindent
37+\begin{center}
38+\fbox{
39+\begin{minipage}{7.5cm}\textbf{Rule \theper:} #1\addtocounter{per}{1}
40+\end{minipage}}
41+\end{center}
42+\vspace*{0.1cm}
43+}
44+
45+\newcommand{\mysubsubsection}[1]{
46+\noindent
47+\textbf{#1}
48+}
49+\newcommand{\hdecl}[1]{\texttt{#1}}
50+
51+\markboth{Edwin C. Brady}{Implementation of a Practical Dependently
52+ Typed Functional Programming Language}
53+\title{Implementation of a Practical Dependently Typed Functional
54+ Programming Language}
55+\author{EDWIN C. BRADY\\ University of St Andrews}
56+
57+\begin{abstract}
58+I describe the implementation of a dependently typed functional
59+programming language, \Idris{}. Much has been written about various
60+aspects of dependently typed language implementation (e.g. checking
61+dependent types, unification, optimisation) but nothing yet about how
62+to bring it all together into a complete, practical, usable tool. This paper
63+attempts to do so. In particular, I explain what is needed to turn
64+concrete syntax with implicit arguments into fully elaborated type
65+theory, using unification and a tactic engine.
66+\end{abstract}
67+
68+\category{D.3.2}{Programming Languages}{Language
69+ Classifications}[Applicative (functional) Languages]
70+\category{D.3.4}{Programming Languages}{Processors}[Compilers]
71+\terms{Languages, Verification, Performance}
72+\keywords{Dependent Types, Typechecking}
73+
74+\begin{document}
75+
76+\begin{bottomstuff}
77+Author's address: Edwin Brady, School of Computer Science, North Haugh, St Andrews,
78+KY16 9SX
79+\end{bottomstuff}
80+\maketitle
81+
82+\input{intro.tex}
83+
84+\input{overview.tex}
85+
86+\input{conclusions.tex}
87+
88+\bibliographystyle{acmtrans}
89+\bibliography{literature.bib}
90+
91+\appendix
92+
93+%\input{code}
94+
95+\end{document}
impl-paper/intro.texnew file+12
@@ -0,0 +1,12 @@
1+\section{Introduction}
2+
3+This paper documents a new implementation of \Idris{}~\cite{plpv11},
4+in which I attempt to learn from the mistakes of the previous
5+implementation and make it nice and clean and solid. Maybe I'll keep
6+it up to date as I write the code.
7+
8+The title is deliberately a reordering of the words in my thesis
9+title~\cite{brady-thesis}. Whereas that was about taking elaborated
10+programs in the core type theory of \Epigram{}~\cite{view-left} and
11+compiling them efficiently (i.e. making the language implementation
12+practical) this paper is about making the language itself practical.
impl-paper/library.ltxnew file+325
@@ -0,0 +1,325 @@
1+%%%%%%%%%%%%%%% library file for datatypes etc.
2+
3+%%% Identifiers
4+
5+\newcommand{\va}{\VV{a}}
6+\newcommand{\vb}{\VV{b}}
7+\newcommand{\vc}{\VV{c}}
8+\newcommand{\vd}{\VV{d}}
9+\newcommand{\ve}{\VV{e}}
10+\newcommand{\vf}{\VV{f}}
11+\newcommand{\vg}{\VV{g}}
12+\newcommand{\vh}{\VV{h}}
13+\newcommand{\vi}{\VV{i}}
14+\newcommand{\vj}{\VV{j}}
15+\newcommand{\vk}{\VV{k}}
16+\newcommand{\vl}{\VV{l}}
17+\newcommand{\vm}{\VV{m}}
18+\newcommand{\vn}{\VV{n}}
19+\newcommand{\vo}{\VV{o}}
20+\newcommand{\vp}{\VV{p}}
21+\newcommand{\vq}{\VV{q}}
22+\newcommand{\vr}{\VV{r}}
23+\newcommand{\vs}{\VV{s}}
24+\newcommand{\vt}{\VV{t}}
25+\newcommand{\vu}{\VV{u}}
26+\newcommand{\vv}{\VV{v}}
27+\newcommand{\vw}{\VV{w}}
28+\newcommand{\vx}{\VV{x}}
29+\newcommand{\vy}{\VV{y}}
30+\newcommand{\vz}{\VV{z}}
31+\newcommand{\vA}{\VV{A}}
32+\newcommand{\vB}{\VV{B}}
33+\newcommand{\vC}{\VV{C}}
34+\newcommand{\vD}{\VV{D}}
35+\newcommand{\vE}{\VV{E}}
36+\newcommand{\vF}{\VV{F}}
37+\newcommand{\vG}{\VV{G}}
38+\newcommand{\vH}{\VV{H}}
39+\newcommand{\vI}{\VV{I}}
40+\newcommand{\vJ}{\VV{J}}
41+\newcommand{\vK}{\VV{K}}
42+\newcommand{\vL}{\VV{L}}
43+\newcommand{\vM}{\VV{M}}
44+\newcommand{\vN}{\VV{N}}
45+\newcommand{\vO}{\VV{O}}
46+\newcommand{\vP}{\VV{P}}
47+\newcommand{\vQ}{\VV{Q}}
48+\newcommand{\vR}{\VV{R}}
49+\newcommand{\vS}{\VV{S}}
50+\newcommand{\vT}{\VV{T}}
51+\newcommand{\vU}{\VV{U}}
52+\newcommand{\vV}{\VV{V}}
53+\newcommand{\vW}{\VV{W}}
54+\newcommand{\vX}{\VV{X}}
55+\newcommand{\vY}{\VV{Y}}
56+\newcommand{\vZ}{\VV{Z}}
57+\newcommand{\vas}{\VV{as}}
58+\newcommand{\vbs}{\VV{bs}}
59+\newcommand{\vcs}{\VV{cs}}
60+\newcommand{\vds}{\VV{ds}}
61+\newcommand{\ves}{\VV{es}}
62+\newcommand{\vfs}{\VV{fs}}
63+\newcommand{\vgs}{\VV{gs}}
64+\newcommand{\vhs}{\VV{hs}}
65+\newcommand{\vis}{\VV{is}}
66+\newcommand{\vjs}{\VV{js}}
67+\newcommand{\vks}{\VV{ks}}
68+\newcommand{\vls}{\VV{ls}}
69+\newcommand{\vms}{\VV{ms}}
70+\newcommand{\vns}{\VV{ns}}
71+\newcommand{\vos}{\VV{os}}
72+\newcommand{\vps}{\VV{ps}}
73+\newcommand{\vqs}{\VV{qs}}
74+\newcommand{\vrs}{\VV{rs}}
75+%\newcommand{\vss}{\VV{ss}}
76+\newcommand{\vts}{\VV{ts}}
77+\newcommand{\vus}{\VV{us}}
78+\newcommand{\vvs}{\VV{vs}}
79+\newcommand{\vws}{\VV{ws}}
80+\newcommand{\vxs}{\VV{xs}}
81+\newcommand{\vys}{\VV{ys}}
82+\newcommand{\vzs}{\VV{zs}}
83+
84+%%% Telescope Identifiers
85+
86+\newcommand{\ta}{\vec{\VV{a}}}
87+\newcommand{\tb}{\vec{\VV{b}}}
88+\newcommand{\tc}{\vec{\VV{c}}}
89+\newcommand{\td}{\vec{\VV{d}}}
90+\newcommand{\te}{\vec{\VV{e}}}
91+\newcommand{\tf}{\vec{\VV{f}}}
92+\newcommand{\tg}{\vec{\VV{g}}}
93+%\newcommand{\th}{\vec{\VV{h}}}
94+\newcommand{\ti}{\vec{\VV{i}}}
95+\newcommand{\tj}{\vec{\VV{j}}}
96+\newcommand{\tk}{\vec{\VV{k}}}
97+\newcommand{\tl}{\vec{\VV{l}}}
98+\newcommand{\tm}{\vec{\VV{m}}}
99+\newcommand{\tn}{\vec{\VV{n}}}
100+%\newcommand{\to}{\vec{\VV{o}}}
101+\newcommand{\tp}{\vec{\VV{p}}}
102+\newcommand{\tq}{\vec{\VV{q}}}
103+\newcommand{\tr}{\vec{\VV{r}}}
104+\newcommand{\tts}{\vec{\VV{s}}}
105+\newcommand{\ttt}{\vec{\VV{t}}}
106+\newcommand{\tu}{\vec{\VV{u}}}
107+%\newcommand{\tv}{\vec{\VV{v}}}
108+\newcommand{\tw}{\vec{\VV{w}}}
109+\newcommand{\tx}{\vec{\VV{x}}}
110+\newcommand{\ty}{\vec{\VV{y}}}
111+\newcommand{\tz}{\vec{\VV{z}}}
112+\newcommand{\tA}{\vec{\VV{A}}}
113+\newcommand{\tB}{\vec{\VV{B}}}
114+\newcommand{\tC}{\vec{\VV{C}}}
115+\newcommand{\tD}{\vec{\VV{D}}}
116+\newcommand{\tE}{\vec{\VV{E}}}
117+\newcommand{\tF}{\vec{\VV{F}}}
118+\newcommand{\tG}{\vec{\VV{G}}}
119+\newcommand{\tH}{\vec{\VV{H}}}
120+\newcommand{\tI}{\vec{\VV{I}}}
121+\newcommand{\tJ}{\vec{\VV{J}}}
122+\newcommand{\tK}{\vec{\VV{K}}}
123+\newcommand{\tL}{\vec{\VV{L}}}
124+\newcommand{\tM}{\vec{\VV{M}}}
125+\newcommand{\tN}{\vec{\VV{N}}}
126+\newcommand{\tO}{\vec{\VV{O}}}
127+\newcommand{\tP}{\vec{\VV{P}}}
128+\newcommand{\tQ}{\vec{\VV{Q}}}
129+\newcommand{\tR}{\vec{\VV{R}}}
130+\newcommand{\tS}{\vec{\VV{S}}}
131+\newcommand{\tT}{\vec{\VV{T}}}
132+\newcommand{\tU}{\vec{\VV{U}}}
133+\newcommand{\tV}{\vec{\VV{V}}}
134+\newcommand{\tW}{\vec{\VV{W}}}
135+\newcommand{\tX}{\vec{\VV{X}}}
136+\newcommand{\tY}{\vec{\VV{Y}}}
137+\newcommand{\tZ}{\vec{\VV{Z}}}
138+
139+
140+
141+%%% Nat
142+
143+\newcommand{\NatPackage}{
144+ \newcommand{\Nat}{\TC{\mathbb{N}}}
145+ \newcommand{\Z}{\DC{0}}
146+ \newcommand{\suc}{\DC{s}}
147+ \newcommand{\NatDecl}{
148+ \Data \hg
149+ \Axiom{\Nat\Hab\Type} \hg
150+ \Where \hg
151+ \Axiom{\Z\Hab\Nat} \hg
152+ \Rule{\vn\Hab\Nat}
153+ {\suc\:\vn\Hab\Nat}
154+}}
155+
156+%%% Bool
157+
158+\newcommand{\BoolPackage}{
159+ \newcommand{\Bool}{\TC{Bool}}
160+ \newcommand{\true}{\DC{true}}
161+ \newcommand{\false}{\DC{false}}
162+ \newcommand{\BoolDecl}{
163+ \Data \hg
164+ \Axiom{\Bool\Hab\Type} \hg
165+ \Where \hg
166+ \Axiom{\true\Hab\Bool} \hg
167+ \Axiom{\false\Hab\Bool}
168+}}
169+
170+%%% So
171+
172+\newcommand{\SoPackage}{
173+ \newcommand{\So}{\TC{So}}
174+ \newcommand{\oh}{\DC{oh}}
175+ \newcommand{\SoDecl}{
176+ \Data \hg
177+ \Rule{\vb\Hab\Bool}
178+ {\So\:\vb\Hab\Type} \hg
179+ \Where \hg
180+ \Axiom{\oh\Hab\So\:\true}
181+}}
182+
183+%%% Unit
184+
185+\newcommand{\UnitPackage}{
186+ \newcommand{\Unit}{\TC{Unit}}
187+ \newcommand{\void}{\DC{void}}
188+ \newcommand{\UnitDecl}{
189+ \Data \hg
190+ \Axiom{\Unit\Hab\Type} \hg
191+ \Where \hg
192+ \Axiom{\void\Hab\Unit}
193+}}
194+
195+%%% Maybe
196+
197+\newcommand{\MaybePackage}{
198+ \newcommand{\Maybe}{\TC{Maybe}}
199+ \newcommand{\yes}{\DC{yes}}
200+ \newcommand{\no}{\DC{no}}
201+ \newcommand{\MaybeDecl}{
202+ \Data \hg
203+ \Rule{\vA\Hab\Type}
204+ {\Maybe\:\vA\Hab\Type} \hg
205+ \Where \hg
206+ \Rule{\va \Hab \vA}
207+ {\yes\:\va\Hab\Maybe\:\vA} \hg
208+ \Axiom{\no\Hab\Maybe\:\vA}
209+}}
210+
211+%%% Cross
212+
213+\newcommand{\pr}[2]{(#1\DC{,}#2)} %grrrr
214+\newcommand{\CrossPackage}{
215+ \newcommand{\Cross}{\times}
216+ \newcommand{\CrossDecl}{
217+ \Data \hg
218+ \Rule{\vA,\vB\Hab\Type}
219+ {\vA\Cross\vB\Hab\Type} \hg
220+ \Where \hg
221+ \Rule{\va \Hab \vA \hg \vb\Hab\vB}
222+ {\pr{\va}{\vb}\Hab\vA\Cross\vB}
223+}}
224+
225+%%% Fin
226+
227+\newcommand{\FinPackage}{
228+ \newcommand{\Fin}{\TC{Fin}}
229+ \newcommand{\fz}{\DC{f0}}
230+ \newcommand{\fs}{\DC{fs}}
231+ \newcommand{\FinDecl}{
232+ \AR{
233+ \Data \hg
234+ \Rule{\vn\Hab\Nat}
235+ {\Fin\:\vn\Hab\Type} \hg \\
236+ \Where \hg
237+ \begin{array}[t]{c}
238+ \Axiom{\fz\Hab\Fin\:(\suc\:\vn)} \hg
239+ \Rule{\vi\Hab\Fin\:\vn}
240+ {\fs\:\vi\Hab\Fin\:(\suc\:\vn)}
241+ \end{array}
242+ }
243+}}
244+
245+%%% Vect
246+
247+\newcommand{\VectPackage}{
248+ \newcommand{\Vect}{\TC{Vect}}
249+ \newcommand{\vnil}{\varepsilon}
250+ \newcommand{\vcons}{\,\dcolon\,}
251+ \newcommand{\vsnoc}{\,\dcolon\,}
252+ \newcommand{\VectConsDecl}{
253+ \Data \hg
254+ \Rule{\vA \Hab \Type \hg \vn\Hab\Nat}
255+ {\Vect\:\vA\:\vn\Hab\Type} \hg
256+ \Where \hg \begin{array}[t]{c}
257+ \Axiom{\vnil \Hab \Vect\:\vA\:\Z} \\
258+ \Rule{\vx\Hab\vA \hg \vxs\Hab \Vect\:\vA\:\vn }
259+ {\vx\vcons\vxs\Hab\Vect\:\vA\:(\suc\vn)}
260+ \end{array}
261+}
262+ \newcommand{\VectSnocDecl}{
263+ \Data \hg
264+ \Rule{\vA \Hab \Type \hg \vn\Hab\Nat}
265+ {\Vect\:\vA\:\vn\Hab\Type} \hg
266+ \Where \hg \begin{array}[t]{c}
267+ \Axiom{\vnil \Hab \Vect\:\vA\:\Z} \\
268+ \Rule{\vxs\Hab \Vect\:\vA\:\vn \hg \vx\Hab\vA}
269+ {\vxs\vsnoc\vx\Hab\Vect\:\vA\:(\suc\vn)}
270+ \end{array}
271+}
272+}
273+
274+%%% Compare
275+
276+%Data Compare : (x:nat)(y:nat)Type
277+% = lt : (x:nat)(y:nat)(Compare x (plus (S y) x))
278+% | eq : (x:nat)(Compare x x)
279+% | gt : (x:nat)(y:nat)(Compare (plus (S x) y) y);
280+
281+
282+\newcommand{\ComparePackage}{
283+ \newcommand{\Compare}{\TC{Compare}}
284+ \newcommand{\ltComp}{\DC{lt}}
285+ \newcommand{\eqComp}{\DC{eq}}
286+ \newcommand{\gtComp}{\DC{gt}}
287+ \newcommand{\CompareDecl}{
288+ \Data \hg
289+ \Rule{\vm\Hab\Nat\hg\vn\Hab\Nat}
290+ {\Compare\:\vm\:\vn\Hab\Type} \\
291+ \Where \hg\begin{array}[t]{c}
292+ \Rule{\vx\Hab\Nat\hg\vy\Hab\Nat}
293+ {\ltComp_{\vx}\:\vy\Hab\Compare\:\vx\:(\FN{plus}\:\vx\:(\suc\:\vy))} \\
294+ \Rule{\vx\Hab\Nat}
295+ {\eqComp_{\vx}\Hab\Compare\:\vx\:\vx}\\
296+ \Rule{\vx\Hab\Nat\hg\vy\Hab\Nat}
297+ {\gtComp_{\vy}\:\vx\Hab\Compare\:(\FN{plus}\:\vy\:(\suc\:\vx))\:\vy} \\
298+ \end{array}
299+ }
300+
301+%Data CompareM : Type
302+% = ltM : (ydiff:nat)CompareM
303+% | eqM : CompareM
304+% | gtM : (xdiff:nat)CompareM;
305+
306+ \newcommand{\CompareM}{\TC{Compare^-}}
307+ \newcommand{\ltCompM}{\DC{lt^-}}
308+ \newcommand{\eqCompM}{\DC{eq^-}}
309+ \newcommand{\gtCompM}{\DC{gt^-}}
310+ \newcommand{\CompareMDecl}{
311+
312+ \Data \hg
313+ \Axiom{\CompareM\Hab\Type} \\
314+ \Where \hg\begin{array}[t]{c}
315+ \Rule{\vy\Hab\Nat}
316+ {\ltCompM\:\vy\Hab\CompareM} \\
317+ \Axiom{\eqCompM\Hab\CompareM}\\
318+ \Rule{\vx\Hab\Nat}
319+ {\gtCompM\:\vx\Hab\CompareM} \\
320+ \end{array}
321+ }
322+ \newcommand{\CompareRec}{\FN{CompareRec}}
323+ \newcommand{\CompareRecM}{\FN{CompareRec^-}}
324+
325+}
impl-paper/literature.bibnew file+3836
@@ -0,0 +1,3836 @@
1+@article{idioms,
2+ author = {McBride, Conor and Paterson, Ross},
3+ title = {Applicative programming with effects},
4+ journal = {J. Funct. Program.},
5+ volume = {18},
6+ issue = {1},
7+ month = {January},
8+ year = {2008},
9+ issn = {0956-7968},
10+ pages = {1--13},
11+ numpages = {13},
12+ url = {http://portal.acm.org/citation.cfm?id=1348940.1348941},
13+ doi = {10.1017/S0956796807006326},
14+ acmid = {1348941},
15+ publisher = {Cambridge University Press},
16+ address = {New York, NY, USA},
17+}
18+
19+@inproceedings{lava,
20+ author = {Bjesse, Per and Claessen, Koen and Sheeran, Mary and Singh, Satnam},
21+ title = {Lava: hardware design in {Haskell}},
22+ booktitle = {Proceedings of the third ACM SIGPLAN international conference on Functional programming},
23+ series = {ICFP '98},
24+ year = {1998},
25+ isbn = {1-58113-024-4},
26+ location = {Baltimore, Maryland, United States},
27+ pages = {174--184},
28+ numpages = {11},
29+ url = {http://doi.acm.org/10.1145/289423.289440},
30+ doi = {http://doi.acm.org/10.1145/289423.289440},
31+ acmid = {289440},
32+ publisher = {ACM},
33+ address = {New York, NY, USA},
34+}
35+
36+@inproceedings{plpv11,
37+ author = {Edwin Brady},
38+ title = {Idris --- Systems programming meets full dependent types},
39+ booktitle = {Programming Languages meets Program Verification {(PLPV 2011)}},
40+ year = {2011},
41+ pages = {43--54},
42+ ee = {http://doi.acm.org/10.1145/1929529.1929536},
43+ bibsource = {DBLP, http://dblp.uni-trier.de}
44+}
45+
46+@inproceedings{epicdraft,
47+ author = {Edwin Brady},
48+ title = {Epic --- a library for generating compilers},
49+ year = 2011,
50+ booktitle = {Draft Proceedings of {Trends in Functional Programming} ({TFP} '11)}
51+}
52+
53+@inproceedings{ynot08,
54+ author = {Nanevski,, Aleksandar and Morrisett,, Greg and
55+ Shinnar,, Avraham and Govereau,, Paul and Birkedal,,
56+ Lars},
57+ title = {Ynot: reasoning with the awkward squad},
58+ booktitle = {{ICFP} '08: Proceeding of the 13th {ACM SIGPLAN}
59+ international conference on Functional programming},
60+ year = {2008},
61+ isbn = {978-1-59593-919-7},
62+ pages = {229--240},
63+ location = {Victoria, BC, Canada},
64+ doi = {http://doi.acm.org/10.1145/1411204.1411237},
65+ publisher = {ACM},
66+ address = {New York, NY, USA},
67+}
68+
69+@article{cbconc-fi,
70+ author = {Edwin Brady and Kevin Hammond},
71+ title = {Correct-by-Construction Concurrency: Using Dependent Types to Verify Implementations of Effectful Resource Usage Protocols},
72+ year = 2010,
73+ journal = {Fundamenta Informaticae},
74+ volume = 102,
75+ number = 2,
76+ pages = {145--176}
77+}
78+
79+@inproceedings{devil-osdi00,
80+ author = {Fabrice M{\'e}rillon and
81+ Laurent R{\'e}veill{\`e}re and
82+ Charles Consel and
83+ Renaud Marlet and
84+ Gilles Muller},
85+ title = {Devil: An IDL for Hardware Programming},
86+ booktitle = {4th USENIX Symposium on Operating Systems Design and Implementation (OSDI 2000)},
87+ year = {2000}
88+}
89+
90+
91+@INPROCEEDINGS{device-osdi08,
92+ author = {Dan Williams and Patrick Reynolds and Kevin Walsh and Emin Gün Sirer and Fred B. Schneider},
93+ title = {Device driver safety through a reference validation mechanism},
94+ booktitle = {8th USENIX Symposium on Operating Systems Design and Implementation (OSDI 2008)},
95+ year = {2008}
96+}
97+
98+@inproceedings{sozeau-equations,
99+ author = {Matthieu Sozeau},
100+ title = {Equations: A Dependent Pattern-Matching Compiler},
101+ booktitle = {First International Conference on Interactive Theorem Proving (ITP 2010)},
102+ year = {2010},
103+ pages = {419--434},
104+ ee = {http://dx.doi.org/10.1007/978-3-642-14052-5_29},
105+ crossref = {DBLP:conf/itp/2010},
106+ bibsource = {DBLP, http://dblp.uni-trier.de}
107+}
108+
109+
110+@inproceedings{packet-type,
111+ author = "Peter J. McCann and Satish Chandra",
112+ title = "Packet Types: Abstract Specification of Network Protocol Messages",
113+ year = 2000,
114+ booktitle = "SIGCOMM '00",
115+ publisher = {{ACM}}
116+}
117+
118+@inproceedings{qs-types,
119+ author = {Eelis {van der Weegen} and James McKinna},
120+
121+ title={A Machine-checked Proof of the Average-case Complexity of Quicksort in Coq},
122+ year={2009},
123+ pages={256--271},
124+ series = {Lecture Notes in Computer Science},
125+ publisher = {Springer}
126+
127+}
128+
129+@inproceedings{totalparser,
130+ author = {Nils Anders Danielsson},
131+ title = {Total Parser Combinators},
132+ booktitle = {{ICFP} '10: Proceedings of the 15th {ACM} {SIGPLAN} International Conference on Functional Programming},
133+ year = {2010},
134+ isbn = {978-1-60558-794-3},
135+ pages = {285--296},
136+ location = {Baltimore, Maryland, USA},
137+ doi = {http://doi.{ACM}.org/10.1145/1863543.1863587},
138+ publisher = {{ACM}},
139+ address = {New York, NY, USA},
140+ }
141+
142+@misc{rfc791,
143+ author="J. Postel",
144+ title="{Internet Protocol}",
145+ series="Request for Comments",
146+ number="791",
147+ howpublished="RFC 791 (Standard)",
148+ publisher="IETF",
149+ organization="Internet Engineering Task Force",
150+ year=1981,
151+ month=sep,
152+ note="Updated by RFC 1349",
153+ url="http://www.ietf.org/rfc/rfc791.txt",
154+}
155+
156+
157+@misc{rfc792,
158+ author="J. Postel",
159+ title="{Internet Control Message Protocol}",
160+ series="Request for Comments",
161+ number="792",
162+ howpublished="RFC 792 (Standard)",
163+ publisher="IETF",
164+ organization="Internet Engineering Task Force",
165+ year=1981,
166+ month=sep,
167+ note="Updated by RFCs 950, 4884",
168+ url="http://www.ietf.org/rfc/rfc792.txt",
169+}
170+
171+@INPROCEEDINGS{Dybjer-indrec,
172+ author = {Peter Dybjer and Anton Setzer},
173+ title = {A Finite Axiomatization of Inductive-Recursive Definitions},
174+ booktitle = {Tyed Lambda Calculi and Applications},
175+ volume = {1581},
176+ series = {Lecture Notes in Computer Science},
177+ year = {1998},
178+ pages = {129--146},
179+ publisher = {Springer}
180+}
181+
182+@book{stevenstcpip,
183+ author = {W. Richard Stevens},
184+ title = {{TCP/IP} Illustrated Volume 1: The Protocols},
185+ year = 1994,
186+ publisher = {Addison Wesley},
187+ isbn = {0-201-63346-9}
188+}
189+
190+@inproceedings{coqtypeclasses,
191+ author = {Sozeau, Matthieu and Oury, Nicolas},
192+ title = {First-Class Type Classes},
193+ booktitle = {TPHOLs '08: Proceedings of the 21st International Conference on Theorem Proving in Higher Order Logics},
194+ year = {2008},
195+ isbn = {978-3-540-71065-3},
196+ pages = {278--293},
197+ location = {Montreal, P.Q., Canada},
198+ doi = {http://dx.doi.org/10.1007/978-3-540-71067-7_23},
199+ publisher = {Springer-Verlag},
200+ address = {Berlin, Heidelberg},
201+ }
202+
203+
204+@inproceedings{kipling,
205+ author = {McBride, Conor},
206+ title = {Outrageous but meaningful coincidences: dependent type-safe syntax and evaluation},
207+ booktitle = {WGP '10: Proceedings of the 6th {ACM} {SIGPLAN} workshop on Generic programming},
208+ year = {2010},
209+ isbn = {978-1-4503-0251-7},
210+ pages = {1--12},
211+ location = {Baltimore, Maryland, USA},
212+ doi = {http://doi.{ACM}.org/10.1145/1863495.1863497},
213+ publisher = {{ACM}},
214+ address = {New York, NY, USA},
215+ }
216+
217+@inproceedings{padsml,
218+ author = {Yitzhak Mandelbaum and
219+ Kathleen Fisher and
220+ David Walker and
221+ Mary F. Fern{\'a}ndez and
222+ Artem Gleyzer},
223+ title = {{PADS/ML}: a functional data description language},
224+ booktitle = {POPL '07: Proceedings of the 34th {ACM} {SIGPLAN}-SIGACT Symposium on
225+ Principles of Programming Languages, POPL 2007, Nice, France,
226+ January 17-19, 2007},
227+ year = {2007},
228+ pages = {77-83},
229+ ee = {http://doi.{ACM}.org/10.1145/1190216.1190231},
230+ crossref = {DBLP:conf/popl/2007},
231+ bibsource = {DBLP, http://dblp.uni-trier.de}
232+}
233+
234+@proceedings{DBLP:conf/popl/2007,
235+ editor = {Martin Hofmann and
236+ Matthias Felleisen},
237+ title = {Proceedings of the 34th {ACM} {SIGPLAN}-SIGACT Symposium on
238+ Principles of Programming Languages, POPL 2007, Nice, France,
239+ January 17-19, 2007},
240+ booktitle = {POPL},
241+ publisher = {{ACM}},
242+ year = {2007},
243+ isbn = {1-59593-575-4},
244+ bibsource = {DBLP, http://dblp.uni-trier.de}
245+}
246+
247+@inproceedings{melange,
248+ author = {Madhavapeddy, Anil and Ho, Alex and Deegan, Tim and Scott, David and Sohan, Ripduman},
249+ title = {Melange: creating a "functional" internet},
250+ booktitle = {EuroSys '07: Proceedings of the 2nd {ACM} SIGOPS/EuroSys European Conference on Computer Systems 2007},
251+ year = {2007},
252+ isbn = {978-1-59593-636-3},
253+ location = {Lisbon, Portugal},
254+ doi = {http://doi.{ACM}.org/10.1145/1272996.1273009},
255+ publisher = {{ACM}},
256+ address = {New York, NY, USA},
257+ }
258+
259+
260+
261+@article{next700data,
262+ author = {Fisher, Kathleen and Mandelbaum, Yitzhak and Walker, David},
263+ title = {The next 700 data description languages},
264+ journal = {{SIGPLAN} Not.},
265+ volume = {41},
266+ number = {1},
267+ year = {2006},
268+ issn = {0362-1340},
269+ pages = {2--15},
270+ doi = {http://doi.{ACM}.org/10.1145/1111320.1111039},
271+ publisher = {{ACM}},
272+ address = {New York, NY, USA},
273+ }
274+
275+
276+@INPROCEEDINGS{xi-ats,
277+ author = {Hongwei Xi},
278+ title = {{Applied Type System} (extended abstract)},
279+ booktitle = {Types for Proofs and Programs 2003},
280+ editor = {Stefano Berardi and Mario Coppo and Ferruccio Damiani},
281+ publisher = {Springer},
282+ series = {Lecture Notes in Computer Science},
283+ volume = {3085},
284+ year = {2004},
285+ pages = {394--408}
286+}
287+
288+@inproceedings{powerpi,
289+ author = {Nicolas Oury and
290+ Wouter Swierstra},
291+ title = {The power of {Pi}},
292+ booktitle = {{ICFP} '08: Proceedings of the 13th {ACM} {SIGPLAN} International Conference
293+ on Functional Programming, {ICFP} 2008, Victoria, BC, Canada,
294+ September 20-28, 2008},
295+ year = {2008},
296+ pages = {39--50},
297+ ee = {http://doi.{ACM}.org/10.1145/1411204.1411213},
298+ crossref = {DBLP:conf/{ICFP}/2008},
299+ bibsource = {DBLP, http://dblp.uni-trier.de}
300+}
301+
302+@proceedings{DBLP:conf/{ICFP}/2008,
303+ editor = {James Hook and
304+ Peter Thiemann},
305+ title = {Proceeding of the 13th {ACM} {SIGPLAN} international conference
306+ on Functional programming, {ICFP} 2008, Victoria, BC, Canada,
307+ September 20-28, 2008},
308+ booktitle = {{ICFP}},
309+ publisher = {{ACM}},
310+ year = {2008},
311+ isbn = {978-1-59593-919-7},
312+ bibsource = {DBLP, http://dblp.uni-trier.de}
313+}
314+
315+
316+@inproceedings{security-types,
317+ author = {Morgenstern, Jamie and Licata, Daniel R.},
318+ title = {Security-typed programming within dependently typed programming},
319+ booktitle = {{ICFP} '10: Proceedings of the 15th {ACM} {SIGPLAN} International Conference on Functional Programming},
320+ year = {2010},
321+ isbn = {978-1-60558-794-3},
322+ pages = {169--180},
323+ location = {Baltimore, Maryland, USA},
324+ doi = {http://doi.{ACM}.org/10.1145/1863543.1863569},
325+ publisher = {{ACM}},
326+ address = {New York, NY, USA},
327+ }
328+
329+@inproceedings{levitation,
330+ author = {Chapman, James and Dagand, Pierre-\'{E}variste and McBride, Conor and Morris, Peter},
331+ title = {The gentle art of levitation},
332+ booktitle = {{ICFP} '10: Proceedings of the 15th {ACM} {SIGPLAN} International Conference on Functional Programming},
333+ year = {2010},
334+ isbn = {978-1-60558-794-3},
335+ pages = {3--14},
336+ location = {Baltimore, Maryland, USA},
337+ doi = {http://doi.{ACM}.org/10.1145/1863543.1863547},
338+ publisher = {{ACM}},
339+ address = {New York, NY, USA},
340+ }
341+
342+
343+
344+@INPROCEEDINGS{awkward,
345+ author = {Simon {Peyton Jones}},
346+ title = {Tackling the awkward squad: monadic input/output, concurrency, exceptions, and foreign-language calls in {Haskell}},
347+ booktitle = {Engineering theories of software construction},
348+ year = {2001},
349+ pages = {47--96}
350+}
351+
352+@inproceedings{scrap-engine,
353+ author = {Brady, Edwin and Hammond, Kevin},
354+ title = {Scrapping your inefficient engine: using partial evaluation to improve domain-specific language implementation},
355+ booktitle = {{ICFP} '10: Proceedings of the 15th {ACM} {SIGPLAN} International Conference on Functional Programming},
356+ year = {2010},
357+ isbn = {978-1-60558-794-3},
358+ pages = {297--308},
359+ location = {Baltimore, Maryland, USA},
360+ doi = {http://doi.{ACM}.org/10.1145/1863543.1863587},
361+ publisher = {{ACM}},
362+ address = {New York, NY, USA},
363+ }
364+
365+@article{urweb,
366+ author = {Chlipala, Adam},
367+ title = {Ur: statically-typed metaprogramming with type-level record computation},
368+ journal = {{SIGPLAN} Not.},
369+ volume = {45},
370+ number = {6},
371+ year = {2010},
372+ issn = {0362-1340},
373+ pages = {122--133},
374+ doi = {http://doi.{ACM}.org/10.1145/1809028.1806612},
375+ publisher = {{ACM}},
376+ address = {New York, NY, USA},
377+ }
378+
379+
380+
381+@phdthesis{norell-thesis,
382+ author = {Ulf Norell},
383+ title = {Towards a practical programming language based on dependent type
384+ theory},
385+ school = {Chalmers University of Technology},
386+ year = 2007,
387+ month = {September},
388+}
389+
390+@inproceedings{open-type,
391+ author = {Schrijvers, Tom and Peyton Jones, Simon and Chakravarty, Manuel and Sulzmann, Martin},
392+ title = {Type checking with open type functions},
393+ booktitle = {International Conf. on Functional Programming ({ICFP} 2008)},
394+ year = {2008},
395+ pages = {51--62},
396+ doi = {http://doi.{ACM}.org/10.1145/1411203.1411215},
397+ publisher = {{ACM}},
398+ address = {New York, NY, USA},
399+ }
400+
401+@inproceedings{ngna-dsl,
402+ title = {Domain Specific Languages ({DSL}s) for Network Protocols},
403+ author = {Saleem Bhatti and Edwin Brady and Kevin Hammond and James McKinna},
404+ year = {2009},
405+ booktitle = {International Workshop on Next Generation Network Architecture ({NGNA} 2009)}
406+}
407+
408+@phdthesis{gill-thesis,
409+ title = {Cheap deforestation for non-strict functional languages},
410+ author = {A Gill},
411+ institution = {University of Glasgow},
412+ month = {January},
413+ year = 1996
414+}
415+
416+@misc{llvm-haskell,
417+ title = {Low Level Virtual Machine for {Glasgow Haskell Compiler}},
418+ author = {David Terei},
419+ year = 2009,
420+ howpublished = {Bachelor's Thesis, Computer Science and Engineering Dept., The University of New South Wales, Sydney, Australia}
421+}
422+
423+@mastersthesis{llvm,
424+ title = {{LLVM}: An Infrastructure for Multi-Stage Optimization},
425+ author = {Chris Lattner},
426+ year = 2002,
427+ month = {December},
428+ institution = {Computer Science Dept., University of Illinois at Urbana-Champaign}
429+}
430+
431+@inproceedings{gpu-arrays,
432+ title = {GPU Kernels as Data-Parallel Array Computations in Haskell},
433+ author = {Sean Lee and Manuel M. T. Chakravarty and Vinod Grover and Gabriele Keller.},
434+ year = 2009,
435+ booktitle = {Workshop on Exploiting Parallelism using GPUs and other Hardware-Assisted Methods (EPAHM 2009)}
436+}
437+
438+@misc{cryptol,
439+ author = {Galois, Inc.},
440+ title = {Cryptol},
441+ year = {2009},
442+ howpublished = {\url{http://cryptol.net/}}
443+}
444+
445+@inproceedings{paradise-dsl,
446+ author = {Lennart Augustsson and Howard Mansell and Ganesh Sittampalam},
447+ title = {{Paradise: a two-stage DSL embedded in Haskell}},
448+ booktitle = {International Conf. on Functional Programming ({ICFP} 2008)},
449+ year = {2008},
450+ publisher = {{ACM}},
451+ pages = {225--228}
452+ }
453+
454+@misc{dsl-bib,
455+ author = {Arie {van Deursen} and Paul Klint and Joost Visser},
456+ title = {Domain-Specific Languages --- an annotated bibliography},
457+ year = 2000,
458+ howpublished = {\url{http://homepages.cwi.nl/~arie/papers/dslbib/}}
459+}
460+
461+@inproceedings{imperative-pe,
462+ author = {Debois, S{\o}ren},
463+ title = {Imperative program optimization by partial evaluation},
464+ booktitle = {PEPM '04: Proceedings of the 2004 {ACM} {SIGPLAN} symposium on Partial evaluation and semantics-based program manipulation},
465+ year = {2004},
466+ isbn = {1-58113-835-0},
467+ pages = {113--122},
468+ location = {Verona, Italy},
469+ doi = {http://doi.{ACM}.org/10.1145/1014007.1014019},
470+ publisher = {{ACM}},
471+ address = {New York, NY, USA},
472+ }
473+
474+
475+@inproceedings{offline-pe-termination,
476+ author = {Andersen, Peter Holst and Holst, Carsten Kehler},
477+ title = {Termination Analysis for Offline Partial Evaluation of a Higher Order Functional Language},
478+ booktitle = {Proc. SAS '96: Intl. Symp. on Static Analysis},
479+ year = {1996},
480+ isbn = {3-540-61739-6},
481+ pages = {67--82},
482+ publisher = {Springer},
483+ notaddress = {London, UK},
484+ }
485+
486+
487+@inproceedings{stage-duplication,
488+ author = {Swadi, Kedar and Taha, Walid and Kiselyov, Oleg and Pasalic, Emir},
489+ title = {A monadic approach for avoiding code duplication when staging memoized functions},
490+ notbooktitle = {PEPM '06: Proceedings of the 2006 {ACM} {SIGPLAN} symposium on Partial evaluation and semantics-based program manipulation},
491+ booktitle = {Proc. PEPM '06:{ACM} Symp. on Partial Evaluation and Semantics-based Program Manipulation},
492+ year = {2006},
493+ isbn = {1-59593-196-1},
494+ pages = {160--169},
495+ location = {Charleston, South Carolina},
496+ doi = {http://doi.{ACM}.org/10.1145/1111542.1111570},
497+ notpublisher = {{ACM}},
498+ notaddress = {New York, NY, USA},
499+ }
500+
501+
502+@inproceedings{concoqtion,
503+ author = {Fogarty, Seth and Pasalic, Emir and Siek, Jeremy and Taha, Walid},
504+ title = {Concoqtion: indexed types now!},
505+ booktitle = {PEPM '07: Proceedings of the 2007 {ACM} {SIGPLAN} symposium on Partial evaluation and semantics-based program manipulation},
506+ year = {2007},
507+ isbn = {978-1-59593-620-2},
508+ pages = {112--121},
509+ location = {Nice, France},
510+ doi = {http://doi.{ACM}.org/10.1145/1244381.1244400},
511+ publisher = {{ACM}},
512+ address = {New York, NY, USA},
513+ }
514+
515+@inproceedings{metahaskell,
516+ author = "Tim Sheard and Simon {Peyton Jones}",
517+ title = "Template metaprogramming for {Haskell}",
518+ booktitle = "{ACM} Haskell Workshop",
519+ year = 2002,
520+ month = oct,
521+ pages = "1-16",
522+ noteditor = "Manuel M. T. Chakravarty",
523+ notpublisher = "{ACM} Press"
524+}
525+
526+@misc{shark-profiler,
527+ title = {Optimizing your application with {Shark 4}},
528+ year = 2009,
529+ howpublished = {\url{http://developer.apple.com/tools/sharkoptimize.html}}
530+}
531+
532+@misc{shootout,
533+ title = {The Computer Language Benchmark Game},
534+ year = {2009},
535+ howpublished = {\url{http://shootout.alioth.debian.org/}}
536+}
537+
538+@article{futamura,
539+ author = {Yoshihiko Futamura},
540+ year = 1971,
541+ title = "Partial Evaluation of Computation Process --– An Approach to a Compiler-Compiler",
542+ journal = {Systems, Comps., Controls},
543+ volume = 2,
544+ number = 5,
545+ pages = {45-–50}
546+}
547+
548+@book{pebook,
549+ title = {Partial Evaluation and Automatic Program Generation},
550+ author = {N.D. Jones and C.K. Gomard and P. Sestoft},
551+ year = 1993,
552+ publisher = {Prentice Hall International}
553+}
554+
555+@inproceedings{pantheon,
556+ author = {Sean Seefried and Manuel Chakravarty and Gabriele Keller},
557+ title = {Optimising Embedded {DSLs} using {Template Haskell}},
558+ year = {2004},
559+ booktitle = {{Proc. GPCE~'04: Conf. Generative Prog. and Component Eng.}},
560+ publisher = {Springer},
561+ series = {LNCS}
562+}
563+
564+@article{pan,
565+ author = {Elliott, Conal and Finne, Sigbj\orn and De Moor, Oege},
566+ title = {Compiling embedded languages},
567+ journal = {J. Funct. Program.},
568+ volume = {13},
569+ number = {3},
570+ year = {2003},
571+ issn = {0956-7968},
572+ pages = {455--481},
573+ doi = {http://dx.doi.org/10.1017/S0956796802004574},
574+ publisher = {Cambridge University Press},
575+ address = {New York, NY, USA},
576+ }
577+
578+
579+@inproceedings{russell,
580+ author = {Sozeau, Matthieu},
581+ title = {Program-ing finger trees in Coq},
582+ booktitle = {{ICFP} '07: Proceedings of the 12th {ACM} {SIGPLAN} international conference on Functional programming},
583+ year = {2007},
584+ isbn = {978-1-59593-815-2},
585+ pages = {13--24},
586+ location = {Freiburg, Germany},
587+ doi = {http://doi.{ACM}.org/10.1145/1291151.1291156},
588+ publisher = {{ACM}},
589+ address = {New York, NY, USA},
590+ }
591+
592+@inproceedings{turner-total,
593+ author = {D. A. Turner},
594+ title = {Elementary Strong Functional Programming},
595+ year = 1995,
596+ booktitle = "First International Symposium on Functional Programming Languages in Education",
597+ publisher = {Springer},
598+ series = {LNCS},
599+ volume = {1022},
600+ pages = {1--13}
601+}
602+
603+@incollection{free-theorems,
604+ author = "P. Wadler",
605+ title = "Theorems for Free!",
606+ booktitle = "{Proc. 4th Int.\ Conf.\ on Funct.\ Prog.\ Languages and Computer Arch., {FPCA}'89, London, {UK}, 11--13 Sept 1989}",
607+ publisher = "{ACM} Press",
608+ address = "New York",
609+ pages = "347--359",
610+ year = "1989",
611+ url = "citeseer.ist.psu.edu/wadler89theorems.html"
612+}
613+
614+@inproceedings{TrulyConcurrent,
615+ author = {Naiyong Jin and Jifeng He},
616+ title = {Towards A Truly Concurrent Model for Processes Sharing Resources},
617+ booktitle = {Proc. 3rd {IEEE} International Conf. on Soft. Eng. and Formal Methods},
618+ year = {2005},
619+ isbn = {0-7695-2435-4},
620+ pages = {231--239},
621+ doi = {http://dx.doi.org/10.1109/SEFM.2005.50},
622+ publisher = {{IEEE} Computer Society},
623+ address = {Washington, DC, USA},
624+ }
625+
626+@misc{GPCE2006,
627+ note = {Omitted to preserve anonymity, contact PC chair for details}
628+}
629+
630+@misc{IFL2006,
631+ note = {Omitted to preserve anonymity, contact PC chair for details}
632+}
633+
634+@misc{ivor-anon,
635+ note = {Omitted to preserve anonymity, contact PC chair for details}
636+}
637+
638+@inproceedings{HaskellIO,
639+ author = {Simon L. {Peyton Jones} and Philip Wadler},
640+ title = {Imperative functional programming},
641+ booktitle = {Proc. 20th {ACM} Symposium on Principles of programming languages},
642+ year = {1993},
643+ isbn = {0-89791-560-7},
644+ pages = {71--84},
645+ location = {Charleston, South Carolina, United States},
646+ doi = {http://doi.{ACM}.org/10.1145/158511.158524},
647+ publisher = {{ACM}},
648+ address = {New York, NY, USA},
649+ }
650+
651+@article{CorrectnessConstruction,
652+author = "P. Amey",
653+title = "{Correctness by Construction: Better can also be Cheaper}",
654+journal = "{CrossTalk: the Journal of Defense Software Engineering}",
655+month = mar,
656+year = 2002,
657+pages = "24--28"
658+}
659+
660+
661+
662+@INPROCEEDINGS{hj:popl03,
663+ AUTHOR = {M. Hofmann and S. Jost},
664+ TITLE = {Static Prediction of Heap Space Usage for First-Order Function
665+al Programs},
666+booktitle = "Proc. {POPL 2003 --- 2003 {ACM} Symp. on Principles of Programming La
667+nguages}",
668+ KEY = {HJ_POPL03},
669+ PAGES = {185--197},
670+ YEAR = {2003},
671+ ORGANIZATION = {{ACM}}
672+}
673+
674+
675+@article{kobayashi-lock,
676+ author = {Naoki Kobayashi},
677+ title = {A type system for lock-free processes},
678+ journal = {Inf. Comput.},
679+ volume = {177},
680+ number = {2},
681+ year = {2002},
682+ issn = {0890-5401},
683+ pages = {122--159},
684+ doi = {http://dx.doi.org/10.1016/S0890-5401(02)93171-8},
685+ publisher = {Academic Press, Inc.},
686+ address = {Duluth, MN, USA},
687+ }
688+
689+@techreport{linear-alias,
690+ title = {Linear types for aliased resources},
691+ author = {Chris Hawblitzel},
692+ year = {2005},
693+ institution = {Microsoft Research},
694+ number = {MSR-TR-2005-141}
695+}
696+
697+@article{kobayashi-esop,
698+ title = {Type-Based Analysis of Deadlock fora Concurrent Calculus with Interrupts},
699+ author = {Kohei Suenaga and Naoki Kobayashi},
700+ year = {2007},
701+ booktitle = {ESOP}
702+}
703+
704+@inproceedings{res-c,
705+ title = {A Path Sensitive Type System for Resource Usage Verification of C Like Languages},
706+ author = {Hyun-Goo Kang and Youil Kim and Taisook Han and Hwansoo Han},
707+ year = 2005,
708+ publisher = {Springer-Verlag},
709+ booktitle = {Programming Languages and Systems},
710+ pages = {264--280},
711+ series = {LNCS},
712+ volume = {3780}
713+}
714+
715+@miscs{lsr,
716+ title = {Lightweight static resources: Sexy types for embedded and systems programming},
717+ author = {Oleg Kiselyov and Chung-Chieh Shan},
718+ year = 2007,
719+ note = {Draft}
720+}
721+
722+@inproceedings{scoped-res,
723+ title = {Resource Usage Analysis Via Scoped Methods},
724+ author = {Gang Tan and Xinming Ou and David Walker},
725+ booktitle = {Foundations of Object-Oriented Languages},
726+ year = {2003}
727+}
728+
729+@article{igarashi-res,
730+ author = {Igarashi, Atsushi and Kobayashi, Naoki},
731+ title = {Resource usage analysis},
732+ journal = {ACM Trans. Program. Lang. Syst.},
733+ volume = {27},
734+ issue = {2},
735+ month = {March},
736+ year = {2005},
737+ issn = {0164-0925},
738+ pages = {264--313},
739+ numpages = {50},
740+ url = {http://doi.acm.org/10.1145/1057387.1057390},
741+ doi = {http://doi.acm.org/10.1145/1057387.1057390},
742+ acmid = {1057390},
743+ publisher = {ACM},
744+ address = {New York, NY, USA},
745+ keywords = {Resource usage, type inference},
746+}
747+
748+@phdthesis{monitoring,
749+ title = {Policy Enforcement via Program Monitoring},
750+ author = {Jarred Adam Ligatti},
751+ year = 2006,
752+ month = {May}
753+}
754+
755+@inproceedings{sec-policy,
756+ title = {A Type System for Expressive Security Policies},
757+ author = {David Walker},
758+ booktitle = {Twenty-Seventh {ACM} {SIGPLAN} Symposium on Principles of Programming Languages},
759+ pages = {254--267},
760+ year = 2000}
761+
762+@inproceedings{res-dfa,
763+ author = {K. Marriott and P.J. Stuckey and M. Sulzmann},
764+ title = {Resource Usage Verification},
765+ year = 2003,
766+ booktitle = {In Proc. of First Asian Symposium, APLAS 2003},
767+ pages = {212--229},
768+ publisher = {Springer-Verlag}
769+}
770+
771+@incollection{ hancock-interactive,
772+ author = "Peter Hancock and Anton Setzer",
773+ title = "Interactive Programs in Dependent Type Theory",
774+ booktitle = "Proc.\ of 14th Ann.\ Conf.\ of {EACSL}, {CSL}'00, Fischbau, Germany, 21--26 Aug 2000",
775+ volume = "1862",
776+ publisher = "Springer-Verlag",
777+ address = "Berlin",
778+ editor = "P. Clote and H. Schwichtenberg",
779+ pages = "317--331",
780+ year = "2000",
781+ url = "citeseer.ist.psu.edu/hancock00interactive.html" }
782+
783+@inproceedings{popeea-resources,
784+ author = {Corneliu Popeea and Wei-Ngan Chin},
785+ title = {A type system for resource protocol verification and its correctness proof},
786+ booktitle = {PEPM '04: Proceedings of the 2004 {ACM} {SIGPLAN} symposium on Partial evaluation and semantics-based program manipulation},
787+ year = {2004},
788+ isbn = {1-58113-835-0},
789+ pages = {135--146},
790+ location = {Verona, Italy},
791+ doi = {http://doi.{ACM}.org/10.1145/1014007.1014021},
792+ publisher = {{ACM} Press},
793+ address = {New York, NY, USA},
794+ }
795+
796+@inproceedings{sheard-langfuture,
797+ author = {Tim Sheard},
798+ title = "Languages of the future",
799+ booktitle = "{ACM} Conference on Object Orientated Programming Systems, Languages and Applicatioons (OOPSLA'04)",
800+ year = "2004"
801+}
802+
803+@inproceedings{ivor,
804+ author = {Edwin Brady},
805+ title = {{Ivor}, a proof engine},
806+ year = {2007},
807+ publisher = {Springer-Verlag},
808+ series = {LNCS},
809+ booktitle = {Implementation and Application of Functional Languages 2006}
810+}
811+
812+@misc{coq-in-coq,
813+ author = {Bruno Barras and Benjamin Werner},
814+ year = 1997,
815+ title = {{Coq} in {Coq}}
816+}
817+
818+@article{hudak-edsl,
819+ author = {Paul Hudak},
820+ title = {Building Domain-Specific Embedded Languages},
821+ year = {1996},
822+ month = {December},
823+ journal = {{ACM} Computing Surveys},
824+ volume = {28A},
825+ number = {4}
826+}
827+
828+@inproceedings{concon,
829+ author = {Conor McBride and Healfdene Goguen and James McKinna},
830+ title = {Some Constructions On Constructors},
831+ year = 2005,
832+ booktitle = {TYPES 2004},
833+ publisher = {Springer},
834+ series = {LNCS},
835+ volume = {3839}
836+}
837+
838+@InProceedings{Hume-GPCE,
839+author = {K. Hammond and G.J. Michaelson},
840+title = {{Hume: a Domain-Specific Language for Real-Time Embedded Systems}},
841+booktitle = {{Proc. Conf. Generative Programming and Component Engineering (GPCE~'03)}},
842+publisher = {Springer-Verlag},
843+series = {Lecture Notes in Computer Science},
844+year = {2003},
845+}
846+
847+@inproceedings{lcf-milner,
848+ author = {Robin Milner},
849+ title = {{LCF}: A Way of Doing Proofs with a Machine},
850+ booktitle = {Mathematical Foundations of Computer Science 1978},
851+ pages = {146-159},
852+ year = 1979,
853+ series = {LNCS},
854+ volume = {64}
855+}
856+
857+
858+@inproceedings{epireloaded,
859+ title = {Epigram Reloaded: A Standalone Typechecker for {ETT}},
860+ author = {James Chapman and Thorsten Altenkirch and Conor McBride},
861+ year = 2006,
862+ booktitle = {Trends in Functional Programming 2005},
863+ note = {To appear}
864+}
865+
866+@TECHREPORT{why-tool,
867+ AUTHOR = {J.-C. Filli\^atre},
868+ TITLE = {{Why: a multi-language multi-prover verification tool}},
869+ INSTITUTION = {{LRI, Universit\'e Paris Sud}},
870+ TYPE = {{Research Report}},
871+ NUMBER = {1366},
872+ MONTH = {March},
873+ YEAR = 2003,
874+ URL = {http://www.lri.fr/~filliatr/ftp/publis/why-tool.ps.gz}
875+}
876+
877+@misc{ large-extraction,
878+ author = "Lu\'iz Cruz-Filipe and Bas Spitters",
879+ title = "Program Extraction from Large Proof Developments",
880+ year = 2003,
881+ url = "citeseer.ist.psu.edu/cruz-filipe03program.html" }
882+
883+@inproceedings{ fta,
884+ author = "Herman Geuvers and Freek Wiedijk and Jan Zwanenburg",
885+ title = "A Constructive Proof of the Fundamental Theorem of Algebra without Using the Rationals",
886+ booktitle = "{TYPES 2000}",
887+ pages = "96--111",
888+ year = "2000",
889+ url = "citeseer.ist.psu.edu/geuvers01constructive.html" }
890+
891+@article{mckinna-expr,
892+ title = {A type-correct, stack-safe, provably correct, expression compiler in {Epigram}},
893+ author = {James McKinna and Joel Wright},
894+ year = 2007,
895+ journal = {Journal of Functional Programming},
896+ note = {To appear}
897+}
898+
899+@article{pugh-omega,
900+ title = "The {Omega} {Test}: a fast and practical integer programming algorithm for dependence analysis",
901+ author = "William Pugh",
902+ journal = "Communication of the {ACM}",
903+ year = 1992,
904+ pages = {102--114}
905+}
906+
907+@misc{four-colour,
908+ author = "Georges Gonthier",
909+ title = "A computer-checked proof of the {Four Colour Theorem}",
910+ year = 2005,
911+ howpublished = {\url{http://research.microsoft.com/~gonthier/4colproof.pdf}}}
912+
913+@inproceedings{sparkle,
914+ author = "Maarten {de Mol} and Marko {van Eekelen} and Rinus Plasmeijer",
915+ title = "Theorem Proving for Functional Programmers",
916+ url = "citeseer.ist.psu.edu/654423.html",
917+ BOOKTITLE = {Proc. Implementation of Functional Languages (IFL 2002)},
918+ publisher = {Springer},
919+ series = {LNCS},
920+ volume = {2312},
921+ year = 2002
922+ }
923+
924+@misc{agda,
925+ title = {Agda},
926+ author = {Catarina Coquand},
927+ howpublished= {\url{http://agda.sourceforge.net/}},
928+ year = 2005
929+}
930+
931+@misc{cover,
932+ title = {Cover Translator},
933+ howpublished = {\url{http://coverproject.org/CoverTranslator/}}
934+}
935+
936+@misc{parsec,
937+ title = {Parsec, a fast combinator parser},
938+ author = {Daan Leijen},
939+ year = {2001},
940+ howpublished = {\url{http://www.cs.uu.nl/~daan/parsec.html}}
941+}
942+
943+@inproceedings{dtpmsp-gpce,
944+ author = {Edwin Brady and Kevin Hammond},
945+ title = {A Verified Staged Interpreter is a Verified Compiler},
946+ booktitle = {{Proc. Conf. Generative Programming and Component Engineering (GPCE~'06)}},
947+ year = 2006
948+}
949+
950+@misc{haddock,
951+ title = {Haddock: A {Haskell} Documentation Tool},
952+ howpublished = {\url{http://www.haskell.org/haddock/}}
953+}
954+
955+@inproceedings{offshoring,
956+ title = {Implicitly Heterogeneous Multi-Stage Programming},
957+ author = {Jason Eckhardt and Roumen Kaibachev and Emir Pa\v{s}al\'{i}c and Kedar Swadi and Walid Taha},
958+ booktitle = {Proc. 2005 Conf. on Generative Programming and Component Engineering (GPCE 2005)},
959+ publisher = {Springer},
960+ series = {LNCS},
961+ volume = {3676},
962+ year = 2005
963+}
964+
965+@misc{alti-partial,
966+ title = {Stop thinking about bottoms when writing programs},
967+ author = {Thorsten Altenkirch},
968+ year = 2006,
969+ note = {Talk at BCTCS 2006}
970+}
971+
972+@misc{tarmo-partial,
973+ title = {Partiality is an Effect},
974+ author = {Tarmo Uustalu},
975+ year = 2004,
976+ note = {Talk at Dagstuhl workshop on Dependently Typed Progamming}
977+}
978+
979+@inproceedings{McKinnaPOPL06,
980+ author = {James McKinna},
981+ title = {Why dependent types matter},
982+ booktitle = {Proc. {ACM} Symp. on Principles of Programming Languages (POPL 2006)},
983+ year = {2006},
984+ issn = {0362-1340},
985+ pages = {1--1},
986+ doi = {http://doi.{ACM}.org/10.1145/1111320.1111038},
987+}
988+
989+
990+@inproceedings{leroy-compiler,
991+ title = {Formal Certification of a Compiler Back-end},
992+ author = {Xavier Leroy},
993+ year = 2006,
994+ booktitle = {Principles of Programming Languages 2006},
995+ pages = {42--54},
996+ publisher = {{ACM} Press}
997+}
998+
999+@inproceedings{hutton-exceptions,
1000+ title = {Compiling Exceptions Correctly},
1001+ year = 2004,
1002+ author = {Graham Hutton and Joel Wright},
1003+ booktitle = {Mathematics of Program Construction},
1004+ publisher = {Springer},
1005+ series = {LNCS},
1006+ volume = {3125}
1007+}
1008+
1009+@inproceedings{tagless-staged,
1010+ title = {Tagless Staged Interpreters for Typed Languages},
1011+ year = {2002},
1012+ booktitle = {Proc. 2002 International Conf. on Functional Programming ({ICFP} 2002)},
1013+ author = {Emir Pa\v{s}al\'{i}c and Walid Taha and Tim Sheard},
1014+ publisher = {{ACM}}
1015+}
1016+
1017+@inproceedings{env-classifiers,
1018+ title = {Environment Classifiers},
1019+ year = 2003,
1020+ author = {Walid Taha},
1021+ booktitle = {Proc. {ACM} Symp. on Principles of Programming Languages (POPL 2003)},
1022+ pages = {26--37},
1023+}
1024+
1025+@inproceedings{dsl-msp,
1026+ title = {{DSL} Implementation in {MetaOCaml}, {Template Haskell}, {and C++}},
1027+ booktitle = {Domain Specific Program Genearation 2004},
1028+ author = {Krzysztof Czarnecki and John O'Donnell and J\"{o}rg Striegnitz and Walid Taha},
1029+ publisher = {Springer},
1030+ series = {LNCS},
1031+ volume = {3016},
1032+ year = 2004
1033+}
1034+
1035+@misc{ gadt-extk,
1036+ author = {Tim Sheard and James Hook and Nathan Linger},
1037+ title = {{GADTs} + Extensible Kinds = Dependent Programming},
1038+ year = 2005,
1039+ misc = {Submitted to {ICFP} '05}
1040+}
1041+
1042+@INPROCEEDINGS{dt-framework,
1043+ TITLE = {A Dependently Typed Framework for Static Analysis of Program Execution Costs},
1044+ YEAR = {2006},
1045+ BOOKTITLE = {Proc. Implementation of Functional Languages (IFL 2005)},
1046+ AUTHOR = {Edwin Brady and Kevin Hammond},
1047+ VOLUME = {4015},
1048+ SERIES = {LNCS},
1049+ PAGES = {74--90},
1050+ PUBLISHER = {Springer}
1051+}
1052+
1053+@INPROCEEDINGS{step-counting,
1054+ TITLE = {Accurate Step Counting},
1055+ YEAR = {2006},
1056+ BOOKTITLE = {Proc. Implementation of Functional Languages (IFL 2005)},
1057+ AUTHOR = {Catherine Hope and Graham Hutton},
1058+ PUBLISHER = {Springer}
1059+}
1060+
1061+@misc{multi-taha,
1062+ author = {Walid Taha},
1063+ title = {{A Gentle Introduction to Multi-stage Programming}},
1064+ year = {2003},
1065+ note = {Available from \url{http://www.cs.rice.edu/~taha}},
1066+ notnote = {Available from \url{http://www.cs.rice.edu/~taha/publications/journal/dspg04a.pdf}}
1067+}
1068+
1069+@misc{mckinnabrady-phase,
1070+ title = {Phase Distinctions in the Compilation of {Epigram}},
1071+ year = 2005,
1072+ author = {James McKinna and Edwin Brady},
1073+ note = {Draft}
1074+}
1075+
1076+@phdthesis{ brady-thesis,
1077+ author = {Edwin Brady},
1078+ title = {Practical Implementation of a Dependently Typed Functional Programming Language},
1079+ year = 2005,
1080+ school = {University of Durham}
1081+}
1082+
1083+@phdthesis{ taha-thesis,
1084+ author = {Walid Taha},
1085+ title = {Multi-stage Programming: Its Theory and Applications},
1086+ year = 1999,
1087+ school = {Oregon Graduate Inst. of Science and Technology}
1088+}
1089+
1090+@phdthesis{ pasalic-thesis,
1091+ author = {Emir Pa\v{s}al\'{i}c},
1092+ title = {The Role of Type-Equality in Meta-programming},
1093+ year = 2004,
1094+ school = {OGI School of Science and Engineering}
1095+}
1096+
1097+@misc{ydtm,
1098+ author = {Thorsten Altenkirch and Conor McBride and James McKinna},
1099+ title = {Why Dependent Types Matter},
1100+ note = {Draft},
1101+ year = 2005}
1102+
1103+
1104+@inproceedings { wadler-listless,
1105+ author = {Philip Wadler},
1106+ title = {Listlessness is better than laziness: {Lazy} evaluation and garbage collection at compile-time},
1107+ booktitle = {Proceedings of the 1984 {ACM} Symposium on LISP and functional programming},
1108+ year = 1984,
1109+ pages = {45--52}
1110+}
1111+
1112+@techreport { gofer-impl,
1113+ author = {Mark P. Jones},
1114+ title = {The implementation of the Gofer functional programming system},
1115+ month = {May},
1116+ year = {1994},
1117+ number = {YALEU/DCS/RR-1030},
1118+ institution = {Yale University}
1119+}
1120+
1121+@techreport { pm-opt1,
1122+ author = {Kevin Scott and Norman Ramsey},
1123+ title = {When do match-compilation heuristics matter?},
1124+ month = {May},
1125+ year = {2000},
1126+ number = {CS-2000-13},
1127+ institution = {Department of Computer Science, University of Virginia}
1128+}
1129+
1130+@inproceedings{ pm-opt2,
1131+ author = "Fabrice Le Fessant and Luc Maranget",
1132+ title = "Optimizing Pattern Matching",
1133+ booktitle = "International Conference on Functional Programming",
1134+ pages = "26-37",
1135+ year = "2001",
1136+ url = "citeseer.ist.psu.edu/lefessant01optimizing.html" }
1137+
1138+@incollection{con-engine,
1139+ author = {G\'{e}rard Huet},
1140+ title = {The constructive engine},
1141+ booktitle = {A Perspective in Theoreticak Computer Science},
1142+ publisher = {World Scientific Publishing},
1143+ year = {1989},
1144+ editor = {R. Narasimhan},
1145+ note = {Commemorative Volume for Gift Siromoney},
1146+ pages = {38--69}
1147+}
1148+
1149+@inproceedings{gadts,
1150+ title = {Simple unification-based type inference for {GADTs}},
1151+ author = {Simon {Peyton Jones} and Dimitrios Vytiniotis and Stephanie Weirich and Geoffrey Washburn},
1152+ year = {2006},
1153+ booktitle = {Proc. 2006 International Conf. on Functional Programming ({ICFP} 2006)}
1154+}
1155+
1156+@misc{wobbly,
1157+ author = {Simon {Peyton Jones} and Geoffrey Washburn and Stephanie Weirich},
1158+ title = {Wobbly types: type inference for generalised algebraic data types},
1159+ year = {2004},
1160+ note = {Submitted to POPL 2005}
1161+}
1162+
1163+@misc{epigram-afp,
1164+ author = {Conor McBride},
1165+ title = {Epigram: Practical Programming with Dependent Types},
1166+ year = {2004},
1167+ howpublished = {Lecture Notes, International Summer School on Advanced Functional Programming}
1168+}
1169+
1170+@book{ml85,
1171+ author = {Per Martin-L\"{o}f},
1172+ title = "Intuitionistic Type Theory",
1173+ year = "1985",
1174+ publisher = "Bibliopolis"
1175+}
1176+
1177+@article{modular-fulllazy,
1178+ title = {A Modular Fully Lazy Lambda Lifter in {Haskell}},
1179+ author = {Simon {Peyton Jones} and David Lester},
1180+ year = {1991},
1181+ month = {May},
1182+ journal = {Software Practice and Experience},
1183+ volume = {21},
1184+ number = {5},
1185+ pages = {479--506}
1186+}
1187+
1188+@article{ghani-jay95,
1189+ author = {Barry Jay and Neil Ghani},
1190+ title = {The Virtues of Eta-Expansion},
1191+ journal = {Journal of Functional Programming},
1192+ year = {1995},
1193+ volume = {5},
1194+ number = {2},
1195+ pages = {135-154},
1196+}
1197+
1198+@misc{nkpat,
1199+ author = {Lennart Augustsson},
1200+ title = {n+k patterns},
1201+ year = {1993},
1202+ howpublished = {Message to the haskell mailing list, Mon, 17 May 93}
1203+}
1204+
1205+@article{ danvy98functional,
1206+ author = "Olivier Danvy",
1207+ title = "Functional Unparsing",
1208+ journal = "Journal of Functional Programming",
1209+ volume = "8",
1210+ number = "6",
1211+ pages = "621-625",
1212+ year = "1998",
1213+ url = "citeseer.ist.psu.edu/danvy98functional.html" }
1214+
1215+@inproceedings{SeveriPoll94,
1216+ author = {Paula Severi and Erik Poll},
1217+ booktitle = {Logical Foundations of Computing Science, LFCS'94},
1218+ editor = {A. Nerode and Yu. V. Matiyasevich},
1219+ number = {813},
1220+ pages = {316--328},
1221+ publisher = {Springer},
1222+ series = {LNCS},
1223+ title = {{P}ure {T}ype {S}ystems with {D}efinitions},
1224+ year = {1994}
1225+}
1226+
1227+@inproceedings{coinductive,
1228+ title = {An Application of Co-Inductive Types in Coq: Verification of the Alternating Bit Protocol},
1229+ booktitle = {Proceedings of the 1995 Workshop on Types for Proofs and Programs},
1230+ series = {LNCS},
1231+ year = {1995},
1232+ volume = {1158},
1233+ pages = {135-152},
1234+ publisher = {Springer-Verlag},
1235+ author = {Eduardo Gim\'{e}nez}
1236+}
1237+
1238+@book{erlang,
1239+ author = "Joe Armstrong and Robert Virding and Claes Wikstr{\"o}m and Mike Williams",
1240+ title = "Concurrent Programming in Erlang",
1241+ edition = "Second",
1242+ publisher = "Prentice-Hall",
1243+ year = "1996",
1244+ url = "citeseer.ist.psu.edu/armstrong93concurrent.html"
1245+}
1246+
1247+@PhdThesis{alti:phd93,
1248+ author = "Thorsten Altenkirch",
1249+ title = "Constructions, Inductive Types and Strong Normalization",
1250+ school = "University of Edinburgh",
1251+ year = "1993",
1252+ month = "November",
1253+}
1254+
1255+@inproceedings{coq-modules,
1256+ author = "Jacek Chrzaszcz",
1257+ title = "Modules in {Coq} Are and Will Be Correct",
1258+ year = {2004},
1259+ booktitle = {Types for Proofs and Programs 2003},
1260+ editor = {Stefano Berardi and Mario Coppo and Ferruccio Damiani},
1261+ publisher = {Springer},
1262+ volume = {3085}
1263+}
1264+
1265+@inproceedings{comp-polymorphism,
1266+ author = "Robert Harper and Greg Morrisett",
1267+ title = "Compiling Polymorphism Using Intensional Type Analysis",
1268+ year = "1995",
1269+ booktitle = "Proceedings of the 22nd {ACM} {SIGPLAN}-SIGACT symposium on Principles of programming languages",
1270+ pages = "130 -- 141"
1271+}
1272+
1273+@misc{runtime-loader,
1274+ author = "Andre Pang",
1275+ title = "{GHC} Runtime Loading",
1276+ year = "2004",
1277+ howpublished = {Available from \verb+http://www.algorithm.com.au/wiki/hacking/haskell.ghc_runtime_loading+}
1278+}
1279+
1280+@article{mccarthy-lisp,
1281+ author = "John McCarthy",
1282+ title = "Recursive Functions of Symbolic Expressions and Their Computation By Machine",
1283+ year = "1960",
1284+ journal = "Communications of the {ACM}",
1285+ volume = "3",
1286+ number = "4",
1287+ pages = "184--195"
1288+}
1289+
1290+@book{stl,
1291+ author = " David R. Musser and Atul Saini and Gillmer J. Derge",
1292+ title= "The {STL} Tutorial and Reference Guide: {C++} Programming with the Standard Template Library",
1293+ year = "2001",
1294+ publisher = "Addison Wesley"
1295+}
1296+
1297+@misc{ phase-distinction,
1298+ author = "Luca Cardelli",
1299+ title = "Phase Distinctions in Type Theory",
1300+ howpublished = "Manuscript",
1301+ year = "1988",
1302+ url = "citeseer.ist.psu.edu/cardelli88phase.html" }
1303+
1304+@book {pierce-types,
1305+ author = "Benjamin C. Pierce",
1306+ title = "Type and Programming Languages",
1307+ year = "2002",
1308+ publisher = "MIT Press"
1309+}
1310+
1311+@article{ coqcc,
1312+ Author = "Thierry Coquand and G\'{e}rard Huet",
1313+ title = "The calculus of constructions",
1314+ year = "1988",
1315+ journal = "Information and Computation",
1316+ volume = "76",
1317+ pages = "95--120"
1318+}
1319+
1320+@article{ miller91jlc,
1321+ Author = "Dale Miller",
1322+ Title = "A Logic Programming Language with Lambda-Abstraction,
1323+ Function Variables, and Simple Unification",
1324+ Journal = "Journal of Logic and Computation",
1325+ Volume = "1",
1326+ Number = "4",
1327+ Pages = "497-536",
1328+ Year = "1991",
1329+ URL = "citeseer.ist.psu.edu/miller91logic.html",
1330+ URL = "file://ftp.cis.upenn.edu/pub/papers/miller/jlc91.dvi.Z" }
1331+
1332+@article{miller-unity,
1333+ author = "Dale Miller",
1334+ title = "Unification Under a Mixed Prefix",
1335+ journal = "Journal of Symbolic Computation",
1336+ volume = "14",
1337+ pages = "321--358",
1338+ year = 1992
1339+}
1340+
1341+@inproceedings{ cynthia,
1342+ author = "Jon Whittle and Alan Bundy and Richard J. Boulton and Helen Lowe",
1343+ title = "An {ML} Editor Based on Proofs-As-Programs",
1344+ booktitle = "Automated Software Engineering",
1345+ pages = "166-173",
1346+ year = "1999",
1347+ url = "citeseer.ist.psu.edu/whittle99ml.html" }
1348+
1349+
1350+@misc{ewd340,
1351+ title={The Humble Programmer},
1352+ author={Edsger Dijkstra},
1353+ year={1972},
1354+ note={Turing Award Lecture, EWD 340}
1355+}
1356+
1357+@misc{fortran,
1358+ title={Specifications for the {IBM} Mathematical FORmula TRANslating System, {FORTRAN}},
1359+ author={{IBM Applied Science Division}},
1360+ key={IBM},
1361+ year={1954},
1362+ month={November}
1363+}
1364+
1365+@inproceedings{quickcheck,
1366+ title = {{QuickCheck}: A Lightweight Tool For Random Testing Of {Haskell} Programs},
1367+ author = {Koen Claessen and John Hughes},
1368+ year = {2000},
1369+ booktitle = {International Conference on Functional Programming}
1370+}
1371+
1372+@inproceedings{currylam,
1373+ title = {Functionality in Combinatory Logic},
1374+ author = {Haskell Curry},
1375+ year = {1934},
1376+ booktitle = {Proc. Nat. Acad. Sci, USA},
1377+ volume = {20},
1378+ pages = {584--590}
1379+}
1380+
1381+@article{churchsimplelam1,
1382+ title = {A set of postulates for the foundation of logic},
1383+ author = {Alonzo Church},
1384+ year = {1932},
1385+ journal = {Annals of Mathematics},
1386+ volume = {2},
1387+ number = {33},
1388+ pages = {346--366}
1389+}
1390+
1391+@article{churchsimplelam2,
1392+ title = {A set of postulates for the foundation of logic},
1393+ author = {Alonzo Church},
1394+ year = {1933},
1395+ journal = {Annals of Mathematics},
1396+ volume = {2},
1397+ number = {34},
1398+ pages = {839--864}
1399+}
1400+
1401+@article{churchlam,
1402+ title = {A Formulation of the Simple Theory of Types},
1403+ author = {Alonzo Church},
1404+ year = {1940},
1405+ journal = {Journal of Symbolic Logic},
1406+ volume = {5},
1407+ pages = {56--58}
1408+}
1409+
1410+@book{mitchell,
1411+ title = {Concepts in Programming Languages},
1412+ author = {John C. Mitchell},
1413+ year = {2003},
1414+ publisher = {Cambridge University Press}
1415+}
1416+
1417+@inproceedings{harrison-hol99,
1418+ title = {A Machine-Checked Theory of Floating Point Arithmetic},
1419+ year = {1999},
1420+ booktitle = {Theorem Proving in Higher Order Logics: 12th International Conference, TP},
1421+ pages = {113--130},
1422+ author = {John Harrison},
1423+ crossref = {hol99}
1424+}
1425+
1426+@inproceedings{c--,
1427+ title = {C--: A portable assembly language},
1428+ year = {1997},
1429+ booktitle = {Workshop on Implementing Functional Languages, St Andrews},
1430+ author = {Simon {Peyton Jones} and Thomas Nordin and Dino Oliva},
1431+ crossref = {func-imp97}
1432+}
1433+
1434+@proceedings{func-imp97,
1435+ title = {Workshop on Implementing Functional Languages, St Andrews},
1436+ year = {1997},
1437+ editor = {C Clack},
1438+ publisher = {Springer-Verlag}
1439+}
1440+
1441+@proceedings{hol99,
1442+ volume = {1690},
1443+ title = {Theorem Proving in Higher Order Logics: 12th International Conference, TPHOLs'99},
1444+ year = {1999},
1445+ editor = {Yves Bertot and Gilles Dowek and Andr{\'e} Hirschowitz and Christine Paul},
1446+ publisher = {Springer-Verlag},
1447+ address = {Nice, France},
1448+ series = {LNCS}
1449+}
1450+
1451+@book{mathlogic,
1452+ title = {Mathematical Logic and Programming Languages},
1453+ year = {1985},
1454+ editor = {C.A.R. Hoare and J.C. Shepherdson},
1455+ publisher = {Prentice-Hall}
1456+}
1457+
1458+@book{automath,
1459+ title = {Selected Papers on Automath},
1460+ year = {1994},
1461+ editor = {S. Abramsky and J. Barwise and K. Fine and H.J. Keisler and A.S. Troelstr},
1462+ publisher = {North-Holland}
1463+}
1464+
1465+@misc{gimps,
1466+ howpublished = {http://www.mersenne.org/prime.htm},
1467+ title = {Great Internet Mersenne Prime Search}
1468+}
1469+
1470+@misc{haskell-report,
1471+ title = {Haskell 98 Language and Libraries --- The Revised Report},
1472+ year = {2002},
1473+ month = {December},
1474+ author = {Simon {Peyton Jones} and others},
1475+ howpublished = {Available from \verb+http://www.haskell.org/+}
1476+}
1477+
1478+@inproceedings{cayenne-{ICFP},
1479+ author = "Lennart Augustsson",
1480+ title = "Cayenne - a Language with Dependent Types",
1481+ booktitle = "Proc. 1998 International Conf. on Functional Programming ({ICFP} '98)",
1482+ pages = "239--250",
1483+ year = "1998",
1484+ url = "citeseer.nj.nec.com/augustsson98cayenne.html"
1485+}
1486+
1487+
1488+@misc{equality-cayenne,
1489+ howpublished = {\verb+http://www.cs.chalmers.se/~augustss/cayenne/+},
1490+ title = {Equality Proofs in Cayenne},
1491+ year = {1999},
1492+ author = {Lennart Augustsson}
1493+}
1494+
1495+@misc{interp-cayenne,
1496+ title = {An exercise in dependent types: A well-typed interpreter},
1497+ year = {1999},
1498+ author = {Lennart Augustsson and Magnus Carlsson}
1499+}
1500+
1501+@inproceedings{balaa00fixpoint,
1502+ title = {Fix-Point Equations for Well-Founded Recursion in Type Theory},
1503+ year = {2000},
1504+ booktitle = {Theorem Proving in Higher Order Logics},
1505+ pages = {1-16},
1506+ author = {Antonia Balaa and Yves Bertot}
1507+}
1508+
1509+@inproceedings{isabelle-maple,
1510+ title = {Theorems and algorithms: An interface between Isabelle and Maple},
1511+ year = {1995},
1512+ booktitle = {International Symposium on Symbolic and Algebraic Computation},
1513+ author = {Ballarin, C. and Homann, K., and Calmet, J.}
1514+}
1515+
1516+@book{barendregt-num,
1517+ title = {The Lambda Calculus, Its Syntax and Semantics},
1518+ year = {1984},
1519+ publisher = {North-Holland},
1520+ author = {Henk Barendregt}
1521+}
1522+
1523+@book{beiler,
1524+ title = {Recreations in the Theory of Numbers},
1525+ year = {1964},
1526+ publisher = {Dover},
1527+ author = {Albert H. Beiler}
1528+}
1529+
1530+@article{multidigit,
1531+ journal = {Advances in Applied Mathematics},
1532+ title = {Multidigit Multiplication for Mathematicians},
1533+ year = {1998},
1534+ author = {Daniel J. Bernstein}
1535+}
1536+
1537+@article{buhler-fox,
1538+ journal = {{ACM} Crossroads 2.1.},
1539+ month = {September},
1540+ title = {The Fox project: A language-structured approach to networking software.},
1541+ year = {1995},
1542+ author = {Buhler, J.},
1543+ note = {Available at http://www.{ACM}.org/crossroads/xrds2-1/foxnet.html}
1544+}
1545+
1546+@techreport{burstall91,
1547+ title = {Computer Assisted Proof for Mathematics: an Introduction Using the \textsc{Lego} Proof System},
1548+ year = {1991},
1549+ institution = {University of Edinburgh},
1550+ author = {Rod Burstall}
1551+}
1552+
1553+@article{plastic,
1554+ title = {An Implementation of {LF} with Coercive Subtyping and Universes},
1555+ author = {Paul Callaghan and Zhaohui Luo},
1556+ journal = {Journal of Automated Reasoning},
1557+ volume = {27},
1558+ number = {1},
1559+ pages = {3--27},
1560+ year = {2001}
1561+}
1562+
1563+@article{coercive,
1564+ title = {Coercive subtyping},
1565+ author = {Zhaohui Luo},
1566+ journal = {J. Logic Comput.},
1567+ volume = {9},
1568+ number = {1},
1569+ year = {1991},
1570+ pages = {105--130}
1571+}
1572+
1573+@inproceedings{calmet-homann,
1574+ title = {Classification of communication and cooperation mechanisms for logical and symbolic computation systems},
1575+ year = {1996},
1576+ booktitle = {Proceedings of the First International Workshop 'Frontiers of Combining S},
1577+ pages = {133-146},
1578+ publisher = {Kluwer},
1579+ author = {J. Calmet and K. Homann}
1580+}
1581+
1582+@techreport{comm-proofs,
1583+ title = {On Communicating Proofs in Interactive Mathematical Documents},
1584+ year = {2000},
1585+ institution = {Eindhoven University of Technology},
1586+ author = {Olga Caprotti and Martijn Oostdijk}
1587+}
1588+
1589+@article{prime2999,
1590+ title = {How to formally and efficiently prove Prime(2999)},
1591+ year = {2001},
1592+ author = {Olga Caprotti and Martijn Oostdijk},
1593+ journal = {Symbolic Computation and Automated Reasoning},
1594+ pages = {114--125}
1595+}
1596+
1597+@book{church-num,
1598+ title = {The Calculi of Lambda-Conversion},
1599+ year = {1941},
1600+ publisher = {Princeton University Press},
1601+ author = {Alonzo Church}
1602+}
1603+
1604+@book{nuprl86,
1605+ title = {Implementing Mathematics with the NuPrl Proof Development System},
1606+ year = {1986},
1607+ publisher = {Prentice-Hall},
1608+ address = {NJ},
1609+ author = {Constable, Robert L. and others}
1610+}
1611+
1612+@book{conway,
1613+ title = {On Numbers and Games},
1614+ year = {1976},
1615+ publisher = {Academic Press},
1616+ author = {J.H. Conway}
1617+}
1618+
1619+@misc{coq-manual,
1620+ howpublished = {\verb+http://coq.inria.fr/+},
1621+ title = {The {Coq} Proof Assistant --- Reference Manual},
1622+ year = {2009},
1623+ author = {{Coq Development Team}}
1624+}
1625+
1626+@misc{tt-prog,
1627+ month = {June},
1628+ title = {Type Theory and Programming},
1629+ year = {1994},
1630+ author = {Thierry Coquand and Bengt Nordstr\"{o}m and Jan M. Smith and Bj\"{o}rn von Sydow}
1631+}
1632+
1633+@book{func-appr,
1634+ title = {The Functional Approach to Programming},
1635+ year = {1998},
1636+ publisher = {Cambridge University Press},
1637+ author = {Guy Cousineau and Michel Mauny}
1638+}
1639+
1640+@misc{ibmspec,
1641+ howpublished = {http://www2.hursley.ibm.com/decimal/},
1642+ month = {January},
1643+ title = {Standard Decimal Arithmetic Specification},
1644+ year = {2001},
1645+ author = {Mike Cowlishaw},
1646+ note = {\copyright IBM Corporation 2001}
1647+}
1648+
1649+@book{dummett,
1650+ title = {Elements of Intuitionism},
1651+ year = {2000},
1652+ edition = {2nd},
1653+ publisher = {Oxford: Clarendon},
1654+ author = {Michael A.E. Dummet}
1655+}
1656+
1657+@article{dybjer94,
1658+ title = {Inductive Families},
1659+ year = {1994},
1660+ author = {Peter Dybjer},
1661+ journal = {Formal Aspects Of Computing},
1662+ volume = {6},
1663+ pages = {440--465}
1664+}
1665+
1666+@misc{octave,
1667+ howpublished = {http://www.octave.org/},
1668+ month = {February},
1669+ title = {GNU Octave -- A high-level interactive language for numerical computations},
1670+ year = {1997},
1671+ author = {John W. Eaton}
1672+}
1673+
1674+@book{comp-methods,
1675+ title = {Computing methods for scientists and engineers},
1676+ year = {1968},
1677+ publisher = {Oxford : Clarendon Press},
1678+ author = {L. Fox and D.F. Mayers}
1679+}
1680+
1681+@misc{guile,
1682+ howpublished = {http://www.gnu.org/software/guile/guile.html},
1683+ title = {Guile -- Project GNU's extension language},
1684+ year = {2001},
1685+ author = {{Free Software Foundation}}
1686+}
1687+
1688+@article{need-dep,
1689+ journal = {Journal of Functional Programming},
1690+ number = {4},
1691+ volume = {10},
1692+ title = {Do we need dependent types?},
1693+ year = {2000},
1694+ pages = {409-415},
1695+ author = {Daniel Fridlender and Mia Indrika}
1696+}
1697+
1698+@book{primes-programming,
1699+ title = {Primes and Programming -- An Introduction to Number Theory with Computing},
1700+ year = {1993},
1701+ publisher = {Cambridge University Press},
1702+ author = {Peter Giblin}
1703+}
1704+
1705+@misc{rec-coq,
1706+ month = {May},
1707+ title = {A Tutorial on Recursive Types in \textsc{Coq}},
1708+ year = {1998},
1709+ author = {Eduardo Gim\'{e}nez}
1710+}
1711+
1712+@article{goldberg91,
1713+ journal = {{ACM} Computing Surveys},
1714+ number = {1},
1715+ volume = {23},
1716+ title = {What every computer scientist should know about floating point arithmetic},
1717+ year = {1991},
1718+ pages = {5-48},
1719+ author = {D. Goldberg}
1720+}
1721+
1722+@article{binary-lambda,
1723+ journal = {Journal of Functional Programming},
1724+ number = {6},
1725+ volume = {10},
1726+ title = {An adequate and efficient left associated binary numeral system in the $\lambda$-calculus},
1727+ year = {2000},
1728+ author = {Mayer Goldberg}
1729+}
1730+
1731+@book{hol,
1732+ title = {Introduction to HOL},
1733+ year = {1993},
1734+ publisher = {Cambridge University Press},
1735+ author = {M. Gordon and T. Melham}
1736+}
1737+
1738+@misc{gmp,
1739+ howpublished = {Available from \verb+http://www.swox.com/gmp/manual/+},
1740+ title = {The {GNU Multiple Precision} Arithmetic Library 4.1.3 --- Manual},
1741+ year = {2004},
1742+ author = {Torbj\"{o}rn Granlund and others}
1743+}
1744+
1745+@article{harrison-fmsd94,
1746+ journal = {Formal Methods in System Design},
1747+ volume = {5},
1748+ title = {Constructing the Real Numbers in {HOL}},
1749+ year = {1994},
1750+ pages = {35--59},
1751+ author = {John Harrison}
1752+}
1753+
1754+@book{harrison-thesis,
1755+ title = {Theorem Proving with the Real Numbers},
1756+ year = {1998},
1757+ publisher = {Springer-Verlag},
1758+ author = {John Harrison}
1759+}
1760+
1761+@techreport{hol-maple,
1762+ title = {Reasing about the Reals: the marriage of HOL and Maple},
1763+ year = {1993},
1764+ institution = {University of Cambridge Computer Laboratory},
1765+ author = {John Harrison and Laurent Th\'{e}ry}
1766+}
1767+
1768+@misc{coq-tutorial,
1769+ howpublished = {http://pauillac.inria.fr/coq},
1770+ title = {The \textsc{Coq} Proof Assistant - A Tutorial},
1771+ author = {G\'{e}rard Huet and Gilles Kahn and Christine Paulin-Mohring}
1772+}
1773+
1774+@misc{restr-haskell,
1775+ howpublished = {http://citeseer.nj.nec.com/253599.html},
1776+ month = {September},
1777+ title = {Restricted Data Types in Haskell},
1778+ year = {1999},
1779+ author = {John Hughes}
1780+}
1781+
1782+@misc{javadec,
1783+ howpublished = {http://www2.hursley.ibm.com/decimalj/decimald.html},
1784+ month = {September},
1785+ title = {Decimal Arithmetic for Java -- a Proposal},
1786+ year = {2000},
1787+ author = {{IBM Corporation}}
1788+}
1789+
1790+@misc{ieee754,
1791+ title = {{IEEE} Standard for Binary Floating Point Arithmetic},
1792+ year = {1985},
1793+ author = {{IEEE Standard 754}}
1794+}
1795+
1796+@misc{ieee854,
1797+ title = {IEEE Standard for Radix-Independent Floating-Point Arithmetic},
1798+ year = {1987},
1799+ author = {{IEEE Standard 854}}
1800+}
1801+
1802+@inproceedings{jon91,
1803+ title = {Completing the Rational and Metric Spaces in \textsc{Lego}},
1804+ year = {1991},
1805+ booktitle = {Proceedings of the Second Workshop on Logical Frameworks},
1806+ author = {Claire Jones}
1807+}
1808+
1809+@misc{ typinghaskell,
1810+ author = "Mark Jones",
1811+ title = "Typing {Haskell} in {Haskell}",
1812+ howpublished = "In Haskell Workshop, September 1999.",
1813+ year = "1999",
1814+ url = "citeseer.ist.psu.edu/article/jones99typing.html" }
1815+
1816+@article{karatsuba,
1817+ journal = {Soviet Physics-Doklady},
1818+ volume = {7},
1819+ title = {Multiplication of multidigit numbers by automata},
1820+ year = {1963},
1821+ pages = {595--596},
1822+ author = {A. Karatsuba and Y. Ofman}
1823+}
1824+
1825+@book{knuth2,
1826+ volume = {2},
1827+ title = {The Art of Computer Programming - Seminumerical Algorithms},
1828+ year = {1969},
1829+ publisher = {Addison Wesley},
1830+ author = {Donald E. Knuth}
1831+}
1832+
1833+@article{next700,
1834+ journal = {Communications of the {ACM}},
1835+ number = {3},
1836+ month = {March},
1837+ volume = {9},
1838+ title = {The next 700 programming languages},
1839+ year = {1966},
1840+ author = {P.J. Landin}
1841+}
1842+
1843+@techreport{luo-spec,
1844+ month = {January},
1845+ title = {Program Specification and Data Refinement in Type Theory},
1846+ year = {1993},
1847+ institution = {Department of Computer Science, University of Edinburgh},
1848+ author = {Zhaohui Luo}
1849+}
1850+
1851+@phdthesis{luo90,
1852+ school = {University of Edinburgh},
1853+ title = {An Extended Calculus Of Constructions},
1854+ year = {1990},
1855+ author = {Zhaohui Luo}
1856+}
1857+
1858+@techreport{lego-manual,
1859+ title = {\textsc{Lego} Proof Development System: User's Manual},
1860+ year = {1992},
1861+ institution = {Department of Computer Science, University of Edinburgh},
1862+ author = {Zhaohui Luo and Robert Pollack}
1863+}
1864+
1865+@inproceedings{alf,
1866+ title = {The {ALF} proof editor and its proof engine},
1867+ year = {1994},
1868+ booktitle = {Formal Proceeding of the 1993 Workshop on Types for Proofs and Programs},
1869+ author = {Lena Magnusson and Bengt N\"{o}rdstrom}
1870+}
1871+
1872+@misc{happy,
1873+ howpublished = {http://www.haskell.org/happy/},
1874+ title = {Happy User Guide},
1875+ year = {2001},
1876+ author = {Simon Marlow and Andy Gill}
1877+}
1878+
1879+@inproceedings{generic-haskell,
1880+ title = {Generic Haskell, Specifically},
1881+ author = {Dave Clarke and Andres L\"{o}h},
1882+ editor = {Jeremy Gibbons and Johan Jeuring},
1883+ booktitle = {Proceedings of the IFIP TC2 Working Conference on Generic Programming},
1884+ year = {2002},
1885+ publisher = {Kluwer Academic Publishers},
1886+ pages = {21--48}
1887+}
1888+
1889+@article{faking-it,
1890+ title = {Faking It -- Simulating Dependent Types in {Haskell}},
1891+ year = {2002},
1892+ author = {Conor McBride},
1893+ journal = {Journal of Functional Programming},
1894+ volume = {12},
1895+ number = {4+5},
1896+ pages = {375--392}
1897+}
1898+
1899+@misc{mcbride-inverting,
1900+ title = {Inverting Inductively Defined Relations in \textsc{Lego}},
1901+ year = {1996},
1902+ author = {Conor McBride}
1903+}
1904+
1905+@phdthesis{mcbride-thesis,
1906+ month = {May},
1907+ school = {University of Edinburgh},
1908+ title = {Dependently Typed Functional Programs and their proofs},
1909+ year = {2000},
1910+ author = {Conor McBride}
1911+}
1912+
1913+@article{mcbride-unification,
1914+ title = {First-Order Unification by Structural Recursion},
1915+ year = {2003},
1916+ author = {Conor McBride},
1917+ journal = {Journal of Functional Programming},
1918+ volume = {13},
1919+ number = {6},
1920+ pages = {1061--1075}
1921+}
1922+
1923+@misc{mckinna-pollack,
1924+ howpublished = {Kluwer Academic Publishers},
1925+ title = {Some Lambda Calculus and Type Theory formalized},
1926+ year = {1998},
1927+ author = {James McKinna and Robert Pollack}
1928+}
1929+
1930+@book{num-theory,
1931+ title = {An Introduction to the Theory of Numbers},
1932+ year = {1980},
1933+ publisher = {John Wiley and Sons},
1934+ author = {Ivan Niven and Herbert S. Zuckerman}
1935+}
1936+
1937+@book{prog-mltt,
1938+ title = {Programming in Martin-L\"{o}f's Type Theory -- An Introduction},
1939+ year = {1990},
1940+ publisher = {Oxford University Press},
1941+ author = {Bengt Nordstr\"{o}m and Kent Petersson and Jan M. Smith},
1942+ note = {Out of print. Available from http://www.cs.chalmers.se/Cs/Research/Logic}
1943+}
1944+
1945+@book{okasaki,
1946+ title = {Purely Functional Data Structures},
1947+ year = {1998},
1948+ publisher = {Cambridge University Press},
1949+ author = {Chris Okasaki}
1950+}
1951+
1952+@book{arith-systems,
1953+ title = {Computer Arithmetic Systems},
1954+ year = {1994},
1955+ publisher = {Prentice-Hall},
1956+ author = {Amos R. Omondi}
1957+}
1958+
1959+@book{pj-imp,
1960+ title = {The Implementation of Functional Programming Languages},
1961+ year = {1987},
1962+ publisher = {Prentice-Hall},
1963+ author = {Simon {Peyton Jones}}
1964+}
1965+
1966+@book{cp-bjc,
1967+ title = {Computational Numerical Methods},
1968+ year = {1986},
1969+ publisher = {John Wiley and Sons},
1970+ author = {C. Phillips and B. Cornelius}
1971+}
1972+
1973+@book{nag,
1974+ title = {The NAG Library: a beginner's guide},
1975+ year = {1986},
1976+ publisher = {Oxford : Clarendon Press},
1977+ author = {Jen Phillips}
1978+}
1979+
1980+@misc{believe,
1981+ month = {September},
1982+ title = {How to Believe a Machine-Checked Proof},
1983+ year = {1996},
1984+ author = {Robert Pollack}
1985+}
1986+
1987+@phdthesis{pollack94,
1988+ school = {University of Edinburgh},
1989+ title = {The Theory of LEGO -- A Proof Checker for the Extended Calculus of Constructions},
1990+ year = {1994},
1991+ author = {Robert Pollack}
1992+}
1993+
1994+@inproceedings{intel-bug,
1995+ series = {LNCS},
1996+ volume = {915},
1997+ title = {Anatomy of the Pentium Bug},
1998+ publisher = {Springer-Verlag},
1999+ year = {1995},
2000+ pages = {97--107},
2001+ author = {V.R. Pratt}
2002+}
2003+
2004+@book{maple,
2005+ title = {The Maple Handbook: Maple V Release 4},
2006+ year = {1996},
2007+ publisher = {Springer},
2008+ author = {Darren Redfern}
2009+}
2010+
2011+@book{crypto,
2012+ title = {Applied Cryptography: protocols, algorithms and source code in C.},
2013+ year = {1996},
2014+ publisher = {Wiley},
2015+ author = {Bruce Schneier}
2016+}
2017+
2018+@article{adts,
2019+ journal = {Mathematical Structures in Computer Science},
2020+ number = {2},
2021+ volume = {10},
2022+ title = {On lists and other abstract data types in the calculus of construction},
2023+ year = {2000},
2024+ pages = {261-276},
2025+ author = {Jonathan P. Seldin}
2026+}
2027+
2028+@article{seldin97,
2029+ journal = {Annals of Pure and Applied Logic},
2030+ number = {1},
2031+ month = {January},
2032+ volume = {83},
2033+ title = {On the proof theory of Coquand's calculus of constructions},
2034+ year = {1997},
2035+ pages = {23--101},
2036+ author = {Jonathan P. Seldin}
2037+}
2038+
2039+@article{wichmann,
2040+ journal = {The Computer Journal},
2041+ volume = {32},
2042+ title = {Towards a Formal Specification of Floating Point},
2043+ year = {1989},
2044+ pages = {432-436},
2045+ author = {B.A. Wichmann}
2046+}
2047+
2048+@book{mathematica,
2049+ title = {Mathematica : a system for doing mathematics by computer},
2050+ year = {1991},
2051+ publisher = {Addison Wesley},
2052+ author = {Stephen Wolfram}
2053+}
2054+
2055+@inproceedings{xi-imp,
2056+author = "Hongwei Xi",
2057+title = {{Imperative Programming with Dependent Types}},
2058+booktitle = "Proceedings of 15th {IEEE} Symposium on Logic in Computer Science",
2059+year = 2000,
2060+month = "June",
2061+address = "Santa Barbara",
2062+pages = "375--387"
2063+}
2064+
2065+@phdthesis{xi-thesis,
2066+ month = {December},
2067+ school = {Department of Mathematical Sciences, Carnegie Mellon University},
2068+ title = {Dependent Types in Practical Programming},
2069+ year = {1998},
2070+ author = {Hongwei Xi}
2071+}
2072+
2073+
2074+@techreport{dtal,
2075+author = {Hongwei Xi and Robert Harper},
2076+title = {A Dependently Typed Assembly Language},
2077+institution = {Computer Science and Engineering Department, Oregon Graduate Institute},
2078+year = 1999,
2079+number = {OGI-CSE-99-008},
2080+month = {July},
2081+}
2082+
2083+@misc{bignum-cmp,
2084+ month = {February},
2085+ title = {Comparison of three public-domain multiprecision libraries: BigNum, Gmp and Pari},
2086+ year = {1998},
2087+ author = {Paul Zimmerman}
2088+}
2089+
2090+@book{perl,
2091+ title = {Programming Perl},
2092+ author = {Larry Wall and Tom Christiansen and Jon Orwant},
2093+ year = {2000},
2094+ edition = {3rd},
2095+ publisher = {O'Reilly}
2096+}
2097+
2098+@misc{python,
2099+ howpublished = {http://www.python.org/doc/current/tut/tut.html},
2100+ month = {April},
2101+ title = {Python Tutorial},
2102+ year = {2001},
2103+ author = {Guido van {Rossum} and Fred L. {Drake, Jr}}
2104+}
2105+
2106+@book{logic,
2107+ title = {The Language of First Order Logic},
2108+ year = {1992},
2109+ publisher = {CSLI Lecture Notes},
2110+ author = {Jon Barwise and John Etchemendy}
2111+}
2112+
2113+@book{haskell,
2114+ title = {Haskell -- The Craft of Functional Programming},
2115+ year = {1999},
2116+ publisher = {Addison Wesley},
2117+ author = {Simon Thompson}
2118+}
2119+
2120+@inproceedings{coq-hol,
2121+ title = {A Comparative Study of Coq and HOL},
2122+ year = {1997},
2123+ booktitle = {Theorem Proving in Higher Order Logics},
2124+ pages = {323-337},
2125+ author = {Vincent Zammit}
2126+}
2127+
2128+@misc{gay90,
2129+ month = {November},
2130+ title = {Correctly Rounded Binary-Decimal and Decimal-Binary Conversions},
2131+ year = {1990},
2132+ author = {David M. Gay},
2133+ note = {AT&T Bell Laboratories, Numerical Analysis Manuscript 90-10}
2134+}
2135+
2136+@article{hughes-matters,
2137+ journal = {Computer Journal},
2138+ number = {2},
2139+ volume = {32},
2140+ title = {Why Functional Programming Matters},
2141+ year = {1989},
2142+ pages = {98--107},
2143+ author = {J. Hughes}
2144+}
2145+
2146+@inproceedings{proofpointing,
2147+ title = {Proof by Pointing},
2148+ year = {1994},
2149+ booktitle = {Proceedings of the International Symposium on Theoretical Aspects of Computer So},
2150+ pages = {141--160},
2151+ editor = {M. Hagiya and J. C. Mitchell},
2152+ publisher = {Springer-Verlag},
2153+ series = {LNCS},
2154+ volume = {789},
2155+ address = {Sendai, Japan},
2156+ author = {Yves Bertot and Gilles Kahn and Laurent Th{\'e}ry}
2157+}
2158+
2159+@misc{inductive-coq,
2160+ month = {December},
2161+ title = {Inductive Definitions in the System Coq -- Rules and Properties},
2162+ year = {1992},
2163+ author = {Christine Paulin-Mohring}
2164+}
2165+
2166+@misc{leiserson98,
2167+ month = {July},
2168+ title = {Using de Bruijn Sequences to Index a 1 in a Computer Word},
2169+ year = {1998},
2170+ author = {{Charles E. Leiserson} and {Harald Prokop} and {Keith H. Randall}}
2171+}
2172+
2173+@inproceedings{proofchecking,
2174+ title = {A two-level approach towards lean proof-checking},
2175+ year = {1996},
2176+ booktitle = {TYPES},
2177+ pages = {16--35},
2178+ author = {G. Barthe and M.P.J. Ruys and H.P. Barendregt}
2179+}
2180+
2181+@inproceedings{congruence,
2182+ title = {Congruence Types},
2183+ year = {1995},
2184+ booktitle = {CSL},
2185+ pages = {36--51},
2186+ author = {Gilles Barthe and Herman Geuvers}
2187+}
2188+
2189+@phdthesis{geuvers-thesis,
2190+ title = {Logic and Type Systems},
2191+ author = {Herman Geuvers},
2192+ year = 1993,
2193+ school = {Katholieke Universiteit Nijmegen}
2194+}
2195+
2196+@techreport{multiple-values,
2197+ title = {Multiple Values in {Standard ML}},
2198+ year = {1994},
2199+ number = {94-312},
2200+ institution = {LFCS, Dept of Computer Science, University of Edinburgh},
2201+ author = {Kevin Mitchell}
2202+}
2203+
2204+@inproceedings{oracle-checking,
2205+ month = {January},
2206+ title = {Oracle-Based Checking of Untrusted Software},
2207+ year = {2001},
2208+ booktitle = {Proceedings of the 28th {ACM} Symposium on Principles of Programming Languages},
2209+ pages = {142--154},
2210+ author = {{George C. Necula} and {S.P. Rahul}}
2211+}
2212+
2213+@article{adams93jfp,
2214+ journal = {Journal of Functional Programming},
2215+ number = {4},
2216+ volume = {3},
2217+ title = {Efficient Sets -- A Balancing Act},
2218+ year = {1993},
2219+ pages = {553--561},
2220+ author = {Stephen Adams}
2221+}
2222+
2223+@inproceedings{hughes-sized,
2224+ title = {Proving the Correctness of Reactive Systems Using Sized Types},
2225+ year = {1996},
2226+ booktitle = {Proceedings of the 23rd {ACM} {SIGPLAN}-SIGACT symposium on Principles of programmin},
2227+ pages = {410--423},
2228+ author = {John Hughes and Lars Pareto and Amr Sabry}
2229+}
2230+
2231+@inproceedings{whittle99ml,
2232+ title = {An {ML} Editor Based on Proofs-As-Programs},
2233+ year = {1999},
2234+ booktitle = {Automated Software Engineering},
2235+ pages = {166--173},
2236+ author = {Jon Whittle and Alan Bundy and Richard J. Boulton and Helen Lowe}
2237+}
2238+
2239+@book{efp-typeinf,
2240+ title = {Elements of Functional Programming},
2241+ year = {1989},
2242+ publisher = {Addison-Wesley},
2243+ author = {Chris Reade},
2244+ series = {International Computer Science Series}
2245+}
2246+
2247+@incollection{ wadler-views,
2248+ author = "Philip Wadler",
2249+ title = "Views: {A} Way for Pattern Matching to Cohabit with Data Abstraction",
2250+ booktitle = "Proceedings, 14th Symposium on Principles of Programming Languages",
2251+ publisher = "Association for Computing Machinery",
2252+ editor = "Steve Munchnik",
2253+ pages = "307--312",
2254+ year = "1987",
2255+ url = "citeseer.nj.nec.com/wadler87views.html" }
2256+
2257+@article{ coquand-checking,
2258+ author = "Thierry Coquand",
2259+ title = "An Algorithm for Type-Checking Dependent Types",
2260+ journal = "Science of Computer Programming",
2261+ volume = "26",
2262+ number = "1-3",
2263+ pages = "167-177",
2264+ year = "1996",
2265+ url = "citeseer.nj.nec.com/coquand96algorithm.html" }
2266+
2267+@misc{coquand-pm,
2268+ author = "Thierry Coquand",
2269+ title = "Pattern Matching with Dependent Types",
2270+ year = "1992",
2271+ howpublished = "Available from \verb+http://www.cs.chalmers.se/~coquand/type.html+"
2272+}
2273+
2274+@misc{pollack-records,
2275+ month = {August},
2276+ title = {Dependently Typed Records for Representing Mathematical Structure},
2277+ year = {2000},
2278+ author = {Robert Pollack}
2279+}
2280+
2281+@article{checking-betarte,
2282+ journal = {Journal of Functional Programming},
2283+ number = {2},
2284+ month = {March},
2285+ volume = {10},
2286+ title = {Type checking dependent (record) types and subtyping},
2287+ year = {2000},
2288+ pages = {137--166},
2289+ author = {Gustavo Betarte}
2290+}
2291+
2292+
2293+@article{ gcode,
2294+ author = "Thomas Johnsson",
2295+ title = "Efficient Compilation of Lazy Evaluation",
2296+ booktitle = "Proceedings of the {{ACM}} {{SIGPLAN}}'84 Symposium on Compiler Con struction",
2297+ journal = "{SIGPLAN} Notices",
2298+ volume = "19",
2299+ number = "6",
2300+ month = "June",
2301+ publisher = "{ACM} Press",
2302+ pages = "58--69",
2303+ year = "1984",
2304+ url = "citeseer.nj.nec.com/johnsson84efficient.html" }
2305+
2306+@misc{kamareddine01,
2307+ month = {February},
2308+ title = {Reviewing the classical and the de Bruijn notation for $\lambda$-calculus and pure type systems},
2309+ year = {2001},
2310+ author = {Fairouz Kamareddine}
2311+}
2312+
2313+@book{prooftheory,
2314+ title = {Basic Proof Theory},
2315+ year = {1996},
2316+ publisher = {Cambridge University Press},
2317+ author = {A.S. Troelstra and H. Schwichtenberg},
2318+ series = {Cambridge Tracts in Theoretical Computer Science}
2319+}
2320+
2321+@misc{nbe_staged,
2322+ title = {Integrating Normalization-by-Evaluation into a Staged Programming Language},
2323+ year = {1998},
2324+ author = {Tim Sheard}
2325+}
2326+
2327+@inproceedings{nbe2,
2328+ title = {Normalization by evaluation},
2329+ year = {1998},
2330+ author = {Ulrich Berger and Matthias Eberl and Helmut Schwichtenberg},
2331+ booktitle = {Prospects for Hardware Foundations 1998},
2332+ pages = {117--137},
2333+ series = {LNCS}
2334+}
2335+
2336+
2337+
2338+@misc{rtcg_jfp,
2339+ title = {Compiling for Run-time Code Generation},
2340+ year = {2000},
2341+ author = {Frederick Smith and Dan Grossman and Greg Morrisett and Luke Hornof and Trevor J},
2342+ note = {Under consideration for J. Functional Programming}
2343+}
2344+
2345+@phdthesis{fredsmith_thesis,
2346+ month = {January},
2347+ school = {Cornell University},
2348+ title = {Certified Run-time Code Generation},
2349+ year = {2002},
2350+ author = {Frederick Smith}
2351+}
2352+
2353+@inproceedings{xi_arraybounds,
2354+author = "Hongwei Xi and Frank Pfenning",
2355+title = {Eliminating Array Bound Checking through Dependent Types},
2356+booktitle = "Proceedings of {ACM} {SIGPLAN} Conference on Programming Language Design and Implementation",
2357+year = 1998,
2358+month = "June",
2359+address = "Montreal",
2360+pages = "249--257",
2361+}
2362+
2363+@inproceedings{xi_deadcode,
2364+author = "Hongwei Xi",
2365+title = {Dead Code Elimination through Dependent Types},
2366+booktitle = "The First International Workshop on Practical Aspects of Declarative Languages",
2367+year = 1999,
2368+month = "January",
2369+address = "San Antonio",
2370+pages = "228--242"
2371+}
2372+
2373+@book{compilers,
2374+ title = {Compilers --- Principles, Techniques and Tools},
2375+ year = {1986},
2376+ publisher = {Addison-Wesley},
2377+ author = {Alfred Aho and Ravi Sethi and Jeffrey Ullman}
2378+}
2379+
2380+@inproceedings{nhc,
2381+ title = {Highlights from nhc: A space efficient {Haskell} Compiler},
2382+ year = {1995},
2383+ author = "Niklas R{\"o}jemo",
2384+ booktitle = "Functional Programming Languages and Computer Architecture",
2385+ pages = "282--292"
2386+}
2387+
2388+
2389+@misc{mlmatch,
2390+ title = {SML/NJ Match Compiler Notes},
2391+ year = {1992},
2392+ author = {William Aitken}
2393+}
2394+
2395+@misc{mlmatch_sestoft,
2396+ title = {ML pattern match compilation and partial evaluation},
2397+ year = {1992},
2398+ author = {Peter Sestoft}
2399+}
2400+
2401+@inproceedings{compiledstrongreduction,
2402+ title = {A Compiled Implementation of Strong Reduction},
2403+ year = {2002},
2404+ author = {Benjamin Gr\'{e}goire and Xavier Leroy},
2405+ booktitle = {Proc. 2002 International Conf. on Functional Programming ({ICFP} 2002)},
2406+ pages = {235--246}
2407+}
2408+
2409+@misc{tclhaskell,
2410+ howpublished = {http://www.dcs.gla.ac.uk/~meurig/TclHaskell/usermanual.html},
2411+ month = {August},
2412+ title = {TclHaskell - User Manual},
2413+ year = {1999},
2414+ author = {Meurig Sage}
2415+}
2416+
2417+
2418+@InProceedings{nbe-cat,
2419+ author = "Thorsten Altenkirch and Martin Hofmann and Thomas Streicher",
2420+ title = "Categorical reconstruction of a reduction free
2421+ normalization proof",
2422+ year = "1995",
2423+ booktitle = "Category Theory and Computer Science",
2424+ editor = {David Pitt and David E. Rydeheard and Peter Johnstone},
2425+ series = {LNCS},
2426+ volume = {953},
2427+ pages = {182-199}
2428+}
2429+
2430+@inproceedings{presburgerEFSM,
2431+ title = {A Comparison of Presburger Engines for EFSM Reachability},
2432+ year = {1998},
2433+ booktitle = {Computer Aided Verification '98},
2434+ pages = {280--292},
2435+ author = {Thomas R. Shiple and James H. Kukula and Rajeev K. Ranjan}
2436+}
2437+
2438+@misc{typesafecast,
2439+ title = {Type-Safe Cast},
2440+ year = {2000},
2441+ author = {Stephanie Weirich}
2442+}
2443+
2444+@phdthesis{grobauer-thesis,
2445+ school = {University of Aarhus},
2446+ title = {Topics in Semantics Based Program Manipulation},
2447+ year = {2001},
2448+ author = {Bernd Grobauer}
2449+}
2450+
2451+@misc{monads-moggi,
2452+ title = {Computational Lambda Calculus and Monads},
2453+ year = {1989},
2454+ author = {Eugenio Moggi}
2455+}
2456+
2457+@article{gmp-proof,
2458+ title = {A proof of {GMP} square root},
2459+ year = {2002},
2460+ journal = {Journal of Automated Reasoning},
2461+ volume = {29},
2462+ pages = {225--252},
2463+ author = {Yves Bertot and Nicolas Magaud and Paul Zimmerman}
2464+}
2465+
2466+@article{F-tal,
2467+ journal = {{ACM} Transactions on Programming Languages and Systems},
2468+ number = {3},
2469+ month = {May},
2470+ volume = {21},
2471+ title = {From {System F} to Typed Assembly Language},
2472+ year = {1999},
2473+ pages = {528--569},
2474+ author = {Greg Morrisett and David Walker and Karl Crary and Neal Glew}
2475+}
2476+
2477+@techreport{nbe-rtcg,
2478+ month = {December},
2479+ title = {Strong Normalization by Type-Directed Partial Evaluation and Run-Time Code Generation},
2480+ year = {1997},
2481+ institution = {BRICS},
2482+ author = {Vincent Balat and Oliver Danvy}
2483+}
2484+
2485+@misc{yong-schemata,
2486+ howpublished = {http://www.dur.ac.uk/yong.luo/},
2487+ title = {A Methodology for Implementing Inductive Schemata},
2488+ year = {2002},
2489+ author = {Yong Luo and Zhaohui Luo}
2490+}
2491+
2492+@inproceedings{harper93,
2493+ title = {Explicit Polymorphism and CPS Conversion},
2494+ year = {1993},
2495+ booktitle = {20th {ACM} {SIGPLAN}-SIGACT Symposium on Principles of Programming Languages},
2496+ pages = {206--219},
2497+ publisher = {{ACM} Press, New York, NY, USA},
2498+ author = {Robert Harper and Mark Lillibridge}
2499+}
2500+
2501+@techreport{backends,
2502+ month = {November},
2503+ title = {Functional Back-Ends within the Lambda-Sigma Calculus},
2504+ year = {1996},
2505+ institution = {INRIA},
2506+ author = {Th\'{e}r\`{e}se Hardin and Luc Maranget and Bruno Pagano}
2507+}
2508+
2509+@article{stg,
2510+ title = {Implementing lazy functional languages on stock hardware -- the {Spineless Tagless G-machine}},
2511+ year = {1992},
2512+ journal = {Journal of Functional Programming},
2513+ volume = {2},
2514+ number = {2},
2515+ pages = {127--202},
2516+ month = {April},
2517+ author = {Simon {Peyton Jones}}
2518+}
2519+
2520+@article{debruijn,
2521+ journal = {Indagationes Mathematicae},
2522+ volume = {34},
2523+ title = {Lambda calculus notation with nameless dummies},
2524+ year = {1972},
2525+ pages = {381--392},
2526+ author = {N.G. de Bruijn}
2527+}
2528+
2529+@book{assembly,
2530+ month = {January},
2531+ title = {PC Assembly Language},
2532+ year = {2002},
2533+ publisher = {http://www.drpaulcarter.com/},
2534+ author = {Paul A. Carter}
2535+}
2536+
2537+@inproceedings{poly99,
2538+ title = {Once Upon A Polymorphic Type},
2539+ year = {1999},
2540+ booktitle = {26th {ACM} {SIGPLAN}-SIGACT Symposium on Principles of Programming Languages},
2541+ publisher = {{ACM}},
2542+ author = {Keith Wansbrough and Simon {Peyton Jones}}
2543+}
2544+
2545+@misc{lazy_intro,
2546+ title = {Compiling Lazy Functional Languages: An introduction},
2547+ year = {1986},
2548+ author = {Thomas Johnsson}
2549+}
2550+
2551+@inproceedings{unboxed-fp,
2552+ month = {Sept},
2553+ title = {Unboxed Values as First Class Citizens in a Non-Strict Functional Language},
2554+ year = {1991},
2555+ author = {Simon {Peyton Jones} and John Launchbury},
2556+ booktitle = {Functional Programming Languages and Computer Architecture (FPCA'91)},
2557+ crossref = {fplca91},
2558+ pages = {636--666}
2559+}
2560+
2561+@inproceedings{abc-machine,
2562+ author = {Sjaak Smetsers and Eric N{\"{o}}cker and John {van Groningen} and Rinus Plasmeijer},
2563+ title = {Generating efficient code for lazy functional languages},
2564+ booktitle = {Functional programming Languages and Computer Architecture},
2565+ year = {1991},
2566+ pages = {592--617},
2567+ crossref = {fplca91}
2568+}
2569+
2570+@proceedings{fplca91,
2571+ title = {Functional programming Languages and Computer Architecture},
2572+ year = {1991},
2573+ volume = {523},
2574+ series = {LNCS},
2575+ publisher = {Springer-Verlag},
2576+ editor = {John Hughes}
2577+}
2578+
2579+
2580+
2581+@inproceedings{nbe,
2582+ title = {An inverse of the evaluation functional for typed $\lambda$-calculus},
2583+ year = {1991},
2584+ booktitle = {Proc. 1991 {IEEE} Symp. on Logic in Comp. Sci.},
2585+ pages = {203--211},
2586+ editor = {R. Vemuri},
2587+ author = {Ulrich Berger and Helmut Schwichtenberg}
2588+}
2589+
2590+@inproceedings{typed-closure,
2591+ title = {Typed Closure Conversion},
2592+ year = {1996},
2593+ booktitle = {Symposium on Principles of Programming Languages},
2594+ pages = {271--283},
2595+ author = {Yasuhiko Minamide and J. Gregory Morrisett and Robert Harper}
2596+}
2597+
2598+@misc{ghc-commentary,
2599+ howpublished = {http://www.cse.unsw.edu.au/~chak/haskell/ghc/comm/},
2600+ title = {The Glasgow Haskell Compiler (GHC) Commentary},
2601+ year = {2002},
2602+ author = {Manuel M. T. Chakravarty and Sigbjorn Finne and Simon Marlow and Simon {Peyton Jones} and Julian Seward and Reuben Thomas},
2603+ note = {Available from GHC CVS repository}
2604+}
2605+
2606+@inproceedings{lambdalift,
2607+ month = {September},
2608+ title = {Lambda Lifting: Transforming Programs to Recursive Equations},
2609+ year = {1985},
2610+ booktitle = {Functional Programming Languages and Computer Architecture},
2611+ pages = {190--203},
2612+ editor = {Jean-Pierre Jouannaud},
2613+ publisher = {Springer-Verlag},
2614+ author = {Thomas Johnsson}
2615+}
2616+
2617+@inproceedings{til,
2618+ title = {TIL: A Type-Directed Optimizing Compiler for ML},
2619+ year = {1996},
2620+ booktitle = {Proc. {{ACM}} {{SIGPLAN}} '96 Conference on Programming Language Design and Implementation},
2621+ pages = {181--192},
2622+ author = {D. Tarditi and G. Morrisett and P. Cheng and C. Stone and R. Harper and P. Lee}
2623+}
2624+
2625+@phdthesis{shao94,
2626+ school = {Princeton University},
2627+ title = {Compiling Standard {ML} for Efficient Execution on Modern Machines},
2628+ year = {1994},
2629+ author = {Zhong Shao}
2630+}
2631+
2632+@inproceedings{gmachine,
2633+ month = {September},
2634+ title = {The {G-Machine}: A fast, graph-reduction evaluator},
2635+ year = {1985},
2636+ booktitle = {Functional Programming Languages and Computer Architecture},
2637+ pages = {400--413},
2638+ editor = {Jean-Pierre Jouannaud},
2639+ publisher = {Springer-Verlag},
2640+ author = {R.B. Kieburtz}
2641+}
2642+
2643+@inproceedings{strictness,
2644+ month = {September},
2645+ title = {Strictness Analysis - A practical approach},
2646+ year = {1985},
2647+ booktitle = {Functional Programming Languages and Computer Hardware},
2648+ pages = {35--49},
2649+ editor = {Jean-Pierre Jouannaud},
2650+ publisher = {Springer-Verlag},
2651+ author = {Chris Clack and Simon {Peyton Jones}}
2652+}
2653+
2654+@book{fl-impl,
2655+ title = {Implementing Functional Languages - A Tutorial},
2656+ year = {1992},
2657+ publisher = {Prentice Hall International},
2658+ author = {Simon {Peyton Jones} and David Lester}
2659+}
2660+
2661+@phdthesis{capretta-thesis,
2662+ school = {Katholieke Universiteit Nijmegen},
2663+ title = {Abstraction and Computation},
2664+ year = {2002},
2665+ author = {Venanzio Capretta}
2666+}
2667+
2668+@article{bird-pointer,
2669+ journal = {Journal of Functional Programming},
2670+ number = {3},
2671+ month = {May},
2672+ volume = {11},
2673+ title = {Unfolding Pointer Algorithms},
2674+ year = {2001},
2675+ pages = {347--358},
2676+ author = {Richard S. Bird}
2677+}
2678+
2679+@article{impl-tp,
2680+ journal = {Journal of Functional Programming},
2681+ number = {2},
2682+ month = {March},
2683+ volume = {9},
2684+ title = {Implementing Theorem Provers in a Purely Functional Style},
2685+ year = {1999},
2686+ pages = {147--166},
2687+ author = {Keith Hanna}
2688+}
2689+
2690+@article{shrink-lambda,
2691+ journal = {Journal of Functional Programming},
2692+ number = {5},
2693+ month = {September},
2694+ volume = {7},
2695+ title = {Shrinking Lambda Expressions in Linear Time},
2696+ year = {1997},
2697+ pages = {515--540},
2698+ author = {Andrew W. Appel and Trevor Jim}
2699+}
2700+
2701+@article{stack-tal,
2702+ journal = {Journal of Functional Programming},
2703+ number = {1},
2704+ month = {January},
2705+ volume = {12},
2706+ title = {Stack-based Typed Assembly Language},
2707+ year = {2002},
2708+ pages = {43--88},
2709+ author = {Greg Morrisset and Karl Crart and Neal Glew and David Walker}
2710+}
2711+
2712+@article{runtime-lamsig,
2713+ journal = {Journal of Functional Programming},
2714+ number = {2},
2715+ month = {March},
2716+ volume = {8},
2717+ title = {Functional Runtime Systems within the lambda-sigma Calculus},
2718+ year = {1998},
2719+ pages = {131--176},
2720+ author = {Th\'{e}r\`{e}se Hardin and Luc Maranget and Bruno Pagano}
2721+}
2722+
2723+@article{busylazy,
2724+ journal = {Journal of Functional Programming},
2725+ number = {6},
2726+ month = {November},
2727+ volume = {11},
2728+ title = {How to look busy while being as lazy as ever: the Implementation of a lazy functional debugger},
2729+ year = {2001},
2730+ pages = {629--671},
2731+ author = {Henrik Nilsson}
2732+}
2733+
2734+@article{lazyveager,
2735+ journal = {Journal of Functional Programming},
2736+ number = {5},
2737+ month = {September},
2738+ volume = {7},
2739+ title = {More haste, less speed: lazy versus eager evaluation},
2740+ year = {1997},
2741+ pages = {541--547},
2742+ author = {Richard Bird and Geraint Jones and Oege {de Moor}}
2743+}
2744+
2745+@article{jvm-fp,
2746+ journal = {Journal of Functional Programming},
2747+ number = {6},
2748+ month = {November},
2749+ volume = {9},
2750+ title = {Compiling lazy functional programs for the Java Virtual Machine},
2751+ year = {1999},
2752+ pages = {579--603},
2753+ author = {David Wakeling}
2754+}
2755+
2756+@book{isabelle,
2757+ publisher = {Springer-Verlag},
2758+ series = {LNCS},
2759+ volume = {2283},
2760+ month = {March},
2761+ title = {Isabelle/HOL - A proof assistant for higher order logic},
2762+ year = {2002},
2763+ author = {Tobias Nipkow and Lawrence C. Paulson and Markus Wenzel}
2764+}
2765+
2766+@article{ghc-inliner,
2767+ journal = {Journal of Functional Programming},
2768+ number = {4},
2769+ month = {September},
2770+ volume = {12},
2771+ title = {Secrets of the {Glasgow Haskell Compiler} inliner},
2772+ year = {2002},
2773+ pages = {393--434},
2774+ author = {Simon {Peyton Jones} and Simon Marlow}
2775+}
2776+
2777+@article{dynamic-fp,
2778+ journal = {Journal of Functional Programming},
2779+ number = {1},
2780+ month = {January},
2781+ volume = {8},
2782+ title = {The dynamic compiliation of lazy functional programs},
2783+ year = {1998},
2784+ pages = {61--81},
2785+ author = {David Wakeling}
2786+}
2787+
2788+@misc{isabelle-ref,
2789+ month = {March},
2790+ title = {Isabelle Reference Manual},
2791+ year = {2002},
2792+ author = {Lawrence C. Paulson}
2793+}
2794+
2795+@article{debruijn-nested,
2796+ journal = {Journal of Functional Programming},
2797+ number = {1},
2798+ month = {January},
2799+ volume = {9},
2800+ title = {de Bruijn notation as a nested datatype},
2801+ year = {1999},
2802+ pages = {77--91},
2803+ author = {Richard S. Bird and Ross Paterson}
2804+}
2805+
2806+@article{perfect-trees,
2807+ journal = {Journal of Functional Programming},
2808+ number = {3},
2809+ month = {May},
2810+ volume = {10},
2811+ title = {Perfect trees and bit-reversal permutations},
2812+ year = {2000},
2813+ pages = {305--317},
2814+ author = {Ralf Hinze}
2815+}
2816+
2817+@phdthesis{paulin-extraction,
2818+ school = {Paris 7},
2819+ title = {Extraction de programmes dans le Calcul des Constructions},
2820+ year = {1989},
2821+ author = {Christine Paulin-Mohring}
2822+}
2823+
2824+@phdthesis{santos95,
2825+ school = {University of Glasgow},
2826+ title = {Compilation By Transformation In Non-Strict Functional Languages},
2827+ year = {1995},
2828+ author = {{Andr\'{e} Lu\'{i}s de Medeiros} Santos}
2829+}
2830+
2831+@book{cps,
2832+ title = {Compiling With Continuations},
2833+ year = {1992},
2834+ publisher = {Cambridge University Press},
2835+ author = {Andrew W. Appel}
2836+}
2837+
2838+@techreport{SKIM,
2839+ number = {31},
2840+ title = {The {SKIM} microprogrammer's guide},
2841+ year = {1983},
2842+ institution = {University of Cambridge},
2843+ author = {W.R. Stoye}
2844+}
2845+
2846+@misc{NORMA,
2847+ title = {An Overview of Burroughs {NORMA}},
2848+ year = {1985},
2849+ author = {H. Richards}
2850+}
2851+
2852+@book{ml,
2853+ title = {The Definition of Standard ML --- Revised},
2854+ year = {1997},
2855+ publisher = {MIT Press},
2856+ author = {Robin Milner and Mads Tofte and Robert Harper and David MacQueen}
2857+}
2858+
2859+@misc{ml71,
2860+ title = {An intuitionistic theory of types},
2861+ year = {1971},
2862+ author = {Per Martin-L\"{o}f}
2863+}
2864+
2865+@phdthesis{girard-thesis,
2866+ school = {Universit\'{e} Paris VII},
2867+ title = {Interpr\'{e}tation fonctionelle et \'{e}limination des coupures de l'arithm\'{e}tique d'ordre sup\'{e}rieur},
2868+ year = {1972},
2869+ author = {Jean-Yves Girard}
2870+}
2871+
2872+@inproceedings{ml75,
2873+ title = {An intuitionistic theory of types: predicative part},
2874+ year = {1975},
2875+ booktitle = {Logic Colloquium '73},
2876+ editor = {H. Rose and J.C. Shepherdson},
2877+ publisher = {North-Holland},
2878+ author = {Per Martin-L\"{o}f}
2879+}
2880+
2881+@inproceedings{cpm90,
2882+ title = {Inductively defined types},
2883+ year = {1990},
2884+ author = {Thierry Coquand and Christine Paulin-Mohring},
2885+ series = {LNCS},
2886+ volume = {417},
2887+ publusher = {Springer-Verlag}
2888+}
2889+
2890+@phdthesis{fpcustom,
2891+ month = {May},
2892+ school = {Computer Lab, University of Cambridge},
2893+ title = {The Implementation of Functional Languages using Custom Hardware},
2894+ year = {1985},
2895+ author = {W.R. Stoye}
2896+}
2897+
2898+@phdthesis{hughesthesis,
2899+ month = {September},
2900+ school = {Programming Research Group, Oxford},
2901+ title = {The design and implementation of programming languages},
2902+ year = {1984},
2903+ author = {John Hughes}
2904+}
2905+
2906+@inproceedings{tim,
2907+ volume = {274},
2908+ title = {{TIM} -- A simple lazy abstract machine to execute supercombinators},
2909+ year = {1987},
2910+ booktitle = {Functional Programming Languages and Computer Architecture},
2911+ publisher = {Springer-Verlag},
2912+ author = {John Fairbairn and Stuart Wray},
2913+ pages = {34--45},
2914+ series = {LNCS}
2915+}
2916+
2917+@techreport{abc,
2918+ title = {The {ABC} machine -- A Sequential Stack-based Abstract Machine For Graph Rewriting},
2919+ year = {1990},
2920+ institution = {University of Nijmegen},
2921+ author = {P.W.M. Koopman and M.C.J.D. van {Eekelen} and E.G.J.M.H. Ncker and J.E.W. Smetsers and M.J. Plasmeijer}
2922+}
2923+
2924+@techreport{implicit,
2925+ title = {On Implicit Arguments},
2926+ year = {1994},
2927+ institution = {Faculty of Science, University of Tokyo},
2928+ author = {Masami Hagiya and Yozo Toda}
2929+}
2930+
2931+@book{semantics,
2932+ title = {Denotational Semantics},
2933+ year = {1986},
2934+ publisher = {Wm. C. Brown},
2935+ author = {David A. Schmidt}
2936+}
2937+
2938+@inproceedings{lazyml,
2939+ month = {August},
2940+ title = {A compiler for {Lazy} {ML}},
2941+ year = {1984},
2942+ booktitle = {Proceedings of the {{ACM}} Symposium on Lisp and Functional Programming},
2943+ pages = {218--227},
2944+ author = {Lennart Augustsson}
2945+}
2946+
2947+@inproceedings{nu-g,
2948+ title = {Parallel graph reduction with the $\langle\nu,G\rangle$-machine},
2949+ year = {1989},
2950+ booktitle = {Functional Programming Languages and Computer Architecture},
2951+ publisher = {{ACM} Press},
2952+ author = {Lennart Augustsson and Thomas Johnsson}
2953+}
2954+
2955+@book{k&r,
2956+ title = {The C programming language},
2957+ year = {1988},
2958+ publisher = {Prentice-Hall},
2959+ author = {Brian W. Kernighan and Dennis M. Ritchie}
2960+}
2961+
2962+@misc{c--garbage,
2963+ title = {C--: a portable assembly language that supports garbage collection},
2964+ year = {1999},
2965+ author = {Simon {Peyton Jones} and Norman Ramsey and Fermin Reig},
2966+ note = {Invited talk at PPDP'99}
2967+}
2968+
2969+@misc{epigram,
2970+ howpublished = {http://www.dur.ac.uk/CARG/epigram.html},
2971+ title = {Project Proposal: {Epigram}: Innovative Programming via Inductive Families},
2972+ year = {2002},
2973+ author = {Zhaohui Luo and James McKinna and Paul Callaghan and Conor McBride}
2974+}
2975+
2976+@misc{ghc-rewrite,
2977+ title = {Playing by the Rules: Rewriting as a practical optimisation technique in {GHC}},
2978+ year = {2001},
2979+ author = {Simon {Peyton Jones} and Andrew Tolmach and Tony Hoare}
2980+}
2981+
2982+@UNPUBLISHED{implicit-pollack,
2983+ AUTHOR = {Robert Pollack},
2984+ TITLE = {Implicit Syntax},
2985+ NOTE = {Informal Proceedings of First Workshop on
2986+ Logical Frameworks, Antibes},
2987+ YEAR = {1990},
2988+ MONTH = MAY
2989+}
2990+
2991+
2992+@article{transform-haskell,
2993+ journal = {Science of Computer Programming},
2994+ volume = {32},
2995+ title = {A transformation-based optimiser for {Haskell}},
2996+ year = {1998},
2997+ pages = {3--47},
2998+ author = {Simon {Peyton Jones} and Andr\'{e} L. M. Santos}
2999+}
3000+
3001+@inproceedings{knuth-bendix,
3002+ title = {Simple Word Problems in Universal Algebras},
3003+ year = {1970},
3004+ booktitle = {Computational Problems in Abstract Algebra},
3005+ pages = {263--298},
3006+ editor = {John Leech},
3007+ publisher = {Pergamon Press},
3008+ author = {Donald E. Knuth and Peter B. Bendix}
3009+}
3010+
3011+@inproceedings{phantomfun,
3012+ title = {Fun With Phantom Types},
3013+ author = {Ralf Hinze},
3014+ pages = {245--262},
3015+ year = {2003},
3016+ crossref = {funprogramming},
3017+ booktitle = {The Fun Of Programming},
3018+ publisher = {Palgrave}
3019+}
3020+
3021+@book{funprogramming,
3022+ month = {March},
3023+ title = {The Fun Of Programming},
3024+ year = {2003},
3025+ editor = {Jeremy Gibbons and Oege {de Moor}},
3026+ publisher = {Palgrave},
3027+ series = {Cornerstones of Computing}
3028+}
3029+
3030+@inproceedings{anderson-proof,
3031+ title = {Representing Proof Transformations For Program Optimization},
3032+ year = {1994},
3033+ booktitle = {International Conference On Automated Deduction},
3034+ publisher = {Springer Verlag},
3035+ author = {Penny Anderson}
3036+}
3037+
3038+@phdthesis{daria-thesis,
3039+ month = {April},
3040+ school = {Institute of Informatics, Warsaw University},
3041+ title = {Termination of Rewriting in the Calculus of Constructions},
3042+ year = {2003},
3043+ author = {Daria Walukiewicz-Chrzaszcz}
3044+}
3045+
3046+@inproceedings{change-data,
3047+ title = {Changing Data Structures In Type Theory: A Study Of Natural Numbers},
3048+ year = {2001},
3049+ booktitle = {Types For Proofs And Programs 2000},
3050+ pages = {181--196},
3051+ editor = {Paul Callaghan and Zhaohui Luo and James McKinna and Robert Pollack},
3052+ publisher = {Springer},
3053+ author = {Nicolas Magaud and Yves Bertot}
3054+}
3055+
3056+@phdthesis{nico-thesis,
3057+ title = {Changement de Representation des donn\'{e}es dans le Calcul de Constructions},
3058+ author = {Nicolas Magaud},
3059+ year = {2003},
3060+ month = {October},
3061+ school = {Universit\'{e} de Nice - Sophia Antipolis}
3062+}
3063+
3064+
3065+@book{patterns,
3066+ title = {Design Patterns},
3067+ year = {1995},
3068+ publisher = {Addison Wesley},
3069+ author = {Erich Gamma and Richard Helm and Ralph Johnson and John Vlissides}
3070+}
3071+
3072+@misc{ghchugs,
3073+ month = {August},
3074+ title = {The New {GHC}/{Hugs} Runtime System},
3075+ year = {1998},
3076+ author = {Simon Marlow and Simon {Peyton Jones}}
3077+}
3078+
3079+@misc{stgrevised,
3080+ month = {February},
3081+ title = {The {STG} runtime system (revised)},
3082+ year = {1999},
3083+ author = {Simon {Peyton Jones} and Simon Marlow and Alastair Reid},
3084+ howpublished = {Available from \verb+http://www.haskell.org/ghc/documentation.html+}
3085+}
3086+
3087+@inproceedings{optimistic,
3088+ month = {March},
3089+ title = {Optimistic Evaluation --- an adaptive evaluation strategy for non-strict programs},
3090+ year = {2003},
3091+ author = {Robert Ennals and Simon {Peyton Jones}},
3092+ booktitle = {International Conference on Functional Programming},
3093+ pages = {287--298}
3094+}
3095+
3096+@phdthesis{ennals-thesis,
3097+ title = {Adaptive Evaluation of Non-Strict Programs},
3098+ author = {Robert Ennals},
3099+ year = {2003},
3100+ month = {December},
3101+ school = {King's College, University of Cambridge}
3102+}
3103+
3104+@article{garbage,
3105+ journal = {{ACM} Computing Surveys},
3106+ number = {3},
3107+ volume = {13},
3108+ title = {Garbage Collection of Linked Data Structures},
3109+ year = {1981},
3110+ pages = {341--367},
3111+ author = {Jacques Cohen}
3112+}
3113+
3114+@article{baker-gc,
3115+ journal = {Communications of the {ACM}},
3116+ number = {4},
3117+ month = {April},
3118+ volume = {21},
3119+ title = {List Processing In Real Time On A Serial Computer},
3120+ year = {1978},
3121+ pages = {280--294},
3122+ author = {Henry G. {Baker Jr}}
3123+}
3124+
3125+@misc{bc-rec,
3126+ month = {February},
3127+ title = {Modelling General Recursion in Type Theory},
3128+ year = {2003},
3129+ note = {Under consideration for publication in Math. Struct. in Comp. Science. Draft, DCS, CTH --- INRIA, Sophia Antipolis, France},
3130+ author = {Ana Bove and Venanzio Capretta}
3131+}
3132+
3133+@misc{global-tag,
3134+ title = {Global Tagging Optimization by Type Inference},
3135+ year = {1992},
3136+ author = {Fritz Henglein}
3137+}
3138+
3139+@book{esr,
3140+ month = {October},
3141+ title = {The Cathedral And The Bazaar},
3142+ year = {1999},
3143+ publisher = {O'Reilly},
3144+ author = {Eric Raymond}
3145+}
3146+
3147+@book{manmonth,
3148+ title = {The Mythical Man-month: Essays on Software Engineering},
3149+ year = {1975},
3150+ publisher = {Addison Wesley},
3151+ author = {Frederick P. Brooks}
3152+}
3153+
3154+@inproceedings{evalpush,
3155+ title = {How to make a fast curry: push/enter vs eval/apply},
3156+ year = {2004},
3157+ author = {Simon Marlow and Simon {Peyton Jones}},
3158+ booktitle = {International Conference on Functional Programming, Snowbird},
3159+ pages = {4--15}
3160+}
3161+
3162+@phdthesis{boquist-thesis,
3163+ month = {April},
3164+ school = {Chalmers University of Technology},
3165+ title = {Code Optimisation Techniques for Lazy Functional Languages},
3166+ year = {1999},
3167+ author = {Urban Boquist}
3168+}
3169+
3170+@book{formal-spec,
3171+ title = {Formal Specification Of Programming Languages},
3172+ year = {1981},
3173+ publisher = {Prentice-Hall},
3174+ author = {Frank G. Pagan}
3175+}
3176+
3177+@inproceedings{elim-motive,
3178+ title = {Elimination With A Motive},
3179+ year = {2000},
3180+ booktitle = {Types for Proofs and Programs},
3181+ pages = {197--216},
3182+ editor = {Paul Callaghan and Zhaohui Luo and James McKinna and Robert Pollack},
3183+ publisher = {Springer},
3184+ author = {Conor McBride}
3185+}
3186+
3187+@article{telescope,
3188+ journal = {Information and Computation},
3189+ number = {2},
3190+ month = {April},
3191+ volume = {91},
3192+ title = {Telescoping Mappings in Typed Lambda Calculus},
3193+ year = {1991},
3194+ pages = {189--204},
3195+ author = {N.G. de Bruijn}
3196+}
3197+
3198+@misc{typeintype,
3199+ title = {Typechecking is undecidable when 'type' is a type},
3200+ year = {1989},
3201+ author = {Mark B. Reinhold}
3202+}
3203+
3204+@misc{core,
3205+ month = {September},
3206+ title = {An External Representation for the {GHC} Core Language},
3207+ year = {2001},
3208+ author = {Andrew Tolmach and {The GHC Team}}
3209+}
3210+
3211+@article{deforestation,
3212+ journal = {Theoretical Computer Science},
3213+ volume = {73},
3214+ title = {Deforestation: Transforming programs to eliminate trees},
3215+ year = {1990},
3216+ pages = {231--248},
3217+ author = {Philip Wadler}
3218+}
3219+
3220+@misc{hep,
3221+ month = {July},
3222+ title = {Architecture of the {Haskell} Execution Platform},
3223+ year = {1999},
3224+ author = {Julian Seward and Simon Marlow and Andy Gill and Sigbjorn Finne and Simon {Peyton Jones} },
3225+ note = {Version 6},
3226+ howpublished = {Available from \verb+http://www.haskell.org/ghc/documentation.html+}
3227+}
3228+
3229+@mastersthesis{wahlstedt-thesis,
3230+ month = {October},
3231+ school = {Chalmers University Of Technology},
3232+ title = {Detecting Termination Using Size Change In Parameter Values},
3233+ year = {2000},
3234+ author = {David Wahlstedt}
3235+}
3236+
3237+@inproceedings{size-change,
3238+ title = {The size-change principle for program termination},
3239+ year = {2001},
3240+ booktitle = {Proceedings of the 28th Annual {ACM} {SIGPLAN}-SIGACT Symposium on Principles of Programming Languages},
3241+ author = {Chin Soon Lee and Neil D. Jones and Amir Ben-Amram. }
3242+}
3243+
3244+@article{ski-turner,
3245+ journal = {Software -- Practice and Experience},
3246+ volume = {9},
3247+ title = {A new implementation technique for applicative languages},
3248+ year = {1979},
3249+ pages = {31--49},
3250+ author = {David Turner}
3251+}
3252+
3253+@inproceedings{turner-strong,
3254+ number = {1022},
3255+ title = {Elementary Strong Functional Programming},
3256+ year = {1996},
3257+ booktitle = {First International Symposium on Functional Programming Languages in Education, Nijmegen, Netherlands, December 1995.},
3258+ pages = {1--13},
3259+ publisher = {Springer},
3260+ author = {David Turner},
3261+ series = {LNCS}
3262+}
3263+
3264+@misc{clean,
3265+ title = {The {Concurrent CLEAN} Language Report (draft)},
3266+ year = {2003},
3267+ author = {Rinus Plasmeijer and Marko van Eekelen},
3268+ howpublished = {Available from \verb+http://www.cs.kun.nl/~clean/+}
3269+}
3270+
3271+@article{burstall-struct,
3272+ journal = {Computer Journal},
3273+ number = {1},
3274+ volume = {12},
3275+ title = {Proving Properties of Programs By Structural Induction},
3276+ year = {1969},
3277+ pages = {41--48},
3278+ author = {Rod Burstall}
3279+}
3280+
3281+@incollection{ barendregt-types,
3282+ author = "Henk Barendregt",
3283+ title = "Lambda Calculi with Types",
3284+ booktitle = "Handbook of Logic in Computer Science, Volumes 1 (Background: Mathematical Structures) and 2 (Background: Computational Structures), Abramsky \& Gabbay \& Maibaum (Eds.)",
3285+ publisher = "Clarendon",
3286+ volume = "2",
3287+ year = "1992",
3288+ url = "citeseer.nj.nec.com/barendregt92lambda.html" }
3289+
3290+@book{curry-feys,
3291+ title = {Combinatory Logic, volume 1},
3292+ year = {1958},
3293+ publisher = {North Holland},
3294+ author = {Haskell B. Curry and Robert Feys}
3295+}
3296+
3297+@phdthesis{bove-thesis,
3298+ month = {November},
3299+ school = {Chalmers University of Technology},
3300+ title = {General Recursion in Type Theory},
3301+ year = {2002},
3302+ author = {Ana Bove}
3303+}
3304+
3305+@inbook{ml-cm,
3306+ title = {Constructive Mathematics and Computer Programming},
3307+ year = {1985},
3308+ booktitle = {Mathematical Logic and Programming Languages},
3309+ publisher = {Prentice Hall},
3310+ author = {Per Martin-L\"{o}f}
3311+}
3312+
3313+@inproceedings{howard,
3314+ title = {The formulae-as-types notion of construction},
3315+ year = {1980},
3316+ booktitle = {To H.B.Curry: Essays on combinatory logic, lambda calculus and formalism},
3317+ editor = {Jonathan P. Seldin and J. Roger Hindley},
3318+ publisher = {Academic Press},
3319+ author = {William A. Howard},
3320+ note = {A reprint of an unpublished manuscript from 1969}
3321+}
3322+
3323+@inproceedings{talx86,
3324+ title = {TALx86: A Realistic Typed Assembly Language},
3325+ year = {1999},
3326+ booktitle = {{ACM} {SIGPLAN} Workshop on Compiler Support for System Software},
3327+ pages = {25--35},
3328+ author = {Greg Morrisett and Karl Crary and Neal Glew and Dan Grossman and Richard Samuels and Frederick Smith and David Walker and Stephanie Weirich and Steve Zdancewic}
3329+}
3330+
3331+@inproceedings{bove-capretta,
3332+ volume = {2152},
3333+ title = {Nested General Recursion and Partiality in Type Theory},
3334+ year = {2001},
3335+ booktitle = {Theorem Proving in Higher Order Logics, 14th International Conference, TPHOLS 2001},
3336+ pages = {121--135},
3337+ editor = {Richard J. Boulton and Paul B. Jackson},
3338+ publisher = {Springer-Verlag},
3339+ author = {Ana Bove and Venanzio Capretta},
3340+ series = {LNCS}
3341+}
3342+
3343+@misc{lvm,
3344+ month = {November},
3345+ title = {LVM, the lazy virtual machine},
3346+ year = {2002},
3347+ author = {Daan Leijen}
3348+}
3349+
3350+@misc{ocaml,
3351+ howpublished = {\verb+http://caml.inria.fr/ocaml/htmlman/+},
3352+ month = {August},
3353+ title = {The {Objective Caml} system release 3.06},
3354+ year = {2002},
3355+ author = {Xavier Leroy}
3356+}
3357+
3358+@misc{lambdagoto,
3359+ title = {Lambda : The Ultimate Goto},
3360+ year = {1977},
3361+ author = {Guy L. {Steele Jr}},
3362+ note = {MIT AI Memo 443}
3363+}
3364+
3365+@inproceedings{ liu-tail,
3366+ author = "Yanhong A. Liu and Scott D. Stoller",
3367+ title = "From Recursion to Iteration: What are the Optimizations?",
3368+ booktitle = "Partial Evaluation and Semantic-Based Program Manipulation",
3369+ pages = "73-82",
3370+ year = "2000",
3371+ url = "citeseer.nj.nec.com/liu00from.html" }
3372+
3373+@inproceedings{aczel77,
3374+ title = {An Introduction To Inductive Definitions},
3375+ year = {1977},
3376+ booktitle = {Handbook of Mathematical Logic},
3377+ editor = {J. Barwise},
3378+ publisher = {North Holland},
3379+ author = {Peter Aczel}
3380+}
3381+
3382+@inproceedings{inductive-plastic,
3383+ volume = {1956},
3384+ title = {Implementation Techniques for Inductive Types in {Plastic}},
3385+ year = {1999},
3386+ booktitle = {Types for Proofs and Programs},
3387+ pages = {94--113},
3388+ editor = {Thierry Coquand and Peter Dybjer and Bengt Nordstr\"{o}m and Jan Smith},
3389+ publisher = {Springer-Verlag},
3390+ author = {Paul Callaghan and Zhaohui Luo},
3391+ series = {LNCS}
3392+}
3393+
3394+@misc{graham,
3395+ howpublished = {Available from \verb+http://www.paulgraham.com/+},
3396+ month = {April},
3397+ title = {The Hundred Year Language},
3398+ year = {2003},
3399+ author = {Paul Graham},
3400+ note = {Keynote address at PyCon 2003}
3401+}
3402+
3403+@inproceedings{gimenez98,
3404+ volume = {1443},
3405+ title = {Structural Recursive Definitions in Type Theory},
3406+ year = {1998},
3407+ booktitle = {Proceedings of ICALP '98},
3408+ publisher = {Springer-Verlag},
3409+ author = {Eduardo Gim\'{e}nez},
3410+ series = {LNCS}
3411+}
3412+
3413+@article{quicksort,
3414+ journal = {Computer Journal},
3415+ number = {1},
3416+ volume = {5},
3417+ title = {Quicksort},
3418+ year = {1962},
3419+ pages = {10--15},
3420+ author = {C.A.R. Hoare}
3421+}
3422+
3423+@phdthesis{goguen-thesis,
3424+ school = {University of Edinburgh},
3425+ title = {A Typed Operational Semantics for Type Theory},
3426+ year = {1994},
3427+ author = {Healfdene Goguen}
3428+}
3429+
3430+@article{ph-universes,
3431+ journal = {Theoretical Computer Science},
3432+ number = {1},
3433+ volume = {89},
3434+ title = {Type Checking With Universes},
3435+ year = {1991},
3436+ pages = {107--136},
3437+ author = {Robert Harper and Randy Pollack}
3438+}
3439+
3440+@inproceedings{pm-compile,
3441+ month = {September},
3442+ title = {Compiling Pattern Matching},
3443+ year = {1985},
3444+ booktitle = {Functional Programming Languages and Computer Architecture},
3445+ pages = {368--381},
3446+ editor = {Jean-Pierre Jouannaud},
3447+ publisher = {Springer-Verlag},
3448+ author = {Lennart Augustsson}
3449+}
3450+
3451+@phdthesis{lena-thesis,
3452+ school = {Chalmers University of Technology, G\"{o}teborg},
3453+ title = {The implementation of {ALF} -- A Proof Editor based on {Martin-L\"{o}f}'s Monomorphic Type Theory with Explicit Substitutions},
3454+ year = {1994},
3455+ author = {Lena Magnusson}
3456+}
3457+
3458+@article{view-left,
3459+ journal = {Journal of Functional Programming},
3460+ number = {1},
3461+ volume = {14},
3462+ title = {The View From The Left},
3463+ year = {2004},
3464+ author = {Conor McBride and James McKinna},
3465+ pages = {69--111}
3466+}
3467+
3468+@inproceedings{not-a-number,
3469+ author = {Conor McBride and James McKinna},
3470+ title = {I am not a number, {I} am a free variable},
3471+ year = {2004},
3472+ booktitle = {Proceedings of the {ACM} {SIGPLAN} Haskell Workshop}
3473+}
3474+
3475+
3476+@misc{profiling,
3477+ title = {Time and Space Profiling for Non-Strict, Higher Order Functional Languages},
3478+ year = {1995},
3479+ author = {Patrick M. Sansom and Simon {Peyton Jones}}
3480+}
3481+
3482+@inbook{pattern-matching,
3483+ title = {The Implementation of Functional Programming Languages},
3484+ year = {1987},
3485+ booktitle = {The Implementation of Functional Programming Languages},
3486+ pages = {78--103},
3487+ editor = {Simon {Peyton Jones}},
3488+ chapter = {5},
3489+ publisher = {Prentice Hall},
3490+ author = {Philip Wadler},
3491+ crossref = {pj-imp}
3492+}
3493+
3494+@article{pe-problems,
3495+ author = {Jones, N. D.},
3496+ title = {Challenging problems in partial evaluation and mixed computation},
3497+ journal = {New Gen. Comput.},
3498+ volume = {6},
3499+ number = {2-3},
3500+ year = {1988},
3501+ issn = {0288-3635},
3502+ pages = {291--302},
3503+ doi = {http://dx.doi.org/10.1007/BF03037143},
3504+ publisher = {Ohmsha},
3505+ address = {Tokyo, Japan, Japan},
3506+ }
3507+
3508+@inproceedings{tag-elim,
3509+ title = {Tag Elimination -- or -- Type Specialisation is a Type Indexed Effect},
3510+ year = {2000},
3511+ booktitle = {Subtyping and Dependent Types in Programming, APPSEM Workshop},
3512+ author = {Walid Taha and Henning Makholm}
3513+}
3514+
3515+@inproceedings{extraction-coq,
3516+ title = {A New Extraction for {Coq}},
3517+ year = {2002},
3518+ booktitle = {Types for proofs and programs},
3519+ editor = {Herman Geuvers and Freek Wiedijk},
3520+ publisher = {Springer},
3521+ author = {Pierre Letouzey},
3522+ series = {LNCS}
3523+}
3524+
3525+@phdthesis{mcbride-snr-thesis,
3526+ school = {Queen's University of Belfast},
3527+ title = {Computer Aided Manipulation of Symbols},
3528+ year = {1970},
3529+ author = {Fred McBride}
3530+}
3531+
3532+@article{ho-strictness,
3533+ journal = {Science of Computer Programming},
3534+ volume = {7},
3535+ title = {Strictness analysis for higher-order functions},
3536+ year = {1986},
3537+ pages = {249--278},
3538+ author = { Geoffrey L. Burn and Chris Hankin and Samson Abramsky}
3539+}
3540+
3541+@phdthesis{mycroft-thesis,
3542+ school = {Dept Computer Science, University of Edinburgh},
3543+ title = {Abstract interpretation and optimising transformations for applicative programs},
3544+ year = {1981},
3545+ author = {A. Mycroft}
3546+}
3547+
3548+@inproceedings{bc-nested,
3549+ month = {September},
3550+ volume = {2152},
3551+ title = {Nested General Recursion and Partiality in Type Theory},
3552+ year = {2001},
3553+ booktitle = {Theorem Proving In Higher Order Logics: 14th International Conferences, TPHOLS 2001},
3554+ pages = {121--135},
3555+ publisher = {Springer--Verlag},
3556+ author = {Ana Bove and Venanzio Capretta},
3557+ series = {LNCS}
3558+}
3559+
3560+@techreport{bove-mutual,
3561+ month = {May},
3562+ title = {Mutual General Recursion in Type Theory},
3563+ year = {2002},
3564+ institution = {Department of Computing Science, Chalmers University of Technology},
3565+ author = {Ana Bove}
3566+}
3567+
3568+@article{berardi-pruning,
3569+ journal = {Journal of Logic and Computation},
3570+ number = {5},
3571+ volume = {6},
3572+ title = {Pruning Simply Typed Lambda Terms},
3573+ year = {1996},
3574+ pages = {663--681},
3575+ author = {Stefano Berardi}
3576+}
3577+
3578+@article{milner-tc,
3579+ journal = {Journal of Computer and System Science},
3580+ volume = {17},
3581+ title = {A Theory of Type Polymorphism in Programming},
3582+ year = {1978},
3583+ pages = {348--75},
3584+ author = {R. Milner}
3585+}
3586+
3587+@inproceedings{extt,
3588+ title = {Inductive Families Need Not Store Their Indices},
3589+ year = {2004},
3590+ booktitle = {Types for Proofs and Programs 2003},
3591+ author = {Edwin Brady and Conor McBride and James McKinna},
3592+ editor = {Stefano Berardi and Mario Coppo and Ferruccio Damiani},
3593+ series = {Lecture Notes in Computer Science},
3594+ publisher = {Springer},
3595+ volume = {3085},
3596+ pages = {115--129}
3597+}
3598+
3599+@book{luo94,
3600+ title = {Computation and Reasoning -- A Type Theory for Computer Science},
3601+ year = {1994},
3602+ publisher = {OUP},
3603+ author = {Zhaohui Luo},
3604+ series = {Intl. Series of Monographs on Comp. Sci.}
3605+}
3606+
3607+@article{backus78,
3608+ journal = {Communications of the {ACM}},
3609+ month = {August},
3610+ volume = {21},
3611+ title = {Can Programming Be Liberated From the {Von Neumann} Style?},
3612+ year = {1978},
3613+ pages = {280--294},
3614+ author = {John Backus}
3615+}
3616+
3617+@misc{henk,
3618+ month = {May},
3619+ title = {Henk: A Typed Intermediate Language},
3620+ year = {1997},
3621+ author = {Simon {Peyton Jones} and Erik Meijer}
3622+}
3623+
3624+@article{thunks,
3625+ journal = {Journal of Functional Programming},
3626+ number = {3},
3627+ month = {May},
3628+ volume = {7},
3629+ title = {Thunks and the $\lambda$-calculus},
3630+ year = {1997},
3631+ pages = {303--319},
3632+ author = {John Hatcliff and Olivier Danvy}
3633+}
3634+
3635+@inproceedings{grin-project,
3636+ author = "Urban Boquist and Thomas Johnsson",
3637+ title = "The {GRIN} Project: A Highly Optimising Back End for Lazy Functional Languages",
3638+ booktitle = "Implementation of Functional Languages",
3639+ pages = "58--84",
3640+ year = "1996",
3641+ url = "citeseer.ist.psu.edu/boquist96grin.html" }
3642+
3643+@misc{boehm-gc,
3644+ nothowpublished = {\url{http://www.hpl.hp.com/personal/Hans_Boehm/gc/}},
3645+ title = {A garbage collector for {C} and {C++}},
3646+ year = {2001},
3647+ author = {Hans-J. Boehm and Alan J. Demers and {Xerox Corporation Silicon Graphic} and {Hewlett-Packard Company}}
3648+}
3649+
3650+@misc{art-interpreter,
3651+ month = {May},
3652+ title = {The Art of the Interpreter or, the Modularity Complex (Parts Zero, One, and Two)},
3653+ year = {1978},
3654+ author = {Guy Lewis {Steele, Jr.} and Gerald Jay Sussman},
3655+ note = {MIT AI Lab. AI Lab Memo AIM-453}
3656+}
3657+
3658+@inproceedings{gimenez,
3659+ title = {Codifying Guarded Definitions With Recursive Schemes},
3660+ year = {1994},
3661+ booktitle = {Proceedings of TYPES 1994},
3662+ pages = {39--59},
3663+ author = {Eduardo Gim\'{e}nez}
3664+}
3665+
3666+@manual{ghc-manual,
3667+ title = {The Glasgow Haskell Compiler User's Guide, Version 6.0},
3668+ year = {2003},
3669+ author = {The {GHC Team}}
3670+}
3671+
3672+@article{rbtree,
3673+ journal = {Journal of Functional Programming},
3674+ number = {4},
3675+ month = {May},
3676+ volume = {9},
3677+ title = {Red-Black Trees In A Functional Setting},
3678+ year = {1999},
3679+ pages = {471--477},
3680+ author = {Chris Okasaki}
3681+}
3682+
3683+@inproceedings{dt-data,
3684+author = "Hongwei Xi",
3685+title = {{Dependently Typed Data Structures}},
3686+booktitle = "Proceedings of Workshop of Algorithmic Aspects of Advanced Programming Languages (WAAAPL '99)",
3687+year = 1999,
3688+month = "September",
3689+pages = "17--32",
3690+address = "Paris",
3691+}
3692+
3693+@misc{krivine,
3694+ title = {On the Correctness and Efficiency of the {Krivine} Machine},
3695+ year = {2003},
3696+ month = {October},
3697+ author = {Mitchell Wand and Daniel P. Friedman},
3698+ howpublished = {Submitted for publication}
3699+ }
3700+
3701+@inproceedings{nbe-filinski,
3702+ title = {Normalization by Evaluation for the Computational Lambda-Calculus},
3703+ year = {2001},
3704+ month = {May},
3705+ booktitle = {Typed Lambda Calculi and Applications: 5th International Conference, TLCA 2001},
3706+ author = {Andrzej Filinski},
3707+ pages = {151--165},
3708+ publisher = {Springer-Verlag},
3709+ series = {LNCS},
3710+ volume = {2044}
3711+}
3712+
3713+@inproceedings{filinski-nbesem,
3714+ title = {A semantic account of type-directed partial evaluation},
3715+ year = {1999},
3716+ author = {Andrzej Filinski},
3717+ editor = {G. Nadathur},
3718+ booktitle = {International Conference on Principles and Practice of Declarative Programming},
3719+ volume = {1702},
3720+ series = {LNCS},
3721+ pages = {378--395},
3722+ publisher = {Springer-Verlag}
3723+}
3724+
3725+@article{secd,
3726+ title = {The mechanical evaluation of expressions},
3727+ author = {P.J. Landin},
3728+ year = {1964},
3729+ journal = {Computer Journal},
3730+ volume = {6},
3731+ pages = {308--320}
3732+}
3733+
3734+@misc{lispkit,
3735+ title = {The {LispKit} Manual},
3736+ author = {Peter Henderson and Geraint Jones and Simon Jones},
3737+ year = {1982},
3738+ howpublished = {Oxford University Computing Laboratory}
3739+}
3740+
3741+@inproceedings{wells-undecidable,
3742+ title = {Typability and Type Checking in the Second-order $\lambda$-calculus are equivalent and undecidable},
3743+ author = {J. Wells},
3744+ year = {1994},
3745+ month = {July},
3746+ booktitle = {Proc. 9th Ann. {IEEE} Symp. Logic Comput. Sci.}
3747+}
3748+
3749+@misc{patguards,
3750+ title = {Pattern Guards and Transformational Patterns},
3751+ author = {Martin Erwig and Simon {Peyton Jones}},
3752+ year = {2000},
3753+ howpublished = {Haskell Workshop}
3754+}
3755+
3756+@misc{alfa-manual,
3757+ title = {Alfa Users' Guide},
3758+ author = {Thomas Hallgren},
3759+ year = {2001},
3760+ howpublished = {Available from \verb+http://www.cs.chalmers.se/~hallgren/Alfa/+}
3761+}
3762+
3763+@inproceedings{nofib,
3764+ title = {The nofib Benchmark Suite of {Haskell} Programs},
3765+ author = {Will Partain},
3766+ year = {1992},
3767+ booktitle = {Functional Programming},
3768+ editor = {J. Launchbury and P.L. Sansom},
3769+ series = {Workshops in Computing},
3770+ publisher = {Springer Verlag}
3771+}
3772+
3773+@article{shape,
3774+ title = {Shape in Computing},
3775+ author = {Barry Jay},
3776+ journal = "{{ACM}} Computing Surveys",
3777+ year = "1996",
3778+ volume = "28",
3779+ number = "2",
3780+ pages = "355--357",
3781+}
3782+
3783+@misc{ffi,
3784+ title = {The {Haskell 98} Foreign Function Interface 1.0: An Addendum to the {Haskell 98} Report},
3785+ editor = {Manuel Chakravarty},
3786+ key = {FFI},
3787+ year = {2002},
3788+ month = {December},
3789+ howpublished = {Available from \verb+http://www.haskell.org/+}
3790+}
3791+
3792+@misc{perlxs,
3793+ title = {Perl {XS} Reference Manual},
3794+ author = {Dean Roehrich and {The Perl Porters}},
3795+ year = {1996},
3796+ howpublished = {\verb+http://www.perldoc.com/perl5.6/pod/perlxs.html+}
3797+}
3798+
3799+@misc{swig,
3800+ title = {{SWIG} : An Easy to Use Tool for Integrating Scripting Languages with {C} and {C++}},
3801+ author = {David M. Beazley},
3802+ year = {1996},
3803+ howpublished = {\verb+http://www.swig.org/papers/Tcl96/tcl96.html+}
3804+}
3805+
3806+@inproceedings{types-prog,
3807+ title = {Type Systems for Programming Languages},
3808+ booktitle = {Handbook of Theoretical Computer Science},
3809+ author = {John C. Mitchell},
3810+ pages = {365--458},
3811+ year = {1990},
3812+ crossref = {htcs}
3813+}
3814+
3815+@book{htcs,
3816+ title = {Handbook of Theoretical Computer Science},
3817+ editor = {J. van Leeuwen},
3818+ publisher = {Elsevier Science},
3819+ year = {1990}
3820+}
3821+
3822+@misc{r5rs,
3823+ title = {Revised$^5$ Report on the Algorithmic Language Scheme},
3824+ author = {Richard Kelsey and William Clinger and Jonathan Rees},
3825+ year = {1998},
3826+ month = {February},
3827+ howpublished = {Available from \verb+http://www.schemers.org/+}
3828+ }
3829+
3830+@misc{gmail-outage,
3831+ title = {Update on today's {Gmail} Outage},
3832+ author = {{Official Gmail Blog}},
3833+ howpublished = {\url{http://gmailblog.blogspot.com/2009/02/update-on-todays-gmail-outage.html}},
3834+ note = {Retrieved 26th February 2009},
3835+ year = 2009
3836+}
impl-paper/macros.ltxnew file+1060
@@ -0,0 +1,1060 @@
1+%\usepackage{amstex}
2+\usepackage{amssymb}
3+\usepackage{latexsym}
4+\usepackage{eepic}
5+
6+
7+%%%%%%%%% INFERENCE RULES
8+
9+\newlength{\rulevgap}
10+\setlength{\rulevgap}{0.05in}
11+\newlength{\ruleheight}
12+\newlength{\ruledepth}
13+\newsavebox{\rulebox}
14+\newlength{\GapLength}
15+\newcommand{\gap}[1]{\settowidth{\GapLength}{#1} \hspace*{\GapLength}}
16+\newcommand{\dotstep}[2]{\begin{tabular}[b]{@{}c@{}}
17+ #1\\$\vdots$\\#2
18+ \end{tabular}}
19+\newlength{\fracwid}
20+\newcommand{\dotfrac}[2]{\settowidth{\fracwid}{$\frac{#1}{#2}$}
21+ \addtolength{\fracwid}{0.1in}
22+ \begin{tabular}[b]{@{}c@{}}
23+ $#1$\\
24+ \parbox[c][0.02in][t]{\fracwid}{\dotfill} \\
25+ $#2$\\
26+ \end{tabular}}
27+\newcommand{\Rule}[2]{\savebox{\rulebox}[\width][b] %
28+ {\( \frac{\raisebox{0in} {\( #1 \)}} %
29+ {\raisebox{-0.03in}{\( #2 \)}} \)} %
30+ \settoheight{\ruleheight}{\usebox{\rulebox}} %
31+ \addtolength{\ruleheight}{\rulevgap} %
32+ \settodepth{\ruledepth}{\usebox{\rulebox}} %
33+ \addtolength{\ruledepth}{\rulevgap} %
34+ \raisebox{0in}[\ruleheight][\ruledepth] %
35+ {\usebox{\rulebox}}}
36+\newcommand{\Case}[2]{\savebox{\rulebox}[\width][b] %
37+ {\( \dotfrac{\raisebox{0in} {\( #1 \)}} %
38+ {\raisebox{-0.03in}{\( #2 \)}} \)} %
39+ \settoheight{\ruleheight}{\usebox{\rulebox}} %
40+ \addtolength{\ruleheight}{\rulevgap} %
41+ \settodepth{\ruledepth}{\usebox{\rulebox}} %
42+ \addtolength{\ruledepth}{\rulevgap} %
43+ \raisebox{0in}[\ruleheight][\ruledepth] %
44+ {\usebox{\rulebox}}}
45+\newcommand{\Axiom}[1]{\savebox{\rulebox}[\width][b] %
46+ {$\frac{}{\raisebox{-0.03in}{$#1$}}$} %
47+ \settoheight{\ruleheight}{\usebox{\rulebox}} %
48+ \addtolength{\ruleheight}{\rulevgap} %
49+ \settodepth{\ruledepth}{\usebox{\rulebox}} %
50+ \addtolength{\ruledepth}{\rulevgap} %
51+ \raisebox{0in}[\ruleheight][\ruledepth] %
52+ {\usebox{\rulebox}}}
53+\newcommand{\RuleSide}[3]{\gap{$#2$} \hspace*{0.1in} %
54+ \Rule{#1}{#3} %
55+ \hspace*{0.1in}$#2$}
56+\newcommand{\AxiomSide}[2]{\gap{$#1$} \hspace*{0.1in} %
57+ \Axiom{#2} %
58+ \hspace*{0.1in}$#1$}
59+\newcommand{\RULE}[1]{\textbf{#1}}
60+\newcommand{\hg}{\hspace{0.2in}}
61+
62+\newcommand{\ProofState}
63+ [2]{\parbox{10cm}{\AR{\hg\AR{#1}\\\Axiom{\hg#2\hg}}}}
64+
65+%%%%%%%%%%%% TRISTUFF
66+
67+\newcommand{\btr}{
68+\setlength{\unitlength}{0.0005in}
69+\begin{picture}(69,180)(0,12)
70+\blacken\path(57,192)(57,12)(12,102)
71+ (57,192)(57,192)
72+\path(57,192)(57,12)(12,102)
73+ (57,192)(57,192)
74+\end{picture}
75+}
76+
77+\newcommand{\btl}{
78+\setlength{\unitlength}{0.0005in}
79+\begin{picture}(69,180)(0,12)
80+\blacken\path(12,192)(12,12)(57,102)
81+ (12,192)(12,192)
82+\path(12,192)(12,12)(57,102)
83+ (12,192)(12,192)
84+\end{picture}
85+}
86+
87+\newcommand{\wtr}{
88+\setlength{\unitlength}{0.0005in}
89+\begin{picture}(69,180)(0,12)
90+%\blacken\path(57,192)(57,12)(12,102)
91+% (57,192)(57,192)
92+\path(57,192)(57,12)(12,102)
93+ (57,192)(57,192)
94+\end{picture}
95+}
96+
97+\newcommand{\wtl}{
98+\setlength{\unitlength}{0.0005in}
99+\begin{picture}(69,180)(0,12)
100+%\blacken\path(12,192)(12,12)(57,102)
101+% (12,192)(12,192)
102+\path(12,192)(12,12)(57,102)
103+ (12,192)(12,192)
104+\end{picture}
105+}
106+
107+
108+
109+%%%%%%%%%%%% FONTS
110+
111+\newcommand{\TC}[1]{\mathsf{#1}}
112+\newcommand{\DC}[1]{\mathsf{#1}}
113+\newcommand{\VV}[1]{\mathit{#1}}
114+\newcommand{\FN}[1]{\mathbf{#1}}
115+\newcommand{\HFN}[1]{\mathtt{#1}}
116+\newcommand{\RW}[1]{\underline{\textrm{#1}}}
117+\newcommand{\MO}[1]{\mbox{\textsc{#1}}}
118+
119+\newcommand{\HF}[1]{\mathtt{#1}}
120+
121+\newcommand{\MV}[1]{\nhole\mathit{#1}}
122+\newcommand{\Lang}[1]{\mathsf{#1}}
123+\newcommand{\Name}[1]{\mathit{#1}}
124+
125+\newcommand{\demph}[1]{\textbf{#1}}
126+\newcommand{\remph}[1]{\emph{#1}}
127+
128+%%%% Keywords for meta operations
129+\newcommand{\IF}{\;\RW{if}\;\;}
130+\newcommand{\THEN}{\RW{then}}
131+\newcommand{\ELSE}{\RW{else}}
132+\newcommand{\AND}{\RW{and}}
133+\newcommand{\Otherwise}{\RW{otherwise}}
134+\newcommand{\Do}{\RW{do}}
135+\newcommand{\Return}{\RW{return}}
136+
137+\newcommand{\CASE}{\RW{case}}
138+\newcommand{\LET}{\RW{let}}
139+\newcommand{\IN}{\RW{in}}
140+\newcommand{\of}{\RW{of}}
141+
142+\newcommand{\CLASS}{\mathtt{class}}
143+\newcommand{\INSTANCE}{\mathtt{instance}}
144+
145+%%%%%%%%%%%% GROUPING
146+
147+\newcommand{\G}{
148+\setlength{\unitlength}{1pt}
149+\begin{picture}(4,10)(0,0)
150+\path(2,10)(2,-10)
151+\end{picture}
152+}
153+
154+\newcommand{\E}{
155+\setlength{\unitlength}{1pt}
156+\begin{picture}(4,10)(0,0)
157+\path(2,10)(2,-2)(4,-2)
158+\end{picture}
159+}
160+
161+%\newcommand{\C}{
162+%\setlength{\unitlength}{1pt}
163+%\begin{picture}(4,10)(0,0)
164+%\path(4,8)(2,8)(2,-2)(4,-2)
165+%\end{picture}
166+%}
167+
168+\newcommand{\M}{
169+\setlength{\unitlength}{1pt}
170+\begin{picture}(4,10)(0,0)
171+\path(2,10)(2,-2)(6,-2)
172+\end{picture}
173+}
174+
175+\newcommand{\F}{
176+\setlength{\unitlength}{1pt}
177+\begin{picture}(4,10)(0,0)
178+\path(4,8)(2,8)(2,-6)
179+\end{picture}
180+}
181+
182+\newcommand{\K}{
183+\setlength{\unitlength}{1pt}
184+\begin{picture}(4,10)(0,0)
185+\path(0,8)(4,8)
186+\end{picture}
187+}
188+
189+\newcommand{\J}{
190+\setlength{\unitlength}{1pt}
191+\begin{picture}(4,10)(0,0)
192+\path(0,-2)(4,-2)
193+\end{picture}
194+}
195+
196+\newcommand{\W}{
197+\setlength{\unitlength}{1pt}
198+\begin{picture}(4,10)(0,0)
199+\end{picture}
200+}
201+
202+
203+
204+%%%%%%%%%%%% GUBBINS
205+
206+\newcommand{\mathskip}{\medskip}
207+
208+\newcommand{\fbx}[1]{\fbox{$#1$}}
209+\newcommand{\stk}[1]{\begin{array}{c}#1\end{array}}
210+%\newcommand{\DM}[1]{\hg\mbox{$#1$}}
211+\newcommand{\DM}[1]{\mathskip\par\(#1\)\mathskip}
212+\newcommand{\mbx}[1]{\mathskip\par\noindent\(#1\)\mathskip}
213+\newcommand{\AR}[1]{\begin{array}[t]{@{}l}#1\end{array}}
214+\newcommand{\ARt}[1]{\begin{array}[t]{@{}l@{}cl}#1\end{array}}
215+\newcommand{\ARc}[1]{\begin{array}{@{}l}#1\end{array}}
216+\newcommand{\ARd}[1]{\begin{array}[t]{cl}#1\end{array}}
217+\newcommand{\DAR}[1]{\begin{array}{ll}\hg & #1\end{array}}
218+\newcommand{\Dor}{\\ \hg\mid & }
219+\newcommand{\EA}[1]{\begin{array}[t]{r@{}c@{}l}#1\end{array}}
220+\newcommand{\A}{@{\:}c}
221+%\newcommand{\R}{@{\:}r}
222+\newcommand{\CA}{c}
223+\newcommand{\LA}{l}
224+\newcommand{\PAc}[2]{\begin{array}{l#1@{}r@{}l}#2\end{array}}
225+\newcommand{\PA}[2]{\begin{array}[t]{l@{\:}l#1@{}r@{\:}l}#2\end{array}}
226+\newcommand{\DTREE}[3]{\begin{array}[t]{l#1@{}r@{\:}l#2}#3\end{array}}
227+\newcommand{\IDTREE}[2]{%
228+ \begin{array}[t]{l@{\:}c@{\:}l@{\:}r@{\:}l#1}#2\end{array}}
229+\newcommand{\IA}[2]
230+ {\begin{array}[t]{l@{\:}r@{\:}c@{\:}l@{\:}#1@{\:}r@{\:}l}#2\end{array}}
231+\newcommand{\IAc}[2]
232+ {\begin{array}[c]{r@{\:}c@{\:}l@{\:}#1@{}r@{}l}#2\end{array}}
233+\newcommand{\CS}[1]{\left\lfloor\begin{array}{@{}l}#1\end{array}\right.}
234+\newcommand{\BY}[3]{\multicolumn{2}{l}{\;\RW{by}\; #1} \\ %
235+ \multicolumn{#2}{l}{\CS{#3}} }
236+\newcommand{\WITH}[3]{\multicolumn{2}{l}{\;\RW{with}\; #1} \\ %
237+ \multicolumn{#2}{l}{\CS{#3}} }
238+\newcommand{\WithBy}{\RW{with-by}}
239+\newcommand{\Wb}[1]{\WithBy& #1}
240+\newcommand{\By}[1]{\multicolumn{2}{l}{\Leftarrow #1}}
241+\newcommand{\andby}{\Leftarrow}
242+\newcommand{\MyWith}[1]{\multicolumn{2}{l}{|\;#1}}
243+\newcommand{\Byr}[1]{\;\RW{by}\; #1}
244+
245+\renewcommand{\Bar}{|}
246+\newcommand{\Bart}{\settowidth{\GapLength}{$\Bar$}%
247+ \raisebox{6pt}[0pt][0pt]{$\Bar$}%
248+ \hspace*{-1\GapLength}%
249+ \Bar}
250+\newcommand{\With}[1]{\Bar & #1}
251+\newcommand{\Witt}[1]{\Bart & #1}
252+
253+\newcommand{\B}{@{\:}r@{\:}c}
254+\newcommand{\Ret}[1]{\multicolumn{2}{l}{\cq #1}}
255+\newcommand{\MRet}[2]{\multicolumn{#1}{l}{\cq #2}}
256+\newcommand{\HRet}[1]{\multicolumn{2}{l}{\hq #1}}
257+\newcommand{\MHRet}[2]{\multicolumn{#1}{l}{\hq #2}}
258+\newcommand{\IRet}[1]{\multicolumn{2}{l}{\iq #1}}
259+\newcommand{\IMRet}[2]{\multicolumn{#1}{l}{\iq #2}}
260+\newcommand{\MoRet}[1]{\multicolumn{2}{l}{\mq #1}}
261+\newcommand{\MMoRet}[2]{\multicolumn{#1}{l}{\mq #2}}
262+\newcommand{\Data}{\RW{data}}
263+\newcommand{\Codata}{\RW{codata}}
264+\newcommand{\Where}{\RW{where}}
265+\newcommand{\Let}{\RW{let}}
266+\newcommand{\Fact}{\RW{fact}}
267+\newcommand{\Rec}[1]{#1\textbf{-Rec}}
268+\newcommand{\Memo}[1]{#1\textbf{-Memo}}
269+\newcommand{\Elim}[1]{#1\textbf{-Elim}}
270+\newcommand{\Cases}[1]{#1\textbf{-Case}}
271+\newcommand{\View}[1]{#1\textbf{-View}}
272+\newcommand{\As}[2]{#1 \:\RW{as}\: #2}
273+\newcommand{\nhole}{\Box}
274+\newcommand{\turq}{\:\vdash_?\:}
275+\renewcommand{\split}{\;\lhd\;}
276+\newcommand{\CType}[2]{\{#1 \split\; #2\}}
277+\newcommand{\CC}[2]{(#1)\:#2}
278+\newcommand{\UP}[2]{#1 | \{#2\}}
279+\newcommand{\Ured}{\:\Downarrow\:}
280+\newcommand{\gdd}{\prec}
281+\newcommand{\HC}[1]{\left<#1\right>}
282+\newcommand{\HT}[2]{\left<#1 \hab #2\right>}
283+
284+\newcommand{\view}{\RW{view}}
285+\newcommand{\ecase}{\RW{case}}
286+\newcommand{\rec}{\RW{rec}}
287+
288+\newcommand{\If}{\mathsf{if}}
289+\newcommand{\Then}{\mathsf{then}}
290+\newcommand{\Else}{\mathsf{else}}
291+\newcommand{\elim}{\RW{elim}}
292+
293+\newcommand{\Payload}{\mathsf{type}}
294+\newcommand{\Any}{\mathsf{Some}}
295+
296+\newcommand{\lbl}[2]{\langle #1 \Hab #2 \rangle}
297+\newcommand{\call}[2]{\RW{call}\:\langle#1\rangle\:#2}
298+\newcommand{\return}[1]{\RW{return}\:#1}
299+
300+\newcommand{\Remark}[1]{\noindent\textbf{Remark:} #1}
301+
302+\newcommand{\DBOX}[2]{\fbox{\parbox{#1}{\textbf{Definition:}#2}}}
303+
304+\newcommand{\useverbtb}[1]{\begin{tiny}\BUseVerbatim{#1}\end{tiny}}
305+\newcommand{\useverb}[1]{\begin{small}\BUseVerbatim{#1}\end{small}}
306+\newcommand{\useverbb}[1]{\begin{small}\BUseVerbatim{#1}\end{small}}
307+
308+\newcommand{\diagfig}[3]{\begin{figure}[h]\begin{center}\includegraphics[width=#1]{#2}\end{center}
309+\caption{#3}\label{#2}\end{figure}}
310+\newcommand{\codefig}[2]{\begin{figure}[h]\useverb{#1}\caption{#2}\label{#1}\end{figure}}
311+\newcommand{\codefigt}[2]{\begin{figure}[t]\useverb{#1}\caption{#2}\label{#1}\end{figure}}
312+\newcommand{\codefigb}[2]{\begin{figure}[b]\useverb{#1}\caption{#2}\label{#1}\end{figure}}
313+\newcommand{\codefigtc}[2]{\begin{figure*}[t]\useverb{#1}\caption{#2}\label{#1}\end{figure}}
314+\newcommand{\diagfigtc}[3]{\begin{figure*}[t]\begin{center}\includegraphics[width=#1]{#2}\end{center}
315+\caption{#3}\label{#2}\end{figure*}}
316+
317+\newcommand{\FIG}[3]{\begin{figure}[h]\DM{#1}\caption{#2}\label{#3}\end{figure}}
318+\newcommand{\FFIG}[3]{\begin{figure}\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure}}
319+\newcommand{\FFIGB}[3]{\begin{figure}[b]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure}}
320+\newcommand{\FFIGTC}[3]{\begin{figure*}[t]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure*}}
321+\newcommand{\VFIG}[3]{\begin{figure}[h]\begin{boxedverbatim}#1\end{boxedverbatim}\caption{#2}\label{#3}\end{figure}}
322+\newcommand{\PFIG}[3]{\begin{figure}[p]\begin{center}\fbox{\DM{#1}}\end{center}\caption{#2}\label{#3}\end{figure}}
323+\newcommand{\CFIG}[3]{\begin{figure}[h]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure}}
324+
325+\newcommand{\TFIG}[4]{\begin{figure}[h]\begin{center}\begin{tabular}{#1}#2\end{tabular}\end{center}\caption{#3}\label{#4}\end{figure}}
326+\newcommand{\TFIGTC}[4]{\begin{figure*}[t]\begin{center}\begin{tabular}{#1}#2\end{tabular}\end{center}\caption{#3}\label{#4}\end{figure*}}
327+
328+\newcommand{\RESFIG}[3]{
329+\TFIG{|l|c|c|c|c|c|c|c|c|}{
330+\hline
331+ & \multicolumn{4}{c|}{\Naive{} compilation} &
332+ \multicolumn{4}{|c|}{Optimised compilation} \\
333+\cline{2-9}
334+\raisebox{1.5ex}[0pt]{Program} & Instrs & Thunks & Cells &
335+Accesses & Instructions & Thunks & Cells & Accesses \\
336+%\raisebox{1.5ex}[0pt]{Program} & I & T & C & M & I & T & C & M \\
337+\hline
338+#1
339+\hline
340+}{#2}{#3}}
341+
342+\newcommand{\NEWRESFIG}[3]{
343+\TFIG{|l|l|c|c|c|c|}{
344+\hline
345+% & \multicolumn{4}{c|}{\Naive{} compilation} &
346+% \multicolumn{4}{|c|}{Optimised compilation} \\
347+%\cline{2-9}
348+Program & Version & Instructions & Thunks & Memory Accesses & Cells \\
349+%\raisebox{1.5ex}[0pt]{Program} & I & T & C & M & I & T & C & M \\
350+\hline
351+#1
352+}{#2}{#3}}
353+
354+\newcommand{\NEWRESFIGTC}[3]{
355+\TFIGTC{|l|l|c|c|c|c|}{
356+\hline
357+% & \multicolumn{4}{c|}{\Naive{} compilation} &
358+% \multicolumn{4}{|c|}{Optimised compilation} \\
359+%\cline{2-9}
360+Program & Version & Instructions & Thunks & Memory Accesses & Cells \\
361+%\raisebox{1.5ex}[0pt]{Program} & I & T & C & M & I & T & C & M \\
362+\hline
363+#1
364+}{#2}{#3}}
365+
366+\newcommand{\RESLINE}[9]{
367+& \Naive{} & #2 & #3 & #5 & #4 \\
368+#1
369+& Optimised & #6 & #7 & #9 & #8 \\
370+}
371+\newcommand{\RESCHANGE}[4]{
372+& Change & \textbf{#1} & \textbf{#2} & \textbf{#4} & \textbf{#3} \\
373+\hline
374+}
375+\newcommand{\RESCHANGEa}[5]{
376+#5 & Change & \textbf{#1} & \textbf{#2} & \textbf{#4} & \textbf{#3} \\
377+\hline
378+}
379+
380+%%%%%%%%%%%% PUNCTUATION
381+
382+\newcommand{\pad}[2]{#1#2#1}
383+
384+\newcommand{\hab}{\pad{\,}{:}}
385+\newcommand{\Hab}{\pad{\;}{:}}
386+\newcommand{\HHab}{\pad{\;}{::}}
387+
388+%%%%%%%%%%%% TYPE
389+
390+\newcommand{\Type}{\mbox{\texttt{\#}}} %\star}
391+
392+
393+%%%%%%%%%%%%% ARROWS
394+
395+\newcommand{\To}{\pad{\:}{\rightarrow}}
396+\newcommand{\Gets}{\leftarrow}
397+%\newcommand{\car}{\vartriangleright}
398+
399+%%%%%%%%%%%%% QUANTIFIERS
400+
401+\newcommand{\lam}[2]{\lambda#1\pad{\!}{:}#2}
402+\newcommand{\fbind}[3]{(#1\Hab#2)\to#3}
403+\newcommand{\all}[2]{\forall#1\pad{\!}{:}#2}
404+\newcommand{\hole}[2]{?#1\pad{\!}{:}#2}
405+\newcommand{\guess}[3]{?#1\pad{\!}{:}#2\approx#3}
406+\newcommand{\remlam}[2]{\lambda\{#1\pad{\!}{:}#2\}}
407+\newcommand{\remall}[2]{\forall\{#1\pad{\!}{:}#2\}}
408+\newcommand{\allpi}[2]{\Pi#1\pad{\!}{:}#2}
409+\newcommand{\ali}[2]{\forall#1|#2}
410+\newcommand{\exi}[2]{\exists#1\pad{\!}{:}#2}
411+\newcommand{\wit}[2]{\ang{#1,#2}}
412+\newcommand{\X}{\times}
413+\newcommand{\sig}[2]{\Sigma#1\pad{\!}{:}#2}
414+
415+\newcommand{\SC}{.\:}
416+
417+\newcommand{\letbind}[3]{\mathsf{let}\:#1{:}#2\:=\:#3\:\mathsf{in}}
418+\newcommand{\ifthen}[3]{\mathsf{if}\:#1\:\mathsf{then}\:#2\:\mathsf{else}\:#3}
419+
420+%%%%%%%%%%%%% EQUALITIES
421+
422+\newcommand{\cq}{\pad{\:}{\mapsto}}
423+\newcommand{\xq}{\pad{}{\doteq}}
424+\newcommand{\pq}{\pad{\:}{=}}
425+\newcommand{\dq}{\pad{\:}{:=}}
426+\newcommand{\iq}{\pad{\:}{\leadsto}}
427+\newcommand{\mq}{\Longrightarrow}
428+\newcommand{\retq}{\Rightarrow}
429+\newcommand{\hq}{\pad{\:}{=}}
430+\newcommand{\defq}{\mapsto}
431+
432+\newcommand{\refl}{\TC{refl}}
433+
434+
435+
436+
437+%%%%%%%%%%%%% CATSTUFF
438+
439+\newlength{\Lwibrs}
440+\newlength{\Lwobrs}
441+\newsavebox{\Bwibrs}
442+\newsavebox{\Bwobrs}
443+\newcommand{\Db}[5]{%
444+ \savebox{\Bwobrs}[\width][b]{$#5$}%
445+ \savebox{\Bwibrs}[\width][b]{$\left#2\usebox{\Bwobrs}\right#3$}%
446+ \settowidth{\Lwobrs}{\usebox{\Bwobrs}}%
447+ \settowidth{\Lwibrs}{\usebox{\Bwibrs}}%
448+ \addtolength{\Lwibrs}{-\Lwobrs}%
449+ \left#1\pad{\hspace*{-0.25\Lwibrs}}{\usebox{\Bwibrs}}\right#4}
450+\newcommand{\LDb}[3]{%
451+ \savebox{\Bwobrs}[\width][b]{$#3$}%
452+ \savebox{\Bwibrs}[\width][b]{$\left#2\usebox{\Bwobrs}\right.$}%
453+ \settowidth{\Lwobrs}{\usebox{\Bwobrs}}%
454+ \settowidth{\Lwibrs}{\usebox{\Bwibrs}}%
455+ \addtolength{\Lwibrs}{-\Lwobrs}%
456+ \left#1\hspace*{-0.4\Lwibrs}\usebox{\Bwibrs}\right.}
457+\newcommand{\RDb}[3]{%
458+ \savebox{\Bwobrs}[\width][b]{$#3$}%
459+ \savebox{\Bwibrs}[\width][b]{$\left.\usebox{\Bwobrs}\right#1$}%
460+ \settowidth{\Lwobrs}{\usebox{\Bwobrs}}%
461+ \settowidth{\Lwibrs}{\usebox{\Bwibrs}}%
462+ \addtolength{\Lwibrs}{-\Lwobrs}%
463+ \left.\usebox{\Bwibrs}\hspace*{-0.4\Lwibrs}\right#2}
464+\newcommand{\Sc}{\Db{[}{[}{]}{]}}
465+\newcommand{\Mo}{\Db{|}{>}{<}{|}}
466+\newcommand{\MoL}{\LDb{|}{>}}
467+\newcommand{\MoR}{\RDb{<}{|}}
468+
469+\newcommand{\car}{\mbox{$-\!\triangleright$}}
470+\newcommand{\io}[1]{\iota_{#1}}
471+\newcommand{\cc}{\diamond}
472+
473+
474+%%%%%%%%%%%%% FNS
475+
476+\newcommand{\Wk}{\Uparrow}
477+
478+%%%%%%%%%%%%% Transformation
479+
480+\newcommand{\Transform}[3]{\textsc{Trans}\:_{\Name{#1}}
481+ \interp{#2}\:\mq\:#3}
482+%\:[\:#2\:\Longrightarrow\:#3\:]}
483+\newcommand{\Morphism}[2]{\textsc{Morphism}\:#1\:\Longrightarrow\:#2}
484+\newcommand{\MI}[1]{\begin{array}{ll} #1 \end{array}\\}
485+\newcommand{\MorphItem}[2]{& #1 \:\Longrightarrow\: #2}
486+
487+%%%%%%%%%%%%% Stuff
488+
489+% Motive and methods
490+
491+\newcommand{\motive}{\vP}
492+\newcommand{\meth}[1]{\vm_{#1}}
493+
494+% Tuples
495+\newcommand{\tuple}[1]{\langle#1\rangle}
496+\newcommand{\Tuple}[1]{\mathsf{Tuple}}
497+\newcommand{\proj}{\mathsf{proj}}
498+\newcommand{\app}{\mathrm{+\!+}}
499+
500+% Commenting out
501+\newcommand{\ig}[1]{[#1]}
502+\newcommand{\rem}[1]{\{\!#1\!\}}
503+\newcommand{\igc}[1]{[#1]}
504+\newcommand{\remc}[1]{\{\!#1\!\}}
505+
506+
507+\newcommand{\ind}{\hspace*{0.1cm}}
508+
509+% Content free type
510+\newcommand{\CF}{\TC{CF}}
511+\newcommand{\cf}{\DC{cf}}
512+
513+% Error token
514+\newcommand{\error}{\DC{error}}
515+\newcommand{\fail}{\perp}
516+
517+% Constructor stripping
518+\newcommand{\conarg}[2]{#1!#2}
519+
520+\newcommand{\Vect}{\TC{Vect}}
521+\newcommand{\VectM}{\TC{Vect^-}}
522+\newcommand{\Vnil}{\DC{\epsilon}}
523+\newcommand{\Vcons}{\DC{::}}
524+
525+\newcommand{\Vsnoc}{\DC{::}}
526+
527+\newcommand{\VnilM}{\DC{\epsilon^-}}
528+\newcommand{\VconsM}{\DC{::^-}}
529+
530+\newcommand{\Vnilcase}{\VV{vNilCase}}
531+\newcommand{\Vconscase}{\VV{vConsCase}}
532+
533+\newcommand{\DSigma}{\TC{Sigma}}
534+\newcommand{\Exists}{\DC{Exists}}
535+
536+\newcommand{\ListPair}[2]{\sig{#1}{\List\:\vA}.#2 = \FN{length}\:#1}
537+\newcommand{\lpNilDef}{\lpNil{\FN{refl}\:\Z}}
538+\newcommand{\lpNil}[1]{(\nil\:\vA,#1)}
539+\newcommand{\lpConsDef}[3]{\lpCons{#1}{(\FN{fst\:#2})}{\FN{resp}\:(\FN{snd}\:#2)}}
540+\newcommand{\lpCons}[3]{(\cons\:#1\:#2,#3)}
541+\newcommand{\lp}[2]{(#1, #2)}
542+
543+\newcommand{\VnilTop}{\DC{vNil}^\ast}
544+\newcommand{\VconsTop}{\DC{vCons}^\ast}
545+
546+\newcommand{\VnilBot}{\DC{\epsilon}^-}
547+\newcommand{\VconsBot}{\DC{::}^-}
548+
549+\newcommand{\VectTop}{\TC{Vect}^\ast}
550+\newcommand{\VectBot}{\TC{Vect}^-}
551+
552+\newcommand{\VectDrop}{\FN{vectDropIdx}}
553+\newcommand{\VectRebuild}{\FN{vectRebuild}}
554+
555+\newcommand{\Prop}{\TC{Prop}}
556+\newcommand{\Set}{\TC{Set}}
557+\newcommand{\CoqType}{\TC{Type}}
558+
559+\newcommand{\List}{\TC{List}}
560+\newcommand{\nil}{\DC{nil}}
561+\newcommand{\cons}{\DC{cons}}
562+
563+\newcommand{\Zip}{\TC{Tsil}}
564+\newcommand{\zip}{\FN{tsil}}
565+\newcommand{\zipcons}{\FN{tsilcons}}
566+\newcommand{\snoc}{\DC{Snoc}}
567+\newcommand{\lin}{\DC{Empty}}
568+
569+\newcommand{\BigInt}{\TC{BigInt}}
570+\newcommand{\False}{\TC{False}}
571+\newcommand{\Unit}{\TC{Unit}}
572+\newcommand{\UnitI}{\DC{unit}}
573+
574+\newcommand{\genType}{\TC{X}}
575+\newcommand{\genIndicesDec}{\tb\Hab\tB}
576+\newcommand{\genIndices}{\tb}
577+\newcommand{\genConArgsDec}[1]{\vec{\VV{a_#1}}\Hab\vec{\VV{A_#1}}}
578+\newcommand{\genConArgs}[1]{\vec{\VV{a_#1}}}
579+\newcommand{\genConIndicesDec}[1]{\vec{\VV{b_#1}}\Hab\vec{\VV{B_#1}}}
580+\newcommand{\genConIndices}[1]{\vec{\VV{b_#1}}}
581+\newcommand{\genCon}[1]{\DC{x}_#1}
582+
583+\newcommand{\genTypeTop}{\TC{X^\ast}}
584+\newcommand{\genTypeBot}{\TC{X^-}}
585+
586+\newcommand{\genTypeDrop}{\FN{XDropIdx}}
587+\newcommand{\genTypeRebuild}{\FN{XRebuild}}
588+
589+\newcommand{\HTerm}{\texttt{Term}}
590+\newcommand{\Term}{\TC{Term}}
591+\newcommand{\Var}{\DC{var}}
592+\newcommand{\Lam}{\DC{lam}}
593+\newcommand{\App}{\DC{app}}
594+\newcommand{\TermM}{\TC{Term^-}}
595+\newcommand{\VarM}{\DC{var^-}}
596+\newcommand{\LamM}{\DC{lam^-}}
597+\newcommand{\AppM}{\DC{app^-}}
598+\newcommand{\Env}{\TC{Env}}
599+\newcommand{\SType}{\TC{STy}}
600+\newcommand{\farrow}{\Rightarrow}
601+\newcommand{\lookup}{\FN{lookup}}
602+
603+% \newcommand{\source}{\Lang{TT}}
604+\newcommand{\source}{\textbf{DT-Res}}
605+\newcommand{\target}{\Lang{ExTT}}
606+\newcommand{\runtime}{\Lang{RunTT}}
607+
608+\newcommand{\lt}{\TC{<}}
609+\newcommand{\ltO}{\DC{ltO}}
610+\newcommand{\ltS}{\DC{ltS}}
611+
612+\newcommand{\interp}[1]{\llbracket #1 \rrbracket}
613+\newcommand{\inferrable}[2]{\FN{inferrable}(#1,#2)}
614+\newcommand{\mkPat}{\FN{mkPat}}
615+
616+\newcommand{\FinM}{\TC{Fin^-}}
617+\newcommand{\fzM}{\DC{f0^-}}
618+\newcommand{\fsM}{\DC{fs^-}}
619+
620+\newcommand{\concat}{\mathrm{++}}
621+
622+%\newcommand{\bottom}{\perp}
623+
624+% Reductions
625+
626+\newcommand{\reduces}{\mapsto}
627+\newcommand{\translation}{\Rightarrow}
628+%\newcommand{\reducesn}[1]{\reduces\hspace*{-0.15cm}_{#1}}
629+%\newcommand{\reducesto}{\reduces\hspace*{-0.15cm}^{*}}
630+\newcommand{\reducesn}[1]{\reduces_{#1}}
631+\newcommand{\reducesto}{\reduces^{*}}
632+
633+% Equality
634+
635+\newcommand{\Refl}{\DC{refl}}
636+\newcommand{\leZ}{\DC{O_{\le}}}
637+\newcommand{\leS}{\DC{S_{\le}}}
638+
639+% Random elimination things
640+
641+\newcommand{\lte}{\TC{\leq}}
642+\newcommand{\lten}{\DC{leN}}
643+\newcommand{\lteO}{\DC{leO}}
644+\newcommand{\lteS}{\DC{leS}}
645+
646+\newcommand{\ltelim}{\Elim{\lt}}
647+\newcommand{\leelim}{\Elim{\lte}}
648+
649+\newcommand{\dD}{\TC{D}}
650+\newcommand{\delim}{\Elim{\TC{D}}}
651+\newcommand{\drec}{\Rec{\TC{D}}}
652+\newcommand{\dcase}{\Cases{\TC{D}}}
653+\newcommand{\dview}{\View{\TC{D}}}
654+\newcommand{\dmemo}{\Memo{\TC{D}}}
655+\newcommand{\natrec}{\Rec{\Nat}}
656+\newcommand{\natmemo}{\Memo{\Nat}}
657+\newcommand{\natmemogen}{\Nat\textbf{-MemoGen}}
658+\newcommand{\natelim}{\Elim{\Nat}}
659+\newcommand{\boolcase}{\Cases{\Bool}}
660+\newcommand{\vectrec}{\Rec{\Vect}}
661+\newcommand{\vectelim}{\Elim{\Vect}}
662+\newcommand{\listrec}{\Rec{\List}}
663+\newcommand{\listelim}{\Elim{\List}}
664+\newcommand{\finrec}{\Rec{\Fin}}
665+\newcommand{\finelim}{\Elim{\Fin}}
666+\newcommand{\natcase}{\Cases{\Nat}}
667+\newcommand{\vectcase}{\Cases{\Vect}}
668+\newcommand{\natdoublerec}{\Nat\textbf{-double-elim}}
669+\newcommand{\eqelim}{=\textbf{-elim}}
670+\newcommand{\falsecase}{\Cases{\False}}
671+
672+% Code
673+\newcommand{\Haskell}[1]{\begin{quotation}\begin{verbatim}#1\end{verbatim}\end{quotation}}
674+
675+% Quicksort
676+
677+\newcommand{\QSView}{\TC{QuickSort}}
678+\newcommand{\qsempty}{\DC{empty}}
679+\newcommand{\partition}{\DC{partition}}
680+\newcommand{\qsview}{\FN{mkQuickSort}}
681+
682+% More gubbins
683+
684+\newcommand{\converts}{\simeq}
685+\newcommand{\cumul}{\preceq}
686+\newcommand{\whnf}{\Downarrow}
687+\newcommand{\elem}{\in}
688+\newcommand{\proves}{\vdash}
689+\newcommand{\biimplies}{\Longleftrightarrow}
690+
691+\newcommand{\lc}{\lambda_{\mathsf{AC}}}
692+\newcommand{\zed}{\mathbb{Z}}
693+
694+% Haskell keywords
695+
696+\newcommand{\hdata}{\mathtt{data}}
697+\newcommand{\newtype}{\mathtt{newtype}}
698+%\newcommand{\htype}{\mathtt{type}}
699+
700+\newcommand{\HTC}[1]{\mathtt{#1}}
701+\newcommand{\HDC}[1]{\mathtt{#1}}
702+
703+% Nobby
704+
705+\newcommand{\Value}{\HTC{Value}}
706+\newcommand{\VGamma}{\HTC{Env}}
707+\newcommand{\Ctxt}{\HTC{Ctxt}}
708+\newcommand{\Defs}{\HTC{Defs}}
709+\newcommand{\ECtxt}{\HTC{ECtxt}}
710+\newcommand{\TCtxt}{\HTC{TCtxt}}
711+\newcommand{\VG}{\HDC{Env}}
712+\newcommand{\Model}{\HTC{Model}}
713+\newcommand{\Const}{\HTC{Const}}
714+\newcommand{\Normal}{\HTC{Normal}}
715+\newcommand{\Scope}{\HTC{Scope}}
716+\newcommand{\Kripke}{\HTC{Kripke}}
717+\newcommand{\Weakening}{\HTC{Weakening}}
718+\newcommand{\Ready}{\HTC{Ready}}
719+\newcommand{\Blocked}{\HTC{Blocked}}
720+\newcommand{\Spine}{\HTC{Spine}}
721+
722+\newcommand{\BV}{\HDC{BV}}
723+\newcommand{\BCon}{\HDC{BCon}}
724+\newcommand{\BTyCon}{\HDC{BTyCon}}
725+\newcommand{\RCon}{\HDC{RCon}}
726+\newcommand{\RTyCon}{\HDC{RTyCon}}
727+\newcommand{\BElim}{\HDC{BElim}}
728+\newcommand{\DV}{\HDC{V}}
729+\newcommand{\DP}{\HDC{P}}
730+
731+\newcommand{\MR}{\HDC{R}}
732+\newcommand{\MB}{\HDC{B}}
733+\newcommand{\DSc}{\HDC{Sc}}
734+\newcommand{\DKr}{\HDC{Kr}}
735+\newcommand{\DWk}{\HDC{Wk}}
736+\newcommand{\DSnoc}{\HDC{;}}
737+\newcommand{\DType}{\HDC{Type}}
738+\newcommand{\DName}{\HDC{Name}}
739+\newcommand{\DInt}{\HDC{Int}}
740+\newcommand{\DString}{\HDC{String}}
741+\newcommand{\DElim}{\HDC{Elim}}
742+\newcommand{\Empty}{\HDC{\emptyset}}
743+
744+\newcommand{\ConCode}{\HTC{ConCode}}
745+\newcommand{\ElimRule}{\HTC{ElimRule}}
746+
747+\newcommand{\DConst}{\HDC{Const}}
748+\newcommand{\DCon}{\HDC{Con}}
749+\newcommand{\DTyCon}{\HDC{TyCon}}
750+\newcommand{\RConst}{\HDC{RConst}}
751+\newcommand{\RLam}{\HDC{RLam}}
752+\newcommand{\RPi}{\HDC{RPi}}
753+\newcommand{\DLam}{\HDC{Lam}}
754+\newcommand{\DLet}{\HDC{Let}}
755+\newcommand{\DPi}{\HDC{Pi}}
756+\newcommand{\DApp}{\HDC{App}}
757+
758+\newcommand{\TMaybe}{\HTC{Maybe}}
759+\newcommand{\DNothing}{\HDC{Nothing}}
760+\newcommand{\DJust}{\HDC{Just}}
761+
762+
763+% G-machine and heap
764+
765+\newcommand{\PUSH}{\mathsf{PUSH}}
766+\newcommand{\PUSHNAME}{\mathsf{PUSHNAME}}
767+\newcommand{\POP}{\mathsf{DISCARD}}
768+\newcommand{\PUSHFUN}{\mathsf{PUSHFUN}}
769+\newcommand{\APPLY}{\mathsf{MKAP}}
770+\newcommand{\EVAL}{\mathsf{EVAL}}
771+\newcommand{\GCON}{\mathsf{MKCON}}
772+\newcommand{\GTUP}{\mathsf{MKTUP}}
773+\newcommand{\GTYPE}{\mathsf{MKTYPE}}
774+\newcommand{\UPDATE}{\mathsf{UPDATE}}
775+\newcommand{\RET}{\mathsf{RET}}
776+\newcommand{\UNWIND}{\mathsf{UNWIND}}
777+\newcommand{\CASEJUMP}{\mathsf{CASEJUMP}}
778+\newcommand{\LABEL}{\mathsf{LABEL}}
779+\newcommand{\MOVE}{\mathsf{MOVE}}
780+\newcommand{\JUMP}{\mathsf{JUMP}}
781+\newcommand{\SPLIT}{\mathsf{SPLIT}}
782+\newcommand{\SQUEEZE}{\mathsf{SQUEEZE}}
783+\newcommand{\JFUN}{\mathsf{JFUN}}
784+\newcommand{\PROJ}{\mathsf{PROJ}}
785+\newcommand{\ERROR}{\mathsf{ERROR}}
786+\newcommand{\SLIDE}{\mathsf{SLIDE}}
787+\newcommand{\ALLOC}{\mathsf{ALLOC}}
788+
789+\newcommand{\PUSHBIG}{\mathsf{PUSHBIG}}
790+\newcommand{\PUSHBASIC}{\mathsf{PUSHBASIC}}
791+\newcommand{\PUSHINT}{\mathsf{PUSHINT}}
792+\newcommand{\PUSHBOOL}{\mathsf{PUSHBOOL}}
793+\newcommand{\GET}{\mathsf{GET}}
794+\newcommand{\MKINT}{\mathsf{MKINT}}
795+\newcommand{\MKBOOL}{\mathsf{MKBOOL}}
796+\newcommand{\ADD}{\mathsf{ADD}}
797+\newcommand{\SUB}{\mathsf{SUB}}
798+\newcommand{\MULT}{\mathsf{MULT}}
799+\newcommand{\LT}{\mathsf{LT}}
800+\newcommand{\EQ}{\mathsf{EQ}}
801+\newcommand{\GT}{\mathsf{GT}}
802+\newcommand{\JTRUE}{\mathsf{JTRUE}}
803+
804+\newcommand{\APP}{\mathsf{APP}}
805+\newcommand{\FUN}{\mathsf{FUN}}
806+\newcommand{\CON}{\mathsf{CON}}
807+\newcommand{\TYCON}{\mathsf{TYCON}}
808+\newcommand{\TUP}{\mathsf{TUP}}
809+\newcommand{\TYPE}{\mathsf{TYPE}}
810+\newcommand{\INT}{\mathsf{INT}}
811+\newcommand{\BIGINT}{\mathsf{BIGINT}}
812+\newcommand{\BOOL}{\mathsf{BOOL}}
813+\newcommand{\HOLE}{\mathsf{HOLE}}
814+
815+% G machine translation scheme
816+
817+\newcommand{\sinterp}[1]{\mathcal{S}\interp{#1}}
818+\newcommand{\sinterpm}[1]{\mathcal{S}\AR{\interp{#1}}}
819+\newcommand{\einterp}[3]{\mathcal{E}\interp{#1}\:#2\:#3}
820+\newcommand{\cinterp}[3]{\mathcal{C}\interp{#1}\:#2\:#3}
821+\newcommand{\binterp}[3]{\mathcal{B}\interp{#1}\:#2\:#3}
822+\newcommand{\rinterp}[3]{\mathcal{R}\interp{#1}\:#2\:#3}
823+\newcommand{\iinterp}[3]{\mathcal{I}\interp{#1}\:#2\:#3}
824+\newcommand{\len}[1]{\MO{length}(#1)}
825+
826+\newcommand{\casecomp}[2]{\mathcal{I}(#1,\left\{\ARc{#2}\right\})}
827+\newcommand{\casecompA}[3]{\mathcal{I}(#1,\left\{\ARc{#2}\right\}[#3])}
828+\newcommand{\ischeme}{\mathcal{I}}
829+
830+% tail call markup
831+
832+\newcommand{\tailcall}{\mathsf{tail}}
833+
834+% Trees
835+
836+\newcommand{\Tree}{\TC{Tree}}
837+\newcommand{\Leaf}{\DC{Leaf}}
838+\newcommand{\Node}{\DC{Node}}
839+\newcommand{\treecase}{\Cases{\Tree}}
840+
841+% Languages
842+
843+\newcommand{\Coq}{\textsc{Coq}}
844+\newcommand{\Lego}{\textsc{Lego}}
845+\newcommand{\Oleg}{\textsc{Oleg}}
846+\newcommand{\Alf}{\textsc{Alf}}
847+\newcommand{\Epigram}{\textsc{Epigram}}
848+\newcommand{\SystemF}{System $\mathcal{F}$}
849+\newcommand{\Iswim}{\textsc{Iswim}}
850+\newcommand{\Cynthia}{\textit{C$^Y$\hspace*{-0.1cm}NTHIA}}
851+
852+% Accessibility
853+
854+\newcommand{\Acc}{\TC{Acc}}
855+\newcommand{\acc}{\DC{acc}}
856+\newcommand{\qsAcc}{\TC{qsAcc}}
857+\newcommand{\qsNil}{\DC{qsNil}}
858+\newcommand{\qsCons}{\DC{qsCons}}
859+\newcommand{\allQsAcc}{\FN{allQsAcc}}
860+
861+% Lazy shortcuts
862+
863+\newcommand{\naive}{na\"{\i}ve}
864+\newcommand{\Naive}{Na\"{\i}ve}
865+
866+% Conor's bits
867+
868+\newcommand{\remem}[1]{\left|#1\right|}
869+\newcommand{\idsb}{\MO{id}}
870+\newcommand{\ang}[1]{\langle#1\rangle}
871+
872+\newcommand{\vePm}[1]{\vP #1 \vm_{\Vnil} #1 \vm_{\Vcons}}%
873+\newcommand{\vcrhs}{\vm_{\Vcons}\:\vk\:\va\:\vv\:%
874+ (\vectelim\:\vA\:\vk\:\vv\:\vePm{\:})}%
875+
876+\newcommand{\igV}[2]{#1^{\ig{#2}}}
877+\newcommand{\remV}[2]{#1^{\rem{#2}}}
878+
879+% More gubbins
880+
881+\newcommand{\Between}{\TC{between}}
882+\newcommand{\bZ}{\DC{bO}}
883+\newcommand{\bZZS}{\DC{bOOs}}
884+\newcommand{\bZSS}{\DC{b0ss}}
885+\newcommand{\bSSS}{\DC{bsss}}
886+\newcommand{\betelim}{\Elim{\Between}}
887+\newcommand{\betrhs}[1]{\motive#1\meth{\bZ}#1\meth{\bZZS}#1\meth{\bZSS}#1\meth{\bSSS}}
888+
889+
890+\newcommand{\valenv}{\TC{ValEnv}}
891+\newcommand{\vempty}{\DC{empty}}
892+\newcommand{\vextend}{\DC{extend}}
893+
894+\newcommand{\EpiVal}{\TC{Epigram}}
895+\newcommand{\unsafeCoerce}{\HF{unsafeCoerce\mbox{\texttt{\#}}}}
896+
897+\newcommand{\qq}{\mbox{\texttt{"}}}
898+\newcommand{\impossible}{\RW{Impossible}}
899+
900+\newcommand{\Real}{\mathbb{R}}
901+
902+\newcommand{\DoubleRec}{\TC{DoubleElim}}
903+\newcommand{\DoubleOn}{\DC{Double_{\Z\vn}}}
904+\newcommand{\DoubleSO}{\DC{Double_{\suc\Z}}}
905+\newcommand{\DoubleSS}{\DC{Double_{\suc\suc}}}
906+
907+\newcommand{\doublerec}{\textbf{double-elim}}
908+
909+\newcommand{\set}{\TC{DList}}
910+\newcommand{\setuser}{\TC{DListTop}}
911+\newcommand{\setempty}{\emptyset}
912+\newcommand{\setinsert}{\DC{insert}}
913+
914+
915+%%%% Type systems
916+
917+\newcommand{\stlc}{\lambda\hspace*{-0.15cm}\to}
918+\newcommand{\plc}{\lambda2}
919+\newcommand{\dlc}{\lambda{}P}
920+
921+\newcommand{\EC}{\mathcal{E}}
922+
923+%%%% reductions
924+
925+\newcommand{\betared}{\iq\hspace*{-0.15cm}_{\beta}}
926+\newcommand{\deltared}{\iq\hspace*{-0.15cm}_{\delta}}
927+\newcommand{\gammared}{\iq\hspace*{-0.15cm}_{\gamma}}
928+\newcommand{\etared}{\iq\hspace*{-0.15cm}_{\eta}}
929+\newcommand{\iotared}{\iq\hspace*{-0.15cm}_{\iota}}
930+\newcommand{\rhored}{\iq\hspace*{-0.15cm}_{\rho}}
931+
932+%%%% ExTT rules
933+
934+\newcommand{\exconverts}{\stackrel{\mathsf{Ex}}{\converts}}
935+\newcommand{\excumul}{\stackrel{\mathsf{Ex}}{\cumul}}
936+\newcommand{\exequiv}{\stackrel{\mathsf{Ex}}{\equiv}}
937+\newcommand{\exreduces}{\stackrel{\mathsf{Ex}}\reduces}
938+\newcommand{\exreducesto}{\stackrel{\mathsf{Ex}}{\reducesto}}
939+\newcommand{\exreducesn}[1]{\exreduces_{#1}}
940+
941+\newcommand{\ttequiv}{\stackrel{\mathsf{TT}}{\equiv}}
942+\newcommand{\ttreduces}{\stackrel{\mathsf{TT}}\reduces}
943+\newcommand{\ttreducesn}[1]{\ttreduces_{#1}}
944+
945+%%% Type synthesis
946+
947+\newcommand{\hastype}{\Longrightarrow}
948+\newcommand{\whnfs}{\twoheadrightarrow}
949+\newcommand{\conv}{\converts}
950+
951+\newcommand{\exhastype}{\stackrel{\mathsf{Ex}}{\hastype}}
952+\newcommand{\exwhnfs}{\stackrel{\mathsf{Ex}}{\whnfs}}
953+\newcommand{\exconv}{\stackrel{\mathsf{Ex}}{\conv}}
954+\newcommand{\exproves}{\stackrel{\mathsf{Ex}}{\proves}}
955+
956+\newcommand{\tthastype}{\stackrel{\mathsf{TT}}{\hastype}}
957+\newcommand{\ttwhnfs}{\stackrel{\mathsf{TT}}{\whnfs}}
958+\newcommand{\ttconv}{\stackrel{\mathsf{TT}}{\conv}}
959+\newcommand{\ttproves}{\stackrel{\mathsf{TT}}{\proves}}
960+
961+%%% Lightning
962+
963+\newcommand{\light}[1]{\lightning^{#1}}
964+\newcommand{\LHab}[1]{\pad{\;}{:^{#1}}}
965+\newcommand{\llam}[3]{\lambda#1\pad{\!}{:}^{#2}#3}
966+\newcommand{\lall}[3]{\forall#1\pad{\!}{:}^{#2}#3}
967+\newcommand{\lapp}[3]{#1(#2)^{#3}}
968+\newcommand{\larg}[2]{(#1)^{#2}}
969+
970+\newcommand{\RName}[1]{\hspace*{0.1in}\mathsf{#1}}
971+
972+%%% LOcal macros
973+
974+\newcommand{\ResState}{\TC{ResourceState}}
975+\newcommand{\Locked}{\DC{Locked}}
976+\newcommand{\ResHandle}{\TC{ResourceHandle}}
977+\newcommand{\Res}{\DC{Resource}}
978+\newcommand{\CLang}{\TC{CLang}}
979+\newcommand{\CFLang}{\TC{CFLang}}
980+\newcommand{\CFType}{\TC{CFType}}
981+\newcommand{\CLType}{\TC{CType}}
982+\newcommand{\RHandle}{\DC{RHandle}}
983+\newcommand{\RType}{\DC{RType}}
984+\newcommand{\RUnit}{\DC{RUnit}}
985+\newcommand{\LOCK}{\DC{LOCK}}
986+\newcommand{\UNLOCK}{\DC{UNLOCK}}
987+\newcommand{\ACTION}{\DC{ACTION}}
988+\newcommand{\FORK}{\DC{FORK}}
989+
990+\newcommand{\FSLang}{\TC{FSLang}}
991+\newcommand{\OPEN}{\DC{OPEN}}
992+\newcommand{\CLOSE}{\DC{CLOSE}}
993+\newcommand{\READ}{\DC{READ}}
994+\newcommand{\WRITE}{\DC{WRITE}}
995+\newcommand{\PRINT}{\DC{PRINT}}
996+\newcommand{\BIND}{\DC{BIND}}
997+
998+\newcommand{\FSType}{\TC{FSType}}
999+\newcommand{\FHandle}{\DC{FHandle}}
1000+\newcommand{\FString}{\DC{FString}}
1001+\newcommand{\FUnit}{\DC{FUnit}}
1002+\newcommand{\ElemIs}{\TC{ElemIs}}
1003+\newcommand{\elemHd}{\TC{atHead}}
1004+\newcommand{\elemTl}{\TC{inTail}}
1005+
1006+\newcommand{\emptyEnv}{\DC{empty}}
1007+\newcommand{\extendEnv}{\DC{extend}}
1008+
1009+\newcommand{\usera}{\FN{Alice}}
1010+\newcommand{\userb}{\FN{Bob}}
1011+\newcommand{\userc}{\FN{Charlie}}
1012+
1013+\newcommand{\FAcc}{\TC{FAcc}}
1014+\newcommand{\UserA}{\DC{UserAcc}}
1015+\newcommand{\GroupA}{\DC{GroupAcc}}
1016+\newcommand{\GlobalA}{\DC{GlobalAcc}}
1017+
1018+\newcommand{\Perm}{\TC{Perm}}
1019+\newcommand{\Username}{\TC{Username}}
1020+\newcommand{\GroupData}{\TC{GroupData}}
1021+\newcommand{\File}{\TC{File}}
1022+\newcommand{\FS}{\DC{file}}
1023+\newcommand{\Filepath}{\TC{Filepath}}
1024+
1025+\newcommand{\Read}{\DC{Read}}
1026+\newcommand{\Write}{\DC{Write}}
1027+\newcommand{\Execute}{\DC{Execute}}
1028+
1029+\newcommand{\Purpose}{\TC{Mode}}
1030+\newcommand{\Reading}{\DC{Reading}}
1031+\newcommand{\Writing}{\DC{Writing}}
1032+
1033+\newcommand{\FileState}{\TC{FileState}}
1034+\newcommand{\FileHandle}{\TC{FileHandle}}
1035+\newcommand{\OpenH}{\DC{OpenH}}
1036+\newcommand{\ClosedH}{\DC{ClosedH}}
1037+\newcommand{\Handle}{\TC{Handle}}
1038+\newcommand{\Open}{\DC{Open}}
1039+\newcommand{\Closed}{\DC{Closed}}
1040+
1041+\newcommand{\UserIO}{\TC{UserIO}}
1042+\newcommand{\uio}{\DC{uio}}
1043+
1044+\newcommand{\CFS}{\TC{C_{fs}}}
1045+\newcommand{\RFS}{\FN{R_{fs}}}
1046+
1047+\newcommand{\String}{\TC{String}}
1048+
1049+% inline idris code
1050+
1051+\newcommand{\Tcon}[1]{\texttt{#1}}
1052+\newcommand{\Dcon}[1]{\texttt{#1}}
1053+\newcommand{\Fname}[1]{\texttt{#1}}
1054+\newcommand{\Vv}[1]{\texttt{#1}}
1055+\newcommand{\TyTy}{\texttt{\#}}
1056+
1057+\newcommand{\direct}[1]{\texttt{\%#1}}
1058+
1059+\newcommand{\Feature}[1]{\textbf{Remark:}}
1060+%\newcommand{\Remark}[1]{\textbf{Remark:}}
impl-paper/overview.texnew file+11
@@ -0,0 +1,11 @@
1+\section{overview}
2+
3+High level view of steps we've taken to implement this new version:
4+
5+\begin{itemize}
6+\item Syntax tree for raw and well-typed terms
7+\item An evaluator for well-typed terms
8+\item The important bit: a simple type checker. No unification or
9+ inference.
10+\item The proof state and a tactic engine.
11+\end{itemize}
miniidris.cabalnew file+26
@@ -0,0 +1,26 @@
1+Name: miniidris
2+Version: 0.1
3+License: BSD3
4+License-file: LICENSE
5+Author: Edwin Brady
6+Maintainer: Edwin Brady <eb@cs.st-andrews.ac.uk>
7+Homepage: http://www.idris-lang.org/
8+
9+Stability: Alpha
10+Category: Compilers/Interpreters, Dependent Types
11+Synopsis: Dependently Typed Functional Programming Language
12+Description: An experimental new version of Idris
13+
14+Cabal-Version: >= 1.6
15+Build-type: Simple
16+
17+Executable miniidris
18+ Main-is: Main.hs
19+ hs-source-dirs: src
20+ Other-modules: Core, Evaluate, Typecheck, ProofState
21+
22+ Build-depends: base>=4 && <5, parsec, mtl, Cabal
23+
24+ Extensions: MultiParamTypeClasses, FunctionalDependencies,
25+ FlexibleInstances
26+ ghc-prof-options: -auto-all
src/Core.hsnew file+151
@@ -0,0 +1,151 @@
1+{-# LANGUAGE MultiParamTypeClasses, FunctionalDependencies #-}
2+
3+module Core where
4+
5+import Control.Monad.State
6+
7+{- The language has:
8+ * Full dependent types
9+ * A hierarchy of universes, with cumulativity: Set : Set1, Set1 : Set2, ...
10+ * Pattern matching letrec binding
11+ * (primitive types defined externally)
12+
13+ Some technical stuff:
14+ * Typechecker is kept as simple as possible
15+ - no unification, just a checker for incomplete terms.
16+ * We have a simple collection of tactics which we use to elaborate source
17+ programs with implicit syntax into fully explicit terms.
18+-}
19+
20+data Option = SetInSet
21+ | CheckConv
22+ deriving Eq
23+
24+-- RAW TERMS ----------------------------------------------------------------
25+
26+-- Names are hierarchies of strings, describing scope (so no danger of
27+-- duplicate names, but need to be careful on lookup).
28+-- Also MN for machine chosen names
29+
30+data Name = UN [String]
31+ | MN Int String
32+ deriving (Show, Eq)
33+
34+data Raw = Var Name
35+ | RBind Name (Binder Raw) Raw
36+ | RApp Raw Raw
37+ | RSet Int
38+ deriving Show
39+
40+data Binder b = Lam { binderTy :: b }
41+ | Pi { binderTy :: b }
42+ | Let { binderTy :: b,
43+ binderVal :: b }
44+ | Hole { binderTy :: b}
45+ | Guess { binderTy :: b,
46+ binderVal :: b }
47+ | PVar { binderTy :: b }
48+ deriving (Show, Eq)
49+
50+data RawFun = RawFun { rtype :: Raw,
51+ rval :: Raw
52+ }
53+ deriving Show
54+
55+data RDef = RFunction RawFun
56+ | RConst Raw
57+ deriving Show
58+
59+type RProgram = [(Name, RDef)]
60+
61+-- WELL TYPED TERMS ---------------------------------------------------------
62+
63+data NameType = Ref | DCon Int Int | TCon Int
64+ deriving (Show, Eq)
65+
66+data TT n = P NameType n (TT n) -- embed type
67+ | V Int
68+ | Bind n (Binder (TT n)) (TT n)
69+ | App (TT n) (TT n) (TT n) -- function, function type, arg
70+ | Set Int
71+ deriving (Show, Eq)
72+
73+type EnvTT n = [(n, Binder (TT n))]
74+
75+bindEnv :: EnvTT n -> TT n -> TT n
76+bindEnv [] tm = tm
77+bindEnv ((n, b):bs) tm = Bind n b (bindEnv bs tm)
78+
79+type Term = TT Name
80+type Type = Term
81+
82+type Env = EnvTT Name
83+
84+-- WELL TYPED TERMS AS HOAS -------------------------------------------------
85+
86+data HTT = HP NameType Name HTT
87+ | HV Int
88+ | HBind Name (Binder HTT) (HTT -> HTT)
89+ | HApp HTT HTT HTT
90+ | HSet Int
91+ | HTmp Int
92+
93+instance Show HTT where
94+ show h = "<<HOAS>>"
95+
96+hoas :: [HTT] -> TT Name -> HTT
97+hoas env (P nt n ty) = HP nt n (hoas env ty)
98+hoas env (V i) | i < length env = env!!i
99+ | otherwise = HV i
100+hoas env (Bind n b sc) = HBind n (hbind b) (\x -> hoas (x:env) sc)
101+ where hbind (Lam t) = Lam (hoas env t)
102+ hbind (Pi t) = Pi (hoas env t)
103+ hbind (Hole t) = Hole (hoas env t)
104+ hbind (PVar t) = PVar (hoas env t)
105+ hbind (Let v t) = Let (hoas env v) (hoas env t)
106+ hbind (Guess v t) = Guess (hoas env v) (hoas env t)
107+hoas env (App f t a) = HApp (hoas env f) (hoas env t) (hoas env a)
108+hoas env (Set i) = HSet i
109+
110+-- CONTEXTS -----------------------------------------------------------------
111+
112+data Fun = Fun Type HTT Term HTT
113+ deriving Show
114+
115+data Def = Function Fun
116+ | Constant NameType Type HTT
117+ deriving Show
118+
119+type Context = [(Name, Def)]
120+
121+lookupTy :: Name -> Context -> Maybe Type
122+lookupTy n ctxt = do def <- lookup n ctxt
123+ case def of
124+ (Function (Fun ty _ _ _)) -> return ty
125+ (Constant _ ty _) -> return ty
126+
127+lookupP :: Name -> Context -> Maybe Term
128+lookupP n ctxt
129+ = do def <- lookup n ctxt
130+ case def of
131+ (Function (Fun ty _ tm _)) -> return (P Ref n ty)
132+ (Constant nt ty hty) -> return (P nt n ty)
133+
134+lookupVal :: Name -> Context -> Maybe HTT
135+lookupVal n ctxt
136+ = do def <- lookup n ctxt
137+ case def of
138+ (Function (Fun _ _ _ htm)) -> return htm
139+ (Constant nt ty hty) -> return (HP nt n hty)
140+
141+lookupTyEnv :: Name -> Env -> Maybe (Int, Type)
142+lookupTyEnv n env = li n 0 env where
143+ li n i [] = Nothing
144+ li n i ((x, b): xs)
145+ | n == x = Just (i, binderTy b)
146+ | otherwise = li n (i+1) xs
147+
148+
149+x = UN ["x"]
150+xt = UN ["X"]
151+testtm = RBind xt (Lam (RSet 0)) (RBind x (Lam (Var xt)) (Var x))
src/Evaluate.hsnew file+72
@@ -0,0 +1,72 @@
1+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
2+
3+module Evaluate(normalise) where
4+
5+import Debug.Trace
6+import Core
7+
8+normalise :: Context -> TT Name -> TT Name
9+normalise ctxt t = quote 0 (eval ctxt (hoas [] t))
10+
11+-- We just evaluate HOAS terms. Any de Bruijn indices will refer to higher
12+-- level things, so, if we remove a binder, we need to strengthen the
13+-- indices appropriately.
14+
15+eval :: Context -> HTT -> HTT
16+eval ctxt t = ev t where
17+ ev (HP Ref n ty)
18+ | Just v <- lookupVal n ctxt = v -- FIXME! Needs evalling
19+ ev (HP nt n ty) = HP nt n (ev ty)
20+ ev (HApp f t a)
21+ = evSpine f [(a, t)]
22+ where evSpine (HApp f t a) sp = evSpine f ((a, t):sp)
23+ evSpine f sp = evAp f sp
24+ ev (HBind n (Let t v) sc) = weaken (-1) (ev (sc (weaken 1 (ev v))))
25+ ev (HBind n b sc)
26+ = HBind n (evB b) (\x -> ev (sc x))
27+ where evB (Lam t) = Lam (ev t)
28+ evB (Pi t) = Pi (ev t)
29+ evB (Hole t) = Hole (ev t)
30+ evB (Guess t v) = Guess (ev t) (ev v)
31+ evB (PVar t) = PVar (ev t)
32+ ev tm = tm -- Constructors + constants
33+
34+ -- TODO:add PE magic here - nothing is evaluated yet
35+
36+ evAp f sp = evAp' (ev f) sp
37+ evAp' (HBind n (Lam ty) sc) ((a, t):sp)
38+ = weaken (-1) (evAp' (sc (weaken 1 (ev a))) sp)
39+ evAp' f sp = apply f (map (\ (a, t) -> (ev a, ev t)) sp)
40+
41+ apply f [] = f
42+ apply f ((a, t):xs) = apply (HApp f t a) xs
43+
44+-- Adjust de Bruijn indices across a term
45+
46+weaken :: Int -> HTT -> HTT
47+weaken w (HV i) = HV (i + w)
48+weaken w (HBind n b sc)
49+ = HBind n (weakenB b) (\x -> weaken w (sc x))
50+ where weakenB (Lam t) = Lam (weaken w t)
51+ weakenB (Pi t) = Pi (weaken w t)
52+ weakenB (Let t v) = Let (weaken w t) (weaken w v)
53+ weakenB (Hole t) = Hole (weaken w t)
54+ weakenB (Guess t v) = Guess (weaken w t) (weaken w v)
55+ weakenB (PVar t) = PVar (weaken w t)
56+weaken w (HApp f t a) = HApp (weaken w f) (weaken w t) (weaken w a)
57+weaken w tm = tm
58+
59+quote :: Int -> HTT -> TT Name
60+quote env (HP nt n t) = P nt n (quote env t)
61+quote env (HV i) = V i
62+quote env (HBind n b sc)
63+ = Bind n (quoteB b) (quote (env+1) (sc (HTmp (env+1))))
64+ where quoteB (Lam t) = Lam (quote env t)
65+ quoteB (Pi t) = Pi (quote env t)
66+ quoteB (Let t v) = Let (quote env t) (quote env v)
67+ quoteB (Hole t) = Hole (quote env t)
68+ quoteB (Guess t v) = Guess (quote env t) (quote env v)
69+ quoteB (PVar t) = PVar (quote env t)
70+quote env (HApp f t a) = App (quote env f) (quote env t) (quote env a)
71+quote env (HSet i) = Set i
72+quote env (HTmp i) = V (env-i)
src/Main.hsnew file+5
@@ -0,0 +1,5 @@
1+module Main where
2+
3+import Typecheck
4+
5+main = putStrLn "Nothing Happens"
src/Parser.hsnew file+103
@@ -0,0 +1,103 @@
1+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
2+
3+module Parser(parseTerm, parseFile, parseDef) where
4+
5+import Core
6+
7+import Text.ParserCombinators.Parsec
8+import Text.ParserCombinators.Parsec.Expr
9+import Text.ParserCombinators.Parsec.Language
10+import qualified Text.ParserCombinators.Parsec.Token as PTok
11+
12+import Debug.Trace
13+
14+type TokenParser a = PTok.TokenParser a
15+
16+lexer :: TokenParser ()
17+lexer = PTok.makeTokenParser haskellDef
18+
19+whiteSpace= PTok.whiteSpace lexer
20+lexeme = PTok.lexeme lexer
21+symbol = PTok.symbol lexer
22+natural = PTok.natural lexer
23+parens = PTok.parens lexer
24+semi = PTok.semi lexer
25+comma = PTok.comma lexer
26+identifier= PTok.identifier lexer
27+reserved = PTok.reserved lexer
28+operator = PTok.operator lexer
29+reservedOp= PTok.reservedOp lexer
30+lchar = lexeme.char
31+
32+parseFile = parse pTestFile "(input)"
33+parseDef = parse pDef "(input)"
34+parseTerm = parse pTerm "(input)"
35+
36+pTestFile :: Parser RProgram
37+pTestFile = many1 pDef
38+
39+pDef :: Parser (Name, RDef)
40+pDef = try (do x <- identifier; lchar ':'; ty <- pTerm
41+ lchar '='
42+ tm <- pTerm
43+ lchar ';'
44+ return (UN [x], RFunction (RawFun ty tm)))
45+ <|> do x <- identifier; lchar ':'; ty <- pTerm; lchar ';'
46+ return (UN [x], RConst ty)
47+
48+app :: Parser (Raw -> Raw -> Raw)
49+app = do whiteSpace ; return RApp
50+
51+arrow :: Parser (Raw -> Raw -> Raw)
52+arrow = do symbol "->" ; return $ \s t -> RBind (MN 0 "X") (Pi s) t
53+
54+pTerm :: Parser Raw
55+pTerm = try (do chainl1 pNoApp app)
56+ <|> pNoApp
57+
58+pNoApp :: Parser Raw
59+pNoApp = try (chainr1 pExp arrow)
60+ <|> pExp
61+
62+pExp :: Parser Raw
63+pExp = do lchar '\\'; x <- identifier; lchar ':'; ty <- pTerm
64+ symbol "=>";
65+ sc <- pTerm
66+ return (RBind (UN [x]) (Lam ty) sc)
67+ <|> try (do lchar '(';
68+ x <- identifier; lchar ':'; ty <- pTerm
69+ lchar ')';
70+ symbol "->";
71+ sc <- pTerm
72+ return (RBind (UN [x]) (Pi ty) sc))
73+ <|> try (do lchar '(';
74+ t <- pTerm
75+ lchar ')'
76+ return t)
77+ <|> try (do lchar '?';
78+ x <- identifier; lchar ':'; ty <- pTerm
79+ lchar '.';
80+ sc <- pTerm
81+ return (RBind (UN [x]) (Hole ty) sc))
82+ <|> try (do symbol "??";
83+ x <- identifier; lchar ':'; ty <- pTerm
84+ lchar '=';
85+ val <- pTerm
86+ sc <- pTerm
87+ return (RBind (UN [x]) (Guess ty val) sc))
88+ <|> try (do reserved "let";
89+ x <- identifier; lchar ':'; ty <- pTerm
90+ lchar '=';
91+ val <- pTerm
92+ sc <- pTerm
93+ return (RBind (UN [x]) (Let ty val) sc))
94+ <|> try (do lchar '_';
95+ x <- identifier; lchar ':'; ty <- pTerm
96+ lchar '.';
97+ sc <- pTerm
98+ return (RBind (UN [x]) (PVar ty) sc))
99+ <|> try (do reserved "Set"; i <- natural
100+ return (RSet (fromInteger i)))
101+ <|> try (do x <- identifier
102+ return (Var (UN [x])))
103+
src/ProofState.hsnew file+8
@@ -0,0 +1,8 @@
1+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
2+
3+module ProofState where
4+
5+import Typecheck
6+import Evaluate
7+import Core
8+
src/Test.hsnew file+11
@@ -0,0 +1,11 @@
1+module Test where
2+
3+import Parser
4+import Core
5+import Typecheck
6+
7+test = do f <- readFile "test.mi"
8+ let Right defs = parseFile f
9+ print defs
10+ let ctxt = checkProgram [] defs
11+ print ctxt
src/Typecheck.hsnew file+134
@@ -0,0 +1,134 @@
1+{-# LANGUAGE MultiParamTypeClasses, FlexibleInstances #-}
2+
3+module Typecheck where
4+
5+import Control.Monad.State
6+import Debug.Trace
7+
8+import Core
9+import Evaluate
10+
11+data TC a = OK a
12+ | Error String -- TMP! Make this an informative data structure
13+ deriving Show
14+
15+-- at some point, this instance should also carry type checking options
16+-- (e.g. Set:Set)
17+
18+instance Monad TC where
19+ return = OK
20+ x >>= k = case x of
21+ OK v -> k v
22+ Error e -> Error e
23+ fail = Error
24+
25+converts :: Context -> Env -> Term -> Term -> TC ()
26+converts ctxt env x y = if (normalise ctxt (bindEnv env x) ==
27+ normalise ctxt (bindEnv env y))
28+ then return ()
29+ else fail ("Can't convert between " ++
30+ show x ++ " and " ++ show y)
31+
32+isSet :: Term -> TC ()
33+isSet (Set _) = return ()
34+isSet tm = fail (show tm ++ " is not a Set")
35+
36+check :: Context -> Env -> Raw -> TC (Term, Type)
37+check ctxt env (Var n)
38+ | Just (i, ty) <- lookupTyEnv n env = return (V i, ty)
39+ | Just (P nt n' ty) <- lookupP n ctxt = return (P nt n' ty, ty)
40+ | otherwise = do fail $ "No such variable " ++ show n
41+check ctxt env (RApp f a)
42+ = do (fv, fty) <- check ctxt env f
43+ (av, aty) <- check ctxt env a
44+ let fty' = normalise ctxt fty
45+ case fty' of
46+ Bind x (Pi s) t ->
47+ do converts ctxt env s aty
48+ return (App fv fty av,
49+ normalise ctxt (Bind x (Let av aty) t))
50+ t -> fail "Can't apply a non-function type"
51+check ctxt env (RSet i) = return (Set i, Set (i+1))
52+check ctxt env (RBind n b sc)
53+ = do b' <- checkBinder b
54+ (scv, sct) <- check ctxt ((n, b'):env) sc
55+ discharge n b' scv sct
56+ where checkBinder (Lam t)
57+ = do (tv, tt) <- check ctxt env t
58+ let tv' = normalise ctxt tv
59+ let tt' = normalise ctxt tt
60+ isSet tt'
61+ return (Lam tv')
62+ checkBinder (Pi t)
63+ = do (tv, tt) <- check ctxt env t
64+ let tv' = normalise ctxt tv
65+ let tt' = normalise ctxt tt
66+ isSet tt'
67+ return (Pi tv')
68+ checkBinder (Let t v)
69+ = do (tv, tt) <- check ctxt env t
70+ (vv, vt) <- check ctxt env v
71+ let tv' = normalise ctxt tv
72+ let tt' = normalise ctxt tt
73+ converts ctxt env tv vt
74+ isSet tt'
75+ return (Let tv' vv)
76+ checkBinder (Hole t)
77+ = do (tv, tt) <- check ctxt env t
78+ let tv' = normalise ctxt tv
79+ let tt' = normalise ctxt tt
80+ isSet tt'
81+ return (Hole tv')
82+ checkBinder (Guess t v)
83+ = do (tv, tt) <- check ctxt env t
84+ (vv, vt) <- check ctxt env v
85+ let tv' = normalise ctxt tv
86+ let tt' = normalise ctxt tt
87+ converts ctxt env tv vt
88+ isSet tt'
89+ return (Guess tv' vv)
90+ checkBinder (PVar t)
91+ = do (tv, tt) <- check ctxt env t
92+ let tv' = normalise ctxt tv
93+ let tt' = normalise ctxt tt
94+ isSet tt'
95+ return (PVar tv')
96+
97+ discharge n (Lam t) scv sct
98+ = return (Bind n (Lam t) scv, Bind n (Pi t) sct)
99+ discharge n (Pi t) scv sct
100+ = return (Bind n (Pi t) scv, sct)
101+ discharge n (Let t v) scv sct
102+ = return (Bind n (Let t v) scv, Bind n (Let t v) sct)
103+ discharge n (Hole t) scv sct
104+ = do -- A hole can't appear in the type of its scope
105+ checkNotHoley 0 sct
106+ return (Bind n (Hole t) scv, sct)
107+ discharge n (Guess t v) scv sct
108+ = do -- A hole can't appear in the type of its scope
109+ checkNotHoley 0 sct
110+ return (Bind n (Guess t v) scv, sct)
111+ discharge n (PVar t) scv sct
112+ = return (Bind n (PVar t) scv, sct)
113+
114+ checkNotHoley i (V v)
115+ | v == i = fail "You can't put a hole where a hole don't belong"
116+ checkNotHoley i (App f t a) = do checkNotHoley i f
117+ checkNotHoley i t
118+ checkNotHoley i a
119+ checkNotHoley i (Bind n b sc) = checkNotHoley (i+1) sc
120+ checkNotHoley _ _ = return ()
121+
122+checkProgram :: Context -> RProgram -> TC Context
123+checkProgram ctxt [] = return ctxt
124+checkProgram ctxt ((n, RConst t):xs)
125+ = do (t', tt') <- trace (show n) $ check ctxt [] t
126+ isSet tt'
127+ checkProgram ((n, Constant Ref t' (hoas [] t')):ctxt) xs
128+checkProgram ctxt ((n, RFunction (RawFun ty val)):xs)
129+ = do (ty', tyt') <- trace (show n) $ check ctxt [] ty
130+ (val', valt') <- check ctxt [] val
131+ isSet tyt'
132+ converts ctxt [] ty' valt'
133+ checkProgram ((n, Function (Fun ty' (hoas [] ty')
134+ val' (hoas [] val'))):ctxt) xs
src/test.minew file+11
@@ -0,0 +1,11 @@
1+N : Set 0;
2+O : N;
3+S : N -> N;
4+
5+one : N = S O;
6+two : N = S one;
7+three : N = S two;
8+
9+Vect : (A:Set 0) -> (n:N) -> Set 0;
10+Nil : (A:Set 0) -> (Vect A O);
11+Cons : (A:Set 0) -> (k:N) -> (Vect A k) -> (Vect A (S k));