on master help sign in
Merge pull request #1540 from edwinb/master

Remove papers directory

commitc26f9aead8c4c6ddf6e3b33be56329340ad5c0ba authorEdwin Brady <edwin.brady@gmail.com> dateTue 23 Sep 2014, 22:50 (12 years ago) parent75720178751795
21 files changed−17894
papers/impl-paper/Makefile−43 papers/impl-paper/acmtrans.bst−1770 papers/impl-paper/acmtrans2m.cls−1460 papers/impl-paper/comments.sty−29 papers/impl-paper/compiling.tex−2 papers/impl-paper/conclusions.tex−167 papers/impl-paper/delab.tex−159 papers/impl-paper/elaboration.tex−1956 papers/impl-paper/hll.tex−441 papers/impl-paper/impldtp.tex−159 papers/impl-paper/intro.tex−196 papers/impl-paper/jfp.bst−1316 papers/impl-paper/jfp1.cls−1894 papers/impl-paper/library.bib−2295 papers/impl-paper/library.ltx−325 papers/impl-paper/literature.bib−3846 papers/impl-paper/macros.ltx−1066 papers/impl-paper/overview.tex−35 papers/impl-paper/proofstate.tex−7 papers/impl-paper/syntax.tex−10 papers/impl-paper/typechecking.tex−718
papers/impl-paper/Makefiledeleted−43
@@ -1,43 +0,0 @@
1−PAPER = impldtp
2−
3−all: ${PAPER}.pdf
4−
5−TEXFILES = ${PAPER}.tex intro.tex conclusions.tex hll.tex\
6− typechecking.tex elaboration.tex delab.tex \
7− syntax.tex
8−
9−DIAGS =
10−
11−SOURCES = ${TEXFILES} ${DIAGS} macros.ltx library.bib
12−
13−DITAA = java -jar ~/Downloads/ditaa.jar
14−
15−${PAPER}.pdf: ${SOURCES}
16−# dvipdf ${PAPER}.dvi
17− pdflatex ${PAPER}
18− -bibtex ${PAPER}
19− -pdflatex ${PAPER}
20− -pdflatex ${PAPER}
21−
22−${PAPER}.ps: ${PAPER}.dvi
23− dvips -o ${PAPER}.ps ${PAPER}
24−
25−${PAPER}.dvi: $(SOURCES)
26− -latex ${PAPER}
27− -bibtex ${PAPER}
28− -latex ${PAPER}
29− -latex ${PAPER}
30−
31−progress:
32− wc -w ${TEXFILES}
33−
34−%.png : %.diag
35− $(DITAA) -o -E $<
36−
37−todropbox:
38− cp ${SOURCES} ~/Dropbox/TeX/ImplDTP/
39−
40−fromdropbox:
41− cp ~/Dropbox/TeX/ImplDTP/* .
42−
43−.PHONY: all progress todropbox fromdropbox
papers/impl-paper/acmtrans.bstdeleted−1770
@@ -1,1770 +0,0 @@
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−
papers/impl-paper/acmtrans2m.clsdeleted−1460
@@ -1,1460 +0,0 @@
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−
papers/impl-paper/comments.stydeleted−29
@@ -1,29 +0,0 @@
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*
papers/impl-paper/compiling.texdeleted−2
@@ -1,2 +0,0 @@
1−\section{Compiling}
2−
papers/impl-paper/conclusions.texdeleted−167
@@ -1,167 +0,0 @@
1−\section{Related Work}
2−
3−\label{sect:related}
4−
5−Dependently-typed programming languages have become more prominent in recent
6−years as tools for verifying software correctness, and several experimental
7−languages are being developed, in particular Agda \cite{norell2007thesis},
8−Epigram \cite{McBride2004a,Levitation2010} and Trellys \cite{Kimmell2012}.
9−Furthermore, recent extensions to Haskell~\cite{Vytiniotis2011}, implemented in the
10−Glasgow Haskell Compiler, are bringing more of the power of dependent types to
11−Haskell. The problem of refining high-level syntax to a core type theory also
12−applies to theorem provers based on dependent types such as
13−Coq~\cite{Bertot2004} and Matita~\cite{Asperti2011}.
14−
15−Checking advanced type system features in Haskell involves a type system
16−parameterised over an underlying constraint system $X$ which captures
17−constraints such as type classes, constrained data types and type families.
18−Types are checked using an inference algorithm
19−\textsc{OutsideIn(X)}~\cite{Vytiniotis2011}, which is stratified into an
20−inference engine independent of the constraint
21−system, and a constraint solver for $X$. An additional difficulty faced by
22−Haskell, and hence any extensions, is the desire to support type \emph{inference}, in
23−which principal types may be inferred for top-level functions. We have avoided
24−such difficulties since, in general, type
25−inference is undecidable for full dependent types. Indeed, it is not clear
26−that type inference is even desirable in many cases, as programmers
27−can use dependent types to state their intentions (hence a program
28−specification) more precisely. However in future work we
29−may consider adapting the \textsc{OutsideIn} approach to provide limited type
30−inference.
31−
32−An earlier implementation of \Idris{} was built on the \Ivor{} proof engine
33−\cite{Brady2006b}. This implementation differed in one important way --- unlike
34−the present implementation, there was limited separation between the type
35−theory and the high-level language. The type theory itself supported implicit
36−syntax and unification, with high-level constructs such as the \texttt{with}
37−rule implemented directly. Two important disadvantages were found with this
38−approach, however: firstly, the type checker is much more complicated when
39−combined with unification, making it harder to maintain; secondly, adding new
40−high-level features requires the type checker to support those features
41−directly. In contrast, elaboration by tactics gives a clean separation between
42−the low-level and high-level languages, and results in programs in a core
43−type theory which are separately checkable, perhaps even by an independently
44−written checker which implements the \TT{} rules directly.
45−
46−Matita uses a bi-directional refinement algorithm~\cite{Asperti}. This is a
47−type directed approach, maintaining a set of yet to be solved unification
48−problems and relying on a small kernel, similar to the approach we now take
49−with \Idris{}, but using refinement rules rather than
50−tactics. This leads to good error messages though it is not clear how
51−easy it would be to extend to additional high-level language features, unlike
52−the tactic-based approach.
53−
54−The Agda implementation is based on a type theory with
55−implicit syntax and pattern matching --- Norell gives an algorithm for type checking
56−a dependently-typed language with pattern matching and metavariables
57−\cite{norell2007thesis}. Unlike the present \Idris{} implementation, metavariables
58−and implicit arguments are part of the type theory. This has the advantage that
59−implicit arguments can be used more freely (for example, in higher order
60−function arguments) at the expense of complicating the type system.
61−
62−Epigram \cite{McBride2004a} and Oleg \cite{McBride1999}
63−have provided much of the inspiration for the \Idris{} elaborator. Indeed,
64−the hole and guess bindings of \TTdev{} are taken directly from Oleg.
65−\Epigram{} does not implement pattern matching directly, but rather translates
66−pattern matching into elimination rules \cite{McBride2002}. This has the
67−advantage that
68−elimination rules provide termination and coverage proofs \emph{by construction}.
69−Furthermore they simplify implementation of the evaluator and provide easy
70−optimisation opportunities \cite{Brady2003}. However, it requires the
71−implementation of extra machinery for constructor manipulation
72−\cite{McBride2006} and so we have avoided it in the present implementation.
73−
74−
75−
76−%[Observation: separate elaboration and type checking, sort of like in GHC which
77−%type checks the high level language and produces a type correct core language.
78−%Elaboration is effectively a type checker for the high level language, so we have
79−%a hope of providing reasonable error messages related to the original code.]
80−
81−\section{Conclusion}
82−
83−\label{sect:conclusion}
84−
85−In this paper, I have given an overview of the programming language \Idris{},
86−and its core type theory \TT{}, giving a detailed algorithm for translating
87−high-level programs into \TT{}.
88−\TT{} itself is deliberately small and simple, and the design has deliberately
89−resisted innovation so that we can rely on existing metatheoretic properties
90−being preserved. The kernel of the \Idris{} implementation consists of a type checker
91−and evaluator for \TT{} along with a pattern match compiler, which are implemented
92−in under 1000 lines of Haskell code. It is important that this kernel remains small
93−--- the correctness of the language implementation relies to a large extent on
94−the correctness of the underlying type system, and keeping the implementation small
95−reduces the possibility of errors.
96−
97−The approach we have taken to implementing the high-level language,
98−implementing an elaboration monad with tactics for program construction, allows
99−us to build programs on top of a small and unchanging kernel, rather than
100−extending the core language to deal with implicit syntax, unification and type
101−classes. High-level \Idris{} features are implemented by describing the
102−corresponding sequence of tactics to build an equivalent program in \TT{}, via
103−a development calculus of incomplete terms, \TTdev{}. A significant advantage
104−we have found with this approach is that higher level features can easily be
105−implemented in terms of existing elaborator components. For example, once we
106−have implemented elaboration for data types and functions, it is easy to add
107−several features:
108−
109−\begin{itemize}
110−\item \textbf{Type classes}: A dictionary is merely a record containing the
111−functions which implement a type class instance. Since we have a tactic-based
112−refinement engine, we can implement type class resolution as a tactic.
113−\item \textbf{\texttt{where} clauses}: We have access to local variables and
114−their types, so we can
115−elaborate \texttt{where} clauses at the point of definition simply by lifting
116−them to the top level.
117−\item \textbf{\texttt{case} expressions}: Similar to \texttt{where} clauses,
118−these are implemented by lifting the branches out to a top-level function.
119−\end{itemize}
120−
121−We do not need to make any changes to the core language type system in order to
122−implement these high-level features.
123−Other high-level features such as dependent records, tuples and monad comprehensions
124−can be added equally easily --- and indeed have been added in the full implementation.
125−Furthermore,
126−since we have taken a tactic-based approach to elaborating \Idris{} to \TT{},
127−it is possible to expose tactics to the programmer. This opens up
128−the possibility of implementing domain specific decision procedures, or
129−implementing user defined tactics in a style similar to Coq's \texttt{Ltac}
130−language \cite{Delahaye2000}. Although \TT{} is primarily intended as a core
131−language for \Idris{}, its rich type system also means that it could be used
132−as a core language for other high-level languages, especially when augmented
133−with primitive operators, and used to express additional properties of those
134−languages.
135−
136−We have not discussed the performance of the elaboration
137−algorithm, or described how \Idris{} compiles to executable code. In practice,
138−we have found performance to be acceptable --- for example, the \Idris{}
139−library (31 files, 3718 lines of code in total at the time of writing)
140−elaborates in around 12 seconds\footnote{On a MacBook Pro, 2.8GHz Intel Core 2
141−Duo, 4Gb RAM}. Profiling suggests that the main bottleneck is locating holes
142−in a proof term, which can be improved by choosing a better representation
143−for proof terms, perhaps based on a zipper \cite{Huet1997}. Compilation is made
144−straightforward by the Epic library \cite{brady2011epic}, with I/O and foreign
145−functions handled using command-response interaction trees \cite{Hancock2000}.
146−Although I have not yet run detailed benchmarks of the performance of compiled
147−code, I believe that rich type information and guaranteed termination will
148−allow aggressive optimisations~\cite{Brady2003,Brady2005}. I will investigate
149−this in future work.
150−
151−The objective of this implementation of \Idris{} is to provide a platform
152−for experimenting with realistic, general purpose programming with dependent
153−types, by implementing a Haskell-like language augmented with \emph{full}
154−dependent types.
155−In this paper, we have seen how such a high-level language can be implemented
156−by building on top of a small, well-understood, easy to reason about type
157−theory.
158−However, a programming language implementation is not an end in itself.
159−Programming languages exist to support research and practice in many different
160−domains. In future work, therefore, I plan to apply domain specific
161−language-based techniques to realistic problems in important safety critical
162−domains such as security and network protocol design and implementation. In
163−order to be successful, this will require a language which is expressive enough
164−to describe protocol specifications at a high-level, and robust enough to
165−guarantee correct implementation of those protocols. \Idris{}, I believe, is
166−the right tool for this work.
167−
papers/impl-paper/delab.texdeleted−159
@@ -1,159 +0,0 @@
1−\section{Reversing Elaboration}
2−
3−\label{sect:delab}
4−
5−As well as translating from \Idris{} to \TT{}, so that programs can be type
6−checked and evaluated, it is valuable to define the reverse transformation. This
7−serves two principal purposes:
8−
9−\begin{itemize}
10−\item To assist the user, it is preferable that the results of evaluation, and any
11−error messages produced by the elaborator, are presented in \Idris{} syntax
12−rather than \TT{}.
13−\item For correctness, we would like to ensure as far as possible that the
14−result of elaboration is equivalent to the original program. Informally, we can
15−achieve this by checking that reversing the elaboration process yields the original
16−program (with implicit arguments expanded).
17−\end{itemize}
18−
19−\noindent
20−In this section, we describe the process for reversing elaboration and the required
21−properties of the elaboration process as a whole. Fortunately, translating from
22−\TT{} to \Idris{} is significantly easier than \Idris{} to \TT{}, because it is
23−primarily \emph{erasing} information.
24−
25−\subsection{From \TT{} to \Idris{}}
26−
27−We define a meta-operation $\uninterp{\vt}$, which converts a \TT{} expression
28−$\vt$ to an \Idris{} expression which would elaborate to $\vt$:
29−
30−\DM{
31−\AR{
32−\begin{array}{rl}
33−\uninterp{\vx} &\mq\:\vx\\
34−\uninterp{\vc} &\mq\:\vc\\
35−\uninterp{\vx\;\ta} &\mq\:\vx\;(\vec{\MO{Impl}}\:\vx\:\ta) \\
36−\uninterp{\vf\:\va} &\mq\:\uninterp{\vf}\:\uninterp{\va}\\
37−\uninterp{\lam{\vx}{\vT}\SC\ve} &\mq \:\ilam{\vx}\uninterp{\ve} \\
38−\uninterp{\all{\vx}{\vT}\SC\ve} &\mq \:\piexp{\vx}{\uninterp{\vT}}\uninterp{\ve} \\
39−\uninterp{\LET\:\vx\defq\vt\Hab\vT\SC\ve} &\mq
40−\ilet{\vx}{\uninterp{\vt}}\uninterp{\ve}\\
41−\end{array}
42−\medskip\\
43−\begin{array}{rll}
44−\MO{Impl}\:\vx\:\va_i\:\mq
45−&
46−\iarg{\vn}{\ttinterp{\va_i}}&
47−\mbox{(if the $i$th argument to $\vx$ is implicit argument $\vn$)}\\
48−& \carg{\ttinterp{\va_i}} &
49−\mbox{(if the $i$th argument to $\vx$ is a constraint argument)}\\
50−& \ttinterp{\va_i} & \mbox{(otherwise)}
51−\end{array}
52−}
53−}
54−
55−\noindent
56−This is mostly a straightforward
57−traversal of the \TT{} expression, translating directly to an \Idris{} equivalent.
58−The interesting case is for applications of named functions,
59−$\uninterp{\vx\:\ta}$, where the arguments are translated to either implicit,
60−constraint or explicit arguments according to the definition of $\vx$.
61−Since only type declarations are allowed to have implicit or constraint arguments,
62−and $\uninterp{\cdot}$ translates \emph{expressions},
63−all function types are assumed to take explicit arguments.
64−
65−We also define an operation $\MO{Unelab}$, which translates \TT{} declarations
66−to corresponding \Idris{} declarations. This generates data declarations and
67−pattern matching definitions only --- it makes no attempt to reconstruct
68−\texttt{class}
69−or \texttt{instance} declarations, or rebuild \texttt{case} expressions.
70−First, we define the reverse elaboration of type declarations, which must reconstruct
71−which arguments are implicit or constraint arguments:
72−
73−\DM{
74−\AR{
75−\begin{array}{l}
76−\MO{UnelabType}\:(\vx\Hab\vt)\:\mq\:\vx\Hab\MO{UnelabTyDecl}\:0\:\vt
77−\end{array}
78−\medskip\\
79−\begin{array}{ll}
80−\MO{UnelabTyDecl}\:\vi\:(\all{\vy}{\vT}\SC\ve)
81−\mq & \piimp{\vy}{\uninterp{\vT}}(\MO{UnelabTyDecl}\:(\vi+1)\:\ve) \\
82− & \hg\mbox{(if the $i$th argument to $\vx$ is an implicit argument)} \\
83− & \piconst{\uninterp{\vT}}(\MO{UnelabTyDecl}\:(\vi+1)\:\ve) \\
84− & \hg\mbox{(if the $i$th argument to $\vx$ is a constraint argument)} \\
85− & \piexp{\vy}{\uninterp{\vT}}(\MO{UnelabTyDecl}\:(\vi+1)\:\ve) \\
86− & \hg\mbox{(otherwise)} \\
87−\end{array}
88−}
89−}
90−
91−\noindent
92−Using this, we define $\MO{Unelab}$ for top-level declarations. For pattern
93−matching clauses reversing elaboration proceeds as follows, discarding the explicit
94−pattern variable bindings and applying $\MO{UnelabType}$ to reconstruct
95−the type declaration:
96−
97−\DM{
98−\AR{
99−\MO{Unelab}\:(\vx\Hab\vt)\:\mq\:\MO{UnelabType}\:(\vx\Hab\vt)\\
100−\MO{Unelab}\:(\pat{\tx}{\tU}\SC\FN{f}\:\tts\:=\:\ve)
101−\:\mq\:\uninterp{\FN{f}\:\tts}\:=\:\uninterp{\ve}
102−}
103−}
104−
105−\noindent
106−For data type declarations, reverse elaboration proceeds as follows, applying $\MO{UnelabType}$
107−for each of the top-level type declarations:
108−
109−\DM{
110−\AR{
111−\MO{Unelab}\:(\Data\;\TC{T}\:(\tx\Hab\ttt)\Hab\vT\;\Where\;\vec{\VV{cons}})
112−\:\\
113−\hg\hg\mq\:\idata\:\MO{UnelabType}\:(\TC{T}\Hab\all{\tx}{\ttt}\SC\vT)\:\iwhere\:
114−(\vec{\MO{UnelabType}}\:\vec{\VV{cons}})
115−}
116−}
117−
118−
119−\subsection{Elaboration Properties}
120−
121−Elaboration satisfies two important properties. We limit our discussion of
122−these properties to \IdrisM{} without type classes, i.e. elaboration of type
123−declarations, functions, and data types. This is primarily because there is not
124−enough information in a \TT{} program alone to reverse elaboration fully. However, since
125−elaboration of the higher level \Idris{} constructs is implemented in terms of
126−the lower level \IdrisM{} constructs, we should not consider this a serious
127−limitation.
128−
129−Informally stated, the properties that elaboration satisfies are
130−i) that if elaboration is successful, the
131−resulting program is a well-typed \TT{} program; ii) elaboration preserves the
132−meaning of the original \Idris{} program. The first property is true by the
133−definition of elaboration --- elaboration fails if it attempts to construct an ill-typed
134−term at any point. Furthermore, the development calculus \TTdev{} ensures that
135−partial constructions are well-typed.
136−The second property can be stated as the following conjecture:
137−\\
138−
139−\noindent
140−\textbf{Conjecture: Preservation of meaning}\\
141−Given an \IdrisM{} declaration $\vd$, which is either a type declaration, a
142−pattern match clause, or a data type declaration,
143−if $\MO{Elab}\:\vd\:\mq\:\vt$, and $\MO{Unelab}\:\vt\:\mq\:\vd'$,
144−then $\MO{Match}\:\vd\:\vd'$ produces a valid match.
145−\\
146−
147−The output of $\MO{Unelab}$ is not necessarily equal to the input of $\MO{Elab}$
148−because elaboration fills in placeholder subexpressions. Therefore it suffices for
149−the input to match the output.
150−
151−We have not yet proved this conjecture. Its truth depends on the implementation
152−of $\MO{Elab}$ faithfully translating each construct, and we observe that the
153−present description of $\MO{Elab}$ elaborates each non-placeholder subexpression
154−according to the structure of the expression. However, since the truth of this
155−conjecture is crucial to the correctness of the implementation, the elaborator
156−checks \emph{dynamically} that meaning is preserved by evaluating
157−$\MO{Unelab}\:\vt$ and matching the input against the result. In practice, this
158−does not have a significant impact on performance.
159−
papers/impl-paper/elaboration.texdeleted−1956
@@ -1,1956 +0,0 @@
1−\newcommand{\ttinterp}[1]{\mathcal{E}\interp{#1}}
2−\newcommand{\ttpinterp}[1]{\mathcal{P}\interp{#1}}
3−\newcommand{\uninterp}[1]{\mathcal{T}\interp{#1}}
4−
5−\section{Elaborating \Idris{}}
6−
7−\label{sect:elaboration}
8−
9−An \Idris{} program consists of a series of declarations --- data types,
10−functions, classes and instances. In this section, we describe how these
11−high-level declarations are translated into a \TT{} program consisting of
12−inductive families and pattern matching function definitions. We will need to
13−work at the \remph{declaration} level, and at the \remph{expression} level,
14−defining the following meta-operations.
15−
16−\begin{itemize}
17−\item $\ttinterp{\cdot}$, which builds a \TT{} expression from an \Idris{} expression.
18−\item $\MO{Elab}$, which processes a top-level \Idris{} declaration by generating
19−one or more \TT{} declarations.
20−\item $\MO{TTDecl}$, which adds a top-level \TT{} declaration.
21−\end{itemize}
22−
23−
24−\subsection{The Development Calculus \TTdev}
25−
26−\TT{} expressions are built by using high-level \Idris{} expressions to
27−direct a tactic-based theorem prover, which builds the \TT{} expressions
28−step by step, by refinement. In order to build expressions in this way,
29−the type theory needs to support
30−\remph{incomplete} terms, and a method for term construction.
31−To achieve this, we extend \TT{} with \remph{holes},
32−calling the extended calculus \TTdev{}.
33−Holes stand for the parts of programs which have not yet been
34−instantiated; this largely follows the Oleg development
35−calculus~\cite{McBride1999}.
36−
37−The idea is to extend the syntax for binders with a \remph{hole}
38−binding and a \remph{guess} binding.
39−These extensions are given in Figure \ref{ttdev}.
40−The \remph{guess} binding is
41−similar to a $\LET$ binding, but without any computational force,
42−i.e. there are no reduction rules for guess bindings.
43−Using binders to represent holes is useful in a dependently-typed setting since
44−one value may determine another. Attaching a guess to a binder ensures that
45−instantiating one such variable also instantiates all of its dependencies.
46−%The
47−%typing rules for binders ensure that no $?$ bindings leak into types.
48−
49−\FFIG{
50−\begin{array}{c}
51−\vb ::= \ldots
52− \;\mid\; \hole{\vx}{\vt} \;\;(\mbox{hole binding}) \;\;
53− \;\mid\; \guess{\vx}{\vt}{\vt} \;\;(\mbox{guess})
54−\medskip\\
55−\mathsf{HoleVar}\;
56−\Rule{(\hole{\vx}{\vS})\in\Gamma}
57−{\Gamma\vdash\vx\Hab\vS}
58−\hg
59−\mathsf{GuessVar}\;
60−\Rule{(\guess{\vx}{\vS}{\vs})\in\Gamma}
61−{\Gamma\vdash\vx\Hab\vS}
62−\\
63−\mathsf{Hole}\;
64−\Rule{
65−\Gamma;\hole{\vx}{\vS}\proves\ve\Hab\vT
66−}
67−{
68−\Gamma\proves\hole{\vx}{\vS}\SC\ve\Hab\vT
69−}
70−%\hspace*{0.1cm}\vx\not\in\vT
71−\hg
72−\mathsf{Guess}\;
73−\Rule{
74−\Gamma;\guess{\vx}{\vS}{\ve_1}\proves\ve_2\Hab\vT
75−}
76−{
77−\Gamma\proves\guess{\vx}{\vS}{\ve_1}\SC\ve_2\Hab\vT
78−}
79−%\hspace*{0.1cm}\vx\not\in\vT
80−\end{array}
81−}
82−{\TTdev{} extensions}
83−{ttdev}
84−
85−
86−\subsection{Proof State}
87−
88−\label{sect:prfstate}
89−
90−We will build expressions in \TT{} from high-level \Idris{} expressions by
91−creating a top-level hole binding with the appropriate type, and refining it
92−according to the structure of the \Idris{} expression. Noting the Curry-Howard
93−correspondence between programs and proofs, and the relationship between our
94−method for elaboration and tactic-based theorem proving, we refer to a development as a \emph{proof}.
95−A proof state is a tuple, $(\vC, \Delta, \ve, \vP, \vQ)$, containing:
96−
97−\begin{itemize}
98−\item A global context, $\vC$, containing pattern matching definitions and their types
99−\item A local context, $\Delta$, containing pattern bindings
100−\item A proof term, $\ve$, in \TTdev{}
101−\item Unsolved unification problems, $\vP$
102−\begin{itemize}
103−\item These take the form $(\Gamma,\ve_1,\ve_2)$, i.e. the context in which
104−the problem is to be solved, and the expressions to be unified.
105−\end{itemize}
106−\item A hole queue, $\vQ$
107−%\item \remph{Deferred} definitions, $\vD$, for introducing global metavariables
108−\end{itemize}
109−
110−The \remph{hole queue} is a priority queue of names of hole and guess binders
111−$\langle\vx_1,\vx_2,\ldots,\vx_n\rangle$
112−in the proof term ---
113−ensuring that each bound name is unique. Holes refer to \remph{sub-goals}
114−in the proof. As a proof develops, unification problems arising from unsolved
115−holes may be introduced, and may be solved when those holes are instantiated.
116−When the hole queue is empty, and there are no remaining unification
117−problems, the proof term is complete.
118−
119−Creating a \TT{} expression from an \Idris{} expression involves creating
120−a new proof state, with an empty proof term, and using the high-level definition
121−to direct the building of a final proof state, with a complete proof term.
122−
123−In the implementation, the proof state is captured in an elaboration monad,
124−\texttt{Elab}, which is simply a state monad with exceptions.
125−Exceptions are captured by the option type $\MO{Result}$ which
126−either indicates success, or reports an error $\MO{Err}$:
127−
128−\DM{
129−\RW{data}\;\MO{Result}\;\vt\;=\;\MO{Success}\;\vt\;\mid\;\MO{Failure}\;\MO{Err}
130−}
131−
132−\noindent
133−If any operation fails during a proof (e.g. a sub-term fails to type check)
134−then the entire proof fails (i.e. returns $\MO{Failure}\;\ve$ with some error
135−message $\ve$) unless otherwise handled.
136−
137−The \texttt{Elab} monad supports various operations for querying and updating
138−the proof state, manipulating terms, generating fresh names, etc. However, we
139−will describe \Idris{} elaboration in terms of meta-operations on the proof
140−state, in order to capture the essence of the elaboration process without being
141−distracted by implementation details. These meta-operations include:
142−
143−\begin{itemize}
144−\item \demph{Queries} which retrieve values from the proof state, without modifying
145−the state. For example, we can:
146−\begin{itemize}
147−\item Get the type of the current sub-goal ($\MO{Type}$)
148−\item Get the current proof term ($\MO{Term}$)
149−\item Retrieve the local context $\Gamma$ at the current sub-goal
150−($\MO{Context}$)
151−\item Type check ($\MO{Check}$) or normalise ($\MO{Normalise}$) a term relative
152−to $\Gamma$
153−\end{itemize}
154−\item \demph{Unification}, which unifies two terms (potentially solving sub-goals) relative to $\Gamma$. This may introduce new unification problems
155−to the proof state
156−\item \demph{Tactics} which update the proof term. Tactics operate on the sub-term
157−at the binder specified by the head of the hole queue $\vQ$
158−\item \demph{Focussing} on a specific sub-goal, which brings a different sub-goal to the
159−head of the hole queue
160−%\item \demph{Deferring} a sub-goal, which adds a new definition to the global context
161−%$\vC$ which solves the sub-goal.
162−\end{itemize}
163−
164−Elaboration of an \Idris{} expression involves creating a new proof state,
165−running a series of tactics to build a complete proof term, then retrieving and
166−\remph{rechecking} the final proof term, which must be a \TT{} program (i.e.
167−does not contain any of the \TTdev{} extensions). We call a sub-term which
168−contains no hole or guess bindings \demph{pure}. Although a pure term does not
169−contain hole or guess bindings, it may nevertheless \remph{refer} to hole- or
170−guess-bound variables.
171−
172−The proof state is initialised with the $\MO{NewProof}$ operation. Given a
173−global context $\vC$, $\MO{NewProof}\;\vt$ sets up the proof state as:
174−
175−\DM{
176−(\vC, \cdot, \hole{\vx}{\vt}\SC\vx, \langle\rangle, \langle\vx\rangle)
177−}
178−
179−The local context is initially empty, and the initial hole queue is the $\vx$ standing for
180−the entire expression. The proof term is reset with the $\MO{NewTerm}$ operation.
181−In an existing proof state $(\vC, \Delta, \ve, \vP, \vQ)$,
182−$\MO{NewTerm}\;\vt$ discards the proof term and hole queue, and
183−updates the proof state to:
184−
185−\DM{
186−(\vC, \Delta, \hole{\vx}{\vt}\SC\vx, \langle\rangle, \langle\vx\rangle)
187−}
188−
189−Resetting the term and queue but retaining pattern bindings
190−allows the elaborator to use pattern bindings from the left
191−hand side of a pattern matching definition in the term on the right hand side.
192−
193−
194−\renewcommand{\Check}{\MO{Check}_\Gamma}
195−\newcommand{\Eval}{\MO{Normalise}_\Gamma}
196−\newcommand{\Unify}{\MO{Unify}_\Gamma}
197−\newcommand{\PrimUnify}{\MO{PrimUnify}_\Gamma}
198−\newcommand{\Subst}{\MO{Subst}}
199−
200−\subsection{Tactics}
201−
202−% Meta-operations Check, Normalise, Unify
203−In order to build \TT{} expressions from \Idris{} programs, we define a collection
204−of meta-operations for querying and modifying the proof state. Meta-operations
205−may have side-effects including failure, or updating the proof state, and
206−may fail. We have the following primitive meta-operations:
207−
208−\begin{itemize}
209−\item $\MO{Get}$ and $\MO{Put}$ which allow direct access to the proof state.
210−% Focus and Unfocus don't need to be primitive, we could show in terms of
211−% Get and Put
212−%\item $\MO{Focus}\;\vn$, which moves $\vn$ to the head of the hole queue.
213−%\item $\MO{Unfocus}$, which moves the current hole to the back of the hole queue.
214−\item $\Check\;\ve$, which type checks an expression $\ve$ relative to a context
215−$\Gamma$, returning its type.
216−$\MO{Check}$ will fail
217−if the expression is not well-typed.
218−\item $\MO{Convert}_\Gamma\;\ve_1\;\ve_2$, which checks that the well-typed
219−expressions $\ve_1$ and $\ve_2$ respect the cumulativity relation
220−(i.e. $\Gamma\proves\ve_1\cumul\ve_2$), and fails otherwise.
221−\item $\Eval\;\ve$, which evaluates a well-typed expression $\ve$ relative to a context
222−$\Gamma$, returning its normal form. $\MO{Normalise}$ reduces under binders,
223−but does not reduce definitions which are not total.
224−\item
225−$\PrimUnify\;\ve_1\;\ve_2$,
226−which attempts to unify $\ve_1$ and $\ve_2$ by finding the values with which
227−holes must be instantiated for $\ve_1$ and $\ve_2$ to be convertible relative
228−to $\Gamma$ (i.e. for $\Gamma\proves\ve_1\converts\ve_2$ to hold).
229−\item $\Subst\;\vx\;\ve$, which instantiates a hole $\vx$ directly with a term
230−$\ve$, typically arising from unification and removes $\vx$ from the hole
231−queue.
232−\end{itemize}
233−
234−\noindent
235−Additionally, we have $\MO{Focus}$, $\MO{Unfocus}$, $\MO{NewHole}$,
236−$\MO{NextHole}$ and $\MO{RemoveHole}$
237−operations which manipulate and inspect
238−the hole queue. $\MO{Focus}\;\vn$ moves a hole to the head of the hole queue:
239−
240−\DM{
241−\MO{Focus}\;\vn\;=\;\RW{do}\;\AR{
242−(\vC,\Delta,\ve,\vP,\vQ;\vn;\vQ')\gets\MO{Get}\\
243−\MO{Put}\;(\vC,\Delta,\ve,\vP,\vn;\vQ;\vQ')\\
244−}
245−}
246−
247−\noindent
248−$\MO{Focus}$ refers to a hole $\vn$ by name. Hole names are either given
249−explicitly in proofs, or chosen (as fresh names) by tactics.
250−Correspondingly, $\MO{Unfocus}$ moves the currently in focus hole to the
251−end of the hole queue:
252−
253−\DM{
254−\MO{Unfocus}\;=\;\RW{do}\;\AR{
255−(\vC,\Delta,\ve,\vP,\vn;\vQ)\gets\MO{Get}\\
256−\MO{Put}\;(\vC,\Delta,\ve,\vP,\vQ;\vn)\\
257−}
258−}
259−
260−\noindent
261−$\MO{NewHole}$ declares that a new hole has been created and is to be solved
262−next; $\MO{NextHole}$ returns the next hole to be solved, and $\MO{RemoveHole}$
263−removes a hole from the head of the queue:
264−
265−\DM{
266−\AR{
267−\MO{NewHole}\;\vn\;=\;\RW{do}\;\AR{
268−(\vC,\Delta,\ve,\vP,\vQ)\gets\MO{Get}\\
269−\MO{Put}\;(\vC,\Delta,\ve,\vP,\vn;\vQ)\\
270−}
271−\\
272−\MO{NextHole}\;=\;\RW{do}\;\AR{
273−(\vC,\Delta,\ve,\vP,\vn;\vQ)\gets\MO{Get}\\
274−\RW{return}\;\vn
275−}
276−\\
277−\MO{RemoveHole}\;=\;\RW{do}\;\AR{
278−(\vC,\Delta,\ve,\vP,\vn;\vQ)\gets\MO{Get}\\
279−\MO{Put}\;(\vC,\Delta,\ve,\vP,\vQ)
280−}
281−}
282−}
283−
284−\noindent
285−\demph{Tactics} are meta-operations which operate on the sub-term given by the
286−hole at the head of the hole queue in the proof state. They take the following
287−form:
288−
289−\DM{
290−\PA{\A\A}{
291−\MO{Tac}_\Gamma & \;\vec{\VV{args}} & \;\vt & \MoRet{\RW{do}\;\AR{
292−\ldots\\
293−\RW{return}\:\vt'}
294−}
295−}
296−}
297−
298−A tactic $\MO{Tac}$ takes a sequence of zero or more arguments
299−$\vec{\VV{args}}$ followed by the sub-term $\vt$ on which it is operating. It
300−runs relative to a context $\Gamma$ which contains all the bindings and pattern
301−bindings in scope at that point in the term. The sub-term $\vt$ will either be
302−a hole binding $\hole{\vx}{\vT}\SC\ve$ or a guess binding
303−$\guess{\vx}{\vT}{\vv}\SC\ve$. The tactic returns a new term $\vt'$ which can
304−take any form, provided it is well-typed, with a type convertible to the type
305−of $\vt$. Tactics may also have the side effect of updating the proof state,
306−therefore we will describe tactics in a pseudo-code with $\RW{do}$ notation.
307−
308−Tactics are executed by a higher level meta-operation $\MO{Tactic}$,
309−given in Figure \ref{runtac}, which
310−locates the appropriate sub-term, applies the tactic with the context
311−local to this sub-term, and
312−replaces the sub-term with the term returned by the
313−tactic. Note that monadic lifting is left implicit in this Figure, so that
314−the details of the algorithm are not obscured.
315−% It then updates the hole queue in the proof state, and updates holes which have
316−% been solved by unification. If the tactic creates new holes, these are automatically
317−% added to the \remph{head} of the hole queue.
318−
319−\FFIG{
320−\AR{
321−\MO{Tactic}\;\VV{tac}\;=\;\RW{do}\;\AR{
322−\ve\Gets\MO{Term}\\
323−\vh\Gets\MO{NextHole}\\
324−\ve'\Gets\MO{Tactic'}\;\langle\rangle\;\ve\\
325−\MO{SetTerm}\;\ve'
326−}
327−\medskip
328−\\
329−\PA{\A\A\A}{
330−\RW{where} \\
331−& \MO{Tactic'} & \Gamma & (\hole{\vx}{\vT}\SC\ve)
332−& \MoRet{\VV{tac}_\Gamma\;(\hole{\vx}{\vT}\SC\ve)\hg\mbox{if}\;\vx=\vh} \\
333−& \MO{Tactic'} & \Gamma & (\hole{\vx}{\vT}\SC\ve)
334−& \MoRet{
335−\RW{do}\; \AR{\vT'\Gets\;\MO{Tactic'}\;\Gamma\;\vT\\
336−\RW{return}\;(\hole{\vx}{\vT'}\SC \MO{Tactic'}\;(\Gamma;\hole{\vx}{\vT'})\;\ve)
337−\hg\RW{otherwise}}
338−}
339−\\
340−& \MO{Tactic'} & \Gamma & (\guess{\vx}{\vT}{\vv}\SC\ve)
341−& \MoRet{\VV{tac}_\Gamma\;(\guess{\vx}{\vT}{\vv}\SC\ve)\hg\mbox{if}\;\vx=\vh} \\
342−
343−& \MO{Tactic'} & \Gamma & (\guess{\vx}{\vT}{\vv}\SC\ve)
344−& \MoRet{\RW{do}\;\AR{\vv'\Gets\;\MO{Tactic'}\;\Gamma\;\vv\\
345−\vT'\Gets\;\MO{Tactic'}\;\Gamma\;\vT\\
346−\RW{return}\;(\guess{\vx}{\vT'}{\vv'}\SC
347−\MO{Tactic'}\;(\Gamma;\guess{\vx}{\vT'}{\vv'}\;\ve)
348−\hg\RW{otherwise}}} \\
349−
350−& \MO{Tactic'} & \Gamma & (\lam{\vx}{\vT}\SC\ve)
351−& \MoRet{
352−\RW{do}\; \AR{\vT'\Gets\;\MO{Tactic'}\;\Gamma\;\vT\\
353−\RW{return}\;(\lam{\vx}{\vT'}\SC \MO{Tactic'}\;(\Gamma;\lam{\vx}{\vT'})\;\ve)}
354−}
355−\\
356−& \MO{Tactic'} & \Gamma & (\all{\vx}{\vT}\SC\ve)
357−& \MoRet{
358−\RW{do}\; \AR{\vT'\Gets\;\MO{Tactic'}\;\Gamma\;\vT\\
359−\RW{return}\;(\all{\vx}{\vT'}\SC \MO{Tactic'}\;(\Gamma;\all{\vx}{\vT'})\;\ve)}
360−}
361−\\
362−& \MO{Tactic'} & \Gamma & (\LET\;\vx\defq\vv\Hab\vT\SC\ve)
363−& \MoRet{\RW{do}\;\AR{\vv'\Gets\;\MO{Tactic'}\;\Gamma\;\vv\\
364−\vT'\Gets\;\MO{Tactic'}\;\Gamma\;\vT\\
365−\RW{return}\;(\LET\;\vx\defq\vv'\Hab\vT'\SC
366−\MO{Tactic'}\;(\Gamma;\LET\;\vx\defq\vv'\Hab\vT')\;\ve)}} \\
367−& \MO{Tactic'} & \Gamma & (\vf\;\va) &
368−\MoRet{\RW{return}\;(\MO{Tactic'}\;\Gamma\;\vf)\; (\MO{Tactic'}\;\Gamma\;\va)}\\
369−& \MO{Tactic'} & \Gamma & \vt & \MoRet{\RW{return}\;\vt}
370−}
371−}
372−}
373−{Applying tactics to the proof state}
374−{runtac}
375−
376−In the remainder of this section, we will define a set of primitive tactics:
377−$\MO{Claim}$, $\MO{Fill}$ and $\MO{Solve}$ which are used to create and destroy
378−holes; and $\MO{Lambda}$, $\MO{Pi}$, $\MO{Let}$ and $\MO{Attack}$ which are
379−used to create binders. First, however, we must explain how unification is
380−applied during elaboration.
381−
382−\subsubsection{Unification}
383−
384−Unification is crucial to the success of elaboration --- it is unification
385−which finds values of implicit arguments, in particular. We do not require
386−unification to succeed immediately, in general, as instantiating a hole may
387−affect the solution to other unification problems. Instead,
388−$\PrimUnify\:\ve_1\:\ve_2$ may give one of the following results:
389−
390−\begin{itemize}
391−\item $\MO{Success}\;(\tx=\te, \tp)$, containing the solved holes mapping
392−$\vx$ to $\ve$, and a possibly empty set of blocked unification problems $\tp$.
393−If $\tp$ is empty, there is a solution unifying $\ve_1$ and $\ve_2$ in
394−the context $\Gamma$.
395−\item $\MO{Failure}\;\ve$, if no solution is found due to a failure to unify
396−sub-terms in normal form.
397−\end{itemize}
398−
399−$\MO{Unify}$ attempts to solve the given unification problem using
400−$\MO{PrimUnify}$,
401−then attempts to further refine existing problems in the proof
402−state. This operation is given in Figure \ref{unifyps}. After attempting to
403−solve the problem with $\MO{PrimUnify}$ and updating the proof term with
404−any solutions found, it updates the existing problems (with $\MO{SubstProblems}$
405−which applies $\MO{Subst}$ across the terms in the problems), then attempts to
406−resolve the existing problems with $\MO{ReUnify}$.
407−
408−\FFIG{
409−%\mbox{\textbf{[UNIFY ALGORITHM GOES HERE] }}
410−%Show how it uses a PrimUnify
411−%operation to update
412−%the proof state with new problems, and solve the old ones
413−\AR{
414−\Unify\;\ve_1\;\ve_2\;=\;\RW{do}\;
415−\AR{
416−(\tx=\te,\tp)\gets\PrimUnify\;\ve_1\;\ve_2\\
417−\vec{\MO{Subst}}\;\tx\;\te\\
418−\MO{SubstProblems}\;\tx\;\te\\
419−(\vC,\Delta,\VV{term},\tP,\vQ)\gets\MO{Get}\\
420−\vec{\MO{ReUnify}}\;\tP
421−}
422−\medskip
423−\\
424−\AR{
425−\MO{ReUnify}\;(\Gamma,\ve_1,\ve_2)\;=\;\RW{do}\;\AR{
426−(\tx=\te,\tp)\Gets\PrimUnify\;\ve_1\;\ve_2\\
427−\vec{\MO{Subst}}\;\tx\;\te\\
428−\RW{return}\;\tp
429−}
430−}
431−}
432−}
433−{The $\MO{Unify}$ meta-operation}
434−{unifyps}
435−
436−
437−\subsubsection{Creating and destroying holes}
438−
439−The $\MO{Claim}$ tactic, given a name and a type, adds a new hole binding in
440−the scope of the current goal $\vx$, adding the new binding to the hole queue, but
441−keeping $\vx$ at the head:
442−
443−\DM{
444−\PA{\A\A}{
445−\MO{Claim}_\Gamma & (\vy \Hab\vS) & (\hole{\vx}{\vT}\SC\ve) &
446− \MoRet{\RW{do}\;\AR{\MO{NewHole}\;\vy\\
447− \MO{Focus}\:\vx\\
448− \RW{return}\;\hole{\vy}{\vS}\SC\hole{\vx}{\vT}\SC\ve}} \\
449−}
450−}
451−
452−An obvious difficulty is in ensuring that names are unique throughout a proof
453−term. The implementation ensures that any hole created by the $\MO{NewHole}$
454−operation has a unique name by checking against existing names in scope and
455−modifying the name if necessary. In this paper, we will assume that all created
456−names are fresh.
457−
458−The $\MO{Fill}$ tactic, given a value $\vv$, attempts to solve the current goal
459−with $\vv$, creating a guess binding in its place. $\MO{Fill}$ attempts to
460−solve other holes by unifying the expected type of $\vx$ with the type of $\vv$:
461−
462−\DM{
463−\PA{\A\A}{
464−\MO{Fill}_\Gamma & \vv & (\hole{\vx}{\vT}\SC\ve) &
465− \MoRet{\RW{do}\;\AR{
466− \vT' \leftarrow \Check\;\vv\\
467− \Unify\;\vT\;\vT'\\
468− \RW{return}\;\guess{\vx}{\vT}{\vv}\SC\ve}
469− } \\
470−}
471−}
472−
473−\noindent
474−For example, consider the following proof term:
475−
476−\DM{
477−\AR{
478−\hole{\va}{\Type}\SC\hole{\vk}{\Nat}\SC
479−\hole{\vx}{\va}\SC\hole{\vxs}{\Vect\;\vk\;\va}\SC
480−\\
481−\hole{\vys}{\Vect\;(\suc\;\vk)\;\va}\SC\vys
482−}
483−}
484−
485−\noindent
486−If $\vx$ is in focus (i.e., at the head of the hole queue) and the elaborator
487−attempts to
488−$\MO{Fill}$ it with an $\TC{Int}$ value $42$, we have:
489−
490−\begin{itemize}
491−\item $\Check\;42\;\mq\;\TC{Int}$
492−\item Unifying $\TC{Int}$ with $\vA$ (the type of $\vx$) is only possible if
493−$\vA\;=\;\TC{Int}$, so solve $\vA$.
494−\end{itemize}
495−
496−\noindent
497−Therefore the resulting proof term is:
498−
499−\DM{
500−\AR{
501−\hole{\vk}{\Nat}\SC
502−\guess{\vx}{\TC{Int}}{42}\SC\hole{\vxs}{\Vect\;\vk\;\TC{Int}}\SC
503−\\
504−\hole{\vys}{\Vect\;(\suc\;\vk)\;\TC{Int}}\SC\vys
505−}
506−}
507−
508−The $\MO{Solve}$ tactic operates on a guess binding. If the guess is \remph{pure}, i.e., it
509−is a \TT{} term containing no hole or guess bindings, then the value attached to
510−the guess is substituted into its scope, and the corresponding hole removed
511−from the hole queue:
512−
513−\DM{
514−\PA{\A}{
515−\MO{Solve}_\Gamma & (\guess{\vx}{\vT}{\vv}\SC\ve) &
516− \MoRet{\RW{do}\;\AR{\MO{RemoveHole}\\
517− \RW{return}\;\ve[\vv/\vx]\hg\mbox{(if $\MO{Pure}\;\vv$)}}}
518−}
519−}
520−
521−The two step process, with $\MO{Fill}$ followed by $\MO{Solve}$, allows the elaborator
522−to work safely with incomplete terms, since an incomplete guess binding has no
523−computational force. Once a term is complete in a guess binding, it may be substituted into the
524−scope of the binding safely.
525−In each of these tactics, if any step fails, or the term in focus does not take
526−the correct form (e.g. is not a guess in the case of $\MO{Solve}$ or not a hole
527−in the case of $\MO{Claim}$ and $\MO{Fill}$) the entire tactic fails. We can
528−handle failure using the $\MO{Try}$ tactic combinator:
529−
530−\DM{
531−\PA{\A\A\A}{
532−\MO{Try}_\Gamma & \VV{t1} & \VV{t2} & \vt &
533− \MoRet{\RW{case}\;\AR{\VV{t1}_\Gamma\;\vt\;\RW{of}\\
534− \MO{Success}\;\vt'\cq\MO{Success}\;\vt'\\
535− \MO{Failure}\;\_\cq\VV{t2}_\Gamma\;\vt\\
536− }}
537−}
538−}
539−
540−We have a primitive tactic $\MO{Fail}$, which may be invoked by
541−any tactic which encounters a failure condition (for example, an unsolvable unification
542−problem) and is handled by $\MO{Try}$.
543−
544−\subsubsection{Creating binders}
545−
546−We also define primitive tactics for constructing binders. Creating a
547−$\lambda$-binding requires that the goal normalises to a function type:
548−
549−\DM{
550−\PA{\A\A}{
551−\MO{Lambda}_\Gamma & \vn & (\hole{\vx}{\vT}\SC\vx) &
552− \MoRet{\RW{do}\;\AR{
553− \all{\vy}{\vS}\SC\vT'\;\leftarrow\;\Eval\;\vT \\
554− \RW{return}\;\lam{\vn}{\vS}\SC\hole{\vx}{\vT'[\vn/\vy]}\SC\vx
555− }
556− }
557−}
558−}
559−
560−\noindent
561−Creating a $\forall$ binding requires that the goal type converts
562−with $\TC{Type}$:
563−
564−\DM{
565−\PA{\A\A}{
566−\MO{Pi}_\Gamma & (\vn\Hab\vS) & (\hole{\vx}{\Type}\SC\vx) &
567− \MoRet{\RW{do}\;\AR{
568− \vV\;\leftarrow\;\Check\;\vS\\
569− \MO{Convert}_\Gamma\;\vV\;\Type\\
570− \RW{return}\;\all{\vn}{\vS}\SC\hole{\vx}{\Type}\SC\vx
571− }
572− }
573−}
574−}
575−
576−\noindent
577−Creating a $\LET$ binding requires a type and a value.
578−
579−\DM{
580−\PA{\A\A}{
581−\MO{Let}_\Gamma & (\vn\Hab\vS\defq\vv) & (\hole{\vx}{\vT}\SC\vx) &
582− \MoRet{\RW{do}\;\AR{
583− \vV\;\leftarrow\;\Check\;\vS\\
584− \MO{Convert}_\Gamma\;\vV\;\Type\\
585− \vS'\;\leftarrow\;\Check\;\vv\\
586− \Unify\;\vS\;\vS'\\
587− \RW{return}\;\LET\;\vn\Hab\vS\defq\vv\SC\hole{\vx}{\vT}\SC\vx
588− }
589− }
590−}
591−}
592−
593−Each of these tactics require the term in focus to be of the form $\hole{\vx}{\vT}\SC\vx$.
594−This is important, because if the scope of the binding were an arbitrary expression $\ve$,
595−the binder would be scoped across this \emph{whole} expression rather than the subexpression
596−$\vx$ as intended.
597−The $\MO{Attack}$ tactic ensures that a hole
598−is in the appropriate form, creating a new hole $\vx'$ which is placed at the
599−head of the queue:
600−
601−\DM{
602−\PA{\A}{
603−\MO{Attack}_\Gamma & (\hole{\vx}{\vT}\SC\ve) &
604− \MoRet{\RW{do}\;\AR{
605− \MO{NewHole}\;\vx'\\
606− \RW{return}\;\guess{\vx}{\vT}{(\hole{\vx'}{\vT}\SC\vx')}\SC\ve}}
607−}
608−}
609−
610−\noindent
611−For example, consider the following proof term:
612−
613−\DM{
614−\hole{\vx}{\va\to\vb}\SC\vx\;\ve
615−}
616−
617−\noindent
618−If we try to instantiate $\vx$ with a $\lambda$-binding $\vn$ immediately,
619−without applying $\MO{Attack}$ first, the $\lambda$ will scope over the
620−entirety of $\vx\;\ve$, and the resulting term is not well-typed:
621−
622−\DM{
623−\AR{
624−\lam{\vn}{\va}\SC\hole{\vx}{\vb}\SC\vx\;\ve
625−}
626−}
627−
628−\noindent
629−If, on the other hand, we $\MO{Attack}$ the hole then instantiate it with
630−a $\lambda$-binding $\vn$, we get:
631−
632−\DM{
633−\begin{array}{ll}
634−\guess{\vx}{\va\to\vb}{\hole{\vx'}{\va\to\vb}\SC\vx'}\SC\vx\;\ve
635−& \hg\mbox{(after $\MO{Attack}$)}\\
636−\guess{\vx}{\va\to\vb}{\lam{\vn}{\va}\SC\hole{\vx'}{\vb}\SC\vx'}\SC\vx\;\ve
637−& \hg\mbox{(after $\MO{Lambda}\;\vn$)}
638−\end{array}
639−}
640−
641−\noindent
642−Now, once $\vx'$ has been instantiated, the guess for $\vx$ can safely be
643−closed with $\MO{Solve}$.
644−
645−\subsubsection{Pattern Binders}
646−
647−Finally, we can convert a hole binding to a pattern binding by giving the
648−pattern variable a name. This solves a hole
649−by adding the pattern binding to the proof state, and updating the proof term
650−with the pattern variable directly:
651−
652−\DM{
653−\PA{\A\A}{
654−\MO{Pat}_\Gamma & \vn & (\hole{\vx}{\vT}\SC\ve) &
655− \MoRet{\RW{do}\;\AR{
656− \MO{PatBind}\;(\vn\Hab\vT)\\
657− \RW{return}\;\ve[\vn/\vx]
658− }}
659−}
660−}
661−
662−The $\MO{PatBind}$ operation simply updates the proof state with the given pattern
663−binding. Once we have created bindings from the left hand side of a pattern
664−matching definition, for example, we can retain these bindings for use when
665−building the right hand side.
666−
667−\subsubsection{Example}
668−
669−To illustrate how tactics are applied, using $\MO{Tactic}$, to build a
670−complete term by refining a proof state, let us consider the following
671−\TT{} definition for the identity function:
672−
673−\DM{
674−\AR{
675−\FN{id}\Hab\all{\vA}{\Type}\SC\all{\va}{\vA}\SC\vA \\
676−\FN{id}\;=\;\lam{\vA}{\Type}\SC\lam{\va}{\vA}\SC\va
677−}
678−}
679−
680−We can build $\FN{id}$ either as a complete term, or by applying a sequence of
681−tactics. To achieve this, we create a proof state initialised with the type of
682−$\FN{id}$ and apply a series of $\MO{Lambda}$ and $\MO{Fill}$ operations using
683−$\MO{Tactic}$. Note that the types on each $\MO{Lambda}$ are taken from
684−the goal type.
685−
686−\DM{
687−\AR{
688−\MO{MkId}\;\mq\;\RW{do}\;
689− \AR{
690− \MO{NewProof}\;\all{\vA}{\Type}\SC\all{\va}{\vA}\SC\vA \\
691− \MO{Tactic}\;\MO{Attack} \\
692− \MO{Tactic}\;(\MO{Lambda}\;\vA) \\
693− \MO{Tactic}\;\MO{Attack} \\
694− \MO{Tactic}\;(\MO{Lambda}\;\va) \\
695− \MO{Tactic}\;(\MO{Fill}\;\va)\\
696− \MO{Tactic}\;\MO{Solve}\\
697− \MO{Tactic}\;\MO{Solve}\\
698− \MO{Tactic}\;\MO{Solve}\\
699− \MO{Term}
700− }
701−}
702−}
703−
704−\FFIG{
705−\begin{array}{lll}
706−\mbox{\textbf{Tactic}} & \mbox{\textbf{Resulting Proof Term}} &
707−\mbox{\textbf{Queue}}
708−\medskip
709−\\
710−\mbox{Initial state}
711−& \underline{\hole{\vx}{\all{\vA}{\Type}\SC\all{\va}{\vA}\SC\vA}\SC\vx}
712−& \langle\vx\rangle \\
713−%
714−\MO{Attack} &
715−\guess{\vx}{\all{\vA}{\Type}\SC\all{\va}{\vA}\SC\vA}{
716−\underline{\hole{\vh_0}{\all{\vA}{\Type}\SC\all{\va}{\vA}\SC\vA}\SC\vh_0}
717−}
718−\SC\vx
719−&
720−\langle\vh_0,\vx\rangle\\
721−%
722−\MO{Lambda}\;\vA &
723−\guess{\vx}{\all{\vA}{\Type}\SC\all{\va}{\vA}\SC\vA}{
724−\lam{\vA}{\Type}\SC\underline{
725−\hole{\vh_0}{\all{\va}{\vA}\SC\vA}\SC\vh_0
726−}
727−}
728−\SC\vx
729−&
730−\langle\vh_0,\vx\rangle\\
731−%
732−\MO{Attack} &
733−\guess{\vx}{\all{\vA}{\Type}\SC\all{\va}{\vA}\SC\vA}{
734−\lam{\vA}{\Type}\SC
735−\guess{\vh_0}{\all{\va}{\vA}\SC\vA}
736−{
737−\underline{
738−\hole{\vh_1}{\all{\va}{\vA}\SC\vA}\SC\vh_1}}
739−\SC\vh_0
740−}
741−\SC\vx
742−&
743−\langle\vh_1,\vh_0,\vx\rangle\\
744−%
745−\MO{Lambda}\;\va &
746−\guess{\vx}{\all{\vA}{\Type}\SC\all{\va}{\vA}\SC\vA}{
747−\lam{\vA}{\Type}\SC
748−\guess{\vh_0}{\all{\va}{\vA}\SC\vA}
749−{
750−\lam{\va}{\vA}\SC\underline{
751−\hole{\vh_1}{\vA}\SC\vh_1
752−}
753−}
754−\SC\vh_0
755−}
756−\SC\vx
757−&
758−\langle\vh_1,\vh_0,\vx\rangle\\
759−%
760−\MO{Fill}\;\va &
761−\guess{\vx}{\all{\vA}{\Type}\SC\all{\va}{\vA}\SC\vA}{
762−\lam{\vA}{\Type}\SC
763−%\\
764−%&
765−%\hg\hg\hg\hg\hg\hg\hg
766−\guess{\vh_0}{\all{\va}{\vA}\SC\vA}
767−{
768−\lam{\va}{\vA}\SC
769−\underline{
770−\guess{\vh_1}{\vA}{\va}\SC\vh_1
771−}
772−}
773−\SC\vh_0
774−}
775−\SC\vx
776−&
777−\langle\vh_1,\vh_0,\vx\rangle\\
778−%
779−\MO{Solve} &
780−\guess{\vx}{\all{\vA}{\Type}\SC\all{\va}{\vA}\SC\vA}{
781−\lam{\vA}{\Type}\SC
782−\underline{
783−\guess{\vh_0}{\all{\va}{\vA}\SC\vA}
784−{
785−\lam{\va}{\vA}\SC
786−\va
787−}
788−\SC\vh_0
789−}
790−}
791−\SC\vx
792−&
793−\langle\vh_0,\vx\rangle\\
794−%
795−\MO{Solve} &
796−\underline{
797−\guess{\vx}{\all{\vA}{\Type}\SC\all{\va}{\vA}\SC\vA}{
798−\lam{\vA}{\Type}\SC
799−\lam{\va}{\vA}\SC
800−\va
801−}
802−\SC\vx
803−}
804−&
805−\langle\vx\rangle\\
806−%
807−\MO{Solve} &
808−\lam{\vA}{\Type}\SC
809−\lam{\va}{\vA}\SC
810−\va
811−&
812−\langle\rangle\\
813−
814−\end{array}
815−}
816−{Proof state development for $\MO{MkId}$}
817−{mkidrefine}
818−
819−Figure \ref{mkidrefine} shows how each step of this sequence of tactics affects
820−the proof state and hole queue. In each step, the underlined fragment of the
821−term is the fragment in focus. One might observe that the
822−$\MO{Attack}$/$\MO{Solve}$ pairs are unnecessary in this case, as the term
823−is already in a form suitable for introduction. However, we retain these for
824−uniform treatment of introductions.
825−
826−To aid readability, we will elide $\MO{Tactic}$, and use a semi-colon to indicate
827−sequencing --- in the implementation we use wrapper functions for each tactic to
828−apply $\MO{Tactic}$.
829−Using this convention, we can build $\FN{id}$'s type and definition as shown
830−in Figure \ref{idelab}. Note that $\MO{Term}$ retrieves the proof term from the current proof
831−state. Both $\MO{MkIdType}$ and $\MO{MkId}$ finish by returning a completed \TT{} term.
832−Note in particular that each tactic which introduces a guess ($\MO{Fill}$
833−and $\MO{Attack}$) is closed with a $\MO{Solve}$.
834−
835−Setting up elaboration in this way, with a proof state captured in a monad,
836−and a primitive collection of tactics, makes it easy to derive more complex
837−tactics for elaborating higher level language constructs, in much the same way
838−as the \texttt{Ltac} language in Coq~\cite{Delahaye2000}. As a result, the
839−description of elaboration of a language construct (or a program such as
840−$\FN{id}$) bears a strong resemblance to
841−a Coq proof script.
842−
843−\FFIG{
844−\AR{
845−\MO{MkIdType}\;\mq\;\RW{do}\;
846− \AR{
847− \MO{NewProof}\;\Type\\
848− \MO{Attack} ; \MO{Pi}\;(\vA\Hab\Type) ;
849− \MO{Attack} ; \MO{Pi}\;(\va\Hab\vA) \\
850− \MO{Fill}\;\vA \\
851− \MO{Solve} ; \MO{Solve} ; \MO{Solve} \\
852− \MO{Term}
853− }
854− \medskip\\
855−\MO{MkId}\;\mq\;\RW{do}\;
856− \AR{
857− \vt\;\leftarrow\;\MO{MkIdType}; \MO{NewProof}\;\vt\\
858− \MO{Attack} ; \MO{Lambda}\;\vA ;
859− \MO{Attack} ; \MO{Lambda}\;\va \\
860− \MO{Fill}\;\va \\
861− \MO{Solve} ; \MO{Solve} ; \MO{Solve}\\
862− \MO{Term}
863− }
864−}
865−}
866−{Building $\FN{id}$ with tactics}
867−{idelab}
868−
869−%--- give unify in full, esp. as it solves sub-goals? Maybe...
870−
871−% Unify' G x t = Success (x, t) if ?x : t in G
872−% Unify' G t x = Success (x, t) if ?x : t in G
873−% Unify' G (b x. e) (b' x'. e') = Unify' G b b'; Unify' G;b e e'[x/x']
874−% Unify' G ((\x.e) x) e' = Unify' G e e'
875−% Unify' G e ((\x.e') x) = Unify' G e e'
876−% Unify' G (f es) (f' es') = vs <- Unify' G f f'; Injective f
877−
878−% Unify' G x y = Success () if G |- x == y
879−% Unify' G . . = Failure
880−
881−% Unify' G (\x : t . e) (\x : t' . e') = Unify' G t t'; Unify' G e e'
882−% ...
883−
884−
885−%\DM{
886−%}
887−
888−\subsection{System State}
889−
890−\label{sect:sysstate}
891−
892−To elaborate \Idris{} programs we will build expressions from high-level
893−declarations of functions, data types and classes, and add the resulting
894−definitions to a global system state.
895−The system state is a tuple, $(\vC,\vA,\vI)$, containing:
896−
897−\begin{itemize}
898−\item A global context, $\vC$, containing pattern matching definitions and their types
899−\item Implicit arguments, $\vA$, recording which arguments are implicit for each global name
900−\item Class information, $\vI$, containing method signatures and dictionaries for classes
901−\end{itemize}
902−
903−In the implementation, the system state is captured in a monad, \texttt{Idris},
904−which includes additional information such as syntax overloadings, command line
905−options, and optimisations, which do not concern us here.
906−
907−For each global name, $\vA$ records whether its arguments are explicit, implicit,
908−or class constraints. For example, recall the declaration
909−of \texttt{vAdd}:
910−
911−\begin{SaveVerbatim}{vAddImpT}
912−
913−vAdd : Num a => Vect n a -> Vect n a -> Vect n a
914−
915−\end{SaveVerbatim}
916−\useverb{vAddImpT}
917−
918−\noindent
919−Written in full, and giving each argument an explicit name, we get the
920−type declaration:
921−
922−\begin{SaveVerbatim}{vAddImpT}
923−
924−vAdd : (a : _) -> (n : _) -> (c : Num a) ->
925− (xs : Vect n a) -> (ys : Vect n a) -> Vect n a
926−
927−\end{SaveVerbatim}
928−\useverb{vAddImpT}
929−
930−\noindent
931−For \tFN{vAdd}, the state records that \texttt{a} and \texttt{n} are implicit,
932−\texttt{c} is a constraint, and \texttt{xs} and \texttt{ys} are explicit. When
933−the elaborator encounters an application of \tFN{vAdd}, it knows that unless these arguments
934−are given explicitly, the application must be expanded.
935−
936−\subsection{Elaborating Expressions}
937−
938−\newcommand{\piimp}[2]{\mbox{\texttt{\{$#1$ : $#2$\} -> }}}
939−%\mathtt{\{}#1\mathtt{:}#2\mbox{\texttt{\} -> }}}
940−\newcommand{\piexp}[2]{\mbox{\texttt{($#1$ : $#2$) -> }}}
941−%\newcommand{\piexp}[2]{\mathtt{(}#1\mathtt{:}#2\mbox{\texttt{) -> }}}
942−\newcommand{\piconst}[1]{\mbox{\texttt{$#1$ => }}}
943−\newcommand{\icase}{\mathtt{case}}
944−\newcommand{\iwith}{\mathtt{with}}
945−\newcommand{\idata}{\mathtt{data}}
946−\newcommand{\iclass}{\mathtt{class}}
947−\newcommand{\iinstance}{\mathtt{instance}}
948−\newcommand{\iwhere}{\mathtt{where}}
949−\newcommand{\iof}{\mathtt{of}}
950−\newcommand{\ilet}[2]{\mathtt{let}\;#1\;\mathtt{=}\;#2\;\mathtt{in}}
951−\newcommand{\ilam}[1]{\mathtt{\backslash}\;#1\;\mathtt{=>}}
952−\newcommand{\iarg}[2]{\mbox{\texttt{\{$#1$ = $#2$\}}}}
953−\newcommand{\ihab}[2]{\mbox{\texttt{$#1$ : $#2$}}}
954−\newcommand{\carg}[1]{\mbox{\texttt{\{\{$#1$\}\}}}}
955−\newcommand{\fatarrow}{\mbox{\texttt{=>}}}
956−\newcommand{\ibar}{\mbox{\texttt{|}}}
957−\newcommand{\mvar}[1]{\mbox{\texttt{?}}#1}
958−
959−\FFIG{
960−\AR{
961−\begin{array}{rll@{\hg}rll}
962−\ve, \vt ::= & \vc & (\mbox{constant}) &
963−\mid & \vx & (\mbox{variable}) \\
964−\mid & \ilam{\vx}\;\ve & (\mbox{lambda abstraction}) &
965−\mid & \ve\;\ta & (\mbox{function application}) \\
966−\mid & \ilet{\vx}{\ve}\;\ve & (\mbox{let binding}) &
967−\mid & \piexp{\vx}{\vt}\vt & (\mbox{explicit function space}) \\
968−%\mid & \icase\;\ve\;\iof\;\vec{\VV{alt}} & (\mbox{case expression}) &
969−%\mid & \mvar{\vx} & (\mbox{metavariable}) \\
970−\mid & \_ & (\mbox{placeholder})
971−\end{array}
972−\medskip\\
973−\begin{array}{rll}
974−\va :: = & \ve & (\mbox{normal argument}) \\
975−\mid & \iarg{\vx}{\ve} & (\mbox{implicit argument with value}) \\
976−\mid & \carg{\ve} & (\mbox{explicit class instance})
977−\end{array}
978−\medskip\\
979−\begin{array}{rll}
980−\VV{declty} ::= & \ve & (\mbox{expression}) \\
981−\mid & \piexp{\vx}{\vt}\VV{declty} & (\mbox{explicit function space}) \\
982−\mid & \piimp{\vx}{\vt}\VV{declty} & (\mbox{implicit function space}) \\
983−\mid & \VV{constr}\;\VV{declty} & (\mbox{constrained type}) \\
984−\end{array}
985−\medskip\\
986−\begin{array}{rll}
987−\VV{constr} ::= & \piconst{\ttt} & (\mbox{class constraint}) \\
988−\end{array}
989−}
990−}
991−{\IdrisM{} expressions}
992−{idrism}
993−
994−\FFIG{
995−\AR{
996−\begin{array}{rll}
997−\vd ::= & \ihab{\vx}{\VV{declty}} & (\mbox{type declaration}) \\
998−\mid & \VV{pclause} & (\mbox{pattern clause}) \\
999−\mid & \VV{ddecl} & (\mbox{data type declaration}) \\
1000−\mid & \VV{cdecl} & (\mbox{class declaration}) \\
1001−\mid & \VV{idecl} & (\mbox{instance declaration}) \\
1002−\end{array}
1003−\medskip\\
1004−\begin{array}{ll}
1005−\begin{array}{rll}
1006−\VV{pclause} ::= &
1007−\vx\;\ttt\;[\ibar\;\te]\mbox{\texttt{ = }}\ve \hg[\iwhere\;\td]\\
1008−\mid & \AR{
1009−\vx\;\ttt\;[\ibar\;\te]\;\iwith\;\ve\\
1010−\hg\vec{\VV{pclause}}
1011−}
1012−\end{array}
1013−&
1014−\begin{array}{rll}
1015−\VV{ddecl} ::= & \idata\;\ihab{\vx}{\VV{declty}}\;\iwhere\;\vec{\VV{con}}\\
1016−\VV{con} ::= & \ihab{\vx}{\VV{declty}}\\
1017−\medskip\\
1018−\VV{cdecl} ::= & \iclass\;[\VV{constr}]\;\vx\;(\ihab{\tx}{\ttt})\;\iwhere\;\td
1019−\\
1020−\VV{idecl} ::= & \iinstance\;[\VV{constr}]\;\vx\;\ttt\;\iwhere\;\td
1021−\end{array}
1022−\end{array}
1023−}
1024−}
1025−{\IdrisM{} declarations}
1026−{idrismd}
1027−
1028−We will use a subset of full \Idris{}, which we call \IdrisM{}, to explain
1029−elaboration of expressions. \IdrisM{} expression syntax is given in Figure
1030−\ref{idrism} and declaration syntax given in Figure \ref{idrismd}.
1031−\IdrisM{} is a subset of \Idris{} without syntactic sugar --- that is, without
1032−\texttt{do}-notation or infix operators --- and with implicit
1033−arguments in types bound explicitly
1034−(e.g. $\piimp{\va}{\_}\piimp{\vn}{\_}\TC{Vect}\;\vn\;\va$
1035−instead of simply $\Vect\;\vn\;\va$).
1036−Note that we separate implicit and type constraint bindings, to ensure that they
1037−only appear in top-level declarations.
1038−It is in general straightforward to
1039−convert full \Idris{} to \IdrisM{} --- syntactic sugar is implemented by a
1040−direct source transformation, and implicit arguments can be identified as the names
1041−which are free in a type in a non-function position.
1042−%
1043−\IdrisM{} differs from \TT{} in several important respects. It has implicit
1044−syntax and classes, and functions are applied to multiple arguments rather
1045−than one at a time.
1046−
1047−%Extensions over \TT{}: implicit syntax, case expressions. Functions are applied to
1048−%multiple arguments, rather than one at a time (this helps with implicit syntax).
1049−%\IdrisM{} also supports explicit \demph{metavariables}. A metavariable \texttt{?mvar}
1050−%creates a new global function \tFN{mvar}, with its type such that it would
1051−%be type correct to apply \tFN{mvar} to all of the variables in scope.
1052−
1053−%Implicit and type class arguments? Expanded at the application site (we need to know
1054−%it's the global name after all and we do that by type).
1055−
1056−To elaborate expressions, we define meta-operations $\ttinterp{\cdot}$ and
1057−$\ttpinterp{\cdot}$, which run relative to a proof state (see Section
1058−\ref{sect:prfstate}). $\ttpinterp{\cdot}$ elaborates \remph{patterns}, i.e.
1059−expressions on the left hand side of a pattern matching definition, whereas
1060−$\ttinterp{\cdot}$ elaborates expressions on the right hand side.
1061−Their effect is
1062−to update the proof state so that the hole in focus contains a representation
1063−of the given expression, by applying tactics. We assume that the proof state
1064−has already been set up, which means that elaboration can always be
1065−\remph{type-directed} since the proof state contains the type of the expression we
1066−are building.
1067−
1068−In all cases except the elaboration of variables and constants,
1069−$\ttpinterp{\vx}\;=\;\ttinterp{\vx}$.
1070−
1071−\subsubsection{Elaborating variables and constants}
1072−
1073−In the simplest cases, there is a direct translation from an \IdrisM{} expression to
1074−a \TT{} expression --- we build \TT{} representations of variables and constants using
1075−the \MO{Fill} tactic:
1076−
1077−\DM{
1078−\AR{
1079−\ttinterp{\vx}\;\mq\;\RW{do}\;\MO{Fill}\;\vx;\;\MO{Solve}\\
1080−\ttinterp{\vc}\;\mq\;\RW{do}\;\MO{Fill}\;\vc;\;\MO{Solve}\\
1081−}
1082−}
1083−
1084−Since $\MO{Fill}$ creates a guess binding, we use $\MO{Solve}$ to instantiate
1085−the guess. We need not concern ourselves with type checking variables or
1086−constants here --- $\MO{Fill}$ will handle this, type checking $\vx$ or $\vc$
1087−and unifying the result with the hole type. If there are any errors,
1088−elaboration will fail.
1089−
1090−If we are building the left hand side of a pattern clause, however, there is a
1091−problem, as it is the left hand side which \remph{defines} variables. In this
1092−context, we assume that attempting to elaborate a variable which does not type
1093−check means that the variable is a pattern variable:
1094−
1095−\DM{
1096−\ttpinterp{\vx}\;\mq\;
1097−\MO{Try}\;\AR{(\RW{do}\;\MO{Fill}\;\vx;\;\MO{Solve})\\
1098−(\MO{Pat}\;\vx)
1099−}
1100−}
1101−
1102−In Haskell, for comparison,
1103−pattern variables are all lower case, so type checking can assume that a
1104−lower case name in a pattern refers to a variable. In \Idris{} however, a
1105−name in a pattern may refer to a function, if forced by some dependency.
1106−
1107−We also need to elaborate \remph{placeholders}, which are subexpressions we expect to
1108−solve by unification. In this case, we simply move on to the next hole in the queue, moving
1109−the current hole to the end of the queue with $\MO{Unfocus}$:
1110−
1111−\DM{
1112−\ttinterp{\_}\;\mq\;\MO{Unfocus}
1113−}
1114−
1115−On encountering a placeholder, our assumption is that unification will
1116−eventually solve the hole. At the end of elaboration, any holes remaining
1117−unsolved on the left hand side become pattern variables. If there are any
1118−unsolved on the right hand side, elaboration is incomplete and an error will
1119−be reported when the resulting term is type checked.
1120−
1121−\subsubsection{Elaborating bindings}
1122−
1123−To elaborate a $\lambda$-binding, we $\MO{Attack}$ the hole, then apply the
1124−$\MO{Lambda}$ tactic, which will fail if the goal is not a function type. We
1125−then elaborate the scope and $\MO{Solve}$, which discharges the $\MO{Attack}$:
1126−
1127−\DM{
1128−\ttinterp{\ilam{\vx}\ve}\;\mq\;
1129−\RW{do}\;
1130−\AR{
1131−\MO{Attack};\;\MO{Lambda}\;\vx\\
1132−\ttinterp{\ve}\\
1133−\MO{Solve}
1134−}
1135−}
1136−
1137−Note that there is no type on the $\lambda$-binding in \IdrisM{}. There is no need --- since
1138−elaboration is type directed, the $\MO{Lambda}$ tactic finds the type of the binding by
1139−looking at the type of the hole. In full \Idris{}, types are allowed on bindings, and the
1140−elaborator merely checks that the given type is equivalent to the inferred type.
1141−
1142−Elaborating a function type is more tricky, since we have to elaborate the argument
1143−type (itself an \IdrisM{} expression) then elaborate the scope. To achieve this, we
1144−create a new goal $\vX$ for the argument type $\vt$, where $\vX$ is a fresh name,
1145−and introduce a function binding with argument type $\vX$. We can then focus on
1146−$\vX$, and elaborate it with the expression $\vt$. Finally, we elaborate the
1147−scope of the binding.
1148−
1149−\DM{
1150−\AR{
1151−\ttinterp{\piexp{\vx}{\vt}\ve}\;\mq\;
1152−\RW{do}\;
1153−\AR{
1154−\MO{Attack};\;\MO{Claim}\;(\vX\Hab\Type)\\
1155−\MO{Pi}\;(\vx\Hab\vX)\\
1156−\MO{Focus}\;\vX\\
1157−\ttinterp{\vt};\;
1158−\ttinterp{\ve}\\
1159−\MO{Solve}
1160−}
1161−}
1162−}
1163−
1164−Elaborating $\vt$ will involve solving unification problems, which will, if the
1165−program is type correct, solve $\vX$. After focussing on $\vX$ and elaborating
1166−$\vt$, there is no need to refocus on the hole representing the scope, as it was
1167−previously at the head of the hole queue before focussing on $\vX$.
1168−Elaboration of implicit and constraint
1169−argument types is exactly the same --- \TT{} makes no distinction between then.
1170−
1171−To elaborate a \texttt{let} binding, we take a similar approach, creating new subgoals
1172−for the \texttt{let}-bound value and its type, then elaborating the scope. Again,
1173−if elaborating the scope is successful, unification will solve the claimed variables
1174−$\vV$ and $\vX$.
1175−
1176−\DM{
1177−\ttinterp{\ilet{\vx}{\vv}\;{\ve}}\;\mq\;\RW{do}\;
1178−\AR{
1179−\MO{Attack};\;
1180−\MO{Claim}\;(\vX\Hab\Type);\;
1181−\MO{Claim}\;(\vV\Hab\vX)\\
1182−\MO{Let}\;(\vx\Hab\vX\defq\vV)\\
1183−\MO{Focus}\;\vV\\
1184−\ttinterp{\vv};\;
1185−\ttinterp{\ve}\\
1186−\MO{Solve}
1187−}
1188−}
1189−\subsubsection{Elaborating Applications}
1190−
1191−\label{sect:elabapps}
1192−
1193−There are two cases to consider when elaborating applications:
1194−
1195−\begin{itemize}
1196−\item Applying a global function name to arguments, some of which may be implicit.
1197−\item Applying an expression, which does not have implicit arguments, to an argument.
1198−\end{itemize}
1199−
1200−In the first case, the elaborator must expand the application to include implicit arguments.
1201−For example \texttt{vAdd xs ys} is expanded to
1202−\texttt{vAdd \{a=\_\} \{n=\_\} \{\{\_\}\} xs ys}, adding the implicit arguments
1203−\texttt{a} and \texttt{n} and a class instance argument. The meta-operation
1204−$\MO{Expand}\;\vx\;\ta$, given a global function name $\vx$ and the
1205−arguments supplied by the programmer $\ta$, returns a new argument list
1206−$\ta'$ with implicit and class arguments added. Each value in
1207−$\ta'$ is paired with an explicit name for the argument.
1208−
1209−Implicit arguments are solved by unification
1210−--- the type or value of another argument determines the value of an implicit argument,
1211−with the appeal to $\MO{Unify}$ in the $\MO{Fill}$ tactic solving as many extra holes
1212−as it can. However, unification problems can take several forms. For example, assuming
1213−$\vf$, $\vg$, $\vx$ are holes, we might have unification problems of the following
1214−forms:
1215−
1216−\DM{
1217−\AR{
1218−\MO{Unify}_\Gamma\;\vf\;\TC{Int}\\
1219−\MO{Unify}_\Gamma\;(\vf\;\vx)\;\TC{Int}\\
1220−\MO{Unify}_\Gamma\;(\vf\;\vx)\;(\vg\;\vx)\\
1221−}
1222−}
1223−
1224−The first problem has a solution: $\vf=\TC{Int}$. The second and third problems
1225−have no solution without further information. In the second case, we cannot
1226−conclude anything about $\vf$ or $\vx$ just from knowing that
1227−$\vf\;\vx\;=\;\TC{Int}$. In the third case, although we have $\vx\;=\;\vx$ in
1228−argument position, we cannot conclude that $\vf\;=\;\vg$ in general as a
1229−result.
1230−
1231−Once $\vf$ or $\vg$ is solved in some other way, perhaps by being given
1232−explicitly in another argument, these unification problems can make progress.
1233−Otherwise, unification blocks. In such a case, the elaborator stores the
1234−problem (i.e. the expressions to be unified with their local context) and
1235−refines it with further information when it becomes available.
1236−Elaborating a global function application makes a $\MO{Claim}$ for each
1237−argument in turn. Then the function is elaborated, applied to each of the
1238−claimed arguments. Each argument which has been given explicitly is
1239−elaborated.
1240−Finally, any class instance arguments are resolved with the
1241−built-in $\MO{Instance}$ tactic.
1242−
1243−\DM{
1244−\AR{
1245−\ttinterp{\vx\;\ta}\;\mq\;
1246−\RW{do}\;
1247−\AR{
1248−(\tn,\tv)\;\gets\;\MO{Expand}\;\vx\;\ta\\
1249−\vec{\MO{Claim}}\;(\tn\Hab\tT)\\
1250−\MO{Fill}\;\vx\;\tn\\
1251−\vec{\MO{ElabArg}}\;\tn\;\tv\hg\mbox{(for non-placeholder $\vv$)}\\
1252−\MO{Solve} \\
1253−\vec{\MO{Instance}}\;\tn\hg\mbox{(for class constraint argument $\vn$)}
1254−}
1255−\medskip
1256−\\
1257−\MO{ElabArg}\;\vn\;\vv\;\mq\;
1258−\MO{Focus}\;\vn;\;\ttinterp{\vv}
1259−}
1260−}
1261−
1262−The $\MO{Instance}$ tactic focuses on the given hole and searches the context for
1263−a class instance which would solve the goal directly. First, it examines the local
1264−context, then recursively searches the global context. $\MO{Instance}$ is covered
1265−in detail in Section \ref{sect:instance}.
1266−
1267−To elaborate a simple function application, of an arbitrary expression to an
1268−arbitrary argument (possibly with a dependent type), we need not worry about
1269−implicit arguments or class constraints. Instead, the function and argument are
1270−elaborated, and the results applied. Since elaboration is type directed,
1271−however, there must be an appropriate type for the function.
1272−
1273−\DM{
1274−\ttinterp{\ve\;\va}\;\mq\;\RW{do}\;
1275−\AR{
1276−\MO{Claim}\;(\vA\Hab\Type);\;\MO{Claim}\;(\vB\Hab\Type)\\
1277−\MO{Claim}\;(\vf\Hab\vA\to\vB);\;\MO{Claim}\;(\vs\Hab\vA)\\
1278−\MO{Focus}\;\vf;\;\ttinterp{\ve}\\
1279−\MO{Focus}\;\vs;\;\ttinterp{\va}\\
1280−}
1281−}
1282−
1283−%\subsubsection{Elaborating metavariables}
1284−
1285−%\subsubsection{Elaborating \texttt{case} expressions}
1286−
1287−\subsection{Elaborating Declarations}
1288−
1289−To elaborate declarations, we define a meta-operation $\MO{Elab}$, which runs
1290−relative to the system state (see Section \ref{sect:sysstate}) and has access to the
1291−current proof state. $\MO{Elab}$ uses $\ttinterp{\cdot}$ to help translate
1292−\IdrisM{} type, function and class declarations into \TT{} declarations.
1293−
1294−\newcommand{\edo}[1]{\RW{do}\;\AR{#1}}
1295−
1296−\subsubsection{Elaborating Type Declarations}
1297−
1298−Elaborating a type declaration involves creating a new proof state,
1299−translating the \IdrisM{} type to a \TT{} type, then adding the resulting type
1300−as a \TT{} declaration:
1301−
1302−\DM{
1303−\MO{Elab}\;(\vx\Hab\vt)\;\mq
1304−\;\edo{\MO{NewProof}\;\Type\\
1305− \ttinterp{\vt}\\
1306− \vt'\gets\MO{Term}\\
1307− \MO{TTDecl}\;(\vx\Hab\vt')
1308−}}
1309−
1310−The final $\MO{TTDecl}$ takes the result of elaboration, type checks it,
1311−and adds it to the global context if type checking succeeds. This final type check
1312−ensures that the elaboration process does not allow any ill-typed terms to creep
1313−into the context.
1314−
1315−\subsubsection{Elaborating Data Types}
1316−
1317−Elaborating a data declaration involves elaborating the type declaration itself,
1318−as a normal type declaration. This ensures that the type is in scope when
1319−elaborating the constructor types. Then using the results, the elaborator
1320−adds a \TT{} data declaration.
1321−
1322−\DM{
1323−\AR{
1324−\MO{Elab}\;(\idata\;\ihab{\vx}{\vt}\;\iwhere\;\tc)\\
1325−\hg\hg\mq\;\edo{\MO{NewProof}\;\Type\\
1326− \ttinterp{\vt}\\
1327− \vt'\gets\MO{Term}\\
1328− \MO{TTDecl}\;(\vx\Hab\vt')\\
1329− \tc'\gets\vec{\MO{ElabCon}}\;\tc\\
1330− \MO{TTDecl}\;(\Data\;\vx\Hab\vt'\;\Where\;\tc')
1331−}
1332−\AR{
1333−\MO{ElabCon}\;(\vx\Hab\vt)\\
1334−\hg\hg\mq\; \edo{\MO{NewProof}\;\Type\\
1335− \ttinterp{\vt}\\
1336− \vt'\gets\MO{Term}\\
1337− \RW{return}\;(\vx\Hab\vt')
1338−}
1339−}}}
1340−
1341−\subsubsection{Elaborating Pattern Matching}
1342−
1343−Elaborating a pattern matching definition works clause by clause, elaborating
1344−the left and right hand sides in turn. $\MO{ElabClause}$ returns the elaborated
1345−left and right hand sides, and may have the side effect of adding entries
1346−to the global context, such as definitions in $\iwhere$ clauses.
1347−First, let us consider the simplest case, with no $\iwhere$ clause:
1348−
1349−\DM{
1350−\MO{ElabClause}\;(\vx\;\ttt\;=\;\ve)\;\mq\;\ldots
1351−}
1352−
1353−How does the left hand side get elaborated, given that elaboration is type directed, and
1354−its type is not known until after elaboration?
1355−This can be achieved without any change to the elaborator by defining
1356−a type $\TC{Infer}$:
1357−
1358−\DM{
1359−\Data\hg\TC{Infer}\Hab\Type\hg\Where\hg\DC{MkInfer}\Hab\all{\va}{\Type}\SC\va\to\TC{Infer}
1360−}
1361−
1362−Now elaboration of the left hand side proceeds by elaborating $\DC{MkInfer}\;\_\;(\vx\;\ttt)$ and
1363−extracting the value and unified type when complete.
1364−
1365−\DM{
1366−\AR{
1367−\MO{ElabClause}\;(\vx\;\ttt\;=\;\ve)\;\mq\;\\
1368−\hg\hg\edo{
1369−\MO{NewProof}\;\TC{Infer};\;
1370−\ttpinterp{\DC{MkInfer}\;\_\;(\vx\;\ttt)}\\
1371−\DC{MkInfer}\;\vT\;\VV{lhs}\gets\MO{Term}\\
1372−\tp\gets\MO{Patterns}\\
1373−\MO{NewTerm}\;\vT;\;
1374−\ttinterp{\ve}\\
1375−\VV{rhs}\gets\MO{Term}\\
1376−\RW{return}\;(\RW{var}\;\tp\SC\VV{lhs}\;=\;\VV{rhs})
1377−}
1378−}
1379−}
1380−
1381−This infers a type for the left hand side, creating pattern variable bindings. Then,
1382−it elaborates the right hand side using the inferred type of the left hand side
1383−and the inferred pattern bindings, which are retrieved from the state with the
1384−$\MO{Patterns}$ operation. Finally, it returns a pattern clause in \TT{} form.
1385−Elaborating a collection of pattern clauses then proceeds by mapping $\MO{ElabClause}$ over
1386−the clauses and adding the resulting collection to \TT{}.
1387−
1388−\DM{
1389−\AR{
1390−\MO{Elab}\;\vec{\VV{pclause}}\;\mq\;
1391−\edo{
1392−\tc\gets\vec{\MO{ElabClause}}\;\vec{\VV{pclause}}\\
1393−\vec{\MO{TTDecl}}\;\tc
1394−}
1395−}
1396−}
1397−
1398−Elaborating a clause is made only slightly more complex by the presence of
1399−$\iwhere$ clauses. In this case, after elaborating the left hand side, the
1400−pattern-bound variables are added as extra arguments to the declarations in the
1401−$\iwhere$ block, which are then recursively elaborated before the right hand
1402−side.
1403−
1404−\DM{
1405−\AR{
1406−\MO{ElabClause}\;(\vx\;\ttt\;=\;\ve\;\iwhere\;\td)\;\mq\;\\
1407−\hg\hg\edo{
1408−\MO{NewProof}\;\TC{Infer};\;
1409−\ttpinterp{\DC{MkInfer}\;\_\;(\vx\;\ttt)}\\
1410−\DC{MkInfer}\;\vT\;\VV{lhs}\gets\MO{Term}\\
1411−\tp\gets\MO{Patterns}\\
1412−(\td', \ve') \gets\MO{Lift}\;\tp\;\td\;\ve\\
1413−\vec{\MO{Elab}}\;\td'\\
1414−\MO{NewTerm}\;\vT;\;
1415−\ttinterp{\ve'}\\
1416−\VV{rhs}\gets\MO{Term}\\
1417−\RW{return}\;(\RW{var}\;\tp\SC\VV{lhs}\;=\;\VV{rhs})
1418−}
1419−}
1420−}
1421−
1422−In \TT{}, all definitions must be at the top level. Therefore, the declarations
1423−in the $\iwhere$ block are lifted out, adding the pattern-bound names as additional arguments
1424−to ensure they are in scope, using the $\MO{Lift}$ operation. This also modifies
1425−the right hand side $\ve$ to use the lifted definitions, rather than the original.
1426−
1427−\subsubsection{Elaborating the \texttt{with} rule}
1428−
1429−The \texttt{with} rule allows \remph{dependent} pattern matching on intermediate values.
1430−Translating this into \TT{} involves constructing an auxiliary top-level
1431−definition for
1432−the intermediate pattern match. For example, recall \tFN{natToBin}:
1433−
1434−\useverb{natToBin}
1435−
1436−\noindent
1437−This is equivalent to the following, using top-level definitions only:
1438−
1439−\begin{SaveVerbatim}{natToBinw}
1440−
1441−natToBin : Nat -> List Bool
1442−natToBin Z = Nil
1443−natToBin k = natToBin' k (parity k)
1444−
1445−\end{SaveVerbatim}
1446−\begin{SaveVerbatim}{natToBinwp}
1447−
1448−natToBin' : (n : Nat) -> Parity n -> List Bool
1449−natToBin' (j + j) even = False :: natToBin j
1450−natToBin' (S (j + j)) odd = True :: natToBin j
1451−
1452−\end{SaveVerbatim}
1453−\useverb{natToBinw}
1454−
1455−\useverb{natToBinwp}
1456−
1457−\noindent
1458−Additionally, the elaborator abstracts over the term being analysed in the type
1459−of the generated auxiliary definition
1460−%\footnote{This is sometimes referred to
1461−%as ``magic \texttt{with}''.}
1462−and reorders the arguments as required.
1463−For example:
1464−
1465−\begin{SaveVerbatim}{magicwith}
1466−
1467−f : Nat -> Bool
1468−
1469−ftest : (n : Nat) -> so (f n) -> Nat
1470−ftest n x with (f n)
1471− | True = ...
1472− | False = ...
1473−
1474−\end{SaveVerbatim}
1475−\useverb{magicwith}
1476−
1477−\noindent
1478−Here, we may require the knowledge that \texttt{f n} is \texttt{True} or
1479−\texttt{False} in the appropriate case. The elaborator abstracts over
1480−\texttt{f n} in the auxiliary definition, specialising the type of
1481−\texttt{x} in each case:
1482−
1483−\begin{SaveVerbatim}{magicwithaux}
1484−
1485−ftest : (n : Nat) -> so (f n) -> Nat
1486−ftest n x = ftest' n (f n) x
1487−
1488−ftest' : (n : Nat) -> (p : Bool) -> so p -> Nat
1489−ftest' n True x = ...
1490−ftest' n False x = ...
1491−
1492−\end{SaveVerbatim}
1493−\useverb{magicwithaux}
1494−
1495−\noindent
1496−Elaboration of \texttt{with} builds the type declaration and auxiliary function
1497−automatically. The elaborator checks the left hand side, resulting in a set of
1498−patterns $\tp$, then infers a type $\vW$ for the expression $\vw$. The patterns
1499−$\tp$ are then split into those necessary to type $\vW$, and the rest ($\tp_w$
1500−and $\tp_n$ respectively) using
1501−$\MO{SplitContext}$. Then, it builds a new declaration, abstracting over
1502−the matched expression $\vw$ in the types of $\tp_n$.
1503−$\MO{Abstract}\;\ve\;\vw\;\vp$ simply replaces any occurrence of $\vw$ in
1504−$\vp$ with the name $\ve$.
1505−
1506−\DM{
1507−\AR{
1508−\MO{ElabClause}\;(\vx\;\ttt\;\iwith\;\vw\;\vec{\VV{pclause}})\;\mq\\
1509−\hg\hg\edo{
1510−\MO{NewProof}\;\TC{Infer};\;
1511−\ttpinterp{\DC{MkInfer}\;\_\;(\vx\;\ttt)}\\
1512−\DC{MkInfer}\;\vT\;\VV{lhs}\gets\MO{Term}\\
1513−\tp\gets\MO{Patterns}\\
1514−\MO{NewTerm}\;\TC{Infer};\;
1515−\ttinterp{\DC{MkInfer}\;\_\;\vw}\\
1516−\DC{MkInfer}\;\vW\;\vw'\gets\MO{Term}\\
1517−(\tp_w,\tp_n)\;\gets\;\MO{SplitContext}\;\vW\;\tp\\
1518−\MO{TTDecl}\;(\vx'\Hab\tp_{w}\to(\ve\Hab\vW)\to\vec{\MO{Abstract}}\;\ve\;\vw'\;\tp_{n}\to\vT)\\
1519−\tc'\gets\vec{\MO{MatchWith}}\;\tp\;\ttt\;\vec{\VV{pclause}}\\
1520−\vec{\MO{Elab}}\;\tc'\\
1521−\RW{return}\;(\RW{var}\;\tp\SC\VV{lhs}\;=\;\vx'\;\tp_{w}\;\vw'\;\tp_{n})
1522−}
1523−}
1524−}
1525−\DM{
1526−\AR{
1527−\MO{MatchWith}\;\tp_w\;\tp_n\;\ttt\;(\vx\;\tw\;\mid\;\ve\;\VV{rhs})\;\mq\\
1528−\hg\hg\edo{
1529−\tp'\gets\vec{\MO{Match}}\;\tw\;\ttt\\
1530−(\tp'_w,\tp'_n)\;\gets\;\MO{SplitPats}\;\tp_w\;\tp_n\;\tp'\\
1531−\RW{return}\;(\vx'\;\tp'_w\;\ve\;\tp'_{n}\;\VV{rhs})
1532−}
1533−}
1534−}
1535−
1536−A $\iwith$ block in a clause for $\vx$
1537−results in an auxiliary definition $\vx'$, where $\vx'$ is a fresh name,
1538−which takes an extra argument corresponding to the intermediate result which
1539−is to be matched.
1540−$\MO{MatchWith}$ matches the left hand side of the top-level definition against
1541−each $\VV{pclause}$, using the result of the match to build each pattern clause
1542−for $\vx'$.
1543−The clauses in the with block must be of a specific form: they must have an initial
1544−set of arguments $\tw$ which matches the outer clause arguments
1545−$\ttt$, and an extra argument
1546−$\ve$ which is the same type as the scrutinee of the \texttt{with}, $\vW$.
1547−The right hand side, $\VV{rhs}$, may either return a value directly, containing
1548−\texttt{where} clauses, or be a nested \texttt{with} block. In any case, it
1549−remains unchanged.
1550−$\MO{Match}\;\vw\;\vt$ returns a list of pattern bindings containing
1551−the variables in $\vt$ and their matches in $\vw$.
1552−The resulting matches are split, using $\MO{SplitPats}$, into matches for those
1553−variables necessary to type $\vW$ and the rest, as before.
1554−
1555−\subsubsection{Elaborating Class and Instance Declarations}
1556−
1557−Classes are implemented as dictionaries of functions for each instance,
1558−following the implementation of first class type classes in Coq~\cite{Sozeau2008}.
1559−Therefore, a class declaration elaborates to a record type containing all
1560−of the functions in the class, and an instance is simply an instance of the
1561−record. The methods are translated to top-level functions which extract the
1562−relevant function from the dictionary. For example, for the \texttt{Show}
1563−class, the \texttt{class} declaration is translated (in the elaborated code,
1564−using the surface \Idris{} syntax for readability)
1565−to:
1566−
1567−\begin{SaveVerbatim}{showdata}
1568−
1569−data Show : Type -> Type where
1570− InstanceShow : (show : a -> String) -> Show a
1571−
1572−show : Show a -> a -> String
1573−show (InstanceShow show') = show'
1574−
1575−\end{SaveVerbatim}
1576−\useverb{showdata}
1577−
1578−\noindent
1579−An instance for a type \texttt{a} is then a value of type \texttt{Show a}; for example for Nat:
1580−
1581−\begin{SaveVerbatim}{shownatf}
1582−
1583−showNat : Show Nat
1584−showNat = InstanceShow show' where
1585− show' : Nat -> String
1586− show' Z = "Z"
1587− show' (S k) = "s" ++ show k
1588−
1589−\end{SaveVerbatim}
1590−\useverb{shownatf}
1591−
1592−The call to \tFN{show} in the body of the instance uses the top-level \tFN{show}
1593−function, with the instance resolved by the elaborator.
1594−Where instances have constraints, these constraints are passed on to
1595−the function declaration for the instance. For example, for \texttt{Show (List a)}:
1596−
1597−\begin{SaveVerbatim}{showlista}
1598−
1599−showList : Show a => Show (List a)
1600−showList = InstanceShow show' where
1601− show' : List a -> String
1602− show' [] = "[]"
1603− show' (x :: xs) = show x ++ " :: " ++ show xs
1604−
1605−\end{SaveVerbatim}
1606−\useverb{showlista}
1607−
1608−\noindent
1609−Where classes have constraints, the
1610−constraints are again passed on to the data type declaration, and resolved by the
1611−elaborator. For example, for \texttt{Ord}:
1612−
1613−\begin{SaveVerbatim}{eqorda}
1614−
1615−class Eq a => Ord a where
1616− compare : a -> a -> Ordering
1617− max : a -> a -> a
1618− -- remaining methods elided
1619−
1620−\end{SaveVerbatim}
1621−\useverb{eqorda}
1622−
1623−\noindent
1624−This translates to:
1625−
1626−\begin{SaveVerbatim}{orddata}
1627−
1628−data Ord : Type -> Type where
1629− InstanceOrd : Eq a => (compare : a -> a -> Ordering) ->
1630− (max : a -> a -> a) -> Ord a
1631−
1632−\end{SaveVerbatim}
1633−
1634−\begin{SaveVerbatim}{orddatab}
1635−compare : Ord a -> a -> a -> Ordering
1636−compare (InstanceOrd compare' max') = compare'
1637−
1638−max : Ord a -> a -> a -> a
1639−max (InstanceOrd compare' max') = max'
1640−
1641−\end{SaveVerbatim}
1642−\useverb{orddata}
1643−
1644−\useverb{orddatab}
1645−
1646−\noindent
1647−The elaborator also adds functions to retrieve parent classes from a
1648−dictionary, to assist with class resolution. In this case:
1649−
1650−\begin{SaveVerbatim}{ordparent}
1651−
1652−OrdEq : Ord a -> Eq a
1653−OrdEq (InstanceOrd {{eq}} compare' max') = eq
1654−
1655−\end{SaveVerbatim}
1656−\useverb{ordparent}
1657−
1658−\noindent
1659−In general, \texttt{class} declarations are elaborated as follows:
1660−
1661−\DM{
1662−\AR{
1663−\MO{Elab}\;(\iclass\;\piconst{\tc}\TC{C}\;(\ta\Hab\ttt)\;\iwhere\;\td)
1664−\\
1665−\hg\hg
1666−\mq\;\RW{do}\;\AR{
1667−%(\vec{\VV{meth}}\Hab\ttt)\gets\td\\
1668−\MO{Elab}\;
1669−\AR{(\RW{data}\;\TC{C}\Hab(\ta\Hab\ttt)\to\Type\;\iwhere\\
1670−\hg\DC{InstanceC}\Hab\piconst{\tc}\td\to\TC{C}\;\ta)}\\
1671−\vec{\MO{ElabMeth}}\;\td\\ % (\vec{\VV{meth}}\Hab\ttt)\\
1672−\vec{\MO{ElabParent}}\;\tc
1673−}
1674−\medskip\\
1675−\MO{ElabMeth}\;(\vf\Hab\vt)\\
1676−\hg\hg\mq\;\RW{do}\;\AR{
1677−\MO{Elab}\;(\vf\Hab\TC{C}\;\ta\to\vt)\\
1678−\MO{Elab}\;(\vf\;(\DC{InstanceC}\;\vec{\VV{meth}})\;=\;\vec{\VV{meth}[\vf]})
1679−}
1680−\medskip\\
1681−\MO{ElabParent}\;\vc\\
1682−\hg\hg\mq\;\RW{do}\;\AR{
1683−\MO{Elab}\;(\VV{cC}\Hab\TC{C}\;\ta\to\vc)\\
1684−\MO{Elab}\;(\VV{cC}\;(\DC{InstanceC}\;\carg{\vc'}\;\vec{\VV{meth}})\;=\;\vc')
1685−}
1686−}
1687−}
1688−
1689−\noindent
1690−Then \texttt{instance} declarations are elaborated as follows. One complication
1691−is that the function definitions in an \texttt{instance} declaration do not
1692−have explicit types, so we must retrieve the method types from the system state
1693−and substitute $\TC{C}\;\ttt$, using $\MO{ExpandTypes}$.
1694−The name $\FN{instanceC}$ is a fresh name generated for the newly
1695−defined instance:
1696−
1697−\DM{
1698−\AR{
1699−\MO{Elab}\;(\iinstance\;\piconst{\tc}\TC{C}\;\ttt\;\iwhere\;\td)\\
1700−\hg\hg\mq\;\RW{do}\;\AR{
1701−(\vec{\VV{meth}}, \vec{\VV{ty}})\gets\MO{ExpandTypes}\;\td\\
1702−\vec{\VV{ty'}}\;=\;\vec{\VV{ty}}[\ttt/\ta]\\
1703−\MO{Elab}\;(\FN{instanceC}\Hab\piconst{\tc}\TC{C}\;\ttt)\\
1704−\MO{Elab}\;\AR{
1705−(\FN{instanceC}\;=\;\DC{InstanceC}\;\vec{\VV{meth'}}\;\iwhere
1706−\\
1707−\hg\vec{\VV{meth'}}\Hab\vec{\VV{ty'}}\\
1708−\hg\td
1709−)}
1710−}
1711−}
1712−}
1713−
1714−Adding default definitions is straightforward: simply insert the default definition where
1715−there is a method missing in an \texttt{instance} declaration.
1716−
1717−Here, we have added a higher level language construct
1718−(classes) simply by elaborating in terms of lower level language constructs
1719−(data types and functions). We achieve type class resolution by implementing a
1720−tactic, $\MO{Instance}$. We can build several extensions this way because we
1721−have effectively built, bottom up, an Embedded Domain Specific Language for
1722−constructing programs in \TT{}.
1723−
1724−\subsubsection{The $\MO{Instance}$ tactic}
1725−
1726−\label{sect:instance}
1727−
1728−When elaborating applications, recall that implicit arguments are filled in by
1729−unification as described in Section \ref{sect:elabapps}, and class
1730−constraints by an $\MO{Instance}$ tactic which searches the context for an
1731−instance of the required class.
1732−
1733−The $\MO{Instance}$ tactic begins by trying to find a solution in the local context,
1734−using the $\MO{Trivial}$ tactic, which attempts
1735−to solve the current goal with each local variable in turn. It is used as a very
1736−basic primitive for proof search, and is defined as follows:
1737−
1738−\DM{
1739−\AR{
1740−\MO{Trivial}\;\mq\;
1741−\RW{do}\;\AR{
1742− (\tv\Hab\ttt)\gets\MO{Context}\\
1743− \MO{TryAll}\;\tv
1744− }
1745−\medskip\\
1746−\MO{TryAll}\;(\vv_1,\vv_2\ldots)\;\mq\;\MO{Try}\;(\MO{Fill}\;\vv_1)\;(\MO{TryAll}\;\vv_2\ldots)
1747−\\
1748−\MO{TryAll}\;\langle\rangle\;\mq\;\MO{Fail}
1749−}
1750−}
1751−
1752−For example, in the following function, the class constraint required for
1753−the $\texttt{>}$ operator is resolved by finding an instance for \texttt{Ord a}
1754−in the local context:
1755−
1756−\begin{SaveVerbatim}{ordlocal}
1757−
1758−max : Ord a => a -> a -> a
1759−max x y = if (x > y) then x else y
1760−
1761−\end{SaveVerbatim}
1762−\useverb{ordlocal}
1763−
1764−If $\MO{Trivial}$ does not find a solution, $\MO{Instance}$ begins a global search,
1765−applying every class instance, and attempting to resolve the instance's parameters
1766−recursively. Given an instance function $\FN{instanceC}$ with parameters
1767−of type $\ttt$:
1768−
1769−\DM{
1770−\MO{TryInstance}\;\FN{instanceC}\;\mq\;\RW{do}\;
1771−\AR{
1772−\vec{\MO{Claim}}\;(\tx\Hab\ttt)\\
1773−\ttinterp{\FN{instanceC};\tx}\\
1774−\vec{\MO{Focus}}\;\tx;\;\vec{\MO{Instance}}
1775−}
1776−}
1777−
1778−We define $\MO{Instance}$ as follows, using $\MO{AllInstances}$ to retrieve
1779−all functions which define instances:
1780−
1781−\DM{
1782−\MO{Instance}\;\mq\;
1783−\MO{Try}\;
1784−\AR{
1785−\MO{Trivial}\\
1786−(\RW{do}\;\AR{
1787−\ti\gets\MO{AllInstances}\\
1788−\vec{\MO{TryInstance}}\;\ti
1789−)
1790−}
1791−}
1792−}
1793−
1794−In practice, for efficiency and to ensure that resolution terminates,
1795−we constrain the search by recording which instances are defined for each
1796−class, and by ensuring that a recursive call of $\MO{Instance}$ is either
1797−searching for a different class, or a structurally smaller instance of the
1798−current class.
1799−
1800−For example, in the following function, the constraints required by the
1801−\tFN{show} function are resolved by a global search which locates a \tTC{Show}
1802−instance for \tTC{List a}, which in turn requires a \tTC{Show} instance for
1803−\texttt{a}. In this case \texttt{a} is instantiated by \tTC{Int}, so resolution finishes
1804−by locating a \tTC{Show} instance for \tTC{Int}:
1805−
1806−\begin{SaveVerbatim}{showinst}
1807−
1808−main : IO ()
1809−main = putStrLn (show [1,2,3,4])
1810−
1811−\end{SaveVerbatim}
1812−\useverb{showinst}
1813−
1814−\subsection{Syntax Extensions}
1815−
1816−We now have a complete elaborator for \IdrisM{}, covering
1817−dependent pattern matching definitions and expansion of implicit arguments
1818−and classes. In order to make the language truly general purpose, however, we
1819−will need to add higher level extensions. Full \Idris{} is \IdrisM{} extended
1820−with \texttt{do}-notation, idiom brackets~\cite{McBride2007}, \texttt{case} expressions,
1821−pattern matching \texttt{let}, metavariables and tactic-based theorem proving.
1822−The majority of these extensions are straightforward transformations of high-level
1823−\Idris{} programs --- for example, \texttt{do}-notation can be reduced directly to
1824−\IdrisM{} function applications. Some, however, require further support. In this section,
1825−we complete the presentation of \IdrisM{} by extending it with metavariables
1826−and $\icase$ expressions:
1827−
1828−\DM{
1829−\AR{
1830−\begin{array}{rll@{\hg}rll}
1831−\ve ::= & \ldots \\
1832−\mid & \mvar{\vx} & (\mbox{metavariable}) &
1833−\mid & \icase\;\ve\;\iof\;\vec{\VV{alt}} & (\mbox{case expression}) \\
1834−\medskip\\
1835−\VV{alt} ::= & \ve\;\fatarrow\;\ve & (\mbox{case alternative})\\
1836−\end{array}
1837−}
1838−}
1839−
1840−\subsubsection{Metavariables}
1841−
1842−\demph{Metavariables} are terms which stand for incomplete programs. A
1843−metavariable serves a similar
1844−purpose to a hole binding in \TT{}, but gives rise to a global rather than a
1845−local variable. For example, the following is an incomplete definition of
1846−the vector append function, containing a metavariable \texttt{append\_rec}:
1847−
1848−\begin{SaveVerbatim}{vappmv}
1849−
1850−(++) : Vect n a -> Vect m a -> Vect (n + m) a
1851−Nil ++ ys = ys
1852−(x :: xs) ++ ys = x :: ?append_rec
1853−
1854−\end{SaveVerbatim}
1855−\useverb{vappmv}
1856−
1857−This generates a new (as yet undefined)
1858−function \texttt{append\_rec}, which takes all of the variables
1859−in scope at the point it is used, and returns a value of the required type.
1860−We can inspect the type of \texttt{append\_rec} at the \Idris{} prompt:
1861−
1862−\begin{SaveVerbatim}{appendrec}
1863−
1864−*vec> :t append_rec
1865−append_rec : (a : Type) -> (m : Nat) -> (n : Nat) -> a ->
1866− Vect n a -> Vect m a -> Vect (n + m) a
1867−
1868−\end{SaveVerbatim}
1869−\useverb{appendrec}
1870−
1871−Metavariables serve two purposes: Firstly, they aid type directed program development
1872−by allowing a programmer direct access to the inferred types of local variables, and
1873−the types of subexpressions. Secondly, they allow a separation of program structure
1874−from proof details. Metavariables can be solved either by directly editing program
1875−source, or by providing a definition elsewhere in the file. For example, we can later say:
1876−
1877−\begin{SaveVerbatim}{appendrec_def}
1878−
1879−append_rec a m n x xs ys = app xs ys
1880−
1881−\end{SaveVerbatim}
1882−\useverb{appendrec_def}
1883−
1884−Elaborating a metavariable involves adding a new top-level definition which is applied
1885−to all of the variables in local scope.
1886−
1887−\DM{
1888−\ttinterp{\mvar{\vx}}\;\mq\;
1889−\edo{
1890−(\tv\Hab\ttt)\gets\MO{Context}\\
1891−\vT\gets\MO{Type}\\
1892−\MO{TTDecl}\;(\vx\Hab(\tv\Hab\ttt)\to\vT)\\
1893−\ttinterp{\vx\;\tv}
1894−}
1895−}
1896−
1897−\subsubsection{\texttt{case} expressions}
1898−
1899−A \texttt{case} expression allows pattern matching on intermediate values. The difficulty
1900−in elaborating \texttt{case} expressions is that \TT{} allows matching only on
1901−\emph{top-level} values. Elaborating a \texttt{case} expression, therefore,
1902−involves creating a new top-level function standing for the expression, and applying it.
1903−The natural
1904−way to implement this is to use a metavariable. For example, we have already seen
1905−\texttt{lookup\_default}:
1906−
1907−\useverb{listlookup}
1908−
1909−\noindent
1910−This elaborates as follows:
1911−
1912−\begin{SaveVerbatim}{listlookupmv}
1913−
1914−lookup_default : Nat -> List a -> a -> a
1915−lookup_default i xs def =
1916− let scrutinee = list_lookup i xs in ?lookup_default_case
1917−
1918−lookup_default_case i xs def Nothing = def
1919−lookup_default_case i xs def (Just x) = x
1920−
1921−\end{SaveVerbatim}
1922−\useverb{listlookupmv}
1923−
1924−To elaborate a $\icase$ expression involves \texttt{let} binding the scrutinee
1925−of the $\icase$ expression, introducing a new name $\VV{scrutinee}$, and
1926−creating a metavariable $\VV{xcase}$ to implement the pattern matching. Then
1927−the elaborator builds a new pattern matching definition for $\VV{xcase}$ and
1928−elaborates it:
1929−
1930−\DM{
1931−\AR{
1932−\ttinterp{\icase\;\ve\;\iof\;\vec{\VV{alt}}}\;\mq\;
1933−\edo{
1934−\ttinterp{\ilet{\VV{scrutinee}}{\ve}\;\mvar{\VV{xcase}}}\\
1935−(\tv\Hab\ttt)\gets\MO{Context}\\
1936−\vec{\MO{MkCase}}\;\tv\;\VV{alt}\\
1937−}
1938−\medskip\\
1939−\MO{MkCase}\;\tv\;(\vl\;\fatarrow\;\vr)\;\mq\;\MO{Elab}\;(\VV{xcase}\;\tv\;\vl\;=\;\vr)
1940−}
1941−}
1942−
1943−Any nested $\icase$ expressions will be handled by the recursive call to
1944−$\MO{Elab}$. Again, because of the way we have set up an Embedded Domain Specific
1945−Language for describing elaboration, we have been able to implement a new higher
1946−level language feature in terms of elaboration of lower level language features.
1947−
1948−
1949−%\subsubsection{Tactic-implicit arguments}
1950−
1951−
1952−%\subsubsection{Pairs and Dependent Pairs}
1953−
1954−% Other extensions: do notation, idiom brackets, pairs, etc, are easily expressed
1955−% by transformations of the high level syntax
1956−
papers/impl-paper/hll.texdeleted−441
@@ -1,441 +0,0 @@
1−\section{\Idris{} --- the High Level Language}
2−
3−\label{sect:hll}
4−
5−\Idris{} is
6−a pure functional programming language with dependent types. It is
7−eagerly evaluated by default, and compiled via the Epic supercombinator
8−library~\cite{brady2011epic}, with irrelevant values and proof terms
9−automatically erased~\cite{Brady2003,Brady2005}.
10−In this section, I present some small examples to illustrate
11−the features of \Idris{}.
12−A full tutorial is available elsewhere \cite{idristutorial}.
13−
14−\subsection{Preliminaries}
15−
16−\Idris{} defines several primitive types: fixed width integers
17−\tTC{Int}, arbitrary width integers \tTC{Integer},
18−\tTC{Float} for numeric operations, \tTC{Char} and \tTC{String} for
19−text manipulation, and \tTC{Ptr} which represents foreign pointers.
20−There are also several data types declared in the library, including
21−\tTC{Bool}, with values \tDC{True} and \tDC{False}. All of the usual
22−arithmetic and comparison operators are defined for the primitive types.
23−
24−An \Idris{} program consists of a module declaration, followed by an optional
25−list of imports and a collection of definitions and declarations, for example:
26−
27−\begin{SaveVerbatim}{constprims}
28−
29−module Main
30−
31−x : Int
32−x = 42
33−
34−main : IO ()
35−main = putStrLn ("The answer is " ++ show x)
36−
37−\end{SaveVerbatim}
38−\useverb{constprims}
39−
40−\noindent
41−Like Haskell, the main function is called \texttt{main}, and input and output
42−is managed with an \texttt{IO} monad. Unlike Haskell, however, \remph{all}
43−top-level functions must have a type signature. This is due to type inference
44−being, in general, undecidable for languages with dependent types.
45−
46−A module declaration also opens a \remph{namespace}. The fully qualified names
47−declared in this module are \texttt{Main.x} and \texttt{Main.main}.
48−
49−\subsection{Data Types}
50−
51−Data types may be declared in a similar way to Haskell data types, with a
52−similar syntax. For example, Peano natural numbers and lists
53−are respectively declared in the library as follows:
54−
55−\begin{SaveVerbatim}{natdecl}
56−
57−data Nat = Z | S Nat
58−data List a = Nil | (::) a (List a)
59−
60−\end{SaveVerbatim}
61−\useverb{natdecl}
62−
63−\noindent
64−A standard example of a \remph{dependent} type is the type of ``lists with
65−length'', conventionally called ``vectors'' in the dependently-typed
66−programming literature. In \Idris{}, vectors are declared as follows:
67−
68−\begin{SaveVerbatim}{vectdecl}
69−
70−data Vect : Nat -> Type -> Type where
71− Nil : Vect Z a
72− (::) : a -> Vect k a -> Vect (S k) a
73−
74−\end{SaveVerbatim}
75−\useverb{vectdecl}
76−
77−\noindent
78−The above declaration creates a family of types. The syntax resembles a Haskell
79−GADT declaration: it explicitly states the type
80−of the type constructor \tTC{Vect} --- it takes a \tTC{Nat} and a type as
81−arguments, where \tTC{Type} stands for the type of types. We say that \tTC{Vect}
82−is \emph{indexed} over \tTC{Nat} and \emph{parameterised} by a type.
83−The distinction between parameters and indices is that a parameter is fixed
84−across an entire data structure, whereas an index may vary.
85−Note that constructor names may be overloaded (such as \texttt{Nil} and
86−\texttt{(::)} here) provided that they are declared in separate
87−namespaces.
88−
89−Note that in the library, \texttt{List} is declared in a module
90−\texttt{Prelude.List}, and \texttt{Vect} in a module \texttt{Prelude.Vect}, so
91−the fully qualified names of \texttt{Nil} are \texttt{Prelude.List.Nil} and
92−\texttt{Prelude.Vect.Nil}. They may be used qualified or unqualified; if
93−used unqualified the elaborator will disambiguate by type.
94−
95−\subsection{Functions}
96−
97−Functions are implemented by pattern matching. For example, the following
98−function defines concatenation of vectors, expressing in the type that
99−the resulting vector's length is the sum of the input lengths:
100−
101−\begin{SaveVerbatim}{vapp}
102−
103−(++) : Vect n a -> Vect m a -> Vect (n + m) a
104−Nil ++ ys = ys
105−(x :: xs) ++ ys = x :: xs ++ ys
106−
107−\end{SaveVerbatim}
108−\useverb{vapp}
109−
110−\noindent
111−Functions can also be defined \emph{locally} using \texttt{where} clauses. For
112−example, to define a function which reverses a list, we can use an auxiliary
113−function which accumulates the new, reversed list, and which does not need to
114−be visible globally:
115−
116−\begin{SaveVerbatim}{revwhere}
117−
118−reverse : List a -> List a
119−reverse xs = revAcc Nil xs where
120− revAcc : List a -> List a -> List a
121− revAcc acc Nil = acc
122− revAcc acc (x :: xs) = revAcc (x :: acc) xs
123−
124−\end{SaveVerbatim}
125−\useverb{revwhere}
126−
127−\subsubsection*{Totality checking}
128−
129−Internally, \Idris{} programs are checked for \emph{totality} --- that they
130−produce an answer in finite time for all possible inputs --- but they are not
131−\emph{required} to be total by default. Totality checking serves two
132−purposes: firstly, if a program terminates for all inputs
133−then its type gives a strong guarantee about the properties specified by its
134−type; secondly, we can optimise total programs more
135−aggressively~\cite{Brady2003}.
136−
137−Totality checking can be enforced by using the \texttt{total} keyword.
138−For example, the following definition is accepted:
139−
140−\begin{SaveVerbatim}{vaddt}
141−
142−total vAdd : Num a => Vect n a -> Vect n a -> Vect n a
143−vAdd Nil Nil = Nil
144−vAdd (x :: xs) (y :: ys) = x + y :: vAdd xs ys
145−
146−\end{SaveVerbatim}
147−\useverb{vaddt}
148−
149−\noindent
150−The elaborator can verify that this is total by checking that it covers all
151−possible patterns --- in this case, both arguments must be of the same form
152−as the type requires that the input vectors are the same length --- and that
153−recursive calls are on structurally smaller values.
154−
155−\Idris{} also supports coinductive definitions, though this and further
156−details of totality checking are beyond the scope of this paper; the totality
157−checker is implemented independently of elaboration and type checking.
158−
159−\subsection{Implicit Arguments}
160−
161−In order to understand how \Idris{} elaborates to an underlying type theory,
162−it is important to understand the notion of \remph{implicit} arguments.
163−To illustrate this, consider the finite sets:
164−
165−\begin{SaveVerbatim}{findecl}
166−
167−data Fin : Nat -> Type where
168− fZ : Fin (S k)
169− fS : Fin k -> Fin (S k)
170−
171−\end{SaveVerbatim}
172−\useverb{findecl}
173−
174−\noindent
175−As the name suggests, these are sets with a finite number of elements.
176−The declaration gives
177−\tDC{fZ} as the zeroth element of a finite set with \texttt{S k} elements,
178−and \texttt{fS n} as the
179−\texttt{n+1}th element of a finite set with \texttt{S k} elements.
180−
181−\tTC{Fin} is indexed by \tTC{Nat}, which represents the number of elements in
182−the set. Neither constructor targets \texttt{Fin Z}, because the empty
183−set has no elements. The following function uses an element
184−of a finite set as a bounds-safe index into a vector:
185−
186−\begin{SaveVerbatim}{vindex}
187−
188−index : Fin n -> Vect n a -> a
189−index fZ (x :: xs) = x
190−index (fS k) (x :: xs) = index k xs
191−
192−\end{SaveVerbatim}
193−\useverb{vindex}
194−
195−\noindent
196−Let us take a closer look at its type.
197−It takes two arguments, an element of the finite set of \texttt{n} elements, and a vector
198−with \texttt{n} elements of type \texttt{a}. But there are also two names,
199−\texttt{n} and \texttt{a}, which are not declared explicitly. These are \emph{implicit}
200−arguments to \texttt{index}. The type of \texttt{index} could also be written as:
201−
202−\begin{SaveVerbatim}{vindeximppl}
203−
204−index : {a:_} -> {n:_} -> Fin n -> Vect n a -> a
205−
206−\end{SaveVerbatim}
207−\useverb{vindeximppl}
208−
209−\noindent
210−This gives bindings for \texttt{a} and \texttt{n} with placeholders for
211−their types, to be inferred by the machine. These types could also be given explicitly:
212−
213−\begin{SaveVerbatim}{vindeximpty}
214−
215−index : {a:Type} -> {n:Nat} -> Fin n -> Vect n a -> a
216−
217−\end{SaveVerbatim}
218−\useverb{vindeximpty}
219−
220−\noindent
221−Implicit arguments, given in braces \texttt{\{\}} in the type signature, are
222−not given in applications of \texttt{index}; their values can be inferred from
223−the types of the \texttt{Fin n} and \texttt{Vect n a} arguments. Any name which
224−appears in a non-function position in a type signature, but which is otherwise
225−free, will be automatically bound as an implicit argument. Implicit arguments
226−can still be given explicitly in applications, using the syntax
227−\texttt{\{a=value\}} and \texttt{\{n=value\}}, for example:
228−
229−\begin{SaveVerbatim}{vindexexp}
230−
231−index {a=Int} {n=2} fZ (2 :: 3 :: Nil)
232−
233−\end{SaveVerbatim}
234−\useverb{vindexexp}
235−
236−\subsection{Classes}
237−
238−\Idris{} supports overloading in two ways. Firstly, as we have already seen
239−with the constructors of \texttt{List} and \texttt{Vect}, names can be
240−overloaded in an ad-hoc manner and resolved according to the context in which
241−they are used. This is mostly for convenience, to eliminate the need to
242−decorate constructor names in similarly structured data types, and eliminate
243−explicit qualification of ambiguous names where only one is well-typed --- this
244−is especially useful for disambiguating record field names, although records
245−are beyond the scope of this paper.
246−
247−Secondly, \Idris{} implements \remph{classes}, following Haskell's type
248−classes. This allows a more principled approach to overloading --- a class
249−gives a collection of overloaded operations which describe the interface for
250−\remph{instances} of that class. \Idris{} classes follow Haskell~98 type
251−classes, except that multiple parameters are supported, and that classes can be
252−parameterised by \remph{any} value, not just types.
253−Hence we refer to
254−them as \remph{classes} generally, rather than \remph{type classes}
255−specifically.
256−
257−A simple example is the \texttt{Show} class, which is defined in the
258−library and provides an interface for converting values to \texttt{String}s:
259−
260−\begin{SaveVerbatim}{showclass}
261−
262−class Show a where
263− show : a -> String
264−
265−\end{SaveVerbatim}
266−\useverb{showclass}
267−
268−\noindent
269−An instance of a class is defined with an \texttt{instance} declaration, which
270−provides implementations of the function for a specific type. For example:
271−
272−\begin{SaveVerbatim}{shownat}
273−
274−instance Show Nat where
275− show Z = "Z"
276− show (S k) = "s" ++ show k
277−
278−\end{SaveVerbatim}
279−\useverb{shownat}
280−
281−\noindent
282−Instance declarations can themselves have constraints. For example, to define a
283−\texttt{Show} instance for vectors, we need to know that there is a
284−\texttt{Show} instance for the element type, because we are going to use it to
285−convert each element to a \texttt{String}:
286−
287−\begin{SaveVerbatim}{showvec}
288−
289−instance Show a => Show (Vect n a) where
290− show xs = "[" ++ show' xs ++ "]" where
291− show' : Vect n a -> String
292− show' Nil = ""
293− show' (x :: Nil) = show x
294− show' (x :: xs) = show x ++ ", " ++ show' xs
295−
296−\end{SaveVerbatim}
297−\useverb{showvec}
298−
299−\noindent
300−Classes can also be extended. A logical next step from an equality relation
301−\texttt{Eq} for example is to define an ordering relation \texttt{Ord}. We can
302−define an \texttt{Ord} class which inherits methods from \texttt{Eq} as well as
303−defining some of its own:
304−
305−\begin{SaveVerbatim}{ord}
306−
307−data Ordering = LT | EQ | GT
308−
309−\end{SaveVerbatim}
310−\useverb{ord}
311−
312−\begin{SaveVerbatim}{eqord}
313−
314−class Eq a => Ord a where
315− compare : a -> a -> Ordering
316− (<) : a -> a -> Bool
317− -- etc
318−
319−\end{SaveVerbatim}
320−\useverb{eqord}
321−
322−\subsection{Matching on intermediate values}
323−
324−%\subsubsection{\texttt{let} bindings}
325−%
326−%Intermediate values can be calculated using \texttt{let} bindings:
327−%
328−%\begin{SaveVerbatim}{letb}
329−%
330−%mirror : List a -> List a
331−%mirror xs = let xs' = rev xs in
332−% app xs xs'
333−%
334−%\end{SaveVerbatim}
335−%\useverb{letb}
336−%
337−%\noindent
338−%Pattern matching is also supported in \texttt{let} bindings. For example, extracting
339−%fields from a record can be achieved as follows, as well as by pattern matching at the top level:
340−%
341−%\begin{SaveVerbatim}{letp}
342−%
343−%data Person = MkPerson String Int
344−%
345−%showPerson : Person -> String
346−%showPerson p = let MkPerson name age = p in
347−% name ++ " is " ++ show age ++ " years old"
348−%
349−%\end{SaveVerbatim}
350−%\useverb{letp}
351−
352−\subsubsection{\texttt{case} expressions}
353−
354−Intermediate values of \emph{non-dependent} types can be inspected using a
355−\texttt{case} expression. For example, \texttt{list\_lookup} looks up an index
356−in a list, returning \texttt{Nothing} if the index is out of bounds. This can
357−be used to write \texttt{lookup\_default}, which looks up an index and
358−returns a default value if the index is out of bounds:
359−
360−\begin{SaveVerbatim}{listlookup}
361−
362−lookup_default : Nat -> List a -> a -> a
363−lookup_default i xs def = case list_lookup i xs of
364− Nothing => def
365− Just x => x
366−
367−\end{SaveVerbatim}
368−\useverb{listlookup}
369−
370−The \texttt{case} construct is intended for simple analysis of intermediate
371−expressions to avoid the need to write auxiliary functions. It will
372−only work if each branch \emph{matches} a value of the same type, and
373−\emph{returns} a value of the same type.
374−
375−\subsubsection{The \texttt{with} rule}
376−
377−Often, matching is required on the result of an intermediate computation
378−with a dependent type.
379−\Idris{} provides a construct for this, the \texttt{with} rule,
380−inspired by views in \Epigram~\cite{McBride2004a},
381−which takes account of the
382−fact that matching on a value in a dependently-typed language can affect what
383−is known about the forms of other values.
384−%
385−For example, a \texttt{Nat} is either even or odd.
386−If it is even it will
387−be the sum of two equal \texttt{Nat}s. Otherwise, it is the sum of two equal \texttt{Nat}s
388−plus one:
389−
390−\begin{SaveVerbatim}{parity}
391−
392−data Parity : Nat -> Type where
393− even : Parity (n + n)
394− odd : Parity (S (n + n))
395−
396−\end{SaveVerbatim}
397−\useverb{parity}
398−
399−\noindent
400−We say \texttt{Parity} is a \emph{view} of \texttt{Nat}.
401−It has a \emph{covering function} which tests whether
402−it is even or odd and constructs the predicate accordingly:
403−
404−\begin{SaveVerbatim}{parityty}
405−
406−parity : (n:Nat) -> Parity n
407−
408−\end{SaveVerbatim}
409−\useverb{parityty}
410−
411−\noindent
412−Using this, a function which converts a natural number to a list
413−of binary digits (least significant first) is written as follows, using the \texttt{with}
414−rule:
415−
416−\begin{SaveVerbatim}{natToBin}
417−
418−natToBin : Nat -> List Bool
419−natToBin Z = Nil
420−natToBin k with (parity k)
421− natToBin (j + j) | even = False :: natToBin j
422− natToBin (S (j + j)) | odd = True :: natToBin j
423−
424−\end{SaveVerbatim}
425−\useverb{natToBin}
426−
427−\noindent
428−The value of the result of \texttt{parity k} affects the form of \texttt{k},
429−because the result
430−of \texttt{parity k} depends on \texttt{k}.
431−So, as well as the patterns for the result of the
432−intermediate computation (\texttt{even} and \texttt{odd}) right of the
433−\texttt{$\mid$}, the definition also expresses how
434−the results affect the other patterns left of the $\mid$. Note that there is a
435−function in the patterns (\texttt{+}) and repeated occurrences of \texttt{j} ---
436−this is allowed
437−because another argument has determined the form of these patterns. In general,
438−non-linear patterns are allowed \emph{only} when their value is forced by
439−some other argument.
440−
441−
papers/impl-paper/impldtp.texdeleted−159
@@ -1,159 +0,0 @@
1−\RequirePackage{amsmath}
2−\documentclass{jfp1}
3−%\documentclass[acmtoplas]{acmtrans2m}
4−
5−\usepackage[draft]{comments}
6−%\usepackage[final]{comments}
7−% \newcommand{\comment}[2]{[#1: #2]}
8−\newcommand{\khcomment}[1]{\comment{KH}{#1}}
9−\newcommand{\ebcomment}[1]{\comment{EB}{#1}}
10−
11−\usepackage{epsfig}
12−%\usepackage{path}
13−\usepackage{url}
14−\usepackage{fancyvrb}
15−
16−\newenvironment{template}{\sffamily}
17−
18−%\usepackage{graphics,epsfig}
19−\usepackage{stmaryrd}
20−\usepackage{amsmath}
21−
22−\input{./macros.ltx}
23−\input{./library.ltx}
24−
25−\NatPackage
26−\FinPackage
27−
28−\newcounter{per}
29−\setcounter{per}{1}
30−
31−\newcommand{\Ivor}{\textsc{Ivor}}
32−\newcommand{\Idris}{\textsc{Idris}}
33−\newcommand{\IdrisM}{\textsc{Idris}$^-$}
34−\newcommand{\TT}{\textsf{TT}}
35−\newcommand{\TTdev}{\textsf{TT$_{dev}$}}
36−\newcommand{\Funl}{\textsc{Funl}}
37−\newcommand{\Agda}{\textsc{Agda}}
38−\newcommand{\LamPi}{$\lambda_\Pi$}
39−
40−\newcommand{\perule}[1]{\vspace*{0.1cm}\noindent
41−\begin{center}
42−\fbox{
43−\begin{minipage}{7.5cm}\textbf{Rule \theper:} #1\addtocounter{per}{1}
44−\end{minipage}}
45−\end{center}
46−\vspace*{0.1cm}
47−}
48−
49−\newcommand{\mysubsubsection}[1]{
50−\noindent
51−\textbf{#1}
52−}
53−\newcommand{\hdecl}[1]{\texttt{#1}}
54−
55−
56−\title
57−[Idris, a General Purpose Dependently Typed Programming Language]
58−{Idris, a General Purpose Dependently Typed Programming Language:
59−Design and Implementation}
60−%Implementing General Purpose Dependently Typed Programming Languages}
61−%\subtitle{Implementing Domain Specific Languages by Overloading}
62−
63−\author[Edwin Brady]
64−{EDWIN BRADY\\
65−School of Computer Science, University of St Andrews, St Andrews,
66−KY16 9SX, UK}
67−
68−\begin{document}
69−
70−\maketitle
71−
72−\begin{abstract}
73−Many components of a dependently-typed programming language are by now well
74−understood, for example the underlying type theory, type checking, unification and
75−evaluation. How to combine these components into a realistic and usable
76−high-level language is, however, folklore, discovered anew by successive
77−language implementators. In this paper, I describe the implementation of
78−\Idris{}, a new dependently-typed functional programming language.
79−\Idris{} is intended to be a \emph{general purpose} programming language
80−and as such provides high-level concepts such as implicit syntax,
81−type classes and \texttt{do} notation.
82−I describe the high-level language and the underlying type theory, and present
83−a tactic-based method for \emph{elaborating} concrete high-level syntax with
84−implicit arguments and type classes into a fully explicit type theory.
85−Furthermore, I show how this method facilitates the implementation of new
86−high-level language constructs.
87−
88−%I describe the implementation of a dependently typed functional
89−%programming language, \Idris{}. Much has been written about various
90−%aspects of dependently typed language implementation (e.g. checking
91−%dependent types, unification, optimisation) but nothing yet about how
92−%to bring it all together into a complete, practical, usable tool. This paper
93−%attempts to do so. In particular, I explain what is needed to turn
94−%concrete syntax with implicit arguments into fully elaborated type
95−%theory, using unification and a tactic engine.
96−\end{abstract}
97−
98−
99−%\category{D.3.2}{Programming Languages}{Language
100−% Classifications}[Applicative (functional) Languages]
101−%\category{D.3.4}{Programming Languages}{Processors}[Compilers]
102−%\terms{Languages, Verification, Performance}
103−%\keywords{Dependent Types, Typechecking}
104−
105−
106−%\begin{bottomstuff}
107−%Author's address: Edwin Brady, School of Computer Science, North Haugh, St Andrews,
108−%KY16 9SX
109−%\end{bottomstuff}
110−
111−\input{intro.tex}
112−
113−%\input{overview.tex}
114−
115−\input{hll.tex}
116−
117−\input{typechecking.tex}
118−
119−%\input{proofstate.tex}
120−
121−\input{elaboration.tex}
122−
123−\input{delab.tex}
124−
125−%\input{compiling.tex}
126−
127−%\input{syntax.tex}
128−
129−\input{conclusions.tex}
130−
131−\section*{Acknowledgements}
132−
133−This work was funded by the Scottish Informatics and Computer Science Alliance
134−(SICSA) and by EU Framework 7 Project No. 248828 (ADVANCE). My thanks to
135−Philip H\"{o}lzenspies, Kevin Hammond, Vilhelm Sj\"{o}berg, Falko Spiller
136−and Nathan Collins
137−for their comments on an earlier draft of this paper, and to the anonymous
138−referees for their many insightful and constructive comments.
139−
140−\bibliographystyle{jfp}
141−\bibliography{library.bib}
142−
143−\appendix
144−
145−%\section{TODOs}
146−%\listoftodos{}
147−
148−%\section{Elaboration meta-operations}
149−
150−%It's possible that it would be useful to have a quick reference of meta-operations
151−%used by the elaborator here.
152−
153−%They are: $\ttinterp{\cdot}$, $\MO{Elab}$, $\MO{TTDecl}$,
154−%$\MO{NewProof}$, $\MO{NewTerm}$,
155−%$\MO{Term}$, $\MO{Type}$, $\MO{Context}$, $\MO{Patterns}$, $\MO{Lift}$, $\MO{Expand}$.
156−
157−%\input{code}
158−
159−\end{document}
papers/impl-paper/intro.texdeleted−196
@@ -1,196 +0,0 @@
1−\section{Introduction}
2−
3−Dependently-typed programming languages, such as Agda \cite{norell2007thesis}
4−and Coq \cite{Bertot2004}, have emerged in recent years as a promising approach
5−to ensuring the correctness of software. Type checking ensures a program has
6−the intended meaning; \emph{dependent} types, where types may be predicated
7−on values, allow a programmer to give a program a more precise type and
8−hence have increased confidence of its correctness.
9−The \Idris{} language
10−\cite{Brady2011a} aims to take this idea further, by providing support for
11−verification of \emph{general purpose} systems software. In contrast to Agda and Coq,
12−which have arisen from the theorem proving community, \Idris{} takes Haskell as
13−its main influence. Recent Haskell extensions such as GADTs and type families have
14−given some of the power of dependent types to Haskell programmers. In the short
15−term this approach has a clear advantage, since it builds on a mature language
16−infrastructure with extensive library support.
17−Taking a longer term view, however,
18−these extensions are inherently limited in that they are required to maintain
19−backwards compatibility with existing Haskell implementations. \Idris{}, being a new
20−language, has no such limitation, essentially asking the question:
21−
22−\begin{center}
23−\emph{``What if Haskell had \emph{full} dependent types?''}
24−\end{center}
25−
26−By \emph{full} dependent types, we mean that there is no restriction on which
27−values may appear in types. It is important for the sake of usability of a
28−programming language to provide a notation which allows programmers to express
29−high-level concepts in a natural way. Taking Haskell as a starting point means
30−that \Idris{} offers a variety of high-level structures such as type
31−classes, \texttt{do}-notation, primitive types and monadic I/O, for example.
32−Furthermore, a goal of \Idris{} is to support high-level domain-specific
33−language implementation, providing appropriate notation for \emph{domain
34−experts} and \emph{systems programmers}, who should not be required to be type
35−theorists in order to solve programming problems. Nevertheless, it is
36−important for the sake of correctness of the language implementation to have a
37−well-defined core language with well-understood meta-theory \cite{Altenkirch2010}.
38−How can we achieve both of these goals?
39−
40−This paper describes a method for elaborating a high-level dependently-typed
41−functional programming language to a low-level core based on dependent
42−type theory. The method involves building an elaboration monad which captures
43−the state of incomplete programs and a collection of \emph{tactics} used by the
44−machine to refine programs, directed by high-level syntax. As we shall see,
45−this method allows higher level language constructs to be elaborated in a
46−straightforward manner, without compromising the simplicity of the underlying
47−type theory.
48−
49−\subsection{Contributions}
50−
51−A dependently-typed programming language relies on several components, many of
52−which are now well understood. For example, we rely on a type checker for
53−the core type theory \cite{Chapman2005epigram,loh2010tutorial}, a
54−unification algorithm \cite{Miller1992} and an evaluator. However, it is less
55−well understood how to combine these components effectively into a practical
56−programming language.
57−
58−The primary contribution of this paper is a tactic-based method for translating
59−programs in a high-level dependently-typed programming language to a small core
60−type theory, \TT{}, based on UTT \cite{luo1994}. The paper describes the
61−structure of an elaboration monad capturing proof and system state, and
62−introduces a collection of \remph{tactics} which the machine uses to
63−manipulate incomplete programs. Secondly, the paper gives a detailed
64−description of the core type theory used by \Idris{}, including a full
65−description of the typing rules. Finally, through describing the specific
66−tactics, the paper shows how to extend \Idris{} with higher level features.
67−While we apply these ideas to \Idris{} specifically, the method for term
68−construction is equally applicable to other typed programming languages, and
69−indeed the tactics themselves are applicable to any high-level language which
70−can be explained in terms of \TT{}.
71−
72−\subsection{Outline}
73−
74−Translating an \Idris{} source program to an executable proceeds through several
75−phases, illustrated below:
76−
77−\begin{center}
78−\DM{
79−\mbox{\Idris{}}
80−\;
81−\xrightarrow{\mathrm{ (desugaring) }}
82−\;
83−\mbox{\IdrisM{}}
84−\;
85−\xrightarrow{\mathrm{ (elaboration) }}
86−\;
87−\mbox{\TT{}}
88−\;
89−\xrightarrow{\mathrm{ (compilation) }}
90−\;
91−\mbox{Executable}
92−}
93−\end{center}
94−
95−\noindent
96−The main focus of this paper is the elaboration phase, which translates
97−a desugared language \IdrisM{} into a core language \TT{}. In order to put
98−this into its proper context, I give an overview of the high-level language
99−\Idris{} in Section \ref{sect:hll} and explain the core language \TT{} and
100−its typing rules in Section \ref{sect:typechecking};
101−Section \ref{sect:elaboration} describes the elaboration process itself,
102−beginning with a tactic-based system for constructing
103−\TT{} programs, then introducing the desugared language \IdrisM{} and
104−showing how this is translated into \TT{} using tactics;
105−Section
106−\ref{sect:delab} describes the process for translating \TT{} back to \Idris{}
107−and properties of the translation; finally,
108−Section \ref{sect:related} discusses related work and Section \ref{sect:conclusion}
109−concludes.
110−
111−\subsection{Typographical conventions}
112−
113−This paper presents programs in two different but related languages: a high-level
114−language \Idris{} intended for programmers, and a low-level language \TT{} to
115−which \Idris{} is elaborated. We distinguish these languages typographically as
116−follows:
117−
118−\begin{itemize}
119−\item \Idris{} programs are written in \texttt{typewriter} font, as they are written
120−in a conventional text editor. We use \texttt{e$_i$} to stand for non-terminal
121−expressions.
122−\item \TT{} programs are written in mathematical notation, with names arising
123−from \Idris{} expressions written in \texttt{typewriter} font. We use vector notation
124−$\te$ to stand for sequences of expressions.
125−\end{itemize}
126−
127−Additionally, we describe the translation from \Idris{} to \TT{} in the form
128−of \emph{meta-operations}, which in practice are Haskell programs. Meta-operations
129−are operations on \Idris{} and \TT{} syntax, and are identified by their names being
130−in $\MO{SmallCaps}$.
131−
132−\subsection{Elaboration Example}
133−
134−A simple example of an \Idris{}
135−program is the following, which adds corresponding
136−elements of vectors of the same length:
137−
138−\begin{SaveVerbatim}{vadd}
139−
140−vAdd : Num a => Vect n a -> Vect n a -> Vect n a
141−vAdd Nil Nil = Nil
142−vAdd (x :: xs) (y :: ys) = x + y :: vAdd xs ys
143−
144−\end{SaveVerbatim}
145−\useverb{vadd}
146−
147−\noindent
148−This illustrates some basic features of \Idris{}:
149−
150−\begin{itemize}
151−\item Functions are defined by pattern matching, with a top-level type signature.
152−Names which are free in the type signature (\texttt{a} and \texttt{n}) here
153−are implicitly bound.
154−\item The type system ensures that both input vectors are the same length (\texttt{n})
155−and have the same element type (\texttt{a}), and that the element type and length
156−are preserved in the output vector.
157−\item Functions can be overloaded using \remph{classes}. Here, the element type
158−of the vector \texttt{a} must be numeric and therefore supports the \texttt{+} operator.
159−\item Unlike Haskell, a single colon is used for type signatures, and a double
160−colon for the cons operator, emphasising the importance of types.
161−\end{itemize}
162−
163−\noindent
164−\Idris{} programs elaborate into a small core language, \TT{}, which is a $\lambda$-calculus
165−with dependent types, augmented with algebraic data types and pattern matching.
166−\TT{} programs are fully explicitly typed, including the names \texttt{a} and \texttt{n}
167−in the type signature, and the names bound in each pattern match clause.
168−Classes are also made explicit.
169−The \TT{} translation of \texttt{vAdd} is:
170−
171−\DM{
172−\AR{
173−\FN{vAdd} \Hab(\va\Hab\Type)\to(\vn\Hab\Nat)\to\TC{Num}\;\va\to
174− \Vect\;\vn\;\va\to\Vect\;\vn\;\va\to\Vect\;\vn\;\va\\
175−\RW{var}\;\va\Hab\Type,\;\vc\Hab\TC{Num}\;\va\SC\\
176−\hg\FN{vAdd} \; \va \; \Z \; \vc \; (\DC{Nil}\;\va) \; (\DC{Nil}\;\va) \;
177−\cq\;\DC{Nil}\;\va \\
178−\RW{var}\;\AR{
179−\va\Hab\Type,\;\vk\Hab\Nat,\;\vc\Hab\TC{Num}\;\va,\\
180−\vx\Hab\va,\;\vxs\Hab\Vect\;\vk\;\va,\;
181−\vy\Hab\va,\;\vys\Hab\Vect\;\vk\;\va
182−\SC
183−\\
184−\FN{vAdd} \; \va \; (\suc\;\vk) \; \vc
185− \; ((\DC{::})\;\va\;\vk\;\vx\;\vxs)
186− \; ((\DC{::})\;\va\;\vk\;\vy\;\vys)
187− \\
188− \hg\hg\cq\:((\DC{::})\;\va\;\vk\;((+)\;\vc\;\vx\;\vy)\; (\FN{vAdd}\;\va\;\vk\;\vc\;\vxs\;\vys))
189−}
190−}
191−}
192−
193−\noindent
194−The rest of this paper describes \Idris{} and \TT{}, and systematically explains
195−how to translate from one to the other.
196−
papers/impl-paper/jfp.bstdeleted−1316
@@ -1,1316 +0,0 @@
1−% CUP Journal of Functional Programming bibliography style
2−% v1.0, released 22nd May 1995
3−% Copyright 1994,1995 Cambridge University Press
4−
5−% This BibTeX 0.99 style file is intended for documents that use the
6−% author-date citation system. It should be used in conjunction with the
7−% authordate1-4.sty (or equivalent) LaTeX style-option.
8−%
9−% In deciding on the bibliography layout to be implemented, the following
10−% works have been consulted:
11−% 1. British Standard 5605: "Citing publications by bibliographic
12−% references", 1978.
13−% 2. British Standard 1629: "Bibliographic references", 1976.
14−% (Note: There is now a 1989 edition.)
15−% 3. "Copy-editing" by Judith Butcher, Cambridge University Press, 1981.
16−% 4. "The Oxford Dictionary for Writers and Editors", Oxford University
17−% Press, 1981 (for abbreviations).
18−% 5. "The Chicago Manual of Style", Chicago University Press, 1982.
19−%
20−% Discretion has been used in certain matters. In particular:
21−% - Titles are italic except when there is a "contribution title" and
22−% a "main publication title", in which case the "contribution title"
23−% is roman while the "main publication title" is italic.
24−% - When there is a PUBLISHER, it is assumed that ADDRESS contains "place of
25−% publication"; output is of the form "place-of-publication: publisher".
26−% When there is an ORGANIZATION as well as a PUBLISHER, output is of the
27−% form "place-of-publication: publisher, for organization". Otherwise,
28−% it is assumed that ADDRESS is a postal address, and output is of the
29−% form "institution, address", "organization, address", "school, address"
30−% or "howpublished, address".
31−% - If there is a MONTH but no VOLUME or NUMBER for a journal-article, the
32−% MONTH is used on the assumption that it contains information that is
33−% equivalent to VOLUME or NUMBER. MONTH is ignored for other documents
34−% that have a PUBLISHER, but output after YEAR for anything else.
35−% - When CHAPTER and/or PAGES are specified with INBOOK, it is assumed that
36−% these fields are being used to pick out particular pages of interest
37−% (as an alternative to using the optional [...] argument of \cite);
38−% the information is put at the very end of the entry, in line with BS 1629.
39−% When CHAPTER and/or PAGES are specified for INCOLLECTION or INPROCEEDINGS,
40−% it is assumed that the fields are being used to specify the location of
41−% the part/article of interest; the information is put before the
42−% BOOKTITLE, in line with Chicago's treatment of "parts" and "chapters".
43−% - Since "volume" can be used in various ways (see page 219 of Butcher),
44−% this file assumes that, when there is a SERIES, any VOLUME and NUMBER
45−% refer to position in the SERIES (i.e. Butcher's meaning 4).
46−% If there is a VOLUME but no SERIES, it is assumed that VOLUME refers
47−% to a volume within a particular work (i.e. Butcher's meaning 1, 2 or 3).
48−% For INPROCEEDINGS and INCOLLECTION, this information goes after the
49−% BOOKTITLE. (If you prefer to have volume information before EDITOR,
50−% as on page 449 of Chicago, you can set TYPE = "Vol." with INCOLLECTION.)
51−%
52−% This file differs from authordate1.bst, authordate3.bst and
53−% authordate4.bst in that:
54−% - Titles of journals, articles and boooks are "downstyle". Apart from the
55−% first character, and the first character following : and white space,
56−% uppercase letters are converted to lowercase unless protected by {}.
57−% - Author's and editor's names are in roman.
58−%
59−% The combination of authordate2.bst and authordate1-4.sty allows citations
60−% of the form \shortcite{bloggs-60} as well as the usual \cite{bloggs-60}.
61−% When
62−% ... \cite{bloggs-60} ... \shortcite{bloggs-60} ...
63−% appears in the input file,
64−% ... (Bloggs, 1960) ... (1960) ...
65−% appears in the final document.
66−%
67−% This file was developed from apalike.bst. It also uses code taken from
68−% acm.bst, aaai-named.bst, btxbst.doc, ieeetr.bst and siam.bst.
69−%
70−% David Rhead
71−% Cripps Computing Centre
72−% Nottingham University
73−% March 1990
74−%
75−
76−ENTRY
77− { address
78− author
79− booktitle
80− chapter
81− edition
82− editor
83− howpublished
84− institution
85− journal
86− key
87− month
88− note
89− number
90− organization
91− pages
92− publisher
93− school
94− series
95− title
96− type
97− volume
98− year
99− }
100− {}
101− { label extra.label sort.label }
102−
103−INTEGERS { output.state before.all mid.sentence after.sentence after.block }
104−
105−FUNCTION {init.state.consts}
106−{ #0 'before.all :=
107− #1 'mid.sentence :=
108− #2 'after.sentence :=
109− #3 'after.block :=
110−}
111−
112−STRINGS { s t }
113−
114−FUNCTION {output.nonnull}
115−{ 's :=
116− output.state mid.sentence =
117− { ", " * write$ }
118− { output.state after.block =
119− { add.period$ write$
120− newline$
121− "\newblock " write$
122− }
123− { output.state before.all =
124− 'write$
125− { add.period$ " " * write$ }
126− if$
127− }
128− if$
129− mid.sentence 'output.state :=
130− }
131− if$
132− s
133−}
134−
135−FUNCTION {output}
136−{ duplicate$ empty$
137− 'pop$
138− 'output.nonnull
139− if$
140−}
141−
142−FUNCTION {output.check}
143−{ 't :=
144− duplicate$ empty$
145− { pop$ "empty " t * " in " * cite$ * warning$ }
146− 'output.nonnull
147− if$
148−}
149−
150−FUNCTION {output.year.month.check}
151−{ year empty$
152− { "empty year in " cite$ * warning$ }
153− { add.period$ write$
154− month empty$
155− { " (" year * extra.label * ")" * % ajw
156− after.sentence 'output.state :=
157− }
158− { " " year * extra.label * " (" * month * ")." *
159− after.sentence 'output.state :=
160− }
161− if$
162− }
163− if$
164−}
165−
166−FUNCTION {output.year.check}
167−{ year empty$
168− { "empty year in " cite$ * warning$ }
169− { add.period$ write$
170− " (" year * extra.label * ")" * % ajw
171− after.sentence 'output.state :=
172− }
173− if$
174−}
175−
176−FUNCTION {output.bibitem}
177−{ newline$
178− "\bibitem[" write$
179− label write$
180− "]{" write$
181− cite$ write$
182− "}" write$
183− newline$
184− ""
185− before.all 'output.state :=
186−}
187−
188−FUNCTION {fin.entry}
189−{ add.period$
190− write$
191− newline$
192−}
193−
194−FUNCTION {new.block}
195−{ output.state before.all =
196− 'skip$
197− { after.block 'output.state := }
198− if$
199−}
200−
201−FUNCTION {new.sentence}
202−{ output.state after.block =
203− 'skip$
204− { output.state before.all =
205− 'skip$
206− { after.sentence 'output.state := }
207− if$
208− }
209− if$
210−}
211−
212−FUNCTION {not}
213−{ { #0 }
214− { #1 }
215− if$
216−}
217−
218−FUNCTION {and}
219−{ 'skip$
220− { pop$ #0 }
221− if$
222−}
223−
224−FUNCTION {or}
225−{ { pop$ #1 }
226− 'skip$
227− if$
228−}
229−
230−FUNCTION {new.block.checkb}
231−{ empty$
232− swap$ empty$
233− and
234− 'skip$
235− 'new.block
236− if$
237−}
238−
239−FUNCTION {field.or.null}
240−{ duplicate$ empty$
241− { pop$ "" }
242− 'skip$
243− if$
244−}
245−
246−FUNCTION {boldface}
247−{ duplicate$ empty$
248− { pop$ "" }
249− { "{\bf " swap$ * "}" * }
250− if$
251−}
252−
253−FUNCTION {emphasize}
254−{ duplicate$ empty$
255− { pop$ "" }
256− { "{\em " swap$ * "}" * }
257− if$
258−}
259−
260−INTEGERS { nameptr namesleft numnames }
261−
262−
263−FUNCTION {format.names}
264−{ 's :=
265− #1 'nameptr :=
266− s num.names$ 'numnames :=
267− numnames 'namesleft :=
268− { namesleft #0 > }
269− { s nameptr "{vv~}{ll}{, jj}{, ff}" format.name$ 't :=
270− nameptr #1 >
271− { namesleft #1 >
272− { ", " * t * }
273− { t "others" =
274− { ", {\em et~al.\ }\relax" * }
275− { ", \& " * t * } % Butcher, pages
276− if$ % 186-189.
277− }
278− if$
279− }
280− 't
281− if$
282− nameptr #1 + 'nameptr :=
283− namesleft #1 - 'namesleft :=
284− }
285− while$
286−}
287−
288−FUNCTION {format.authors}
289−{ author empty$
290− { "" }
291− { author format.names }
292− if$
293−}
294−
295−FUNCTION {format.key}
296−{ empty$
297− { key field.or.null }
298− { "" }
299− if$
300−}
301−
302−FUNCTION {format.editors}
303−{ editor empty$
304− { "" }
305− { editor format.names
306− editor num.names$ #1 > % Use ODWE abbrevs.
307− { " (eds)" * } % to avoid
308− { " (ed)" * } % ambiguity between
309− if$ % "editor" and
310− } % "edition".
311− if$
312−}
313−
314−FUNCTION {format.title} % Howells example
315−{ title empty$ % in BS 5605 comes
316− { "" } % out wrong because
317− { title "t" change.case$ } % Patashnik
318− if$ % capitalizes
319−} % after a colon.
320−
321−FUNCTION {n.dashify}
322−{ 't :=
323− ""
324− { t empty$ not }
325− { t #1 #1 substring$ "-" =
326− { t #1 #2 substring$ "--" = not
327− { "--" *
328− t #2 global.max$ substring$ 't :=
329− }
330− { { t #1 #1 substring$ "-" = }
331− { "-" *
332− t #2 global.max$ substring$ 't :=
333− }
334− while$
335− }
336− if$
337− }
338− { t #1 #1 substring$ *
339− t #2 global.max$ substring$ 't :=
340− }
341− if$
342− }
343− while$
344−}
345−
346−FUNCTION {format.btitle}
347−{ title empty$
348− { "" }
349− { title "t" change.case$ emphasize }
350− if$
351−}
352−
353−FUNCTION {tie.or.space.connect}
354−{ duplicate$ text.length$ #3 <
355− { "~" }
356− { " " }
357− if$
358− swap$ * *
359−}
360−
361−FUNCTION {either.or.check}
362−{ empty$
363− 'pop$
364− { "can't use both " swap$ * " fields in " * cite$ * warning$ }
365− if$
366−}
367−
368−INTEGERS { multiresult }
369−
370−FUNCTION {multi.page.check}
371−{ 't :=
372− #0 'multiresult :=
373− { multiresult not
374− t empty$ not
375− and
376− }
377− { t #1 #1 substring$
378− duplicate$ "-" =
379− swap$ duplicate$ "," =
380− swap$ "+" =
381− or or
382− { #1 'multiresult := }
383− { t #2 global.max$ substring$ 't := }
384− if$
385− }
386− while$
387− multiresult
388−}
389−
390−FUNCTION {format.numberinseries}
391−{ number empty$
392− { "" }
393− { number multi.page.check
394− { ", nos. " number n.dashify tie.or.space.connect }
395− { ", no. " number tie.or.space.connect }
396− if$
397− }
398− if$
399−}
400−
401−FUNCTION {booklike.series.volume.number} % Chicago, pages
402−{ series empty$ % 450-451.
403− { volume empty$
404− { " " }
405− { " Vol. " volume * }
406− if$
407− }
408− {
409− volume empty$
410− { number empty$
411− { series }
412− { series format.numberinseries * }
413− if$
414− }
415− { number empty$
416− { series ", vol. " volume * * }
417− { series ", vol. " * volume * format.numberinseries * }
418− if$
419− }
420− if$
421− }
422− if$
423−}
424−
425−FUNCTION {incollectionlike.series.volume.number}
426−{ series empty$
427− { volume empty$
428− { " " }
429− { " vol. " volume * }
430− if$
431− }
432− { new.block
433− volume empty$
434− { number empty$
435− { series }
436− { series format.numberinseries * }
437− if$
438− }
439− { number empty$
440− { series ", vol. " volume * * }
441− { series ", vol. " * volume * format.numberinseries * }
442− if$
443− }
444− if$
445− }
446− if$
447−}
448−
449−FUNCTION {format.edition}
450−{ edition empty$
451− { "" }
452− { output.state mid.sentence =
453− { edition "l" change.case$ " edn." * }
454− { edition "t" change.case$ " edn." * }
455− if$
456− }
457− if$
458−}
459−
460−FUNCTION {format.pages}
461−{ pages empty$
462− { "" }
463− { pages multi.page.check
464− { "" pages n.dashify tie.or.space.connect }
465− { "" pages tie.or.space.connect }
466− if$
467− }
468− if$
469−}
470−
471−FUNCTION {format.pagesinbook} % By the time the
472−{ pages empty$ % reader has read
473− { "" } % address, pub'r,
474− { pages multi.page.check % note (where the
475− { "Pages " pages n.dashify tie.or.space.connect } % note may end with
476− { "Page " pages tie.or.space.connect } % numbers), s/he
477− if$ % may not recognise
478− } % a number-range as
479− if$ % meaning pages.
480−} % Avoid ambiguity
481− % (Butcher, p.181).
482−
483−FUNCTION {format.vol.num.date.pages}
484−{ volume empty$
485− { month empty$
486− { "" }
487− { month }
488− if$
489− }
490− { volume boldface field.or.null
491− number empty$
492− { month empty$
493− 'skip$
494− { "(" month * ")" * * }
495− if$
496− }
497− { "(" number * ")" * *
498− volume empty$
499− { "there's a number but no volume in " cite$ * warning$ }
500− 'skip$
501− if$
502− }
503− if$
504− }
505− if$
506− pages empty$
507− 'skip$
508− { duplicate$ empty$
509− { pop$ format.pages }
510− { ", " * pages n.dashify * }
511− if$
512− }
513− if$
514−}
515−
516−FUNCTION {format.chapter.pages.inbook}
517−{ chapter empty$
518− 'format.pagesinbook
519− { type empty$
520− { "Chap." }
521− { type }
522− if$
523− chapter tie.or.space.connect
524− pages empty$
525− 'skip$
526− { ", " * format.pagesinbook "l" change.case$ * }
527− if$
528− }
529− if$
530−}
531−
532−FUNCTION {format.chapter.pages.incoll}
533−{ chapter empty$
534− { pages empty$
535− { " " } % ajw
536− { "{\em " format.pagesinbook " of:} " * * }
537− if$
538− }
539− { type empty$
540− { "{\em Chap. " chapter * }
541− { "{\em " type * " " * chapter * }
542− if$
543− pages empty$
544− { " of:} " * }
545− { ", " * format.pagesinbook "l" change.case$ " of:} " * * }
546− if$
547− }
548− if$
549−}
550−
551−FUNCTION {format.in.ed.booktitle} % Achieves effect
552−{ booktitle empty$ % shown in 16.51
553− { "" } % of Chicago, at
554− { editor empty$ % expense of not
555− { format.chapter.pages.incoll % achieving effects
556− booktitle "t" change.case$ emphasize * } % shown in 16.50
557− { format.chapter.pages.incoll % of Chicago, on
558− format.editors * ", " * % page 189 of
559− booktitle "t" change.case$ emphasize * } % Butcher and in
560− if$ % 4.4 of BS 1629.
561− }
562− if$
563−}
564−
565−FUNCTION {format.thesis.type}
566−{ type empty$
567− 'skip$
568− { pop$
569− type "t" change.case$
570− }
571− if$
572−}
573−
574−FUNCTION {format.tr.number}
575−{ type empty$
576− { "Tech. rept." } % ODWE abbrevs.
577− 'type
578− if$
579− number empty$
580− { "t" change.case$ }
581− { number tie.or.space.connect }
582− if$
583−}
584−
585−FUNCTION {format.addr.pub}
586−{ publisher empty$
587− { "" }
588− { address empty$
589− { "" }
590− { address ": " * }
591− if$
592− publisher *
593− }
594− if$
595−}
596−
597−FUNCTION {format.addr.pub.org} % If there's an
598−{ address empty$ % an organization
599− { publisher * ", for " * organization * } % and a publisher
600− { address ": " * publisher * ", for " * organization * } % too.
601− if$
602−}
603−
604−FUNCTION {format.addr.inst}
605−{ address empty$
606− { institution empty$
607− { "" }
608− { institution }
609− if$
610− }
611− { institution empty$
612− { "" }
613− { institution ", " * }
614− if$
615− address *
616− }
617− if$
618−}
619−
620−FUNCTION {format.addr.org}
621−{ address empty$
622− { organization empty$
623− { "" }
624− { organization }
625− if$
626− }
627− { organization empty$
628− { "" }
629− { organization ", " * }
630− if$
631− address *
632− }
633− if$
634−}
635−
636−FUNCTION {format.article.crossref}
637−{ "{\em In:}"
638− " \cite{" * crossref * "}" *
639−}
640−
641−FUNCTION {format.book.crossref}
642−{ volume empty$
643− { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
644− "{\em In:}"
645− }
646− { " Vol." volume tie.or.space.connect
647− " of " *
648− }
649− if$
650− "\cite{" * crossref * "}" *
651−}
652−
653−FUNCTION {format.incoll.inproc.crossref}
654−{ "{\em In:}"
655− " \cite{" * crossref * "}" *
656−}
657−
658−FUNCTION {article}
659−{ output.bibitem
660− format.authors "author" output.check
661− author format.key output
662− output.year.check
663− new.block
664− format.title "title" output.check
665− new.block
666− crossref missing$
667− { journal "t" change.case$ emphasize
668− "journal" output.check
669− format.vol.num.date.pages output
670− }
671− { format.article.crossref output.nonnull
672− format.pages output
673− }
674− if$
675− new.block
676− note output
677− fin.entry
678−}
679−
680−FUNCTION {book}
681−{ output.bibitem
682− author empty$
683− { format.editors "author and editor" output.check
684− editor format.key output
685− }
686− { format.authors output.nonnull
687− crossref missing$
688− { "author and editor" editor either.or.check }
689− 'skip$
690− if$
691− }
692− if$
693− output.year.check
694− new.block
695− format.btitle "title" output.check
696− crossref missing$
697− { new.sentence
698− format.edition output
699− new.block
700− booklike.series.volume.number output
701− new.block
702− format.addr.pub "publisher" output.check
703− }
704− { new.block
705− format.book.crossref output.nonnull
706− }
707− if$
708− new.block
709− note output
710− fin.entry
711−}
712−
713−FUNCTION {booklet}
714−{ output.bibitem
715− format.authors output
716− author format.key output
717− output.year.month.check
718− new.block
719− format.btitle "title" output.check
720− new.block
721− howpublished output
722− address output
723− new.block
724− note output
725− fin.entry
726−}
727−
728−FUNCTION {inbook}
729−{ output.bibitem
730− author empty$
731− { format.editors "author and editor" output.check
732− editor format.key output
733− }
734− { format.authors output.nonnull
735− crossref missing$
736− { "author and editor" editor either.or.check }
737− 'skip$
738− if$
739− }
740− if$
741− output.year.check
742− new.block
743− format.btitle "title" output.check
744− crossref missing$
745− { new.sentence
746− format.edition output
747− new.block
748− booklike.series.volume.number output
749− new.block
750− format.addr.pub "publisher" output.check
751− }
752− { new.block
753− format.book.crossref output.nonnull
754− }
755− if$
756− new.block
757− note output
758− new.block % BS 1629 (rather
759− format.chapter.pages.inbook "chapter and pages" output.check
760− fin.entry % than Chicago,
761−} % p. 451)
762−
763−FUNCTION {incollection}
764−{ output.bibitem
765− author empty$
766− { format.editors "editor" output.check
767− editor format.key output }
768− { format.authors "author" output.check
769− author format.key output }
770− if$
771− output.year.check
772− new.block
773− format.title "title" output.check
774− new.block
775− crossref missing$ % Chapter and/or
776− { format.in.ed.booktitle output % page numbers can
777− format.edition output % come out via this
778− incollectionlike.series.volume.number output % route, too.
779− new.block
780− format.addr.pub "publisher" output.check
781− }
782− { format.incoll.inproc.crossref output.nonnull
783− new.block
784− }
785− if$
786− new.block
787− note output
788− fin.entry
789−}
790−
791−FUNCTION {inproceedings}
792−{ output.bibitem
793− format.authors "author" output.check
794− author format.key output
795− publisher empty$
796− { output.year.month.check }
797− { output.year.check }
798− if$
799− new.block
800− format.title "title" output.check
801− new.block
802− crossref missing$
803− { format.in.ed.booktitle "booktitle" output.check
804− incollectionlike.series.volume.number output
805− new.block
806− publisher empty$
807− {
808− organization empty$
809− 'skip$
810− { format.addr.org output }
811− if$
812− }
813− {
814− organization empty$
815− { format.addr.pub output }
816− { format.addr.pub.org output }
817− if$
818− }
819− if$
820− }
821− { format.incoll.inproc.crossref output.nonnull
822− }
823− if$
824− new.block
825− note output
826− fin.entry
827−}
828−
829−FUNCTION {conference} { inproceedings }
830−
831−FUNCTION {manual}
832−{ output.bibitem
833− format.authors output
834− author format.key output
835− output.year.month.check
836− new.block
837− format.btitle "title" output.check
838− new.sentence
839− format.edition output
840− new.block
841− organization address new.block.checkb
842− format.addr.org output
843− new.block
844− note output
845− fin.entry
846−}
847−
848−FUNCTION {mastersthesis}
849−{ output.bibitem
850− format.authors "author" output.check
851− author format.key output
852− output.year.month.check
853− new.block
854− format.btitle "title" output.check
855− new.block
856− "M.Phil. thesis" format.thesis.type output.nonnull % ODWE abbrev.
857− school "school" output.check
858− address output
859− new.block
860− note output
861− fin.entry
862−}
863−
864−FUNCTION {misc}
865−{ output.bibitem
866− format.authors output
867− author format.key output
868− output.year.month.check
869− new.block
870− format.btitle output
871− new.block
872− howpublished output
873− new.block
874− note output
875− fin.entry
876−}
877−
878−FUNCTION {phdthesis}
879−{ output.bibitem
880− format.authors "author" output.check
881− author format.key output
882− output.year.month.check
883− new.block
884− format.btitle "title" output.check
885− new.block
886− "Ph.D. thesis" format.thesis.type output.nonnull % Butcher,
887− school "school" output.check % page 174.
888− address output
889− new.block
890− note output
891− fin.entry
892−}
893−
894−FUNCTION {proceedings}
895−{ output.bibitem
896− format.editors "author and editor" output.check
897− editor format.key output
898− publisher empty$
899− { output.year.month.check }
900− { output.year.check }
901− if$
902− new.block
903− format.btitle "title" output.check
904− new.block
905− booklike.series.volume.number output
906− new.block
907− publisher empty$
908− {
909− organization empty$
910− 'skip$
911− { format.addr.org output }
912− if$
913− }
914− {
915− organization empty$
916− { format.addr.pub output }
917− { format.addr.pub.org output }
918− if$
919− }
920− if$
921− new.block
922− note output
923− fin.entry
924−}
925−
926−FUNCTION {techreport}
927−{ output.bibitem
928− format.authors "author" output.check
929− author format.key output
930− output.year.month.check
931− new.block
932− format.btitle "title" output.check
933− new.block
934− format.tr.number output.nonnull
935− new.sentence
936− format.addr.inst "institution" output.check
937− new.block
938− note output
939− fin.entry
940−}
941−
942−FUNCTION {unpublished}
943−{ output.bibitem
944− format.authors "author" output.check
945− author format.key output
946− output.year.month.check
947− new.block
948− format.btitle "title" output.check
949− new.block
950− note "note" output.check
951− fin.entry
952−}
953−
954−FUNCTION {default.type} { misc }
955−
956−MACRO {jan} {"Jan."} % ODWE, "months", &
957− % Chicago, p. 383.
958−MACRO {feb} {"Feb."}
959−
960−MACRO {mar} {"Mar."}
961−
962−MACRO {apr} {"Apr."}
963−
964−MACRO {may} {"May"}
965−
966−MACRO {jun} {"June"}
967−
968−MACRO {jul} {"July"}
969−
970−MACRO {aug} {"Aug."}
971−
972−MACRO {sep} {"Sept."}
973−
974−MACRO {oct} {"Oct."}
975−
976−MACRO {nov} {"Nov."}
977−
978−MACRO {dec} {"Dec."}
979−
980−MACRO {acmcs} {"ACM Computing Surveys"}
981−
982−MACRO {acta} {"Acta Informatica"}
983−
984−MACRO {cacm} {"Communications of the ACM"}
985−
986−MACRO {ibmjrd} {"IBM Journal of Research and Development"}
987−
988−MACRO {ibmsj} {"IBM Systems Journal"}
989−
990−MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
991−
992−MACRO {ieeetc} {"IEEE Transactions on Computers"}
993−
994−MACRO {ieeetcad}
995− {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
996−
997−MACRO {ipl} {"Information Processing Letters"}
998−
999−MACRO {jacm} {"Journal of the ACM"}
1000−
1001−MACRO {jcss} {"Journal of Computer and System Sciences"}
1002−
1003−MACRO {scp} {"Science of Computer Programming"}
1004−
1005−MACRO {sicomp} {"SIAM Journal on Computing"}
1006−
1007−MACRO {tocs} {"ACM Transactions on Computer Systems"}
1008−
1009−MACRO {tods} {"ACM Transactions on Database Systems"}
1010−
1011−MACRO {tog} {"ACM Transactions on Graphics"}
1012−
1013−MACRO {toms} {"ACM Transactions on Mathematical Software"}
1014−
1015−MACRO {toois} {"ACM Transactions on Office Information Systems"}
1016−
1017−MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
1018−
1019−MACRO {tcs} {"Theoretical Computer Science"}
1020−
1021−READ
1022−
1023−FUNCTION {sortify}
1024−{ purify$
1025− "l" change.case$
1026−}
1027−
1028−INTEGERS { len }
1029−
1030−FUNCTION {chop.word}
1031−{ 's :=
1032− 'len :=
1033− s #1 len substring$ =
1034− { s len #1 + global.max$ substring$ }
1035− 's
1036− if$
1037−}
1038−
1039−FUNCTION {format.lab.names}
1040−{ 's :=
1041− s #1 "{vv~}{ll}" format.name$
1042− s num.names$ duplicate$
1043− #2 >
1044−%%%%% { pop$ " {\em et~al.\ }\relax" * }
1045− { pop$ " {\em et~al.}\relax" * }
1046− { #2 <
1047− 'skip$
1048− { s #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
1049− { " {\em et~al.\ }\relax" * }
1050− { " \& " * s #2 "{vv~}{ll}" format.name$ * }
1051− if$
1052− }
1053− if$
1054− }
1055− if$
1056−}
1057−
1058−FUNCTION {author.key.label}
1059−{ author empty$
1060− { key empty$
1061− { cite$ #1 #3 substring$ }
1062− 'key
1063− if$
1064− }
1065− { author format.lab.names }
1066− if$
1067−}
1068−
1069−FUNCTION {author.editor.key.label}
1070−{ author empty$
1071− { editor empty$
1072− { key empty$
1073− { cite$ #1 #3 substring$ }
1074− 'key
1075− if$
1076− }
1077− { editor format.lab.names }
1078− if$
1079− }
1080− { author format.lab.names }
1081− if$
1082−}
1083−
1084−FUNCTION {editor.key.label}
1085−{ editor empty$
1086− { key empty$
1087− { cite$ #1 #3 substring$ }
1088− 'key
1089− if$
1090− }
1091− { editor format.lab.names }
1092− if$
1093−}
1094−
1095−FUNCTION {calc.label}
1096− { type$ "book" =
1097− type$ "inbook" =
1098− type$ "incollection" = % For sensible
1099− or or % treatment of
1100− 'author.editor.key.label % Singer in
1101− { type$ "proceedings" = % BS 1629.
1102− 'editor.key.label
1103− 'author.key.label
1104− if$
1105− }
1106− if$
1107− duplicate$
1108− year empty$
1109− {
1110− "\protect\citename{" swap$ * ", }" *
1111− "n.d." * 'label := % Chicago,
1112− } % page 457.
1113− {
1114− "\protect\citename{" swap$ * ", }" *
1115− year
1116− *
1117− 'label :=
1118− }
1119− if$
1120− year field.or.null purify$ *
1121− sortify 'sort.label :=
1122−}
1123−
1124−
1125−FUNCTION {sort.format.names} % To produce the
1126−{ 's := % order of entries
1127− #1 'nameptr := % specified in item
1128− "" % (3) on page 187
1129− s num.names$ 'numnames := % of Butcher.
1130− numnames 'namesleft :=
1131− { namesleft #0 > nameptr #3 < and } % Only 1st 2 names
1132− { nameptr #1 > % matter for
1133− { " " * } % sorting.
1134− 'skip$
1135− if$ % Anything that's
1136− nameptr #2 = numnames #2 > and % "et al" goes
1137− { "zzzzz" * } % after works by 2
1138− { % authors.
1139− s nameptr "{vv{ } }{ll{ }}{ ff{ }}{ jj{ }}" format.name$ 't :=
1140− nameptr numnames = t "others" = and
1141− { "zzzzz" * }
1142− { t sortify * }
1143− if$
1144− }
1145− if$
1146− nameptr #1 + 'nameptr :=
1147− namesleft #1 - 'namesleft :=
1148− }
1149− while$
1150−}
1151−
1152−FUNCTION {sort.format.title}
1153−{ 't :=
1154− "A " #2
1155− "An " #3
1156− "The " #4 t chop.word
1157− chop.word
1158− chop.word
1159− sortify
1160− #1 global.max$ substring$
1161−}
1162−
1163−FUNCTION {author.sort}
1164−{ author empty$
1165− { key empty$
1166− { "to sort, need author or key in " cite$ * warning$
1167− ""
1168− }
1169− { key sortify }
1170− if$
1171− }
1172− { author sort.format.names }
1173− if$
1174−}
1175−
1176−FUNCTION {author.editor.sort}
1177−{ author empty$
1178− { editor empty$
1179− { key empty$
1180− { "to sort, need author, editor, or key in " cite$ * warning$
1181− ""
1182− }
1183− { key sortify }
1184− if$
1185− }
1186− { editor sort.format.names }
1187− if$
1188− }
1189− { author sort.format.names }
1190− if$
1191−}
1192−
1193−FUNCTION {editor.sort}
1194−{ editor empty$
1195− { key empty$
1196− { "to sort, need editor or key in " cite$ * warning$
1197− ""
1198− }
1199− { key sortify }
1200− if$
1201− }
1202− { editor sort.format.names }
1203− if$
1204−}
1205−
1206−FUNCTION {presort} % Two sorting
1207−{ calc.label % passes, from
1208− label sortify % apalike.bst.
1209− " "
1210− *
1211− type$ "book" =
1212− type$ "inbook" =
1213− type$ "incollection" = % For Singer
1214− or or % in BS 1629.
1215− 'author.editor.sort
1216− { type$ "proceedings" =
1217− 'editor.sort
1218− 'author.sort
1219− if$
1220− }
1221− if$
1222− #1 entry.max$ substring$
1223− 'sort.label :=
1224− sort.label
1225− *
1226− " "
1227− *
1228− title field.or.null
1229− sort.format.title
1230− *
1231− #1 entry.max$ substring$
1232− 'sort.key$ :=
1233−}
1234−
1235−ITERATE {presort}
1236−
1237−SORT
1238−
1239−STRINGS { last.label next.extra }
1240−
1241−INTEGERS { last.extra.num }
1242−
1243−FUNCTION {initialize.extra.label.stuff}
1244−{ #0 int.to.chr$ 'last.label :=
1245− "" 'next.extra :=
1246− #0 'last.extra.num :=
1247−}
1248−
1249−FUNCTION {forward.pass}
1250−{ last.label label =
1251− { last.extra.num #1 + 'last.extra.num :=
1252− last.extra.num int.to.chr$ 'extra.label :=
1253− }
1254− { "a" chr.to.int$ 'last.extra.num :=
1255− "" 'extra.label :=
1256− label 'last.label :=
1257− }
1258− if$
1259−}
1260−
1261−FUNCTION {reverse.pass}
1262−{ next.extra "b" =
1263− { "a" 'extra.label := }
1264− 'skip$
1265− if$ % Code needed here
1266− % if \citeauthor
1267− % and \citeyear
1268− label extra.label * 'label := % were supported.
1269− extra.label 'next.extra :=
1270−}
1271−
1272−EXECUTE {initialize.extra.label.stuff}
1273−
1274−ITERATE {forward.pass}
1275−
1276−REVERSE {reverse.pass}
1277−
1278−FUNCTION {bib.sort.order}
1279−{ sort.label
1280− " "
1281− *
1282− year field.or.null sortify
1283− *
1284− " "
1285− *
1286− title field.or.null
1287− sort.format.title
1288− *
1289− #1 entry.max$ substring$
1290− 'sort.key$ :=
1291−}
1292−
1293−ITERATE {bib.sort.order}
1294−
1295−SORT
1296−
1297−FUNCTION {begin.bib}
1298−{ preamble$ empty$
1299− 'skip$
1300− { preamble$ write$ newline$ }
1301− if$
1302− "\begin{thebibliography}{}" write$ newline$
1303−}
1304−
1305−EXECUTE {begin.bib}
1306−
1307−EXECUTE {init.state.consts}
1308−
1309−ITERATE {call.type$}
1310−
1311−FUNCTION {end.bib}
1312−{ newline$
1313− "\end{thebibliography}" write$ newline$
1314−}
1315−
1316−EXECUTE {end.bib}
papers/impl-paper/jfp1.clsdeleted−1894
@@ -1,1894 +0,0 @@
1−%%
2−%% This is file `jfp.cls'
3−%%
4−%% CUP Journal of Functional Programming document class
5−%% Copyright 2001 Cambridge University Press
6−%%
7−%% by Mark A. Reed
8−%% based on JFP.STY v1.24.
9−%%
10−%% Incorporating parts of authordate.sty
11−%% by David Rhead, Cripps Computing Centre (Feb 1990).
12−%%
13−%% Bugs (in the case of unchanged files) should be reported to
14−%% texline@cambridge.org
15−%%
16−%% This software may only be used in the preparation of journal articles
17−%% or books or parts of books to be published by Cambridge University Press.
18−%% Any other use constitutes an infringement of copyright.
19−%%
20−%% \CharacterTable
21−%% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z
22−%% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z
23−%% Digits \0\1\2\3\4\5\6\7\8\9
24−%% Exclamation \! Double quote \" Hash (number) \#
25−%% Dollar \$ Percent \% Ampersand \&
26−%% Acute accent \' Left paren \( Right paren \)
27−%% Asterisk \* Plus \+ Comma \,
28−%% Minus \- Point \. Solidus \/
29−%% Colon \: Semicolon \; Less than \<
30−%% Equals \= Greater than \> Question mark \?
31−%% Commercial at \@ Left bracket \[ Backslash \\
32−%% Right bracket \] Circumflex \^ Underscore \_
33−%% Grave accent \` Left brace \{ Vertical bar \|
34−%% Right brace \} Tilde \~}
35−%%
36−
37−\NeedsTeXFormat{LaTeX2e}[1997/12/01]
38−\ProvidesClass{jfp}[2001/09/27 v1.02 Journal of Functional Programming
39− ^^Jdocument class]
40−
41−\newif\ifprodtf
42−\newif\ifonepage\global\onepagefalse%
43−\newif\ifonline
44−\onlinefalse
45−%
46−\newif\ifcompmod\global\compmodfalse
47−%
48−\newif\ifincremental\incrementalfalse
49−%%
50−\newif\ifindex
51−\newif\ifdraft
52−\newif\ifnoquery
53−\newif\ifbookreview
54−\newif\ifsptitle
55−%
56−\newif\ifsplissue
57−\global\splissuefalse
58−%
59−\newif\ifprinter
60−\newdimen\draftrule
61−\newdimen\trimrule
62−\global\draftrule0pt
63−\trimrule.1pt
64−%
65−\newdimen\trimwidth
66−\newdimen\trimheight
67−\newdimen\typewidth
68−\newdimen\typeheight
69−
70−\newdimen\tempdimen
71−\newdimen\normaltextheight
72−\newskip\normalbaselineskip
73−\newdimen\blindfoliodrop
74−\newif\ifprinter
75−\global\printerfalse
76−%%
77−\DeclareOption{compmod}{\compmodtrue}
78−%
79−\DeclareOption{splissue}{\splissuetrue}
80−%
81−%
82−\DeclareOption{incremental}{\incrementaltrue}
83−\DeclareOption{index}{\indextrue}
84−\DeclareOption{bookreview}{\bookreviewtrue}
85−\DeclareOption{noquery}{\noquerytrue}
86−\DeclareOption{oneside}{\relax}
87−\DeclareOption{twoside}{\@twosidetrue \@mparswitchtrue}
88−\DeclareOption{draft}{\draftrule.5pt\setlength\overfullrule{5\p@}}
89−\DeclareOption{final}{\setlength\overfullrule{\z@}}
90−\DeclareOption{onecolumn}{\@twocolumnfalse}
91−\DeclareOption{onepage}{\global\onepagetrue}
92−\DeclareOption{twocolumn}{\relax}
93−\DeclareOption{titlepage}{\relax}
94−\DeclareOption{notitlepage}{\relax}
95−\DeclareOption{leqno}{\relax}
96−\DeclareOption{fleqn}{\relax}
97−\DeclareOption{prodtf}{\prodtftrue}
98−\DeclareOption{sptitle}{\sptitletrue}
99−\DeclareOption{printer}{\printertrue}
100−\DeclareOption{online}{\onlinetrue}
101−%
102−\ExecuteOptions{twoside,final,onecolumn}
103−\ProcessOptions\relax
104−
105−\newif\ifCUPmtlplainloaded
106−%% \ifprodtf
107−%% \CUPmtlplainloadedtrue
108−%% \RequirePackage{CUPTimes,jfp2esym}
109−%% % \RequirePackage{Times,jfp2esym} %%% TB
110−%% \fi
111−%%%%%%%%%%%%%%%%
112−%
113−\def\trkdefault{trk}% All trk
114−\DeclareRobustCommand\trkshape
115− {\not@math@alphabet\trkshape\mathrm
116− \fontshape\trkdefault\selectfont}
117−%
118−\def\spchapterfont{\fontsize{18}{21}\selectfont}%\trkshape}
119−\def\subtitlefont{\normalfont\fontsize{12}{14}\selectfont\itshape}%
120−%
121−\def\splissuefont{\fontsize{12}{14}\itshape\selectfont}%\trkshape}
122−%
123−\DeclareFontFamily{OT1}{mtr}{}
124−\DeclareFontShape{OT1}{mtr}{m}{n}{<->mtr10}{}
125−\DeclareFontShape{OT1}{mtr}{m}{trk}{<->mtr10[track+140]}{}
126−\DeclareFontShape{OT1}{mtr}{m}{sl}{<->mtsl10}{}
127−\DeclareFontShape{OT1}{mtr}{m}{it}{<->mtti10}{}
128−\DeclareFontShape{OT1}{mtr}{m}{sc}{<->mtcsc10}{}
129−%
130−% Warning: please note that the upright shape below is
131−% used for the \pounds symbol of LaTeX. So this
132−% font definition shouldn't be removed.
133−%
134−\DeclareFontShape{OT1}{mtr}{m}{ui}{<->mtu10}{}
135−%
136−%%%%%%% bold series
137−\DeclareFontShape{OT1}{mtr}{b}{n}{<->sub * cmr/b/n}{}
138−%
139−%%%%%%%% bold extended series
140−\DeclareFontShape{OT1}{mtr}{bx}{n}{<->mtbx10}{}
141−\DeclareFontShape{OT1}{mtr}{bx}{sl}{<->mtbxsl10}{}
142−\DeclareFontShape{OT1}{mtr}{bx}{it}{<->mtbxti10}{}
143−%
144−% Again this is necessary for a correct \pounds symbol in
145−% the cmr fonts Hopefully the dc/ec font layout will take
146−% over soon.
147−%
148−\DeclareFontShape{OT1}{mtr}{bx}{ui}{<->ssub * mtr/m/ui}{}
149−%
150−%%%%% For mathfrak ... updated on 26th of April 2006
151−%
152−\DeclareFontFamily{U}{eufa}{}%
153−\DeclareFontShape{U}{eufa}{m}{n}{<-6>eufm5<6-8>eufm7<8->eufm10}{}%
154−\DeclareFontShape{U}{eufa}{b}{n}{<-6>eufb5<6-8>eufb7<8->eufb10}{}%
155−%
156−%%\newcommand{\mathfrak}[1]{{\protect\pmathfrak#1}}
157−%%\newcommand{\pmathfrak}{\@fontswitch{\relax}{\mfraknew}}
158−\DeclareMathAlphabet\mfraknew{U}{eufa}{m}{n}
159−\SetMathAlphabet\mfraknew{normal}{U}{eufa}{m}{n}
160−\SetMathAlphabet\mfraknew{bold}{U}{eufa}{b}{n}
161−%%%%
162−
163−%%%%%%%%%%%%%%%%
164−\setlength\lineskip{1\p@}
165−\setlength\normallineskip{1\p@}
166−\renewcommand\baselinestretch{}
167−
168−\renewcommand\normalsize{%
169−\ifbookreview
170−\@setfontsize\small\@ixpt{11}%
171−\else
172−\@setfontsize\normalsize\@xpt{13}%
173−\fi
174− \abovedisplayskip 6.5\p@ \@plus 1\p@ \@minus 1\p@
175− \belowdisplayskip \abovedisplayskip
176− \abovedisplayshortskip 3\p@ \@plus 1\p@
177− \belowdisplayshortskip \abovedisplayshortskip
178− \let\@listi\@listI}
179−
180−\normalsize
181−
182−\newcommand\small{%
183− \@setfontsize\small\@ixpt{11}%
184− \abovedisplayskip 6\p@ \@plus 1\p@ \@minus 1\p@
185− \belowdisplayskip \abovedisplayskip
186− \abovedisplayshortskip 3\p@ \@plus 1\p@
187− \belowdisplayshortskip \abovedisplayshortskip
188− \def\@listi{\leftmargin\leftmargini
189− \topsep 6\p@ \@plus 1\p@ \@minus 1\p@
190− \parsep \z@ \itemsep \parsep}%
191−}
192−
193−\newcommand\footnotesize{%
194− \@setfontsize\footnotesize\@ixpt\@xpt
195− \abovedisplayskip 5\p@ \@plus 1\p@ \@minus 1\p@
196− \belowdisplayskip \abovedisplayskip
197− \abovedisplayshortskip \z@ \@plus 1\p@
198− \belowdisplayshortskip \abovedisplayshortskip
199− \def\@listi{\leftmargin\leftmargini
200− \topsep 4.5\p@ \@plus 1\p@ \@minus 1\p@
201− \parsep \z@ \itemsep \parsep}%
202−}
203−
204−\newcommand\scriptsize{\@setfontsize\scriptsize\@viiipt\@ixpt}
205−\newcommand\tiny{\@setfontsize\tiny\@vpt\@vipt}
206−\newcommand\large{\@setfontsize\large\@xiipt{14}}
207−\newcommand\Large{\@setfontsize\Large\@xvpt{18}}
208−\ifprodtf
209− \newcommand\LARGE{\@setfontsize\LARGE{19}{21}}%
210−\else
211− \newcommand\LARGE{\@setfontsize\LARGE{18}{21}}%
212−\fi
213−\newcommand\huge{\@setfontsize\huge\@xxpt{25}}
214−\newcommand\Huge{\@setfontsize\Huge\@xxvpt{30}}
215−%
216−\def\sluglinefont{\fontsize{7.5}{10}\selectfont}
217−%
218−\newcommand\affilsize{\@setfontsize\affilsize\@viiipt\@xpt}
219−\newcommand\onlineaffilsize{\@setfontsize\affilsize\@viipt\@ixpt}
220−\let\authorsize\normalsize
221−
222−\DeclareOldFontCommand{\rm}{\normalfont\rmfamily}{\mathrm}
223−\DeclareOldFontCommand{\sf}{\normalfont\sffamily}{\mathsf}
224−\DeclareOldFontCommand{\tt}{\normalfont\ttfamily}{\mathtt}
225−\DeclareOldFontCommand{\bf}{\normalfont\bfseries}{\mathbf}
226−\DeclareOldFontCommand{\it}{\normalfont\itshape}{\mathit}
227−\DeclareOldFontCommand{\sl}{\normalfont\slshape}{\@nomath\sl}
228−\DeclareOldFontCommand{\sc}{\normalfont\scshape}{\@nomath\sc}
229−\DeclareRobustCommand*\cal{\@fontswitch\relax\mathcal}
230−\DeclareRobustCommand*\mit{\@fontswitch\relax\mathnormal}
231−
232− \setlength\topmargin{11mm}
233−\setlength\trimheight{247mm}
234−\setlength\trimwidth{174mm}
235−%
236−\setlength\typeheight{50.5pc}
237−\setlength\typewidth{30pc}
238−
239−\setlength\marginparwidth{2.0cm}
240−\setlength\marginparsep{10\p@}
241−
242−\setlength\headheight{6\p@}
243−\setlength\headsep{18\p@}
244−\setlength\topskip{6\p@}
245−\setlength\footskip{26\p@}
246−
247−\setlength\textheight{48.5pc}
248−\addtolength\textheight{-8.8pt}
249−\addtolength\textheight{\topskip}
250−\setlength\normaltextheight{\textheight}
251−
252−\setlength\textwidth{30pc}
253−\setlength\columnsep{10\p@}
254−\setlength\columnseprule{\z@}
255−
256−\setlength\oddsidemargin{21mm}%5pc}
257−\setlength\evensidemargin\trimwidth
258−\addtolength\evensidemargin{-\textwidth}
259−\addtolength\evensidemargin{-\oddsidemargin}
260−
261−\setlength\footnotesep{\z@}
262−\setlength{\skip\footins}{19.5\p@ \@plus 12\p@ \@minus 1\p@}
263−
264−\setlength\floatsep{13\p@ \@plus 6.5\p@ \@minus 1\p@}
265−\setlength\textfloatsep{15\p@ \@plus 4.5\p@ \@minus 3\p@}
266−\setlength\intextsep{13\p@ \@plus 6.5\p@ \@minus 2\p@}
267−\setlength\dblfloatsep{13\p@ \@plus 6.5\p@ \@minus 2\p@}
268−\setlength\dbltextfloatsep{15\p@ \@plus 4.5\p@ \@minus 3\p@}
269−\setlength\@fptop{\z@ \@plus 0fil}
270−\setlength\@fpsep{13\p@ \@plus 0fil}
271−\setlength\@fpbot{\z@ \@plus 3fil}
272−\setlength\@dblfptop{\z@ \@plus 0fil}
273−\setlength\@dblfpsep{13\p@ \@plus 0fil}
274−\setlength\@dblfpbot{\z@ \@plus 3fil}
275−\setlength\marginparpush{5\p@}
276−
277−\setlength\parskip{\z@}% \@plus .3\p@}
278−\setlength\parindent{10pt}
279−\setlength\partopsep{\z@ \@plus 1\p@}
280−\@lowpenalty 51
281−\@medpenalty 151
282−\@highpenalty 301
283−\@beginparpenalty -\@lowpenalty
284−\@endparpenalty -\@lowpenalty
285−\@itempenalty -\@lowpenalty
286−\clubpenalty\@M%z@
287−\widowpenalty\@M
288−\hyphenpenalty8000
289−
290−%
291−\def\cleardoublepage{\clearpage\if@twoside \ifodd\c@page\else
292− \hbox{}\thispagestyle{empty}\newpage\if@twocolumn\hbox{}\newpage\fi\fi\fi}
293−%
294−\newcommand\partname{Part}
295−\newcommand\part{\par\addvspace{4ex}\@afterindentfalse \secdef\@part\@spart}
296−
297−\def\@part[#1]#2{%
298− \ifnum \c@secnumdepth >\m@ne
299− \refstepcounter{part}%
300− \addcontentsline{toc}{part}{\partname\ \thepart: #1}%
301− \else
302− \addcontentsline{toc}{part}{#1}%
303− \fi
304− {\parindent \z@ \centering
305− \ifnum \c@secnumdepth >\m@ne
306− \normalfont\large\rmfamily \MakeUppercase{\partname}\ %
307− \ifcase\thepart \or ONE \or TWO \or THREE \or FOUR \or FIVE
308− \or SIX \or SEVEN \or EIGHT \or NINE \or TEN \else \fi
309− \par \nobreak
310− \fi
311− \normalfont\LARGE\rmfamily #2 \markboth{}{}\par}%
312− \nobreak \vskip 3ex \@afterheading
313−}
314−
315−\def\@spart#1{%
316− {\parindent \z@ \centering\normalfont\LARGE\rmfamily #1\par}%
317− \nobreak \vskip 3ex \@afterheading
318−}
319−
320−\newcommand\section{%
321− \@startsection {section}{1}{\z@}%
322− {-19.5\p@ \@plus -6.5\p@ \@minus -3.25\p@}%
323− {6.5\p@ \@plus \z@ \@minus 1\p@}
324− {\normalfont\normalsize\bfseries\centering}%
325−}
326−
327−\newcommand\subsection{%
328− \@startsection{subsection}{2}{\z@}
329− {-19.5\p@ \@plus -3.25\p@ \@minus -3.25\p@}
330− {6.5\p@ \@plus \z@ \@minus 1\p@}
331− {\normalfont\normalsize\bfseries\itshape\centering}%
332−}
333−
334−\newcommand\subsubsection{%
335− \@startsection{subsubsection}{3}{\z@}
336− {-19.5\p@ \@plus -3.25\p@ \@minus -3.25\p@}
337− {6.5\p@ \@plus \z@ \@minus 1\p@}
338− {\normalfont\normalsize\itshape\centering}%
339−}
340−
341−\newcommand\paragraph{%
342− \@startsection{paragraph}{4}{\z@}
343− {-13\p@ \@plus -1.5\p@ \@minus -1.5\p@}
344− {-0.5em}
345− {\normalfont\normalsize\bfseries\raggedright}%
346−}
347−
348−\newcommand\subparagraph{%
349− \@startsection{subparagraph}{4}{\parindent}
350− {-13\p@ \@plus -3.25\p@ \@minus -3.25\p@}
351− {-0.5em}
352− {\normalfont\normalsize\rmfamily\raggedright}%
353−}
354−
355−\def\@seccntformat#1{\csname the#1\endcsname\hskip5pt}%
356−
357−\newcommand\appendixname{Appendix}
358−
359−\newcommand\appendix{\par
360− \@addtoreset{equation}{section}%
361− \@addtoreset{figure}{section}%
362− \@addtoreset{table}{section}%
363− \setcounter{section}\z@
364− \renewcommand\thesection{\@Alph\c@section}%
365− \renewcommand\theequation{\thesection\,\@arabic\c@equation}%
366− \renewcommand\thefigure{\thesection\,\@arabic\c@figure}%
367− \renewcommand\thetable{\thesection\,\@arabic\c@table}%
368−}
369−
370−\setcounter{secnumdepth}{3}
371−
372−\newcounter{part}
373−\newcounter{section}
374−\newcounter{subsection}[section]
375−\newcounter{subsubsection}[subsection]
376−\newcounter{paragraph}[subsubsection]
377−\newcounter{subparagraph}[paragraph]
378−\renewcommand\thepart {\@arabic\c@part}
379−\renewcommand\thesection {\@arabic\c@section}
380−\renewcommand\thesubsection {\thesection.\@arabic\c@subsection}
381−\renewcommand\thesubsubsection {\thesubsection.\@arabic\c@subsubsection}
382−\renewcommand\theparagraph {\thesubsubsection.\@arabic\c@paragraph}
383−\renewcommand\thesubparagraph {\theparagraph.\@arabic\c@subparagraph}
384−
385−\newskip\@leftskip \@leftskip=\z@
386−
387−\setlength\leftmargini {13pt}
388−\setlength\leftmarginii {15.2pt}
389−\setlength\leftmarginiii {1.5em}
390−\setlength\leftmarginiv {1.5em}
391−\setlength\leftmarginv {1em}
392−\setlength\leftmarginvi {1em}
393−\setlength\leftmargin {\leftmargini}
394−\setlength\labelsep {5\p@}
395−\setlength\labelwidth {\leftmargini}
396−\addtolength\labelwidth {-\labelsep}
397−
398−\newcommand\makeRLlabel[1]{\rlap{#1}\hss}
399−\newcommand\makeRRlabel[1]{\hss\llap{#1}}
400−
401−\def\@listI{\leftmargin\leftmargini\advance\leftmargin11.5pt
402− \parsep \z@ \topsep 6.5\p@ \@plus 3\p@ \@minus 3\p@
403− \itemsep \z@ \@plus 1\p@ \@minus 1\p@
404− \let\makelabel\makeRLlabel}
405−
406−\def\@listii{\leftmargin\leftmarginii
407− \labelwidth\leftmarginii
408− \advance\labelwidth-\labelsep
409− \topsep 3\p@ \@plus 1\p@ \@minus 1\p@
410− \parsep \z@ \itemsep \parsep
411− \let\makelabel\makeRLlabel}
412−
413−\def\@listiii{\leftmargin\leftmarginiii
414− \labelwidth\leftmarginiii
415− \advance\labelwidth-\labelsep
416− \topsep 3\p@ \@plus 1\p@ \@minus 1\p@
417− \parsep \z@ \partopsep \z@
418− \itemsep \topsep
419− \let\makelabel\makeRLlabel}
420−
421−\def\@listiv{\leftmargin\leftmarginiv
422− \labelwidth\leftmarginiv
423− \advance\labelwidth-\labelsep
424− \let\makelabel\makeRLlabel}
425−
426−\def\@listv{\leftmargin\leftmarginv
427− \labelwidth\leftmarginv
428− \advance\labelwidth-\labelsep
429− \let\makelabel\makeRLlabel}
430−
431−\def\@listvi{\leftmargin\leftmarginvi
432− \labelwidth\leftmarginvi
433− \advance\labelwidth-\labelsep
434− \let\makelabel\makeRLlabel}
435−
436−\let\@listi\@listI
437−\@listi
438−
439−\def\itemize{% FROM LATEX.LTX
440− \ifnum \@itemdepth >\thr@@ \@toodeep\else
441− \advance\@itemdepth \@ne
442− \edef\@itemitem{labelitem\romannumeral\the\@itemdepth}%
443− \expandafter
444− \list
445− \csname\@itemitem\endcsname
446− {\let\makelabel\makeRRlabel\advance\itemindent0pt\advance\leftmargin.5pt}%
447− \fi
448−}
449−
450−\newif\ifhyphen\global\hyphenfalse
451−
452−\newcommand\labelitemi{\ifhyphen \normalfont\bfseries ---\else
453−$\m@th\bullet$\fi}
454−
455−%\newcommand\labelitemi{$\m@th\bullet$}
456−\newcommand\labelitemii{\normalfont\bfseries ---}
457−\newcommand\labelitemiii{\normalfont\bfseries --}
458−\newcommand\labelitemiv{$\m@th\cdot$}
459−
460−%%%%%%%%%%%%%%%%%%%%%%%%%%%%% unnumlist %%%%%%%%%%%%%%%%%%%%%%%%%%%%% TB
461−%
462−\def\unnumlistfont{\fontsize{10}{13}\selectfont}
463−
464−\newenvironment{unnumlist}{\par%
465− \unnumlistfont%
466− \list{}{%
467− \topsep6pt plus2pt
468− \itemindent-10pt
469− \leftmargin10pt
470− \parsep0pt
471− \itemsep0pt
472− \partopsep0pt}
473− \def\makelable##1{##1}%
474−}{%
475− \endlist%
476−}%
477−%
478−%%%%%%%%%%%%%%%%%%%%%%%%%%%%% unnumlist %%%%%%%%%%%%%%%%%%%%%%%%%%%%%
479−
480−\def\enumerate{% FROM LATEX.LTX
481− \ifnum \@enumdepth >\thr@@ \@toodeep\else
482− \advance\@enumdepth \@ne
483− \edef\@enumctr{enum\romannumeral\the\@enumdepth}%
484− \fi
485− \@ifnextchar [{\@enumeratetwo}{\@enumerateone}%
486−}
487−
488−\def\@enumerateone{%
489− \expandafter
490− \list
491− \csname label\@enumctr\endcsname
492− {\usecounter{\@enumctr}%
493− \let\makelabel\makeRRlabel}%
494−}
495−
496−\def\@enumeratetwo[#1]{%
497− \expandafter
498− \list
499− \csname label\@enumctr\endcsname
500− {\usecounter{\@enumctr}%
501− \settowidth\labelwidth{\normalfont\rmfamily #1}%
502− \itemindent0pt\leftmargin\labelwidth\advance\leftmargin\labelsep\advance\leftmargin13pt
503− \let\makelabel\makeRRlabel}%
504−}
505−
506−\newcommand\labelenumi {{\normalfont\rmfamily\theenumi.}}
507−\newcommand\labelenumii {{\normalfont\rmfamily(\theenumii)}}
508−\newcommand\labelenumiii{{\normalfont\rmfamily\theenumiii}}
509−\newcommand\labelenumiv {{\normalfont\rmfamily\theenumiv}}
510−
511−\renewcommand\theenumi{\@arabic\c@enumi}
512−\renewcommand\theenumii{\@alph\c@enumii}
513−\renewcommand\theenumiii{\@roman\c@enumiii}
514−\renewcommand\theenumiv{\@Alph\c@enumiv}
515−
516−\renewcommand\p@enumii{\theenumi}
517−\renewcommand\p@enumiii{\theenumi(\theenumii)}
518−\renewcommand\p@enumiv{\p@enumiii\theenumiii}
519−
520−\newcommand*\descriptionlabel[1]{\hspace\labelsep \normalfont\bfseries #1}
521−
522−\newenvironment{description}
523− {\list{}{\leftmargin 1em \labelwidth\z@ \itemindent-\leftmargin
524− \let\makelabel\descriptionlabel}}
525− {\endlist}
526−
527−\newenvironment{verse}
528− {\let\\=\@centercr
529− \list{}{\itemsep\z@
530− \itemindent -2.5em%
531− \listparindent \itemindent
532− \rightmargin\leftmargin
533− \advance\leftmargin 2.5em}\item[]}
534− {\endlist}
535−
536−\newenvironment{extract} %quotation
537− {\list{}{\vskip6pt\listparindent\parindent
538− \topsep6pt\itemindent\listparindent
539− \leftmargin\z@ \rightmargin\leftmargin
540− \parsep \z@ \@plus 1\p@}\item[]%
541− \normalfont\small\rmfamily}
542− {\endlist}
543−
544−
545−\newenvironment{quote} %quotation
546− {\par\vskip5pt\itshape\leftskip0pt plus1fill\rightskip0pt plus 0fill}
547− {\par}
548−
549−\newenvironment{qtsource} %quotation source
550− {\par\leftskip0pt plus1fill\rightskip0pt plus 0fill}
551− {\par}
552−
553−\def\quotespace{\vspace*{6.5pt}}
554−
555−\newenvironment{letter} %quotation
556− {\list{}{\listparindent\z@
557− \topsep6pt\itemindent\listparindent
558− \leftmargin24pt \rightmargin\z@
559− \parsep \z@ \@plus 1\p@}\item[]%
560− \normalfont\itshape}
561− {\endlist}
562−
563−
564−\newif\ifrembrks
565−\newcommand\removebrackets{\rembrkstrue}
566−
567−\def\@begintheorem#1#2{% FROM LATEX.LTX
568− \normalfont\rmfamily
569− \trivlist
570− \item[\hskip \labelsep{\normalfont\itshape #1\ #2}]%
571− \item[]%
572−}
573−
574−\def\@opargbegintheorem#1#2#3{% FROM LATEX.LTX
575− \normalfont\rmfamily
576− \trivlist
577− \item[\hskip \labelsep{\normalfont\itshape #1\ #2\ %
578− \ifrembrks #3\/\global\rembrksfalse\else {\upshape(}#3\/{\upshape)}\fi}]%
579− \item[]%
580−}
581−
582−\newsavebox{\proofsavebox}
583−
584−
585−%% \newtheorem{lemma}{Lemma}[section]
586−%% \newtheorem{example}{Example}[section]
587−%% \newtheorem{theorem}{Theorem}[section]
588−%% \newtheorem{definition}{Definition}[section]
589−%% \newtheorem{corollary}{Corollary}[section]
590−
591−
592− \sbox{\proofsavebox}
593− {\unitlength 1pt\begin{picture}(6.5,6.5)%
594− \put(0,0){\framebox(6.5,6.5){}}\end{picture}}
595− \newcommand\proofbox{\usebox{\proofsavebox}\relax}
596−
597−\newcommand\mathproofbox{\rlap{\quad\proofbox}}
598−
599−\def\@nprf{\normalfont\rmfamily \trivlist
600− \item[\hskip \labelsep {\normalfont\itshape Proof}]%
601− \item[]}
602−
603−\def\@oprf[#1]{\normalfont\rmfamily \trivlist
604− \item[\hskip \labelsep {\normalfont\itshape #1\ }]%
605− \item[]}
606−
607−\newenvironment{proof}
608− {\@ifnextchar[{\@oprf}{\@nprf}}
609− {\hspace*{15pt}\hbox{\proofbox}\endtrivlist}
610−
611−\newenvironment{proof*}
612− {\proof}
613− {\endtrivlist}
614−
615−\renewcommand\theequation{\@arabic\c@equation}
616−
617−\setlength\arraycolsep{5\p@}
618−\setlength\tabcolsep{0\p@}
619−\setlength\arrayrulewidth{.5\p@}
620−\setlength\doublerulesep{1.5\p@}
621−\setlength\tabbingsep{\labelsep}
622−\setlength{\skip\@mpfootins}{\skip\footins}
623−\setlength\fboxsep{3\p@}
624−\setlength\fboxrule{.5\p@}
625−
626−\newcommand\maketitle{\@ifnextchar [{\m@ketitleone}{\m@ketitleone[n]}}
627−
628−\def\m@ketitleone[#1]{\par
629− \begingroup
630− \newpage
631− \global\@topnum\z@
632− \titlefntrue
633− \def\thefootnote{\@fnsymbol\c@footnote}%
634− \def\@makefnmark{\hbox{$\@thefnmark$}}%
635− \@maketitle{#1}%
636− \thispagestyle{titlepage}\@thanks
637− \endgroup
638− \global\let\@maketitle\relax
639− \global\let\@thanks\@empty
640− \global\let\@title\@empty
641− \global\let\@author\@empty
642− \global\let\maketitle\relax
643− \global\let\thanks\relax
644− \setcounter{footnote}\z@
645−}
646−
647−\def\pe@rl#1{%
648− \if t#1 {\tpe@rl}\else
649− \if T#1 {\Tpe@rl}\else
650− \if f#1 {\fpe@rl}\else
651− \if F#1 {\Fpe@rl}\else
652− \if e#1 {\edpe@rl}\else
653− \if E#1 {\Edpe@rl}\else
654− \if o#1 {\otherpearl}\else
655− \vspace*{32\p@}%
656− \fi
657− \fi
658− \fi
659− \fi
660− \fi
661− \fi
662− \fi
663−}
664−%
665−\newenvironment{bookrevauthor}{\par\vskip5pt\noindent\ignorespaces}{\par}
666−
667−\def\bookreventryfont{\fontsize{10}{13}\selectfont}
668−\newenvironment{bookreventry}{\par\bookreventryfont\noindent\leftskip18pt\rightskip18pt\ignorespaces}{\vskip7pt\@endparenv\@ignoretrue}
669−\newenvironment{question}{\par\vskip6.5pt\tablefont\noindent\ignorespaces}{\vskip6.5pt\@endparenv\@ignoretrue}
670−%
671−\def\spe@rl{\vspace*{32\p@}\normalfont\LARGE\rmfamily}
672−\def\epe@rl#1{\par\vspace*{6.5\p@}\xdef\@shorttitle{#1}}
673−
674−\def\tpe@rl{\spe@rl T\ls H\ls E\ls O\ls R\ls E\ls T\ls
675− I\ls C\ls A\ls L\ns P\ls E\ls A\ls R\ls L\ls S%
676− \epe@rl{Theoretical pearls}%
677−}
678−
679−\def\Tpe@rl{\spe@rl T\ls H\ls E\ls O\ls R\ls E\ls T\ls
680− I\ls C\ls A\ls L\ns P\ls E\ls A\ls R\ls L%
681− \epe@rl{Theoretical pearl}%
682−}
683−
684−\def\fpe@rl{\spe@rl F\ls U\ls N\ls C\ls T\ls I\ls O\ls
685− N\ls A\ls L\ns P\ls E\ls A\ls R\ls L\ls S%
686− \epe@rl{Functional pearls}%
687−}
688−
689−\def\Fpe@rl{\spe@rl F\ls U\ls N\ls C\ls T\ls I\ls O\ls
690− N\ls A\ls L\ns P\ls E\ls A\ls R\ls L%
691− \epe@rl{Functional pearl}%
692−}
693−
694−\def\edpe@rl{\spe@rl E\ls D\ls U\ls C\ls A\ls T\ls I\ls O\ls N\ls A\ls L\ns
695− P\ls E\ls A\ls R\ls L\ls S%
696− \epe@rl{Educational pearls}%
697−}
698−
699−\def\Edpe@rl{\spe@rl E\ls D\ls U\ls C\ls A\ls T\ls I\ls O\ls N\ls A\ls L\ns
700− P\ls E\ls A\ls R\ls L%
701− \epe@rl{Educational pearl}%
702−}
703−
704−\def\otherpearl{\spe@rl
705− \@ifundefined{othrpearl}
706− {Please define {\normalfont\ttfamily\char92 othrpearl} to obtain\\ the correct title!}
707− {\othrpearl}%
708− \epe@rl{Short title--please redefine with {\normalfont\ttfamily\char92 shorttitle}}%
709−}
710−
711−\def\authormark#1{\xdef\@authormark{#1}}
712−
713−\def\author{\@ifnextchar [{\@authortwo}{\@authorone}}
714−\def\@authortwo[#1]#2{\@author{#2}\xdef\@authormark{#1}}
715−\def\@authorone#1{\@author{#1}\xdef\@authormark{#1}}
716−%
717−%\def\@author#1{\global\advance\authorcount by 1
718−% \expandafter\xdef\csname author\romannumeral\the\authorcount\endcsname{#1}\affil{}}
719−%
720−\def\@author#1{\global\advance\authorcount by 1
721− \expandafter\gdef\csname author\romannumeral\the\authorcount\endcsname{#1}}
722−%
723−\def\affil#1{\expandafter\gdef\csname affil\romannumeral\the\authorcount\endcsname{#1}}
724−\def\email#1{\expandafter\gdef\csname email\romannumeral\the\authorcount\endcsname{\normalfont\rmfamily
725− \itshape\textup{(}e-mail: \textup{\texttt{#1})}}}
726−%
727−\def\and{{\reset@font and}}
728−%
729−\def\authorsep{\unskip, }
730−\newcount\authorcount\authorcount=0
731−\newcount\tempcount
732−\newcount\authortempcount
733−%
734−\def\@authors{%
735− \ifnum\authorcount>0% %%%% Authors available
736− \tempcount=1%
737− \loop%
738− \ifnum\authorcount>0%
739− \noindent{\reset@font\authorsize\csname author\romannumeral\the\tempcount \endcsname}\par\vskip3pt%
740− \noindent{\baselineskip10pt\normalfont\reset@font\affilsize\itshape\csname affil\romannumeral\the\tempcount \endcsname\par}%
741− \noindent{\baselineskip10pt\normalfont\affilsize\itshape\csname email\romannumeral\the\tempcount \endcsname\par}%
742−% \ifnum\authorcount>1\ifnum\authorcount>2\ \else \ \and\ \fi\fi%
743− \global\advance\authorcount by -1%
744− \advance\tempcount by 1 %
745− \vskip7pt
746− \repeat
747− \global\authortempcount\tempcount
748− \fi}%
749−%
750−\def\spchapter{\@ifnextchar[{\@@spchapter}{\@@spchapter[]}}
751−
752−\def\@@spchapter[#1]#2{\gdef\@spchapter{#2}}
753−\spchapter{}
754−%
755−\ifindex
756− \def\@maketitle#1{\cleardoublepage\bgroup%
757− {\vspace*{18pt}\indexheadfont
758−\indexname\par}\vskip43pt
759− \egroup
760− }%
761−\else
762−\def\@maketitle#1{%
763− \newpage\null
764− \ifbookreview\vskip-29pt\else\vskip-25\p@\fi%
765− {\centering \sloppy
766− \pe@rl{#1}%
767− \ifsptitle
768− \ifx\@spchapetr\@empty\else{\spchapterfont\@spchapter}\par\vskip7pt\fi%
769− \else
770− \ifsplissue
771− \ifx\@spchapetr\@empty\else{\splissuefont\@spchapter}\par\fi%
772− \else
773− \fi
774− \fi
775− {\normalfont\LARGE\itshape \@title\par}%
776− \ifx\@subtitle\@empty%
777− \else%
778− \vskip8pt%
779− {\subtitlefont \@subtitle\par}%
780−% \vskip4pt%
781− \fi%
782− \vskip 16\p@
783− {%
784− \@authors
785− \par}%
786− }%
787− \ifsptitle\vspace*{-4\p@}\else\vskip 13.5\p@ \fi\ifbookreview\vskip26.5pt\fi%\@plus 2\p@ \@minus 1\p@
788−}
789−\fi
790−\def\abs@header#1{%
791− \vbox{\hrule \@height .25pt \@width30.05pc
792− \vskip 8\p@ \@plus 3\p@ \@minus 1\p@
793− \centerline{\normalfont\normalsize\bfseries #1}}%
794−}
795−
796−\def\abs@body{%
797− \list{}{\leftmargin\z@ \rightmargin\leftmargin
798− \listparindent 1em \parsep \z@ \@plus 1\p@
799− \topsep 8\p@ %\@plus 3\p@ \@minus 1\p@
800− }%
801− \item[]\normalfont\small\rmfamily
802−}
803−
804−\newcommand\abstractname{Abstract}
805−\newenvironment{abstract}
806− {\ifsptitle\vspace*{17.3\p@}\else\fi\abs@header{\abstractname}\abs@body}
807− {\endlist\vbox{\hrule \@height .25pt \@width 30.05pc}%
808− \gdef\abs@header##1{\vskip 2\p@
809− \centerline{\normalfont\normalsize\bfseries ##1}}}
810−
811−\newcommand\capsulename{Capsule Review}
812−\newenvironment{capsule}
813− {\abs@header{\capsulename}\abs@body}
814− {\endabstract}
815−
816−
817−\mark{{}{}}
818−
819−\newcommand\shortauthor[1]{\gdef\@shortauthor{#1}}
820−\gdef\@shortauthor{}
821−
822−\renewcommand\title{\@ifnextchar [{\@titletwo}{\@titleone}}
823−\def\@titleone#1{\gdef\@title{#1}\xdef\@shorttitle{#1}}
824−\def\@titletwo[#1]#2{\gdef\@title{#2}\xdef\@shorttitle{#1}}
825−\gdef\@title{\mbox{}}
826−
827−\newcommand\subtitle[1]{\xdef\@subtitle{#1}}
828−\subtitle{}
829−
830−\newcommand\shorttitle[1]{\xdef\@shorttitle{#1}}
831−
832−\newcommand\volume[1]{\gdef\@volume{#1}}
833−\gdef\@volume{{\normalfont\bfseries 1} (1):}
834−
835−\newcommand\pagerange[1]{\gdef\@pagerange{#1}}
836−\gdef\@pagerange{1--000}
837−
838−\newcommand\pubyear[1]{\gdef\@year{#1}}
839−\gdef\@year{19XX}
840−
841−\newcommand\jdate[1]{\gdef\@jdate{#1}}
842−\gdef\@jdate{January \@year}
843−
844−\newcommand\doi[1]{\gdef\@doi{10.1017/#1}}
845−\gdef\@doi{10.1017/S0000000000000000}
846−
847−%% TB
848−
849−\def\Copyright{\raise.2pt\hbox{\fontsize{8}{8}\selectfont\ooalign{\hfil\raise.9pt\hbox{\hskip-.3pt{\normalfont\fontsize{7.5}{7.5}\selectfont
850−c}}%
851− \hfil\crcr\mathhexbox20D}}}
852−
853−\newcommand\journal[1]{\gdef\@journal{#1}}
854−%
855−\def\pubonline#1{\gdef\@pubonline{#1}}
856−\def\@pubonline{}
857−%
858−\ifonline
859− \def\@journal{%
860− \vbox to 8.6\p@{\noindent\parbox[t]{4.8in}{\normalfont\onlineaffilsize\rmfamily
861− {\itshape JFP\/}\ {\bf \@volume}\ (\@issue):\ \ifonepage\thepage\else\thepage--\pageref{lastpage}\fi* %
862− (First pubd online \@cpyyear)\hskip5pt \Copyright\
863− \@cpyyear\ Cambridge University Press\ doi:\@doi\\[2\p@]
864− *Provisional -- final page numbers to be inserted when paper edition is published}% published
865− \vss}}
866−\else
867− \ifincremental
868− \def\@journal{%
869− \vbox to 8.6\p@{\noindent\parbox[t]{4.8in}{\sluglinefont%
870− {\it JFP\kern-1pt{:}\/}\ page \ifonepage\thepage\else\thepage\ of\ \pageref{lastpage}\fi.\hskip7.5pt %
871− \Copyright\ \@cpyyear\ Cambridge University Press\\[2\p@]
872− doi:\@doi}%
873− \vss}}%
874−\else
875− \def\@journal{%
876− \vbox to 8.6\p@{\noindent\parbox[t]{4.8in}{\sluglinefont%
877− {\itshape JFP\/}\ {\bf \@volume}\ (\@issue):\ \ifonepage\thepage\else\thepage--\pageref{lastpage}\fi, %
878− \@pubyear.\hskip7.5pt \Copyright\
879− \@cpyyear\ Cambridge University Press\\[2\p@]
880− doi:\@doi\hskip5pt \ifx\@pubonline\empty\else First published online \@pubonline\fi\hskip5pt {Printed in the United Kingdom}}%{Printed in the United Kingdom}}%
881− \vss}%
882−}
883−\fi\fi
884−
885−\def\@underjournal{%
886− \vbox to 5.6\p@{\noindent\parbox[t]{4.8in}{\normalfont\affilsize\rmfamily
887− {\itshape Under consideration for publication in
888− J.\ Functional Programming\/}\\[2.5\p@]
889− \ }%
890− \vss}%
891−}
892−%%
893−\def\bookrevmark#1{\gdef\@bookrevmark{#1}}
894−\bookrevmark{Book review}
895−%
896−\def\rhfont{\fontsize{11}{11}\selectfont}
897−%%
898−\def\ps@headings{\let\@mkboth\markboth
899− \def\@oddhead{\hfil{\ifbookreview\fontsize{10}{13}\selectfont\fi\itshape\@shorttitle}\hfil \llap{\rhfont\thepage}}%
900− \def\@evenhead{\rlap{\rhfont\thepage}\hfil\ifbookreview{\fontsize{10}{13}\selectfont\itshape\@bookrevmark}\else\itshape\@authormark\fi\hfil}%
901− \let\@oddfoot\@empty
902− \let\@evenfoot\@oddfoot
903− \def\sectionmark##1{\markboth{##1}{}}%
904− \def\subsectionmark##1{\markright{##1}}%
905−}
906−
907−\def\ps@Empty{%
908− \def\@oddfoot{}%
909− \let\@evenfoot\@oddfoot
910− \def\@evenhead{}%
911− \def\@oddhead{}%
912− \let\@mkboth\markboth
913− \let\chaptermark\@gobble
914− \let\sectionmark\@gobble%
915−}
916−
917−\def\ps@myheadings{\let\@mkboth\@gobbletwo
918− \def\@oddhead{\hfil{\itshape\rightmark}\hfil \llap{\rhfont\thepage}}%
919− \def\@evenhead{\rlap{\rhfont\thepage}\hfil\itshape\leftmark\hfil}%
920− \let\@oddfoot\@empty
921− \let\@evenfoot\@oddfoot
922− \let\sectionmark\@gobble
923− \let\subsectionmark\@gobble
924−}
925−
926−\def\@indjournal{%
927− \vbox to 6.5\p@{\noindent\parbox[t]{4.8in}{\normalfont\affilsize\rmfamily
928− {\itshape J. Functional Programming\/}\ {\bf \@volume}\ (\@issue):\
929−\thepage--\pageref{lastpage}, \@pubyear\hskip7.5pt {Printed in
930−United Kingdom}}%
931− \vss}%
932−}
933−
934−\ifprodtf
935− \let\@j@urnal\@journal
936−\else
937− \let\@j@urnal\@underjournal
938−\fi
939−
940−\def\ps@titlepage{\leftskip\z@ \let\@mkboth\@gobbletwo
941− \def\@oddhead{\ifindex\@indjournal
942−\hfil\hbox{\llap{\rhfont\thepage}}\else\@j@urnal \hfil\raise1.6pt\hbox{\llap{\rhfont\thepage}}\fi}%
943− \let\@evenhead\@oddhead
944− \let\@oddfoot\@empty
945− \let\@evenfoot\@oddfoot
946− \let\sectionmark\@gobble
947− \let\subsectionmark\@gobble
948−}
949−
950−\def\@pnumwidth{1.55em}
951−\def\@tocrmarg {2.55em}
952−\def\@dotsep{4.5}
953−\setcounter{tocdepth}{2}
954−
955−\def\@dottedtocline#1#2#3#4#5{% FROM LATEX.LTX
956− \ifnum #1>\c@tocdepth \else
957− \vskip \z@ \@plus.2\p@
958− {\leftskip #2\relax \rightskip \@tocrmarg \parfillskip -\rightskip
959− \parindent #2\relax\@afterindenttrue
960− \interlinepenalty\@M
961− \leavevmode
962− \@tempdima #3\relax
963− \advance\leftskip \@tempdima \null\hskip -\leftskip
964− {#4}\nobreak
965− \leaders\hbox{$\m@th
966− \mkern \@dotsep mu\hbox{\phantom{.}}\mkern \@dotsep
967− mu$}\hfill
968− \nobreak
969− \hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}%
970− \par}%
971− \fi}
972−
973−\newcommand\contentsname{Contents}
974−
975−\newcommand\tableofcontents{%
976− \section*{\contentsname}%
977− \@starttoc{toc}\par
978− \vspace{13\p@}%
979−}
980−
981−\newcommand*\l@part[2]{%
982− \ifnum \c@tocdepth >-2\relax
983− \addpenalty{-\@highpenalty}%
984− \addvspace{.5\baselineskip \@plus 1\p@}%
985− \begingroup
986− \parindent \z@ \rightskip \@pnumwidth
987− \parfillskip -\@pnumwidth
988− {\leavevmode
989− \normalfont\rmfamily
990− #1\hfil \hb@xt@\@pnumwidth{\hfil}}\par
991− \nobreak
992− \if@compatibility
993− \global\@nobreaktrue
994− \everypar{\global\@nobreakfalse\everypar{}}%
995− \fi
996− \endgroup
997− \vskip .25\baselineskip \@plus 1\p@
998− \fi
999−}
1000−
1001−\newcommand*\l@section[2]{%
1002− \ifnum \c@tocdepth >\z@
1003− \addpenalty\@secpenalty
1004− \setlength\@tempdima{1.5em}%
1005− \begingroup
1006− \parindent \z@ \rightskip \@pnumwidth
1007− \parfillskip -\@pnumwidth
1008− \leavevmode \normalfont\rmfamily
1009− \advance\leftskip\@tempdima
1010− \hskip -\leftskip
1011− {\bfseries #1}\nobreak\hfil \nobreak\hb@xt@\@pnumwidth{\hss #2}\par
1012− \endgroup
1013− \fi}
1014−
1015−\newcommand*\l@subsection{\@dottedtocline{2}{1.5em}{2.3em}}
1016−\newcommand*\l@subsubsection{\@dottedtocline{3}{3.8em}{3.2em}}
1017−\newcommand*\l@paragraph{\@dottedtocline{4}{7.0em}{4.1em}}
1018−\newcommand*\l@subparagraph{\@dottedtocline{5}{10em}{5em}}
1019−
1020−\newcommand\listfigurename{List of Figures}
1021−\newcommand\listoffigures{%
1022− \section*{\listfigurename}%
1023− \@starttoc{lof}\par
1024− \vskip 13\p@
1025−}
1026−
1027−\newcommand*\l@figure{\@dottedtocline{1}{1.5em}{2.3em}}
1028−
1029−\newcommand\listtablename{List of Tables}
1030−\newcommand\listoftables{%
1031− \section*{\listtablename}%
1032− \@starttoc{lot}\par
1033− \vskip 13\p@
1034−}
1035−
1036−\let\l@table\l@figure
1037−
1038−\renewcommand\footnoterule{%
1039− \kern-3\p@
1040− \hrule \@width .4\columnwidth height \z@
1041− \kern 3\p@}
1042−
1043−\newif\iftitlefn
1044−
1045−%%
1046−\newbox\tempbox
1047−\newdimen\@footmax
1048−\def\footmax#1{%
1049− \setbox\tempbox\hbox{\footnotesize$^{#1}$}%
1050− \global\@footmax\wd\tempbox\global\advance\@footmax.5em}
1051−%
1052−\footmax{0}
1053−%%
1054−\newcommand\@makefntext[1]{%
1055− \leavevmode\@hangfrom{\hb@xt@ \@footmax{\hss$\iftitlefn\else^\fi{\@thefnmark}\hskip.5em$}}#1}
1056−%%
1057−
1058−\ifprodtf \else \let\highast\ast\fi
1059−
1060−\def\@fnsymbol#1{\ensuremath{% FROM LATEX.LTX
1061− \ifcase#1\or \hbox{$\highast$}\or \dagger\or \ddagger\or
1062− \mathchar "278\or \mathchar "27B\or \|\or \hbox{$\highast\highast$}\or
1063− \dagger\dagger\or \ddagger\ddagger\or \mathchar "278\mathchar "278\or
1064− \mathchar "27B\mathchar "27B\or \|\|\or \else\@ctrerr\fi}%
1065−}
1066−
1067−\renewcommand\@makefnmark{\hbox{$^{\@thefnmark}$}}% FROM LATEX.LTX
1068−\renewcommand\thefootnote{\@arabic\c@footnote}% FROM LATEX.LTX
1069−\renewcommand\thempfootnote{\mathit{\@alph\c@mpfootnote}}% FROM LATEX.LTX
1070−
1071−\setcounter{topnumber}{2}
1072−\renewcommand\topfraction{.9}
1073−\setcounter{bottomnumber}{1}
1074−\renewcommand\bottomfraction{.9}
1075−\setcounter{totalnumber}{3}
1076−\renewcommand\textfraction{.1}
1077−\renewcommand\floatpagefraction{.9}
1078−\setcounter{dbltopnumber}{2}
1079−\renewcommand\dbltopfraction{.9}
1080−\renewcommand\dblfloatpagefraction{.5}
1081−
1082−\newcounter{table}
1083−\renewcommand\thetable{\@arabic\c@table}
1084−\def\fps@table{tbp}
1085−\def\ftype@table{1}
1086−\def\ext@table{lot}
1087−\newcommand\tablename{Table}
1088−\def\fnum@table{\tablename\ \thetable}
1089−
1090−\newenvironment{table}
1091− {\@float{table}}
1092− {\end@float}
1093−
1094−\newenvironment{table*}
1095− {\@dblfloat{table}}
1096− {\end@dblfloat}
1097−
1098−\def\fstyle@table{\normalfont\small\rmfamily}
1099−\def\fjust@table{\centering}
1100−\def\fcapjust@table{\centering}
1101−\def\fcapsize@table{\normalfont\normalsize\rmfamily}
1102−\def\fcapstyle@table{\normalfont\normalsize\itshape}
1103−
1104−\newcommand\contname{(cont.)}
1105−\newcommand\continuedfigure{%
1106− \addtocounter{figure}\m@ne
1107− \let\curr@thefigure\thefigure
1108− \def\thefigure{\curr@thefigure\ \contname}%
1109−}
1110−
1111−\newcommand\continuedtable{%
1112− \addtocounter{table}\m@ne
1113− \let\curr@thetable\thetable
1114− \def\thetable{\curr@thetable\ \contname}%
1115−}
1116−
1117−\newif\ifrem@fullpt
1118−\newcommand\removefullpoint{\global\rem@fullpttrue}
1119−
1120−\newif\ifbot@fig
1121−\newenvironment{bottomfigure}{\def\fps@figure{b}%
1122− \setcounter{bottomnumber}{1}%
1123− \global\bot@figtrue
1124− \@float{figure}\fstyle@figure}
1125− {\end@float}
1126−
1127−\newbox\@tempboxb
1128−
1129−\def\enskip{\hskip4.5pt}
1130−\long\def\@makecaption#1#2{%
1131− \ifbot@fig \rule{30.05pc}{.25\p@}\fi
1132− \vskip 0\p@ %\@plus .4\p@ \@minus .4\p@
1133− \begingroup
1134− \setbox\@tempboxb\hbox{#2}%
1135− \def\@xtra{\ifdim\wd\@tempboxb>\z@ \ifrem@fullpt\else .\enskip\fi\fi}%
1136− \setbox\@tempboxa\hbox{#1\@xtra #2}%
1137− \ifdim\wd\@tempboxa>\tw@\textwidth
1138− {\let\centering\relax #1\@xtra #2\par}%
1139− \else
1140− #1\@xtra #2\par
1141− \fi
1142− \endgroup
1143− \global\bot@figfalse
1144− \global\rem@fullptfalse
1145−}
1146−
1147−\newcounter{figure}
1148−\renewcommand\thefigure{\@arabic\c@figure}
1149−\def\fps@figure{tbp}
1150−\def\ftype@figure{2}
1151−\def\ext@figure{lof}
1152−\newcommand\figurename{Fig.}
1153−\def\fnum@figure{\figurename\ \thefigure}
1154−
1155−\newenvironment{figure}
1156− {\@float{figure}}
1157− {\end@float}
1158−
1159−\newenvironment{figure*}
1160− {\@dblfloat{figure}}
1161− {\end@dblfloat}
1162−
1163−\def\fstyle@figure{\normalfont\small\rmfamily}
1164−\def\fjust@figure{\centering}
1165−\def\fcapjust@figure{\centering}
1166−\def\fcapsize@figure{\normalfont\small\rmfamily}
1167−\def\fcapstyle@figure{\normalfont\small\rmfamily}
1168−
1169−\long\def\@caption#1[#2]#3{% FROM LATEX.LTX
1170− \par
1171− \addcontentsline{\csname ext@#1\endcsname}{#1}%
1172− {\protect\numberline{\csname the#1\endcsname}{\ignorespaces #2}}%
1173− \begingroup
1174− \@parboxrestore
1175− \if@minipage
1176− \@setminipage
1177− \fi
1178− \normalsize
1179− \@makecaption{\csname fcapjust@#1\endcsname
1180− \csname fcapsize@#1\endcsname
1181− \csname fnum@#1\endcsname}%
1182− {\csname fcapstyle@#1\endcsname \ignorespaces #3}\par
1183− \endgroup
1184−}
1185−
1186−\def\@xfloat #1[#2]{% FROM LATEX.LTX
1187− \@nodocument
1188− \def\@captype {#1}%
1189− \def\@fps {#2}%
1190− \@onelevel@sanitize \@fps
1191− \def \reserved@b {!}%
1192− \ifx \reserved@b \@fps
1193− \@fpsadddefault
1194− \else
1195− \ifx \@fps \@empty
1196− \@fpsadddefault
1197− \fi
1198− \fi
1199− \ifhmode
1200− \@bsphack
1201− \@floatpenalty-\@Mii
1202− \else
1203− \@floatpenalty-\@Miii
1204− \fi
1205− \ifinner
1206− \@parmoderr\@floatpenalty\z@
1207− \else
1208− \@next\@currbox\@freelist
1209− {%
1210− \@tempcnta \sixt@@n
1211− \expandafter \@tfor \expandafter \reserved@a
1212− \expandafter :\expandafter =\@fps
1213− \do
1214− {%
1215− \if \reserved@a h%
1216− \ifodd \@tempcnta
1217− \else
1218− \advance \@tempcnta \@ne
1219− \fi
1220− \fi
1221− \if \reserved@a t%
1222− \@setfpsbit \tw@
1223− \fi
1224− \if \reserved@a b%
1225− \@setfpsbit 4%
1226− \fi
1227− \if \reserved@a p%
1228− \@setfpsbit 8%
1229− \fi
1230− \if \reserved@a !%
1231− \ifnum \@tempcnta>15
1232− \advance\@tempcnta -\sixt@@n\relax
1233− \fi
1234− \fi
1235− }%
1236− \@tempcntb \csname ftype@\@captype \endcsname
1237− \multiply \@tempcntb \@xxxii
1238− \advance \@tempcnta \@tempcntb
1239− \global \count\@currbox \@tempcnta
1240− }%
1241− \@fltovf
1242− \fi
1243− \global \setbox\@currbox
1244− \color@vbox
1245− \normalcolor
1246− \vbox \bgroup
1247− \hsize\columnwidth
1248− \@parboxrestore
1249− \@floatboxreset
1250− \csname fstyle@\@captype\endcsname
1251− \csname fjust@\@captype\endcsname
1252−}
1253−
1254−\let\oldtabular\tabular
1255−\let\endoldtabular\endtabular
1256−
1257−\def\tabular{% FROM LATEX.LTX
1258− \def\@halignto{to \textwidth}\tabskip\tabcolsep \@plus 1fil\@ttabular
1259−}
1260−
1261−\def\@ttabular{\leavevmode \hbox \bgroup $\let\@acol\@tabacol
1262− \let\@classz\@tabclassz
1263− \let\@classiv\@tabclassiv \let\\\@tabularcr\@ttabarray}
1264−
1265−\def\@ttabarray{\m@th\@ifnextchar[\@tarray{\@ttarray}}
1266−
1267−\def\@tarray[#1]#2{\t@barray[#1]{@{\tabskip\tw@\tabcolsep \@plus 3\p@}#2}}
1268−\def\@ttarray#1{\t@barray[c]{@{\tabskip\tw@\tabcolsep \@plus 3\p@}#1}}
1269−
1270−\def\t@barray[#1]#2{%
1271− \if #1t\vtop \else \if#1b\vbox \else \vcenter \fi\fi
1272− \bgroup
1273− \setbox\@arstrutbox\hbox{%
1274− \vrule \@height\arraystretch\ht\strutbox
1275− \@depth\arraystretch \dp\strutbox
1276− \@width\z@}%
1277− \@mkpream{#2}%
1278− \edef\@preamble{%
1279− \halign \noexpand\@halignto
1280− \bgroup \tabskip\z@skip \@arstrut \@preamble \tabskip\tabcolsep \@plus 1fil\cr}%
1281− \let\@startpbox\@@startpbox \let\@endpbox\@@endpbox
1282− \let\tabularnewline\\%
1283− \let\par\@empty
1284− \let\@sharp##%
1285− \set@typeset@protect
1286− \lineskip\z@skip\baselineskip\z@skip
1287− \@preamble}
1288−
1289−\newcommand\ls{\kern.15em\relax}
1290−\newcommand\ns{\kern.55em\relax}
1291−
1292−\def\hline{% FROM LATEX.LTX
1293− \noalign{\ifnum0=`}\fi \vskip 6\p@
1294− \hrule \@height \arrayrulewidth \vskip 6\p@
1295− \futurelet \reserved@a\@xhline}
1296−
1297−\def\@xhline{% FROM LATEX.LTX
1298− \ifx\reserved@a\hline
1299− \vskip -12\p@
1300− \vskip\doublerulesep
1301− \fi
1302− \ifnum0=`{\fi}}
1303−
1304−\newcommand\today{}
1305−\edef\today{\number\day\ \ifcase\month\or
1306− January\or February\or March\or April\or May\or June\or
1307− July\or August\or September\or October\or November\or December
1308− \fi \ \number\year}
1309−
1310−\renewcommand\@biblabel[1]{}% FROM LATEX.LTX
1311−\newcommand\newblock{\hskip .11em \@plus .33em \@minus .07em}
1312−
1313−\newcommand\refname{References}
1314−\newenvironment{thebibliography}[1]
1315− {\section*{\refname}%
1316− \normalfont\small\rmfamily
1317− \addcontentsline{toc}{section}{\refname}%
1318− \list{}{\usecounter{enumiv}\labelwidth\z@ \leftmargin 9pt \itemindent -9pt}%
1319− \parindent\z@
1320− \parskip 2\p@ \@plus .1\p@
1321− \sloppy\clubpenalty\z@ \widowpenalty\@M
1322− \sfcode`\.\@m\relax}
1323− {\def\@noitemerr
1324− {\@latex@warning{Empty `thebibliography' environment}}%
1325− \endlist}
1326−%
1327−%
1328−%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% End Bibliography Section %%%%%%%%%%%%%%%%
1329−\def\@citex[#1]#2{% FROM LATEX.LTX
1330− \let\@citea\@empty
1331− \@cite{\@for\@citeb:=#2\do
1332− {\@citea\def\@citea{; }%
1333− \edef\@citeb{\expandafter\@firstofone\@citeb}%
1334− \if@filesw\immediate\write\@auxout{\string\citation{\@citeb}}\fi
1335− \@ifundefined{b@\@citeb}{\mbox{\reset@font\bfseries ?}%
1336− \G@refundefinedtrue
1337− \@latex@warning
1338− {Citation `\@citeb' on page \thepage \space undefined}}%
1339− {\csname b@\@citeb\endcsname}}}{#1}}
1340−
1341−\def\@cite#1#2{{\if@tempswa #2\else (#1)\fi}}% FROM LATEX.LTX
1342−
1343−\let\@internalcite\cite
1344−\def\cite{\def\citename##1{##1}\@internalcite}
1345−\DeclareRobustCommand\shortcite{\def\citename##1{}\@internalcite}
1346−
1347−\newif\iffontfound
1348−\newcommand\checkfont[1]{%
1349− \batchmode
1350− \font\test=#1\relax
1351− \errorstopmode
1352− \fontfoundfalse
1353− \ifx\test\nullfont \else \fontfoundtrue\fi
1354−}
1355−%%%%%%%%%%%
1356−%
1357−\def\ct@indenttext#1{\parindent24pt{\par\hangindent48pt #1\par}}
1358−\def\ct@Indenttext#1{\parindent48pt{\par\hangindent48pt #1\par}}
1359−%
1360−%
1361−%
1362−\newcount\minute
1363−\newcount\hour
1364−\def\currenttime{%
1365− \minute\time
1366− \hour\minute
1367− \divide\hour60
1368− \the\hour:\multiply\hour60\advance\minute-\hour\the\minute}
1369−%%%%%
1370−\def\gray{\special{color CMYK 0 0 0 0.5}}
1371−\def\@questionmark{\vbox to 0pt{\vskip13pc\hskip-5pc
1372− \hbox to \textwidth{\special{color push}\gray\fontsize{270}{270}\selectfont ?
1373− \special{color pop}\hss}}}
1374−\def\questionmark#1{\xdef\@questionmark{#1}}%
1375−%
1376−\def\@TotalChars{}
1377−\def\TotalChars#1{\xdef\@TotalChars{#1}}%
1378−%%
1379−\def\document{\endgroup
1380− \ifx\@unusedoptionlist\@empty\else
1381− \@latex@warning@no@line{Unused global option(s):^^J%
1382− \@spaces[\@unusedoptionlist]}%
1383− \fi
1384− \@colht\textheight
1385− \@colroom\textheight \vsize\textheight
1386− \columnwidth\textwidth
1387− \@clubpenalty\clubpenalty
1388− \if@twocolumn
1389− \advance\columnwidth -\columnsep
1390− \divide\columnwidth\tw@ \hsize\columnwidth \@firstcolumntrue
1391− \fi
1392− \hsize\columnwidth \linewidth\hsize
1393− \begingroup\@floatplacement\@dblfloatplacement
1394− \makeatletter\let\@writefile\@gobbletwo
1395− \global \let \@multiplelabels \relax
1396− \@input{\jobname.aux}%
1397− \endgroup
1398− \if@filesw
1399− \immediate\openout\@mainaux=\jobname.aux
1400− \immediate\write\@mainaux{\relax}
1401− \fi
1402− \process@table
1403− \let\glb@currsize\@empty %% Force math initialization.
1404− \normalsize
1405− \everypar{}%
1406− \ifx\normalsfcodes\@empty
1407− \ifnum\sfcode`\.=\@m
1408− \let\normalsfcodes\frenchspacing
1409− \else
1410− \let\normalsfcodes\nonfrenchspacing
1411− \fi
1412− \fi
1413− \@noskipsecfalse
1414− \let \@refundefined \relax
1415− \let\AtBeginDocument\@firstofone
1416− \@begindocumenthook
1417− \ifdim\topskip<1sp\global\topskip 1sp\relax\fi
1418− \global\@maxdepth\maxdepth
1419− \global\let\@begindocumenthook\@undefined
1420− \ifx\@listfiles\@undefined
1421− \global\let\@filelist\relax
1422− \global\let\@addtofilelist\@gobble
1423− \fi
1424− \gdef\do##1{\global\let ##1\@notprerr}%
1425− \@preamblecmds
1426− \global\let \@nodocument \relax
1427− \global\let\do\noexpand
1428− \ignorespaces}
1429−%
1430−%%
1431−\def\enddocument{\label{lastpage}%
1432− \@checkend{document}%
1433− \@enddocumenthook
1434− \ifodd\c@page\cleardoublepage\else\clearpage\fi
1435− \begingroup
1436− \if@filesw
1437− \immediate\write\@mainaux{\string\questionmark{}}%
1438− \immediate\closeout\@mainaux
1439− \let\@setckpt\@gobbletwo
1440− \let\@newl@bel\@testdef
1441− \@tempswafalse
1442− \makeatletter
1443− \catcode`\\0
1444− \catcode`\{1
1445− \catcode`\}2
1446− \catcode`\^=7
1447− \catcode`\_=8
1448− \catcode`\&=4
1449− \catcode`\$=3
1450− \catcode`\@11
1451− \catcode`\#6
1452− \catcode`\"=12
1453− \input\jobname.aux
1454− \fi
1455− \@dofilelist
1456− \ifdim \font@submax >\fontsubfuzz\relax
1457− \@font@warning{Size substitutions with differences\MessageBreak
1458− up to \font@submax\space have occured.\@gobbletwo}%
1459− \fi
1460− \@defaultsubs
1461− \@refundefined
1462− \if@filesw
1463− \ifx \@multiplelabels \relax
1464− \if@tempswa
1465− \@latex@warning@no@line{Label(s) may have changed.
1466− Rerun to get cross-references right}%
1467− \fi
1468− \else
1469− \@multiplelabels
1470− \fi
1471− \fi
1472− \endgroup
1473− \deadcycles\z@\@@end}
1474−%%
1475−\def\@outputpage{%
1476−\begingroup % the \endgroup is put in by \aftergroup
1477− \let \protect \noexpand
1478− \@resetactivechars
1479− \@parboxrestore
1480− \shipout \vbox{%
1481− \set@typeset@protect
1482− \aftergroup \endgroup
1483− \aftergroup \set@typeset@protect
1484− % correct? or just restore by ending
1485− % the group?
1486− \if@specialpage
1487− \global\@specialpagefalse\@nameuse{ps@\@specialstyle}%
1488− \fi
1489− \if@twoside
1490− \ifodd\count\z@ \let\@thehead\@oddhead \let\@thefoot\@oddfoot
1491− \let\@themargin\oddsidemargin
1492− \else \let\@thehead\@evenhead
1493− \let\@thefoot\@evenfoot \let\@themargin\evensidemargin
1494− \fi
1495− \fi
1496− \reset@font
1497− \normalsize
1498− \normalsfcodes
1499− \let\label\@gobble
1500− \let\index\@gobble
1501− \let\glossary\@gobble
1502− \baselineskip\z@skip \lineskip\z@skip \lineskiplimit\z@
1503− \@begindvi\trimmarks
1504− \vskip \topmargin
1505− \moveright\@themargin \vbox {%
1506− \setbox\@tempboxa \vbox to\headheight{%
1507− \vfil
1508− \color@hbox
1509− \normalcolor
1510− \hb@xt@\textwidth{\@thehead}%
1511− \color@endbox
1512− }% %% 22 Feb 87
1513− \dp\@tempboxa \z@
1514− \box\@tempboxa
1515− \vskip \headsep
1516− \box\@outputbox
1517− \baselineskip \footskip
1518− \color@hbox
1519− \normalcolor
1520− \hb@xt@\textwidth{\@thefoot}%
1521− \color@endbox
1522− }%
1523− }%
1524− \global \@colht \textheight
1525− \stepcounter{page}%
1526− \let\firstmark\botmark
1527− \ifodd\c@page
1528− \ifspreadlong\global\spreadlongfalse
1529− \enlargethispage{\@spreadlong}\fi
1530− \fi
1531−}
1532−%%%%%
1533−\newif\ifspreadlong
1534−\def\spreadlong#1{\ifodd\c@page\wlog{Ignoring spreadlong}
1535− \else
1536− \spreadlongtrue\gdef\@spreadlong{#1}%
1537− \enlargethispage{#1}%
1538− \fi}
1539−% check specs and enable one or both of these commands
1540−\def\leaflong#1{\enlargethispage{#1}}
1541−%%%%%
1542−\def\trimmarks{%
1543− \vbox to 0pt{%
1544− \vskip-25pt\parindent0pt
1545− \draftnote\offinterlineskip}%
1546− \ifdraft
1547− \vbox to 0pt{\hsize\trimwidth\offinterlineskip
1548− \parindent0pt\leftskip0pt\rightskip0pt
1549− \fboxsep0pt\fboxrule\draftrule
1550− \fbox{\vbox{\vskip\trimheight\hskip\trimwidth}}}%
1551−%
1552− \vbox to 0pt{\hsize\trimwidth\offinterlineskip
1553− \parindent0pt\leftskip0pt\rightskip0pt
1554− \vbox to \trimheight{\offinterlineskip\parindent0pt
1555− \hbox to \trimwidth{\vbox to 2pc{\vskip-3.5pc\hbox{\vrule height2pc width\trimrule}}\raisebox{2pc}{\hbox{\hskip-3.5pc\vrule width2pc height\trimrule}}\hfill
1556− \raisebox{2pc}{\vrule width2pc height\trimrule\hskip-3.75pc}
1557− \vbox to 2pc{\vskip-3.5pc\hbox{\vrule height2pc width\trimrule}}%
1558− }\vfill
1559− \hbox to \trimwidth{\hbox{\hskip-3.5pc\vrule height\trimrule width2pc}\vbox to 3pc{\vspace*{4.5pc}\hbox{\hskip1.5pc\vrule width\trimrule height2pc}}\hfill
1560− \vbox to 3.5pc{\vskip5pc\hbox{\vrule height2pc width\trimrule}}\rlap{\hskip1.5pc\vrule width2pc height\trimrule}}}}%
1561−%
1562− \else
1563− \vbox to 0pt{\hsize\trimwidth\offinterlineskip
1564− \parindent0pt\leftskip0pt\rightskip0pt
1565− \vbox to \trimheight{\offinterlineskip\parindent0pt
1566− \hbox to \trimwidth{\vbox to 2pc{\vskip-3.5pc\hbox{\vrule height2pc width\trimrule}}\raisebox{2pc}{\hbox{\hskip-3.5pc\vrule width2pc height\trimrule}}\hfill
1567− \raisebox{2pc}{\vrule width2pc height\trimrule\hskip-3.75pc}
1568− \vbox to 2pc{\vskip-3.5pc\hbox{\vrule height2pc width\trimrule}}%
1569− }\vfill
1570− \hbox to \trimwidth{\hbox{\hskip-3.5pc\vrule height\trimrule width2pc}\vbox to 3pc{\vspace*{4.5pc}\hbox{\hskip1.5pc\vrule width\trimrule height2pc}}\hfill
1571− \vbox to 3.5pc{\vskip5pc\hbox{\vrule height2pc width\trimrule}}\rlap{\hskip1.5pc\vrule width2pc height\trimrule}}}}
1572−\fi
1573−\insidedraftrules}
1574−%
1575−\def\insidedraftrules{\overfullrule0pt\leftskip0pt\rightskip0pt\vbox to 0pt{%
1576− \offinterlineskip\parindent0pt
1577− \vskip \topmargin
1578− \tempdimen\normaltextheight
1579− \advance\tempdimen\headheight
1580− \advance\tempdimen\headsep
1581− \moveright\@themargin
1582− \vbox{\vbox to 0pt{\vskip\headheight\vskip\headsep\vskip.2pt
1583− \vrule height\draftrule width\textwidth
1584− }
1585− \hbox{\fboxsep0pt\fboxrule\draftrule
1586− \fbox{\vbox to \tempdimen
1587− {\hsize\textwidth\hskip\textwidth}}}}}}%
1588−%
1589−
1590−%%
1591−%%
1592−\usepackage{rotating}
1593−%%
1594−\ifprinter
1595− \def\draftnote{}
1596− \def\Qauthor{}
1597−\else
1598−\def\draftnote{\vbox to 0pt{\vskip-12pt
1599− \hbox{\ \footnotesize}}%\TeXversion
1600− \hbox{\ \footnotesize ZU064-05-FPR\qquad\jobname\qquad\today\qquad\currenttime\qquad %Char Count= \@TotalChars
1601− \@questionmark\hfil}}%
1602− \def\Qauthor#1{\marginpar{{\raggedright\footnotesize\bf #1\endgraf}}}
1603−\fi
1604−%%
1605−\newdimen\figheight
1606−\newdimen\figwidth
1607−%
1608−\def\ArtDir{art/}%
1609−\input epsf.sty
1610−%
1611−\newbox\figtempbox
1612−\def\ArtPiece#1{\epsfbox{\ArtDir#1}}%
1613−%
1614−\def\figurebox#1#2{%
1615− \@ifnextchar[{\@figurebox{#1}{#2}}{\@figurebox{#1}{#2}[]}}
1616−%
1617−\def\@figurebox#1#2[#3]{%
1618− \gdef\@thirdarg{#3}%
1619− \ifx\@thirdarg\empty
1620− \global\figheight=#1
1621− \global\figwidth=#2
1622− \else
1623− \setbox\figtempbox=\hbox{\epsfbox{\ArtDir\@thirdarg}}%
1624− \global\figwidth=\wd\figtempbox
1625− \global\figheight=\ht\figtempbox
1626− \fi
1627− \centerline{\figbox}
1628− \vskip7pt}%
1629−%
1630−\def\figbox{%
1631− \ifx\@thirdarg\empty
1632− \vbox{\vskip.3pt\hsize\figwidth
1633− \hrule\hbox to\figwidth{\vrule\hfill\vbox to\figheight{%
1634− \hsize\figwidth\vfill}\vrule}\hrule}%
1635− \else
1636− \vbox{\hsize\figwidth
1637− \hbox to\figwidth{\vbox to\figheight{\hsize\figwidth\box\figtempbox}}}%
1638− \fi}
1639−%
1640−%
1641−%
1642−\newdimen\tabledim
1643−\newskip\tableleftskip
1644−\newskip\tablerightskip
1645−\newskip\tabnoteleftskip
1646−\newskip\tabnoterightskip
1647−\newdimen\tablewidth
1648−%
1649−
1650−%
1651−\def\tbl#1#2{%
1652− \setbox\tempbox\hbox{\tablefont#2}%
1653− \tabledim\hsize
1654− \advance\tabledim-\wd\tempbox
1655− \ifdim\tabledim>0pt
1656− \divide\tabledim2
1657− \else
1658− \global\tabledim0pt
1659− \fi
1660− \global\tableleftskip\tabledim
1661− \global\tablerightskip\tabledim plus.5fill
1662− \global\tabnoteleftskip\tabledim
1663− \global\tabnoterightskip\tabledim
1664− \caption{\tablefont #1}%
1665− {\centerline{\box\tempbox}}}%
1666−%
1667−\let\bulletlist\itemize
1668−\let\endbulletlist\enditemize
1669−\let\arabiclist\enumerate
1670−\let\endarabiclist\endenumerate
1671−\let\ulist\unnumlist
1672−\let\endulist\endunnumlist
1673−\def\bibauthor#1{{#1}}
1674−\def\x{@{\extracolsep{\fill}}}
1675−\def\tablefont{\fontsize{9}{11}\selectfont}%\leftskip\tableleftskip\rightskip\tablerightskip\mathversion{normal}}% use plus 1fill if needed
1676−\def\tablecaptionfont{\fontsize{10}{12}\selectfont\itshape\leftskip\tableleftskip\rightskip\tablerightskip}%\itshape
1677−\def\tablecaptionnumfont{\reset@font\fontsize{10}{12}\selectfont}%
1678−\def\TCHfont{\fontsize{9}{13}\selectfont}%
1679−\def\TSCHfont{}%
1680−\def\tabnotefont{\fontsize{9}{11}\selectfont\leftskip\tabnoteleftskip\rightskip\tabnoterightskip}% use plus 1fill if needed
1681−\def\toprule{\\[-5pt]\Hline\\[-9pt]\Hline\\[-7.1pt]}
1682−\def\colrule{\\[-7.8pt]\HHline\\[-7pt]}
1683−\def\Colrule{\\[-8.6pt]\HHline\\[-5.2pt]}
1684−\def\botrule{\\[-8.3pt]\Hline\\[-9pt]\Hline}
1685−\def\crule#1{\\[-10.9pt]#1\\[-21.4pt]}
1686−%
1687−\def\Hline{%
1688− \noalign{\ifnum0=`}\fi\hrule \@height .5pt \futurelet%\@height \arrayrulewidth
1689− \@tempa\@xhline}
1690−%
1691−\def\HHline{%
1692− \noalign{\ifnum0=`}\fi\hrule \@height .5pt \futurelet%\@height \arrayrulewidth
1693− \@tempa\@xhline}
1694−%
1695−%
1696−%
1697−\def\pubDate#1{(#1)}
1698−%
1699−\newenvironment{ack}{\par\addvspace{\baselineskip}}{\par}
1700−%
1701−\def\@Afterheading{%
1702− \global\@nobreaktrue
1703− \everypar{%
1704− \if@nobreak
1705− \global\@nobreakfalse
1706− \clubpenalty \@M
1707− \if@afterindent \else
1708− {\setbox\z@\lastbox}%
1709− \fi
1710− \else
1711− \clubpenalty \@clubpenalty
1712− \everypar{}%
1713− \fi}}
1714−%
1715−\def\getBIBNUM#1{%
1716− \expandafter\getstring#1\@}
1717−%
1718−\def\getstring #1#2#3#4\@{\gdef\@@getstr{#1#2#3}}
1719−%
1720−\let\summary\abstract
1721−\let\endsummary\endabstract
1722−\let\makechaptertitle\relax
1723−%
1724−\@namedef{equation*}{$$}
1725−\@namedef{endequation*}{$$}
1726−%
1727−\gdef\zero@{0}
1728−\gdef\REF{ref}
1729−\gdef\removedash#1-#2-#3#4#5#6#7#8#9{%
1730−\gdef\tempa{#2}%
1731−\gdef\tempb{#3}%
1732−\ifx\tempa\REF%
1733−\else%
1734−\ifx\tempb\N%
1735−\expandafter\removezeros#7#8#9%
1736−\else%
1737−\fi%
1738−\fi%
1739−\gdef\tempa{}\gdef\tempb{}}
1740−%
1741−\gdef\N{n}
1742−%
1743−\gdef\removezeros#1#2#3{%
1744−\gdef\tempd{#1}%
1745−\gdef\tempe{#2}%
1746−\gdef\tempf{#3}%
1747−\ifnum\tempd=\zero@%
1748− \ifnum\tempe=\zero@%
1749− $^\tempf$%
1750− \else%
1751− $^{\tempe\tempf}$%
1752− \fi%
1753−\else%
1754− $^{\tempd\tempe\tempf}$%
1755−\fi
1756−\gdef\tempd{}\gdef\tempe{}\gdef\tempf{}}
1757−\newcount\colcount
1758−\newcount\firstcol
1759−\newcount\lastcol
1760−\def\getCOLNUM#1#2{
1761−\global\colcount\expandafter\getnumber#2
1762−\global\advance\colcount-\expandafter\getnumber#1
1763−\global\advance\colcount1
1764−\global\firstcol\expandafter\getnumber#1
1765−\global\lastcol\expandafter\getnumber#2}
1766−%
1767−%\def\getnumber col#1{#1}
1768−\def\getnumber #1{#1}
1769−%
1770−\gdef\removexref#1-#2-#3#4#5#6#7#8{%
1771−\thechapter.\expandafter\removexzeros#6#7#8}
1772−%
1773−\gdef\removehash#1#2{#2}
1774−\gdef\removexzeros#1#2#3{%
1775−\gdef\tempd{#1}%
1776−\gdef\tempe{#2}%
1777−\gdef\tempf{#3}%
1778−\ifnum\tempd=\zero@%
1779− \ifnum\tempe=\zero@%
1780−{\tempf}%
1781− \else%
1782−{\tempe\tempf}%
1783− \fi%
1784−\else%
1785−{\tempd\tempe\tempf}%
1786−\fi
1787−\gdef\tempd{}\gdef\tempe{}\gdef\tempf{}}
1788−%
1789−\newif\ifframed
1790−\newif\ifnotablenum
1791−%
1792−\renewcommand{\textellipsis}{%
1793− .\kern\fontdimen3\font
1794− .\kern\fontdimen3\font
1795− .\kern\fontdimen3\font}
1796−%
1797−%
1798−\let\thenotes\Notes
1799−\let\endthenotes\endNotes
1800−\let\endnote\Enote
1801−\def\listhead#1{}
1802−\let\parahead\prhead
1803−%
1804−\let\@chaptertitle\@chaptitle
1805−%
1806−\def\Pound{\hbox{\char'243}}%
1807−%
1808−\newbox\tempbox
1809−%
1810−\def\pubyear#1{\gdef\@pubyear{#1}}%\pubyear{2002}
1811−\def\cpyyear#1{\gdef\@cpyyear{#1}}%\pubyear{2002}
1812−\cpyyear{}
1813−%\def\volume#1{\gdef\@volume{#1}}%\volume{xxx}
1814−\def\issue#1{\gdef\@issue{#1}}%\volume{xxx}
1815−\issue{}
1816−\def\doi#1{\gdef\@doi{#1}}%\doi{10.1017$/$S002211200100622X}
1817−%
1818−\let\chapter\title
1819−%
1820−\def\indexfont{\fontsize{9}{10}\selectfont}
1821−%
1822−\def\alphabet#1{{\bf#1}\par\vskip.5\baselineskip}
1823−
1824−%
1825−\def\indexheadfont{\fontsize{18.5}{20.5}\selectfont\bfseries\centering}
1826−\newcommand\indexname{Author index}
1827−\newenvironment{theindex}[2][\relax]{\thispagestyle{empty}\authormark{\indexname}%\global\indextrue%%
1828− \ifx#2\relax\else\gdef\indexname{#2}\fi%
1829− \ifx#1\relax\else\gdef\indexhead{#1}\fi%
1830− \maketitle\indexfont%
1831− \parindent\z@
1832− \let\item\@idxitem
1833−}{%
1834− \par%\global\indexfalse
1835−}
1836−\newcommand\@idxitem {\par\hangindent9pt}
1837−\newcommand\subitem {\par\hangindent2em\hspace*{1em}}
1838−\newcommand\subsubitem{\par\hangindent2em\hspace*{2em}}
1839−\newcommand\indexspace{\par \vskip\baselineskip}
1840−%
1841−\newenvironment{indexpara}{\setbox\tempbox\hbox\bgroup}{\egroup}
1842−\def\au#1{{\indexfont\scshape#1}}
1843−\def\ttl#1{{\indexfont#1}}
1844−%
1845−%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1846−
1847−%\newcommand\email[1]{\par{\normalfont\rmfamily
1848−% \itshape\textup{(}e-mail: \textup{\texttt{#1})}}\par}
1849−
1850−\edef\r@{\ifprodtf mtr\else cmr\fi}
1851−%\edef\s@{\ifprodtf mtss\else cmr\fi}
1852−
1853−\let\real@font@warning\@font@warning
1854−\DeclareMathVersion{program}
1855−\let\@font@warning\@gobble
1856−\SetSymbolFont{letters}{program}{OT1}{\r@}{m}{sl}
1857−\let\@font@warning\real@font@warning
1858−\SetMathAlphabet{\mathnormal}{program}{OT1}{\r@}{m}{sl}
1859−
1860−
1861−\newcommand{\programmath}{\mathversion{program}}
1862−\newcommand{\unprogrammath}{\mathversion{normal}}
1863−\newcommand{\figrule}{\begin{center}\hrule\end{center}}
1864−
1865−\DeclareRobustCommand\dplus{\mathbin{+\!\!+}}
1866−\DeclareRobustCommand\dequals{\mathbin{==}}
1867−\DeclareRobustCommand\dcolon{\mathbin{::}}
1868−\DeclareRobustCommand\dcolonequals{\mathbin{::=}}
1869−
1870−\pagestyle{headings}
1871−\pagenumbering{arabic}
1872−\frenchspacing
1873−\flushbottom
1874−
1875−\def\parahead#1{}
1876−
1877−\ifprinter
1878−\voffset-18.4mm
1879−\hoffset-25.4mm
1880−\else
1881−\voffset2.3pc
1882−\hoffset-1pc
1883−\fi
1884−%%
1885−\ifcompmod
1886−\else
1887− \usepackage{mathptmx,bm}
1888− \DeclareMathVersion{bold}
1889− \usepackage{amsfonts}
1890−\fi
1891−%%
1892−\endinput
1893−
1894−% end of file jfp.cls
papers/impl-paper/library.bibdeleted−2295
@@ -1,2295 +0,0 @@
1−Automatically generated by Mendeley 1.6
2−Any changes to this file will be lost if it is regenerated by Mendeley.
3−
4−@article{McBride2007,
5−author = {McBride, Conor and Paterson, Ross},
6−file = {:Users/edwin/Documents/Mendeley Desktop/McBride, Paterson/Applicative programming with effects/McBride, Paterson - Applicative programming with effects - 2008.pdf:pdf},
7−journal = {Journal of functional programming},
8−number = {1},
9−pages = {1----13},
10−title = {{Applicative programming with effects}},
11−url = {http://journals.cambridge.org/abstract_S0956796807006326},
12−volume = {18},
13−year = {2008}
14−}
15−@inproceedings{McBride2006,
16−author = {McBride, C and Goguen, H and McKinna, J},
17−booktitle = {Types for Proofs and Programs {(TYPES 2006)}},
18−title = {{A few constructions on constructors}},
19−url = {http://www.springerlink.com/index/P4863U0M41396254.pdf},
20−year = {2006}
21−}
22−@article{McBride2005,
23−author = {McBride, Conor},
24−editor = {Vene, Varmo and Uustalu, Tarmo},
25−isbn = {3540285407},
26−journal = {Advanced Functional Programming},
27−keywords = {Dependent Types},
28−mendeley-tags = {Dependent Types},
29−pages = {130--170},
30−publisher = {Springer},
31−series = {Lecture Notes in Computer Science},
32−title = {{Epigram: Practical programming with dependent types}},
33−url = {http://www.springerlink.com/index/96j7v5vn8tyebeky.pdf},
34−volume = {3622},
35−year = {2005}
36−}
37−@article{Okasaki1993,
38−author = {Okasaki, Chris},
39−file = {:Users/edwin/Documents/Mendeley Desktop/Okasaki/Red-Black Trees in A Functional Setting/Okasaki - Red-Black Trees in A Functional Setting - 1993.pdf:pdf},
40−journal = {Journal of functional programming},
41−title = {{Red-Black Trees in A Functional Setting}},
42−year = {1993}
43−}
44−@inproceedings{Hancock2000,
45−author = {Hancock, Peter and Setzer, Anton},
46−booktitle = {{Proceedings of the 14th Annual Conference of the EACSL on Computer Science Logic}},
47−file = {:Users/edwin/Documents/Mendeley Desktop/Hancock, Setzer/Interactive Programs in Dependent Type Theory/Hancock, Setzer - Interactive Programs in Dependent Type Theory - 2000.pdf:pdf},
48−isbn = {3-540-67895-6},
49−month = aug,
50−pages = {317--331},
51−title = {{Interactive Programs in Dependent Type Theory}},
52−url = {http://dl.acm.org/citation.cfm?id=647850.737221},
53−year = {2000}
54−}
55−@article{Turner2004,
56−author = {Turner, D A},
57−file = {:Users/edwin/Documents/Mendeley Desktop/Turner/Total Functional Programming/Turner - Total Functional Programming - 2004.pdf:pdf},
58−journal = {Journal of Universal Computer Science},
59−keywords = {functional programming},
60−number = {7},
61−pages = {751----768},
62−title = {{Total Functional Programming}},
63−volume = {10},
64−year = {2004}
65−}
66−@phdthesis{norell2007thesis,
67−author = {Norell, Ulf},
68−file = {:Users/edwin/Documents/Mendeley Desktop/Norell/Towards a practical programming language based on dependent type theory/Norell - Towards a practical programming language based on dependent type theory - 2007.pdf:pdf},
69−keywords = {Dependent Types},
70−mendeley-tags = {Dependent Types},
71−publisher = {Citeseer},
72−school = {Chalmers University of Technology},
73−title = {{Towards a practical programming language based on dependent type theory}},
74−url = {http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.65.7934&amp;rep=rep1&amp;type=pdf},
75−year = {2007}
76−}
77−@article{Wu,
78−annote = {1,3
79−
80−
81−This paper describes a solution, in Haskell, of the 2012 ICFP Programming Contest task, explaining in particular how Haskell's laziness and higher order functions helped to build a solution in limited time. I enjoyed reading this paper as an experience report - it provides evidence for the importance of high level features such as purity and laziness (for example when describing the GameTrie), and shows that Haskell can handle more realistic, practical, problems such as concurrency and exceptions (for example when dealing gracefully with timeout and communication between solving threads).
82−
83−
84−My main concern with the paper is that it reads as if the reader is already familiar with the contest task. It would be useful to be more precise about the task itself in the introduction, rather than by making it implicit from the code samples. Section 1.1 describes the problem, but only in general terms - I think it would be worth extending this, and correspondingly removing some of the code. In particular, 'stepRobot' and 'updRocks' would probably be fine just with their type signatures if the problem specification was more precise.
85−
86− },
87−author = {Wu, Nicolas and Magalh\~{a}es, Jos\'{e} Pedro and Bransen, Jeroen and Swierstra, Wouter},
88−file = {:Users/edwin/Documents/Mendeley Desktop/Wu et al/Pure and Lazy Lambda Mining/Wu et al. - Pure and Lazy Lambda Mining - Unknown.pdf:pdf},
89−title = {{Pure and Lazy Lambda Mining}}
90−}
91−@inproceedings{NanevskiAAMorrisett2008,
92−abstract = {We describe an axiomatic extension to the Coq proof assistant, that supports writing, reasoning about, and extracting higher-order, dependently-typed programs with side-effects. Coq already includes a powerful functional language that supports dependent types, but that language is limited to pure, total functions. The key contribution of our extension, which we call Ynot, is the added support for computations that may have effects such as non-termination, accessing a mutable store, and throwing/catching exceptions. The axioms of Ynot form a small trusted computing base which has been formally justified in our previous work on Hoare Type Theory (HTT). We show how these axioms can be combined with the powerful type and abstraction mechanisms of Coq to build higher-level reasoning mechanisms which in turn can be used to build realistic, verified software components. To substantiate this claim, we describe here a representative series of modules that implement imperative finite maps, including support for a higher-order (effectful) iterator. The implementations range from simple (e.g., association lists) to complex (e.g., hash tables) but share a common interface which, abstracts the implementation details and ensures that the modules properly implement the finite map abstraction. Copyright 2008 ACM.},
93−author = {{Nanevski A A Morrisett}, G B Shinnar A B Govereau P B Birkedal L C},
94−booktitle = {International Conference on Functional Programming},
95−doi = {10.1145/1411204.1411237},
96−file = {:Users/edwin/Documents/Mendeley Desktop/Nanevski A A Morrisett/Ynot Dependent types for imperative programs/Nanevski A A Morrisett - Ynot Dependent types for imperative programs - 2008.pdf:pdf},
97−isbn = {9781595939197},
98−issn = {15232867},
99−keywords = {Dependent Types},
100−mendeley-tags = {Dependent Types},
101−number = {9},
102−pages = {229--240},
103−title = {{Ynot: Dependent types for imperative programs}},
104−url = {http://www.scopus.com/inward/record.url?eid=2-s2.0-67650032847&partnerID=40&md5=7a5be3083878399cebafda33b1affa6b},
105−volume = {43},
106−year = {2008}
107−}
108−@article{Walt,
109−annote = {-1, 5
110−
111−
112−This paper describes the use of Agda's reflection mechanism to help with proof automation, and gives some simple examples, including proving evenness of natural numbers and proving that a boolean formula is a tautology.
113−
114−
115−It seems that proof automation is important for a practical language with dependent types, and Agda's reflection mechanism as described is likely to help. However, this paper only really scratches the surface of what is possible - existing (unpublished, as far as I'm aware) examples such as the Ring solver go much further towards demonstrating its value.
116−
117−
118−The 'Evenness' example uses a lot of space for something pretty simple. An in practice, the number won't necessarily be known. What if you know "Even x" and need to prove "Even (x + 100)". Does it still work? Similarly for the tautology example - what if there is an unknown formula which is nevertheless known to be a tautology? It would be nice, therefore, to show how such proof obligations come up in practice and how the reflection techniques described help. Without this, it's not clear that the paper answers the given central question of whether Agda's reflective capabilities are sufficient and practically usable.
119−
120−
121−In summary: there's some nice tutorial material here describing reflection and its application, but I don't think there is enough depth for it to be really interesting.
122−
123−
124−Minor comments
125−
126−
127−The fonts and layout look wrong. Is this the proper LaTeX class? Also remember that the colour won't come out in print...
128−
129−
130−p2 "new" keywords seems wrong for a technique was has been aroundfor a couple of years. I know it hasn't been written up elsewhere, but I'd omit the word "new"
131−
132−
133−p3 "This is why we have decidable equality" - can you explain what you mean by this, for the non-Agda expert?
134−
135−
136−Vars are naturals - so they are de Bruijn indexed?
137−
138−
139−p5 "Other terms are rejected" - what does it mean for a term to be rejected? i.e. what is the effect? The text hints that this is a type error, since there is a suggestion that a proof is needed to show it is valid, but it would be good to be explicit.
140−
141−
142−p8 I'm not sure I'd go as far as to say it's "trivial" to show that (1) is a tautology, but I agree it should be easy, if tedious.},
143−author = {Walt, Paul Van Der and Swierstra, Wouter},
144−file = {:Users/edwin/Documents/Mendeley Desktop/Walt, Swierstra/Engineering Proof by Reflection in Agda/Walt, Swierstra - Engineering Proof by Reflection in Agda - Unknown.pdf:pdf},
145−title = {{Engineering Proof by Reflection in Agda}}
146−}
147−@misc{Haskell98,
148− author = {{Peyton-Jones}, Simon and Hughes, John and Augustsson, Lennart and Barton, Dave and Boutel, Brian and Burton, Warren and Fasel, Joseph and Hammond, Kevin and Hinze, Ralf and Hudak, Paul and Johnsson, Thomas and Jones, Mark and Launchbury, John and Meijer, Erik and Peterson, John and Reid, Alastair and Runciman, Colin and Wadler, Philip},
149− citeulike-article-id = {4034405},
150− comment = {Available from \url{http://www.haskell.org/onlinereport/}},
151− keywords = {file-import-09-02-11, postdoc\_bib},
152− posted-at = {2009-02-11 10:55:50},
153− priority = {2},
154− title = {{The Haskell 98 Report}},
155− year = {1999}
156−}
157−@inproceedings{madhavapeddy2007melange,
158−author = {Madhavapeddy, A. and Ho, A. and Deegan, T. and Scott, D. and Sohan, R.},
159−booktitle = {ACM SIGOPS Operating Systems Review},
160−file = {:Users/edwin/Documents/Mendeley Desktop/Madhavapeddy et al/Melange creating a functional internet/Madhavapeddy et al. - Melange creating a functional internet - 2007.pdf:pdf},
161−number = {3},
162−pages = {101--114},
163−publisher = {ACM},
164−title = {{Melange: creating a functional internet}},
165−url = {http://dl.acm.org/citation.cfm?id=1273009},
166−volume = {41},
167−year = {2007}
168−}
169−@inproceedings{czarnecki2004dsl,
170−author = {Czarnecki, K. and O’Donnell, J. and Striegnitz, J. and Taha, W.},
171−booktitle = {Domain-Specific Program Generation},
172−file = {:Users/edwin/Documents/Mendeley Desktop/Czarnecki et al/DSL implementation in MetaOCaml, Template Haskell, and C/Czarnecki et al. - DSL implementation in MetaOCaml, Template Haskell, and C - 2004.pdf:pdf},
173−pages = {51--72},
174−publisher = {Springer},
175−title = {{DSL implementation in MetaOCaml, Template Haskell, and C++}},
176−url = {http://www.springerlink.com/index/NL620EL7N94M161H.pdf},
177−year = {2004}
178−}
179−@article{Wadler2001,
180−abstract = {The use of monads to structure functional programs is described. Monads provide a convenient framework for simulating effects found in other languages, such as global state, exception handling, output, or non-determinism. Three case studies are looked at in detail: how monads ease the modification of a simple evaluator; how monads act as the basis of a datatype of arrays subject to in-place update; and how monads can be used to build parsers.},
181−author = {Wadler, Philip},
182−doi = {10.1007/3-540-59451-5_2},
183−editor = {Jeuring, Johan and Meijer, Erik},
184−file = {:Users/edwin/Documents/Mendeley Desktop/Wadler/Monads for functional programming/Wadler - Monads for functional programming - 2001.pdf:pdf},
185−isbn = {3540594515},
186−issn = {03029743},
187−journal = {Advanced Functional Programming},
188−number = {August 1992},
189−pages = {24--52},
190−publisher = {Springer},
191−series = {Lecture Notes in Computer Science},
192−title = {{Monads for functional programming}},
193−url = {http://www.springerlink.com/index/715264614rh13340.pdf},
194−volume = {925},
195−year = {2001}
196−}
197−@phdthesis{Boquist1999,
198−author = {Boquist, Urban},
199−file = {:Users/edwin/Documents/Mendeley Desktop/Boquist/Code optimisation techniques for lazy functional languages/Boquist - Code optimisation techniques for lazy functional languages - 1999.pdf:pdf},
200−title = {{Code optimisation techniques for lazy functional languages}},
201−url = {http://mirror.seize.it/papers/Code Optimization Techniques for Lazy Functional Languages.pdf},
202−year = {1999}
203−}
204−@inproceedings{Taha2003,
205−author = {Taha, Walid and Nielsson, Michael Florentin},
206−booktitle = {Principles of Programming Languages},
207−file = {:Users/edwin/Documents/Mendeley Desktop/Taha, Nielsson/Environment Classifiers/Taha, Nielsson - Environment Classifiers - 2003.pdf:pdf},
208−isbn = {1581136285},
209−keywords = {linear,modal logic,multi-stage programming,temporal logic,type safety,type systems},
210−title = {{Environment Classifiers}},
211−year = {2003}
212−}
213−@article{Brady2012a,
214−author = {{Peyton Jones}, S.L.},
215−doi = {10.1093/geront/gns026},
216−file = {:Users/edwin/Documents/Mendeley Desktop/Peyton Jones/Beautiful Code Chapter 24/Peyton Jones - Beautiful Code Chapter 24 - 2012.pdf:pdf},
217−isbn = {9780596510046},
218−issn = {1758-5341},
219−journal = {The Gerontologist},
220−month = dec,
221−number = {6},
222−pages = {NP},
223−pmid = {23150082},
224−title = {{Beautiful Code Chapter 24}},
225−url = {http://www.ncbi.nlm.nih.gov/pubmed/23150082},
226−volume = {52},
227−year = {2012}
228−}
229−@article{mcbride2010ornamental,
230−author = {McBride, Conor},
231−file = {:Users/edwin/Documents/Mendeley Desktop/McBride/Ornamental algebras, algebraic ornaments/McBride - Ornamental algebras, algebraic ornaments - 2010.pdf:pdf},
232−journal = {Journal of Functional Programming},
233−title = {{Ornamental algebras, algebraic ornaments}},
234−url = {http://personal.cis.strath.ac.uk/$\sim$conor/pub/OAAO/Ornament.pdf},
235−year = {2010}
236−}
237−@inproceedings{Gall2012,
238−author = {Gall, Yann Le and Lee, Adam J and Kapdia, Apu},
239−booktitle = {SCMAT},
240−file = {:Users/edwin/Documents/Mendeley Desktop/Gall, Lee, Kapdia/PlexC A Policy Language for Exposure Control/Gall, Lee, Kapdia - PlexC A Policy Language for Exposure Control - 2012.pdf:pdf},
241−isbn = {9781450312950},
242−keywords = {exposure,policy languages,privacy},
243−pages = {219--228},
244−title = {{PlexC : A Policy Language for Exposure Control}},
245−year = {2012}
246−}
247−@article{Campbell-moore,
248−author = {Campbell-moore, Catrin},
249−file = {:Users/edwin/Documents/Mendeley Desktop/Campbell-moore/A Computable Infinitary Logic/Campbell-moore - A Computable Infinitary Logic - Unknown.pdf:pdf},
250−pages = {1--10},
251−title = {{A Computable Infinitary Logic}}
252−}
253−@misc{Resolution2012a,
254−author = {Fall, Kevin R and Stevens, W. Richard},
255−doi = {10.1093/epirev/mxr031},
256−file = {:Users/edwin/Documents/Mendeley Desktop/Fall, Stevens/TCPIP Illustrated Volume 1 Chapter 11/Fall, Stevens - TCPIP Illustrated Volume 1 Chapter 11 - Unknown.pdf:pdf},
257−issn = {1478-6729},
258−pmid = {22215642},
259−title = {{TCP/IP Illustrated Volume 1 Chapter 11}}
260−}
261−@inproceedings{Pasalic2002,
262−author = {Pa\v{s}alic, Emir and Taha, Walid and Sheard, Tim},
263−booktitle = {International Conference on Functional Programming},
264−doi = {10.1145/583852.581499},
265−file = {:Users/edwin/Documents/Mendeley Desktop/Pa\v{s}alic, Taha, Sheard/Tagless staged interpreters for typed languages/Pa\v{s}alic, Taha, Sheard - Tagless staged interpreters for typed languages - 2002.pdf:pdf},
266−isbn = {1-58113-487-8},
267−issn = {03621340},
268−keywords = {calculus of constructions,definitional interpreters,domain-specific languages,multi-stage programming},
269−month = sep,
270−number = {9},
271−pages = {218--229},
272−title = {{Tagless staged interpreters for typed languages}},
273−url = {http://dl.acm.org/citation.cfm?id=583852.581499},
274−volume = {37},
275−year = {2002}
276−}
277−@book{Projects,
278−author = {Hunt, Andrew and Thomas, David},
279−file = {:Users/edwin/Documents/Mendeley Desktop/Hunt, Thomas/The Pragmatic Programmer Chapter 8/Hunt, Thomas - The Pragmatic Programmer Chapter 8 - Unknown.pdf:pdf},
280−isbn = {020161622X},
281−title = {{The Pragmatic Programmer Chapter 8}}
282−}
283−@inproceedings{Wadler1989,
284−abstract = {From the type of a polymorphic function we can derive a theorem that it satisfies. Every function of the same type satisfies the same theorem. This provides a free source of useful theorems, courtesy of Reynolds' abstraction theorem for the polymorphic lambda calculus.},
285−author = {Wadler, Philip},
286−booktitle = {Proceedings of the fourth international conference on Functional programming languages and computer architecture},
287−doi = {10.1145/99370.99404},
288−file = {:Users/edwin/Documents/Mendeley Desktop/Wadler/Theorems for free!/Wadler - Theorems for free! - 1989.pdf:pdf},
289−isbn = {0897913280},
290−number = {June},
291−pages = {347--359},
292−publisher = {ACM},
293−series = {FPCA '89},
294−title = {{Theorems for free!}},
295−url = {http://portal.acm.org/citation.cfm?id=99404},
296−year = {1989}
297−}
298−@inproceedings{swierstra2007beauty,
299−author = {Swierstra, W. and Altenkirch, T.},
300−booktitle = {Proceedings of the ACM SIGPLAN workshop on Haskell workshop},
301−file = {:Users/edwin/Documents/Mendeley Desktop/Swierstra, Altenkirch/Beauty in the beast/Swierstra, Altenkirch - Beauty in the beast - 2007.pdf:pdf},
302−pages = {25--36},
303−publisher = {ACM},
304−title = {{Beauty in the beast}},
305−url = {http://dl.acm.org/citation.cfm?id=1291206},
306−year = {2007}
307−}
308−@inproceedings{Xi1999,
309−abstract = {Note: OCR errors may be found in this Reference List extracted from the full text article. ACM has opted to expose the complete List rather than only correct and linked references.},
310−author = {Xi, Hongwei and Pfenning, Frank},
311−booktitle = {Proceedings of the 26th ACM SIGPLANSIGACT symposium on Principles of programming languages POPL 99},
312−doi = {10.1145/292540.292560},
313−file = {:Users/edwin/Documents/Mendeley Desktop/Xi, Pfenning/Dependent types in practical programming/Xi, Pfenning - Dependent types in practical programming - 1999.pdf:pdf},
314−isbn = {1581130953},
315−issn = {07439016},
316−keywords = {Dependent Types},
317−mendeley-tags = {Dependent Types},
318−organization = {Carnegie Mellon University},
319−pages = {214--227},
320−publisher = {ACM Press},
321−series = {POPL '99},
322−title = {{Dependent types in practical programming}},
323−url = {http://portal.acm.org/citation.cfm?doid=292540.292560},
324−volume = {26},
325−year = {1999}
326−}
327−@inproceedings{Kimmell2012,
328−author = {Kimmell, G and Stump, A and {Eades III}, HD and Fu, Peng and Sheard, Tim and Weirich, S and Casinghino, C and Sj\"{o}berg, V and Collins, N and Ahn, KY},
329−booktitle = {{Proceedings of the 6th {ACM} workshop on Programming Languages Meets Program Verification - PLPV '12}},
330−file = {:Users/edwin/Documents/Mendeley Desktop/Kimmell et al/Equational reasoning about programs with general recursion and call-by-value semantics/Kimmell et al. - Equational reasoning about programs with general recursion and call-by-value semantics - 2012.pdf:pdf},
331−title = {{Equational reasoning about programs with general recursion and call-by-value semantics}},
332−url = {http://dl.acm.org/citation.cfm?id=2103780},
333−year = {2012}
334−}
335−@article{mccann2000packet,
336−author = {McCann, P.J. and Chandra, S.},
337−journal = {ACM SIGCOMM Computer Communication Review},
338−number = {4},
339−pages = {321--333},
340−publisher = {ACM},
341−title = {{Packet types: abstract specification of network protocol messages}},
342−url = {http://dl.acm.org/citation.cfm?id=347563},
343−volume = {30},
344−year = {2000}
345−}
346−@misc{Ferreira2012,
347−annote = {This paper explains how to compile Beluga, a programming language with higher order abstract syntax which is specifically designed to support data structures with binders. In particular, it aims to make it easy to reason about metatheory of programming languages by supporting name generation, alpha conversion and capture avoiding substitution.
348−
349−
350−In general, I liked this paper, primarily because it tackles an underrepresented problem - namely, taking a high level language with support for theorem proving and dependent types, and generating efficient executable code. This is clearly important if such high level languages are to be useful in practice, and even to demonstrate the usefulness and power of the language on anything other than small scale examples.
351−
352−
353−I think this paper can be accepted, though I have some small comments and suggestions for improvements:
354−
355−
356−The introductory example in section 2 provides a generally clear introduction to contextual objects, motivating the problem with a well-understood example. However, it would be nice to say more here about what the target of the compilation is (otherwise I'm not sure what you mean by using "simple names" here). You say: "The output is a fully annotated program using a representation close to the one presented by Cave and Pientka" - as well as the reference it would be very useful here to summarise what that representation is. There are a couple of instances of this, where some background is assumed, which would be good to explain in a couple of sentences in the early sections - e.g. it would also be useful to say what you mean by "Fresh-Style" earlier on.
357−
358−
359−Section 4 - maybe give the informal description of fresh binders earlier?
360−
361−
362−p6-7 On dependency erasure - "The compiler keeps the simple types as a way of sanity check" - is this always true? It isn't true in general for dependent types (consider, for example, a function which computes a simple type) and certainly not with more aggressive dependency erasure such as forcing of constructor arguments which is implemented in Agda and Idris, for example.
363−
364−
365−p9 It seems that the type system is strong enough to support some optimisations on pattern match compilation - such as Epigram's detagging, where the result of a case split on one value informs what another value should be.
366−
367−
368−In related work, you don't mention any other compilers for dependently typed languages which have to tackle similar problems, though you do mention program extraction for Coq. There is also MAlonzo, which translates Agda to Haskell, and Epic (Trends in Functional Programming), used by Epigram, Agda and Idris, which deals with naming though in a much more limited way than this paper.},
369−author = {Ferreira, Francisco and Monnier, Stefan and Pientka, Brigitte},
370−file = {:Users/edwin/Documents/Mendeley Desktop/Ferreira, Monnier, Pientka/Compiling Contextual Objects Bringing Higher-Order Abstract Syntax to Programmers/Ferreira, Monnier, Pientka - Compiling Contextual Objects Bringing Higher-Order Abstract Syntax to Programmers - 2012.pdf:pdf},
371−keywords = {compilation,contextual objects,pattern matching},
372−title = {{Compiling Contextual Objects Bringing Higher-Order Abstract Syntax to Programmers}},
373−year = {2012}
374−}
375−@misc{The2012b,
376−author = {Brooks, Fred},
377−doi = {10.1093/epirev/mxr031},
378−file = {:Users/edwin/Documents/Mendeley Desktop/Brooks/The Design of Design Chapter 1/Brooks - The Design of Design Chapter 1 - Unknown.pdf:pdf},
379−isbn = {9780321702081},
380−issn = {1478-6729},
381−pmid = {22215642},
382−title = {{The Design of Design Chapter 1}}
383−}
384−@book{peyton1987implementation,
385−author = {{Peyton Jones}, S.L.},
386−publisher = {Prentice-Hall, Inc.},
387−title = {{The implementation of functional programming languages (prentice-hall international series in computer science)}},
388−url = {http://dl.acm.org/citation.cfm?id=1096899},
389−year = {1987}
390−}
391−@article{Miller1992,
392−author = {Miller, Dale},
393−file = {:Users/edwin/Documents/Mendeley Desktop/Miller/Unification under a mixed prefix/Miller - Unification under a mixed prefix - 1992.pdf:pdf},
394−journal = {Journal of Symbolic Computation},
395−title = {{Unification under a mixed prefix}},
396−url = {http://www.sciencedirect.com/science/article/pii/074771719290011R},
397−year = {1992},
398−volume = {14},
399−pages = {321--358}
400−}
401−@inproceedings{Danielsson2010,
402−author = {Danielsson, Nils Anders},
403−booktitle = {International Conference on Functional Programming},
404−doi = {10.1145/1932681.1863585},
405−file = {:Users/edwin/Documents/Mendeley Desktop/Danielsson/Total parser combinators/Danielsson - Total parser combinators - 2010.pdf:pdf},
406−isbn = {978-1-60558-794-3},
407−issn = {03621340},
408−keywords = {dependent types,mixed induction and coinduction,parser combinators,productivity,termination},
409−month = sep,
410−number = {9},
411−pages = {285},
412−title = {{Total parser combinators}},
413−url = {http://dl.acm.org/citation.cfm?id=1932681.1863585},
414−volume = {45},
415−year = {2010}
416−}
417−@inproceedings{augustsson1999exercise,
418−author = {Augustsson, L. and Carlsson, M.},
419−booktitle = {In Workshop on Dependent Types in Programming, Gothenburg},
420−keywords = {Depe},
421−mendeley-tags = {Depe},
422−publisher = {Citeseer},
423−title = {{An exercise in dependent types: A well-typed interpreter}},
424−url = {http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.39.2895},
425−year = {1999}
426−}
427−@inproceedings{Sheard2005,
428−address = {New York, New York, USA},
429−author = {Sheard, Tim},
430−booktitle = {Proceedings of the 2005 ACM SIGPLAN workshop on Haskell - Haskell '05},
431−doi = {10.1145/1088348.1088356},
432−file = {:Users/edwin/Documents/Mendeley Desktop/Sheard/Putting curry-howard to work/Sheard - Putting curry-howard to work - 2005.pdf:pdf},
433−isbn = {159593071X},
434−keywords = {GADT,curry-howard isomorphism,extensional kind system,haskell,logic},
435−month = sep,
436−pages = {74--85},
437−publisher = {ACM Press},
438−title = {{Putting curry-howard to work}},
439−url = {http://dl.acm.org/citation.cfm?id=1088348.1088356},
440−year = {2005}
441−}
442−@phdthesis{McBride1999,
443−author = {McBride, Conor},
444−file = {:Users/edwin/Documents/Mendeley Desktop/McBride/Dependently typed functional programs and their proofs/McBride - Dependently typed functional programs and their proofs - 1999.pdf:pdf},
445−keywords = {Dependent Types},
446−mendeley-tags = {Dependent Types},
447−school = {University of Edinburgh},
448−title = {{Dependently typed functional programs and their proofs}},
449−url = {http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.26.4785&rep=rep1&type=pdf},
450−year = {1999}
451−}
452−@article{The2012a,
453−author = {Bentley, Jon},
454−doi = {10.1093/geront/gns026},
455−file = {:Users/edwin/Documents/Mendeley Desktop/Bentley/Beautiful Code Chapter 3/Bentley - Beautiful Code Chapter 3 - 2012.pdf:pdf},
456−isbn = {9780596510046},
457−issn = {1758-5341},
458−month = dec,
459−number = {6},
460−pages = {NP},
461−pmid = {23150082},
462−title = {{Beautiful Code Chapter 3}},
463−url = {http://www.ncbi.nlm.nih.gov/pubmed/23150082},
464−volume = {52},
465−year = {2012}
466−}
467−@inproceedings{Fournet2011,
468−author = {Fournet, Cedric and Bhargavan, Karthikeyan and Gordon, Andrew D},
469−booktitle = {Foundations of security analysis and design {VI}},
470−file = {:Users/edwin/Documents/Mendeley Desktop/Fournet, Bhargavan, Gordon/Cryptographic verification by typing for a sample protocol implementation/Fournet, Bhargavan, Gordon - Cryptographic verification by typing for a sample protocol implementation - 2010.pdf:pdf},
471−title = {{Cryptographic verification by typing for a sample protocol implementation}},
472−url = {http://www.springerlink.com/index/V168041M46658R73.pdf},
473−year = {2010}
474−}
475−@inproceedings{chlipala2010ur,
476−author = {Chlipala, Adam},
477−booktitle = {ACM SIGPLAN Notices},
478−file = {:Users/edwin/Documents/Mendeley Desktop/Chlipala/Ur statically-typed metaprogramming with type-level record computation/Chlipala - Ur statically-typed metaprogramming with type-level record computation - 2010.pdf:pdf},
479−number = {6},
480−pages = {122--133},
481−publisher = {ACM},
482−title = {{Ur: statically-typed metaprogramming with type-level record computation}},
483−url = {http://dl.acm.org/citation.cfm?id=1806612},
484−volume = {45},
485−year = {2010}
486−}
487−@article{Fluet,
488−annote = {0,3
489−
490−
491−This paper gives a control flow analysis for polymorphic functional programs (specifically System F with recursion). Surprisingly (to me at least) this appears not to have been done before, with previous analyses targetting dynamically typed or simply typed languages, or handling polymorphism by explicitly eliminating it. It seems to be a worthwhile exercise: richer static type systems should give more information to support static analysis.
492−
493−
494−While I like what is achieved by this paper, I did find it rather hard going. The introduction feels laboured and then the paper covers a lot of detail (possibly too much) in quite a short space (though it still runs to 18 pages, two more than the limit!). I would suggest that the paper would be much improved, particularly to a non-expert reader, if it give one or more motivating examples in the introduction and showed how the analysis applied to these examples, when translated to ANF.
495−I think this would shorten the introduction and give a much better intuition for the rules.},
496−author = {Fluet, Matthew},
497−file = {:Users/edwin/Documents/Mendeley Desktop/Fluet/A Type- and Control-Flow Analysis for System F/Fluet - A Type- and Control-Flow Analysis for System F - Unknown.pdf:pdf},
498−pages = {1--18},
499−title = {{A Type- and Control-Flow Analysis for System F}}
500−}
501−@article{Vytiniotis2011,
502−author = {Vytiniotis, Dimitrios and {Peyton Jones}, Simon and Schrijvers, Tom and Sulzmann, Martin},
503−file = {:Users/edwin/Documents/Mendeley Desktop/Vytiniotis et al/textsc{OutsideIn}(X) Modular type inference with local assumptions/Vytiniotis et al. - textsc{OutsideIn}(X) Modular type inference with local assumptions - 2011.pdf:pdf;:Users/edwin/Documents/Mendeley Desktop/Vytiniotis et al/textsc{OutsideIn}(X) Modular type inference with local assumptions/Vytiniotis et al. - textsc{OutsideIn}(X) Modular type inference with local assumptions - 2011(2).pdf:pdf},
504−journal = {{Journal of Functional Programming}},
505−number = {4--5},
506−pages = {333----412},
507−title = {{\textsc{OutsideIn}(X) Modular type inference with local assumptions}},
508−url = {http://journals.cambridge.org/abstract_S0956796811000098},
509−volume = {21},
510−year = {2011}
511−}
512−@inproceedings{Gregoire2005,
513−author = {Gregoire, Benjamin and Mahboubi, Assia},
514−booktitle = {{Theorem Proving in Higher Order Logics (TPHOLS 2005)}},
515−file = {:Users/edwin/Documents/Mendeley Desktop/Gregoire, Mahboubi/Proving Equalities in a Commutative Ring Done Right in Coq/Gregoire, Mahboubi - Proving Equalities in a Commutative Ring Done Right in Coq - 2005.pdf:pdf},
516−pages = {98----113},
517−title = {{Proving Equalities in a Commutative Ring Done Right in Coq}},
518−url = {http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.61.3041},
519−year = {2005}
520−}
521−@book{Cryptography2012,
522−author = {Anderson, Ross},
523−doi = {10.1093/intimm/dxs023},
524−file = {:Users/edwin/Documents/Mendeley Desktop/Anderson/Security Engineering Chapter 5/Anderson - Security Engineering Chapter 5 - Unknown.pdf:pdf},
525−isbn = {9780470068526},
526−issn = {1460-2377},
527−number = {4},
528−pmid = {22451589},
529−title = {{Security Engineering Chapter 5}},
530−url = {http://www.ncbi.nlm.nih.gov/pubmed/22451589},
531−volume = {24}
532−}
533−@article{Brady,
534−author = {Butenhof, David R.},
535−file = {:Users/edwin/Documents/Mendeley Desktop/Butenhof/Programming with POSIX Threads Chapter 8/Butenhof - Programming with POSIX Threads Chapter 8 - Unknown.pdf:pdf},
536−isbn = {0201633922},
537−title = {{Programming with POSIX Threads Chapter 8}}
538−}
539−@inproceedings{oury2008power,
540−author = {Oury, N. and Swierstra, W.},
541−booktitle = {International Conference on Functional Programming},
542−file = {:Users/edwin/Documents/Mendeley Desktop/Oury, Swierstra/The power of Pi/Oury, Swierstra - The power of Pi - 2008.pdf:pdf},
543−keywords = {Dependent Types},
544−mendeley-tags = {Dependent Types},
545−number = {9},
546−pages = {39--50},
547−publisher = {ACM},
548−title = {{The power of Pi}},
549−url = {http://dl.acm.org/citation.cfm?id=1411213},
550−volume = {43},
551−year = {2008}
552−}
553−@article{McBride2004a,
554−abstract = {ABSTRACT Pattern matching has proved an extremely powerful and durable notion in functional programming. This paper contributes a new programming notation for type theory which elaborates the notion in various ways. First, as is by now quite well-known in the type theory community, definition by pattern matching becomes a more discriminating tool in the presence of dependent types, since it refines the explanation of types as well as values. This becomes all the more true in the presence of the rich class of datatypes known as inductive families (Dybjer, 1991). Secondly, as proposed by Peyton Jones (1997) for Haskell, and independently rediscovered by us, subsidiary case analyses on the results of intermediate computations, which commonly take place on the right-hand side of definitions by pattern matching, should rather be handled on the left. In simply-typed languages, this subsumes the trivial case of Boolean guards; in our setting it becomes yet more powerful. Thirdly, elementary pattern matching decompositions have a well-defined interface given by a dependent type; they correspond to the statement of an induction principle for the datatype. More general, user-definable decompositions may be defined which also have types of the same general form. Elementary pattern matching may therefore be recast in abstract form, with a semantics given by translation. Such abstract decompositions of data generalize Wadler&apos;s (1987) notion of &lsquo;view&rsquo;. The programmer wishing to introduce a new view of a type mathitT, and exploit it directly in pattern matching, may do so via a standard programming idiom. The type theorist, looking through the Curry&ndash;Howard lens, may see this as proving a theorem, one which establishes the validity of a new induction principle for mathitT. We develop enough syntax and semantics to account for this high-level style of programming in dependent type theory. We close with the development of a typechecker for the simply-typed lambda calculus, which furnishes a view of raw terms as either being well-typed, or containing an error. The implementation of this view is ipso facto a proof that typechecking is decidable.},
555−author = {McBride, Conor and McKinna, James},
556−doi = {10.1017/S0956796803004829},
557−file = {:Users/edwin/Documents/Mendeley Desktop/McBride, McKinna/The view from the left/McBride, McKinna - The view from the left - 2004.pdf:pdf},
558−issn = {09567968},
559−journal = {Journal of Functional Programming},
560−keywords = {Dependent Types},
561−mendeley-tags = {Dependent Types},
562−number = {1},
563−pages = {69--111},
564−publisher = {Cambridge University Press},
565−title = {{The view from the left}},
566−url = {http://www.journals.cambridge.org/abstract_S0956796803004829},
567−volume = {14},
568−year = {2004}
569−}
570−@book{Cryptography2012a,
571−author = {Pfleeger, Charles P and Pfleeger, S. L.},
572−booktitle = {Nicotine & tobacco research : official journal of the Society for Research on Nicotine and Tobacco},
573−doi = {10.1093/ntr/nts035},
574−file = {:Users/edwin/Documents/Mendeley Desktop/Pfleeger, Pfleeger/Security in Computing Chapter 2/Pfleeger, Pfleeger - Security in Computing Chapter 2 - 2012.pdf:pdf},
575−isbn = {0132390779},
576−issn = {1469-994X},
577−month = oct,
578−number = {10},
579−pages = {NP},
580−pmid = {23012339},
581−title = {{Security in Computing Chapter 2}},
582−url = {http://www.ncbi.nlm.nih.gov/pubmed/23012339},
583−volume = {14},
584−year = {2012}
585−}
586−@phdthesis{Pretnar2010,
587−author = {Pretnar, Matija},
588−file = {:Users/edwin/Documents/Mendeley Desktop/Pretnar/The Logic and Handling of Algebraic Effects/Pretnar - The Logic and Handling of Algebraic Effects - 2010.pdf:pdf},
589−school = {University of Edinburgh},
590−title = {{The Logic and Handling of Algebraic Effects}},
591−year = {2010}
592−}
593−@inproceedings{Brady2010,
594−author = {Brady, Edwin and Hammond, Kevin},
595−booktitle = {Proceedings of the 15th ACM SIGPLAN international conference on Functional programming},
596−file = {:Users/edwin/Documents/Mendeley Desktop/Brady, Hammond/Scrapping your inefficient engine using partial evaluation to improve domain-specific language implementation/Brady, Hammond - Scrapping your inefficient engine using partial evaluation to improve domain-specific language implementation - 2010.pdf:pdf},
597−isbn = {9781605587943},
598−keywords = {Dependent Types,code generation gives,contrast,dependent types,efficient,harder,however,implementation,likely efficient,ness interpreter,partial evaluation,resulting implementation,un,verify its correctness},
599−mendeley-tags = {Dependent Types},
600−pages = {297--308},
601−publisher = {ACM},
602−title = {{Scrapping your inefficient engine: using partial evaluation to improve domain-specific language implementation}},
603−url = {http://portal.acm.org/citation.cfm?id=1863587},
604−year = {2010}
605−}
606−@misc{Danielsson2002,
607−author = {Danielsson, Nils Anders and Altenkirch, Thorsten},
608−file = {:Users/edwin/Documents/Mendeley Desktop/Danielsson, Altenkirch/Subtyping, Declaratively/Danielsson, Altenkirch - Subtyping, Declaratively - 2002.pdf:pdf},
609−title = {{Subtyping, Declaratively}},
610−year = {2002}
611−}
612−@book{Strings2012,
613−author = {Sedgewick, Robert and Wayne, Kevin},
614−booktitle = {Nicotine & tobacco research : official journal of the Society for Research on Nicotine and Tobacco},
615−doi = {10.1093/ntr/nts035},
616−file = {:Users/edwin/Documents/Mendeley Desktop/Sedgewick, Wayne/Algorithms Chapter 5/Sedgewick, Wayne - Algorithms Chapter 5 - 2012.pdf:pdf},
617−isbn = {9780132762571},
618−issn = {1469-994X},
619−month = oct,
620−number = {10},
621−pages = {NP},
622−pmid = {23012339},
623−title = {{Algorithms Chapter 5}},
624−url = {http://www.ncbi.nlm.nih.gov/pubmed/23012339},
625−volume = {14},
626−year = {2012}
627−}
628−@inproceedings{Augustsson1985,
629−address = {Berlin, Heidelberg},
630−author = {Augustsson, Lennart},
631−booktitle = {Functional Programming Languages and Computer Architecture},
632−doi = {10.1007/3-540-15975-4},
633−editor = {Jouannaud, Jean-Pierre},
634−isbn = {978-3-540-15975-9},
635−keywords = {Computer Science},
636−pages = {368----381},
637−publisher = {Springer Berlin Heidelberg},
638−series = {Lecture Notes in Computer Science},
639−title = {{Compiling Pattern Matching}},
640−url = {http://www.springerlink.com/content/y647423656557505/},
641−volume = {201},
642−year = {1985}
643−}
644−@misc{Abel1998,
645−author = {Abel, Andreas},
646−booktitle = {Language},
647−file = {:Users/edwin/Documents/Mendeley Desktop/Abel/foetus - Termination Checker for Simple Functional Programs/Abel - foetus - Termination Checker for Simple Functional Programs - 1998.pdf:pdf},
648−title = {{foetus - Termination Checker for Simple Functional Programs}},
649−year = {1998}
650−}
651−@article{Silkensen,
652−author = {Silkensen, Erik and Siek, Jeremy},
653−file = {:Users/edwin/Documents/Mendeley Desktop/Silkensen, Siek/Well-typed Islands Parse Faster/Silkensen, Siek - Well-typed Islands Parse Faster - Unknown.pdf:pdf},
654−title = {{Well-typed Islands Parse Faster}}
655−}
656−@misc{Svenningsson,
657−author = {Svenningsson, Josef and Axelsson, Emil},
658−booktitle = {Writing},
659−file = {:Users/edwin/Documents/Mendeley Desktop/Svenningsson, Axelsson/Combining Deep and Shallow Embedding for EDSL/Svenningsson, Axelsson - Combining Deep and Shallow Embedding for EDSL - Unknown.pdf:pdf},
660−title = {{Combining Deep and Shallow Embedding for EDSL}}
661−}
662−@misc{Bauer,
663−archivePrefix = {arXiv},
664−arxivId = {arXiv:1203.1539v1},
665−author = {Bauer, Andrej and Pretnar, Matija},
666−eprint = {arXiv:1203.1539v1},
667−file = {:Users/edwin/Documents/Mendeley Desktop/Bauer, Pretnar/Programming with Algebraic Effects and Handlers/Bauer, Pretnar - Programming with Algebraic Effects and Handlers - Unknown.pdf:pdf},
668−keywords = {()},
669−title = {{Programming with Algebraic Effects and Handlers}}
670−}
671−@misc{Krustev,
672−author = {Krustev, Dimitur},
673−booktitle = {Language},
674−file = {:Users/edwin/Documents/Mendeley Desktop/Krustev/Towards a Framework for Building Formally Verified Supercompilers in Coq/Krustev - Towards a Framework for Building Formally Verified Supercompilers in Coq - Unknown.pdf:pdf},
675−title = {{Towards a Framework for Building Formally Verified Supercompilers in Coq}}
676−}
677−@book{Graphs2012,
678−author = {Sedgewick, Robert and Wayne, Kevin},
679−booktitle = {The Gerontologist},
680−doi = {10.1093/geront/gns026},
681−file = {:Users/edwin/Documents/Mendeley Desktop/Sedgewick, Wayne/Algorithms Chapter 4/Sedgewick, Wayne - Algorithms Chapter 4 - 2012.pdf:pdf},
682−isbn = {9780132762571},
683−issn = {1758-5341},
684−month = dec,
685−number = {6},
686−pages = {NP},
687−pmid = {23150082},
688−title = {{Algorithms Chapter 4}},
689−url = {http://www.ncbi.nlm.nih.gov/pubmed/23150082},
690−volume = {52},
691−year = {2012}
692−}
693−@misc{Brady2012c,
694−author = {Brooks, Fred},
695−doi = {10.1093/epirev/mxr031},
696−file = {:Users/edwin/Documents/Mendeley Desktop/Brooks/The Design of Design Chapter 5/Brooks - The Design of Design Chapter 5 - Unknown.pdf:pdf},
697−isbn = {9780321702081},
698−issn = {1478-6729},
699−number = {1},
700−pages = {NP},
701−pmid = {22215642},
702−title = {{The Design of Design Chapter 5}},
703−volume = {34}
704−}
705−@inproceedings{coquand1986analysis,
706−author = {Coquand, T.},
707−booktitle = {{Proceedings of the First IEEE Symposium on Logic in Computer Science}},
708−file = {:Users/edwin/Documents/Mendeley Desktop/Coquand/An analysis of Girard's paradox/Coquand - An analysis of Girard's paradox - 1986.pdf:pdf},
709−pages = {227----246},
710−title = {{An analysis of Girard's paradox}},
711−url = {http://hal.inria.fr/docs/00/07/60/23/PDF/RR-0531.pdf},
712−year = {1986}
713−}
714−@book{Harper2012,
715−author = {Harper, Robert},
716−file = {:Users/edwin/Documents/Mendeley Desktop/Harper/Practical Foundations for Programming Languages/Harper - Practical Foundations for Programming Languages - 2012.pdf:pdf},
717−title = {{Practical Foundations for Programming Languages}},
718−year = {2012}
719−}
720−@misc{dagand2011transporting,
721−author = {Dagand, Pierre-Evariste and McBride, Conor},
722−file = {:Users/edwin/Documents/Mendeley Desktop/Dagand, McBride/Transporting Functions across Ornaments/Dagand, McBride - Transporting Functions across Ornaments - 2011.pdf:pdf},
723−title = {{Transporting Functions across Ornaments}},
724−url = {http://personal.cis.strath.ac.uk/$\sim$dagand/stuffs/paper-2011-patch/paper.pdf},
725−year = {2011}
726−}
727−@article{Abel2010,
728−abstract = {Sized types are a modular and theoretically well-understood tool for checking termination of recursive and productivity of corecursive definitions. The essential idea is to track structural descent and guardedness in the type system to make termination checking robust and suitable for strong abstractions like higher-order functions and polymorphism. To study the application of sized types to proof assistants and programming languages based on dependent type theory, we have implemented a core language, MiniAgda, with explicit handling of sizes. New considerations were necessary to soundly integrate sized types with dependencies and pattern matching, which was made possible by concepts such as inaccessible patterns and parametric function spaces. This paper provides an introduction to MiniAgda by example and informal explanations of the underlying principles.},
729−author = {Abel, Andreas},
730−file = {:Users/edwin/Documents/Mendeley Desktop/Abel/MiniAgda Integrating Sized and Dependent Types/Abel - MiniAgda Integrating Sized and Dependent Types - 2010.pdf:pdf},
731−journal = {EPTCS},
732−pages = {1--15},
733−title = {{MiniAgda: Integrating Sized and Dependent Types}},
734−url = {http://arxiv.org/abs/1012.4896},
735−volume = {43},
736−year = {2010}
737−}
738−@article{burrows1990,
739−author = {Burrows, Michael and Abadi, Martin and Needham, Roger},
740−file = {:Users/edwin/Documents/Mendeley Desktop/Burrows, Abadi, Needham/A logic of authentication/Burrows, Abadi, Needham - A logic of authentication - 1990.pdf:pdf},
741−journal = {ACM Transactions on Computer Systems},
742−pages = {18----36},
743−title = {{A logic of authentication}},
744−url = {http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.115.3569},
745−volume = {8},
746−year = {1990}
747−}
748−@article{loh2010tutorial,
749−author = {L\"{o}h, A. and McBride, C. and Swierstra, W.},
750−file = {:Users/edwin/Documents/Mendeley Desktop/L\"{o}h, McBride, Swierstra/A tutorial implementation of a dependently typed lambda calculus/L\"{o}h, McBride, Swierstra - A tutorial implementation of a dependently typed lambda calculus - 2010.pdf:pdf},
751−journal = {Fundamenta Informaticae},
752−number = {2},
753−pages = {177--207},
754−publisher = {IOS Press},
755−title = {{A tutorial implementation of a dependently typed lambda calculus}},
756−url = {http://iospress.metapress.com/index/976W4716TM79M6U8.pdf},
757−volume = {102},
758−year = {2010}
759−}
760−@article{mcbride2008functional,
761−author = {McBride, C. and Paterson, R.},
762−file = {:Users/edwin/Documents/Mendeley Desktop/McBride, Paterson/Functional pearl Applicative programming with effects/McBride, Paterson - Functional pearl Applicative programming with effects - 2008.pdf:pdf},
763−journal = {Journal of functional programming},
764−number = {1},
765−pages = {1--13},
766−publisher = {Cambridge Univ Press},
767−title = {{Functional pearl: Applicative programming with effects}},
768−url = {http://journals.cambridge.org/production/action/cjoGetFulltext?fulltextid=1457860},
769−volume = {18},
770−year = {2008}
771−}
772−@techreport{Cardelli1988,
773−author = {Cardelli, L},
774−file = {:Users/edwin/Documents/Mendeley Desktop/Cardelli/Phase distinctions in type theory/Cardelli - Phase distinctions in type theory - 1988.pdf:pdf},
775−title = {{Phase distinctions in type theory}},
776−year = {1988}
777−}
778−@misc{Abadi1997,
779−author = {Abadi, Martin and Gordon, Andrew D},
780−booktitle = {4TH ACM CONFERENCE ON COMPUTER AND COMMUNICATIONS SECURITY},
781−file = {:Users/edwin/Documents/Mendeley Desktop/Abadi, Gordon/A calculus for cryptographic protocols The spi calculus/Abadi, Gordon - A calculus for cryptographic protocols The spi calculus - 1997.pdf:pdf},
782−pages = {36 -- 47},
783−title = {{A calculus for cryptographic protocols: The spi calculus}},
784−url = {http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.49.2176},
785−year = {1997}
786−}
787−@article{Haskell2012a,
788−author = {Biancuzzi, F and Warden, S},
789−doi = {10.1093/epirev/mxr031},
790−file = {:Users/edwin/Documents/Mendeley Desktop/Biancuzzi, Warden/Masterminds of Programming Chapter 8/Biancuzzi, Warden - Masterminds of Programming Chapter 8 - Unknown.pdf:pdf},
791−isbn = {9780596801670},
792−issn = {1478-6729},
793−pmid = {22215642},
794−title = {{Masterminds of Programming Chapter 8}}
795−}
796−@inproceedings{madhavapeddy2010turning,
797−author = {Madhavapeddy, A. and Mortier, R. and Sohan, R. and Gazagnaire, T. and Hand, S. and Deegan, T. and McAuley, D. and Crowcroft, J.},
798−booktitle = {Proceedings of the 2nd USENIX conference on Hot topics in cloud computing},
799−file = {:Users/edwin/Documents/Mendeley Desktop/Madhavapeddy et al/Turning down the LAMP software specialisation for the cloud/Madhavapeddy et al. - Turning down the LAMP software specialisation for the cloud - 2010.pdf:pdf},
800−publisher = {USENIX Association},
801−title = {{Turning down the LAMP: software specialisation for the cloud}},
802−url = {http://dl.acm.org/citation.cfm?id=1863114},
803−year = {2010}
804−}
805−@misc{Braßel,
806−annote = {New compilation system for Curry, a Haskell like language with equational constraints, making it a functional logic language.
807−
808−
809−What is the contribution of this paper? i.e. what is new about the compiler? Seems to be efficient implementation of equational constraints.
810−
811−
812−Nice introduction to the language, easy for a Haskell programmer to follow, and nice explanation of how it works motivating the problem. But I find it hard to tell what in the paper is already known and what is a specific contribution.
813−
814−
815−Functional patterns look nice, if hard to implement. Related to views? Limitations?
816−Could these techniques improve (compile-time) unification in dependently typed languages?
817−
818−
819−Not many results. Encouraging, but only 7 of various forms isn't conclusive. },
820−author = {Bra\ss el, Bernd and Hanus, Michael and Peem\"{o}ller, Bj\"{o}rn and Reck, Fabian},
821−file = {:Users/edwin/Documents/Mendeley Desktop/Bra\ss el et al/Implementing Equational Constraints in a Functional Language/Bra\ss el et al. - Implementing Equational Constraints in a Functional Language - Unknown.pdf:pdf},
822−keywords = {func-,functional logic programming,implementation,unification},
823−title = {{Implementing Equational Constraints in a Functional Language}}
824−}
825−@inproceedings{Brady2003,
826−author = {Brady, Edwin and McBride, Conor and McKinna, James},
827−booktitle = {Types for Proofs and Programs {(TYPES 2003)}},
828−file = {:Users/edwin/Documents/Mendeley Desktop/Brady, McBride, McKinna/Inductive families need not store their indices/Brady, McBride, McKinna - Inductive families need not store their indices - 2003.pdf:pdf},
829−keywords = {Dependent Types},
830−mendeley-tags = {Dependent Types},
831−title = {{Inductive families need not store their indices}},
832−year = {2003}
833−}
834−@book{An2012,
835−author = {Fowler, Martin},
836−booktitle = {Carcinogenesis},
837−doi = {10.1093/carcin/bgs054},
838−file = {:Users/edwin/Documents/Mendeley Desktop/Fowler/Domain Specific Languages Chapter 1/Fowler - Domain Specific Languages Chapter 1 - Unknown.pdf:pdf},
839−isbn = {9780132107549},
840−issn = {1460-2180},
841−number = {3},
842−pmid = {22383472},
843−title = {{Domain Specific Languages Chapter 1}},
844−url = {http://www.ncbi.nlm.nih.gov/pubmed/22383472},
845−volume = {33}
846−}
847−@book{Choosing2012,
848−author = {Fowler, Martin},
849−booktitle = {Carcinogenesis},
850−doi = {10.1093/carcin/bgs054},
851−file = {:Users/edwin/Documents/Mendeley Desktop/Fowler/Domain Specific Languages Chapter 6/Fowler - Domain Specific Languages Chapter 6 - Unknown.pdf:pdf},
852−isbn = {9780132107549},
853−issn = {1460-2180},
854−number = {3},
855−pmid = {22383472},
856−title = {{Domain Specific Languages Chapter 6}},
857−url = {http://www.ncbi.nlm.nih.gov/pubmed/22383472},
858−volume = {33}
859−}
860−@misc{altenkirch2008nσ,
861−author = {Altenkirch, T. and Oury, N.},
862−file = {:Users/edwin/Documents/Mendeley Desktop/Altenkirch, Oury/$Pi$$Sigma$ A Core Language for Dependently Typed Programming/Altenkirch, Oury - $Pi$$Sigma$ A Core Language for Dependently Typed Programming - 2008.pdf:pdf},
863−title = {{$\Pi$$\Sigma$: A Core Language for Dependently Typed Programming}},
864−url = {http://verse.aasemoon.com/images/6/6f/PiSigma.pdf},
865−year = {2008}
866−}
867−@misc{Silkensen2012,
868−annote = {This paper tackles an interesting problem, namely that of building DSLs independently which are nevertheless composable (at least as far as parsing goes). The claim is that the approach taken - using type based disambiguation - can combine the good features of internal and external DSLs - namely, that they become easier to implement, and have a nice syntax.
869−
870−
871−I found the paper interesting to read, the contribution worthwhile and the results convincing, though I have a few suggestions for preparing the paper for TFP submission, since it wouldn't be possible to accept it in its current form.
872−
873−
874−Perhaps most importantly, the draft submission is in the SIGPLAN format, which means you've used a lot more space than you have available. I find that 1 SIGPLAN page becomes at least 2 in Springer format because of font size and margins, so you'll need to think carefully about what you consider the most important contribution of the paper, how much detail you can go into, and how many examples to give.
875−If it helps, I think you could reduce section 5 to just a short sketch of Typed Racket and there'd be enough of a contribution to justify a TFP paper (though of course I can't speak for other potential referees!)
876−
877−
878−I found the paper a bit difficult to read at first since I don't have a detailed understand of parsing algorithms, and I suspect I won't be alone in this among the TFP readership. It would be useful to say more in the introduction about island parsing, and what a chart parsing strategy is. An intuitive explanation of the various parsing algorithms you give formally (Example 2.3, say) would be very useful for this (possibly even more useful than the formal descriptions...).
879−
880−
881−Another advantage of internal DSLs that I didn't see mentioned explicitly in the paper is that many features of the host language - syntax, code generation, type checking - are available for free, but have to be implemented explicitly for an external DSL. Maybe this is part of what you mean by interoperability. There is more than parsing needed for this though.
882−
883−
884−A question on contribution 1: how realistic is it to assume that nonterminals are largely disjoint? I could imagine, say, function calls or arithmetic being part of multiple DSLs if not factored out. Or have I misunderstood what you mean?
885−
886−
887−Some modern languages with dependent types have systems for syntax extension, e.g. Agda has mixfix declarations, Idris has syntax rules, type-directed elaboration and overloaded variable bindings. I wonder, therefore, if your approach to parsing could be better integrated into this kind of language, where embedded verifiable DSLs seem to be an obvious application. The Typed Racket example suggests to me that this would be an interesting thing to explore.},
888−author = {Silkensen, Erik and Siek, Jeremy},
889−file = {:Users/edwin/Documents/Mendeley Desktop/Silkensen, Siek/Well-typed Islands Parse Faster/Silkensen, Siek - Well-typed Islands Parse Faster - 2012.pdf:pdf},
890−pages = {1--12},
891−title = {{Well-typed Islands Parse Faster}},
892−year = {2012}
893−}
894−@misc{The2012c,
895−author = {Robbins, A and Hannah, E and Lamb, L},
896−doi = {10.1093/epirev/mxr031},
897−file = {:Users/edwin/Documents/Mendeley Desktop/Robbins, Hannah, Lamb/Learning the vi and Vim Editors/Robbins, Hannah, Lamb - Learning the vi and Vim Editors - Unknown.pdf:pdf},
898−isbn = {9780596529833},
899−issn = {1478-6729},
900−pmid = {22215642},
901−title = {{Learning the vi and Vim Editors}}
902−}
903−@misc{idristutorial,
904−author = {Brady, Edwin},
905−file = {:Users/edwin/Documents/Mendeley Desktop/Brady/Programming in Idris a tutorial/Brady - Programming in Idris a tutorial - 2012.pdf:pdf},
906−title = {{Programming in Idris : a tutorial}},
907−url = {http://idris-lang.org/tutorial},
908−year = {2013}
909−}
910−@book{Simon2012,
911−author = {Seibel, Peter},
912−booktitle = {The Gerontologist},
913−doi = {10.1093/geront/gns026},
914−file = {:Users/edwin/Documents/Mendeley Desktop/Seibel/Coders at Work Chapter 7/Seibel - Coders at Work Chapter 7 - 2012.pdf:pdf},
915−isbn = {9781430219484},
916−issn = {1758-5341},
917−month = dec,
918−number = {6},
919−pages = {NP},
920−pmid = {23150082},
921−title = {{Coders at Work Chapter 7}},
922−url = {http://www.ncbi.nlm.nih.gov/pubmed/23150082},
923−volume = {52},
924−year = {2012}
925−}
926−@misc{TheMendeleySupportTeam2011,
927−abstract = {A quick introduction to Mendeley. Learn how Mendeley creates your personal digital library, how to organize and annotate documents, how to collaborate and share with colleagues, and how to generate citations and bibliographies.},
928−address = {London},
929−author = {{The Mendeley Support Team}},
930−booktitle = {Mendeley Desktop},
931−file = {:Users/edwin/Documents/Mendeley Desktop/The Mendeley Support Team/Getting Started with Mendeley/The Mendeley Support Team - Getting Started with Mendeley - 2011.pdf:pdf},
932−keywords = {Mendeley,how-to,user manual},
933−pages = {1--16},
934−publisher = {Mendeley Ltd.},
935−title = {{Getting Started with Mendeley}},
936−url = {http://www.mendeley.com},
937−year = {2011}
938−}
939−@book{Brady2012d,
940−author = {Seibel, Peter},
941−booktitle = {The Gerontologist},
942−doi = {10.1093/geront/gns026},
943−file = {:Users/edwin/Documents/Mendeley Desktop/Seibel/Coders at Work Chapter 6/Seibel - Coders at Work Chapter 6 - 2012.pdf:pdf},
944−isbn = {9781430219484},
945−issn = {1758-5341},
946−month = dec,
947−number = {6},
948−pages = {NP},
949−pmid = {23150082},
950−title = {{Coders at Work Chapter 6}},
951−url = {http://www.ncbi.nlm.nih.gov/pubmed/23150082},
952−volume = {52},
953−year = {2012}
954−}
955−@inproceedings{l,
956−author = {L\"{a}mmel, R. and Jones, S.P.},
957−booktitle = {ACM SIGPLAN Notices},
958−file = {:Users/edwin/Documents/Mendeley Desktop/L\"{a}mmel, Jones/Scrap your boilerplate a practical design pattern for generic programming/L\"{a}mmel, Jones - Scrap your boilerplate a practical design pattern for generic programming - 2003.pdf:pdf},
959−number = {3},
960−pages = {26--37},
961−publisher = {ACM},
962−title = {{Scrap your boilerplate: a practical design pattern for generic programming}},
963−url = {http://dl.acm.org/citation.cfm?id=640136.604179},
964−volume = {38},
965−year = {2003}
966−}
967−@phdthesis{Okasaki1996,
968−author = {Okasaki, Chris},
969−file = {:Users/edwin/Documents/Mendeley Desktop/Okasaki/Purely Functional Data Structures/Okasaki - Purely Functional Data Structures - 1996.pdf:pdf},
970−school = {Carnegie Mellon University},
971−title = {{Purely Functional Data Structures}},
972−year = {1996}
973−}
974−@inproceedings{McBride2004b,
975−author = {McBride, Conor and McKinna, James},
976−booktitle = {Haskell Workshop},
977−file = {:Users/edwin/Documents/Mendeley Desktop/McBride, McKinna/I am not a number I am a free variable/McBride, McKinna - I am not a number I am a free variable - 2004.pdf:pdf},
978−title = {{I am not a number : I am a free variable}},
979−year = {2004}
980−}
981−@inproceedings{Brady2005a,
982−author = {Brady, E and Hammond, K},
983−booktitle = {Implementation and Application of Functional \ldots},
984−file = {:Users/edwin/Documents/Mendeley Desktop/Brady, Hammond/A dependently typed framework for static analysis of program execution costs/Brady, Hammond - A dependently typed framework for static analysis of program execution costs - 2005.pdf:pdf},
985−keywords = {Dependent Types},
986−mendeley-tags = {Dependent Types},
987−title = {{A dependently typed framework for static analysis of program execution costs}},
988−url = {http://www.springerlink.com/index/P446P2HH70107759.pdf},
989−year = {2005}
990−}
991−@misc{TMR13,
992−author = {Eidhof, Chris and Elkins, Derek and Hicks, Stephen},
993−file = {:Users/edwin/Documents/Mendeley Desktop/Eidhof, Elkins, Hicks/The Monad . Reader Issue 13/Eidhof, Elkins, Hicks - The Monad . Reader Issue 13 - 2009.pdf:pdf},
994−number = {13},
995−title = {{The Monad . Reader Issue 13}},
996−year = {2009}
997−}
998−@inproceedings{taha2004gentle,
999−author = {Taha, W.},
1000−booktitle = {Domain-Specific Program Generation},
1001−pages = {30--50},
1002−publisher = {Springer},
1003−title = {{A gentle introduction to multi-stage programming}},
1004−url = {http://www.springerlink.com/index/JEMT0D8VYN5JB2L8.pdf},
1005−year = {2004}
1006−}
1007−@article{Rose,
1008−annote = {This paper describes a language, Jeeves, for describing privacy policies and ensuring that they are automatically enforced. It gives the semantics of Jeeves in terms of a translation to a target language $\lambda_J$ and shows how to implement the privacy rules in a monadic style in Haskell which captures the constraint propagation.
1009−
1010−
1011−Capturing policy rules in this way is an interesting idea and the monadic definition of constraint propagation is natural, but unfortunately the paper itself only seems half-written. I found the website (https://sites.google.com/site/jeevesprogramming/) and the tutorial there much more enlightening! Perhaps relating the implementation to some more extensive examples would be helpful, illustrating how the Haskell code relates to Jeeves programs. This would be particularly valuable in sections 3 and 5, and there is plenty of space available for this.
1012−
1013−
1014−The paper could use a thorough proof read and spell check. For example:
1015−
1016−
1017−end of sec 1 - references for the report and web site would be useful here.
1018−End of sec 2: privacy politics? This is the only place this phrase is used.
1019−
1020−
1021−p2 etal => et al
1022−
1023−
1024−"The program read" => "The program reads"
1025−"Depending on what" => comma before this
1026−"bottem" => "bottom"
1027−
1028−
1029−p4 "Eventhough" => "Even though"
1030−"The program body, consist" => "The program body consists"
1031−
1032−
1033−"but without any substantial..." - there is a missing word here
1034−
1035−
1036−The presentation of Sec 5 is untidy - for example a section heading at the end of the page and bad spacing between subsections.
1037−
1038−
1039−Reference 1 is blank
1040−
1041−
1042−
1043− },
1044−author = {Rose, Eva},
1045−file = {:Users/edwin/Documents/Mendeley Desktop/Rose/Declarative implementation aspects of privacy policy effects/Rose - Declarative implementation aspects of privacy policy effects - Unknown.pdf:pdf},
1046−keywords = {constraints,language design,mon-,privacy policy,semantics},
1047−title = {{Declarative implementation aspects of privacy policy effects}}
1048−}
1049−@inproceedings{morris2006exploring,
1050−author = {Morris, P. and Altenkirch, T. and McBride, C.},
1051−booktitle = {Types for Proofs and Programs},
1052−file = {:Users/edwin/Documents/Mendeley Desktop/Morris, Altenkirch, McBride/Exploring the regular tree types/Morris, Altenkirch, McBride - Exploring the regular tree types - 2006.pdf:pdf},
1053−pages = {252--267},
1054−publisher = {Springer},
1055−title = {{Exploring the regular tree types}},
1056−url = {http://www.springerlink.com/index/f9p1317716614834.pdf},
1057−year = {2006}
1058−}
1059−@inproceedings{pj2006gadts,
1060−author = {{Peyton Jones}, S. and Vytiniotis, D. and Weirich, S. and Washburn, G.},
1061−booktitle = {{International Conference on Functional Programming} ({ICFP} '06)},
1062−file = {:Users/edwin/Documents/Mendeley Desktop/Peyton Jones et al/Simple unification-based type inference for GADTs/Peyton Jones et al. - Simple unification-based type inference for GADTs - 2006.pdf:pdf},
1063−number = {9},
1064−pages = {50--61},
1065−publisher = {ACM},
1066−title = {{Simple unification-based type inference for GADTs}},
1067−url = {http://dl.acm.org/citation.cfm?id=1159811},
1068−volume = {41},
1069−year = {2006}
1070−}
1071−@book{luo1994,
1072−author = {Luo, Z.},
1073−publisher = {Oxford University Press, Inc.},
1074−title = {{Computation and reasoning: a type theory for computer science}},
1075−url = {http://dl.acm.org/citation.cfm?id=SERIES9893.184757},
1076−year = {1994}
1077−}
1078−@misc{Hancock,
1079−author = {Hancock, Peter and Setzer, Anton},
1080−file = {:Users/edwin/Documents/Mendeley Desktop/Hancock, Setzer/Interactive Programs in Dependent Type Theory/Hancock, Setzer - Interactive Programs in Dependent Type Theory - 2000(2).pdf:pdf},
1081−keywords = {dependent types,functional programming,interac-,monadic i,o,reactive programming,refinement,repetition constructs,tion},
1082−title = {{Interactive Programs in Dependent Type Theory}},
1083−year = {2000}
1084−}
1085−@book{Chlipala2012,
1086−author = {Chlipala, Adam},
1087−file = {:Users/edwin/Documents/Mendeley Desktop/Chlipala/Certified Programming with Dependent Types/Chlipala - Certified Programming with Dependent Types - 2012.pdf:pdf},
1088−title = {{Certified Programming with Dependent Types}},
1089−year = {2012}
1090−}
1091−@article{Mandelbaum2007,
1092−abstract = {Massive amounts of useful data are stored and processed in ad hoc formats for which common tools like parsers, printers, query engines and format converters are not readily available. In this paper, we explain the design and implementation of PADS/ML , a new language and system that facilitates the generation of data processing tools for ad hoc formats. The PADS/ML design includes features such as dependent, polymorphic and recursive datatypes, which allow programmers to describe the syntax and semantics of ad hoc data in a concise, easy-to-read notation. The PADS/ML implementation compiles these descriptions into ml structures and functors that include types for parsed data, functions for parsing and printing, and auxiliary support for user-specified, format-dependent and format-independent tool generation.},
1093−author = {Mandelbaum, Yitzhak and Fisher, Kathleen and Walker, David and Fernandez, Mary and Gleyzer, Artem},
1094−doi = {10.1145/1190215.1190231},
1095−isbn = {1595935754},
1096−issn = {03621340},
1097−journal = {SIGPLAN Not},
1098−number = {1},
1099−pages = {77--83},
1100−publisher = {ACM},
1101−series = {POPL '07},
1102−title = {{PADS/ML: a functional data description language}},
1103−url = {http://doi.acm.org/10.1145/1190216.1190231},
1104−volume = {42},
1105−year = {2007}
1106−}
1107−@article{Nabais2008,
1108−author = {Nabais, Davide},
1109−file = {:Users/edwin/Documents/Mendeley Desktop/Nabais/DesCo a Web Based Information System for Descriptional Complexity of Formal Languages/Nabais - DesCo a Web Based Information System for Descriptional Complexity of Formal Languages - 2008.pdf:pdf},
1110−journal = {Most},
1111−pages = {1--5},
1112−title = {{DesCo : a Web Based Information System for Descriptional Complexity of Formal Languages}},
1113−year = {2008}
1114−}
1115−@book{Edition2012,
1116−author = {Pfleeger, Charles P and Pfleeger, S. L.},
1117−booktitle = {Nicotine & tobacco research : official journal of the Society for Research on Nicotine and Tobacco},
1118−doi = {10.1093/ntr/nts035},
1119−file = {:Users/edwin/Documents/Mendeley Desktop/Pfleeger, Pfleeger/Security in Computing Chapter 1/Pfleeger, Pfleeger - Security in Computing Chapter 1 - 2012.pdf:pdf},
1120−isbn = {0132390779},
1121−issn = {1469-994X},
1122−month = oct,
1123−number = {10},
1124−pages = {NP},
1125−pmid = {23012339},
1126−title = {{Security in Computing Chapter 1}},
1127−url = {http://www.ncbi.nlm.nih.gov/pubmed/23012339},
1128−volume = {14},
1129−year = {2012}
1130−}
1131−@book{Eap,
1132−author = {Fall, Kevin R and Stevens, W. Richard},
1133−file = {:Users/edwin/Documents/Mendeley Desktop/Fall, Stevens/TCPIP Illustrated Chapter 18/Fall, Stevens - TCPIP Illustrated Chapter 18 - Unknown.pdf:pdf},
1134−isbn = {9780132808200},
1135−title = {{TCP/IP Illustrated Chapter 18}}
1136−}
1137−@book{Fowler,
1138−author = {Fowler, Martin},
1139−booktitle = {Language},
1140−file = {:Users/edwin/Documents/Mendeley Desktop/Fowler/Domain Specific Languages Chapter 2/Fowler - Domain Specific Languages Chapter 2 - Unknown.pdf:pdf},
1141−isbn = {9780132107549},
1142−title = {{Domain Specific Languages Chapter 2}}
1143−}
1144−@book{Brady2012e,
1145−author = {Seibel, Peter},
1146−booktitle = {The Gerontologist},
1147−doi = {10.1093/geront/gns026},
1148−file = {:Users/edwin/Documents/Mendeley Desktop/Seibel/Coders at Work Chapter 9/Seibel - Coders at Work Chapter 9 - 2012.pdf:pdf},
1149−isbn = {9781430219484},
1150−issn = {1758-5341},
1151−month = dec,
1152−number = {6},
1153−pages = {NP},
1154−pmid = {23150082},
1155−title = {{Coders at Work Chapter 9}},
1156−url = {http://www.ncbi.nlm.nih.gov/pubmed/23150082},
1157−volume = {52},
1158−year = {2012}
1159−}
1160−@article{Regular2012,
1161−author = {Kernighan, Brian},
1162−doi = {10.1093/geront/gns026},
1163−file = {:Users/edwin/Documents/Mendeley Desktop/Kernighan/Beautiful Code Chapter 1/Kernighan - Beautiful Code Chapter 1 - 2012.pdf:pdf},
1164−isbn = {9780596510046},
1165−issn = {1758-5341},
1166−month = dec,
1167−number = {6},
1168−pages = {NP},
1169−pmid = {23150082},
1170−title = {{Beautiful Code Chapter 1}},
1171−url = {http://www.ncbi.nlm.nih.gov/pubmed/23150082},
1172−volume = {52},
1173−year = {2012}
1174−}
1175−@inproceedings{norell2009dependently,
1176−author = {Norell, Ulf},
1177−booktitle = {Advanced Functional Programming},
1178−file = {:Users/edwin/Documents/Mendeley Desktop/Norell/Dependently typed programming in Agda/Norell - Dependently typed programming in Agda - 2009.pdf:pdf},
1179−keywords = {Dependent Types},
1180−mendeley-tags = {Dependent Types},
1181−pages = {230--266},
1182−publisher = {Springer},
1183−title = {{Dependently typed programming in Agda}},
1184−url = {http://www.springerlink.com/index/8X0H38858233VN26.pdf},
1185−year = {2009}
1186−}
1187−@misc{Interface2012a,
1188−author = {Kreibich, Jay A.},
1189−doi = {10.1093/epirev/mxr031},
1190−file = {:Users/edwin/Documents/Mendeley Desktop/Kreibich/Using SQLite Chapter 7/Kreibich - Using SQLite Chapter 7 - Unknown.pdf:pdf},
1191−isbn = {9781449394592},
1192−issn = {1478-6729},
1193−pmid = {22215642},
1194−title = {{Using SQLite Chapter 7}}
1195−}
1196−@inproceedings{Augustsson1998,
1197−abstract = {Cayenne is a Haskell-like language. The main difference between Haskell and Cayenne is that Cayenne has dependent types, i.e., the result type of a function may depend on the argument value , and types of record components (which can be types or values) may depend on other components. Cayenne also combines the syntactic categories for value expressions and type expressions; thus reducing the number of language concepts. Having dependent types and combined type and value expressions makes the language very powerful. It is powerful enough that a special module concept is unnecessary; ordinary records suffice. It is also powerful enough to encode predicate logic at the type level, allowing types to be used as specifications of programs. However, this power comes at a cost: type checking of Cayenne is undecidable. While this may appear to be a steep price to pay, it seems to work well in practice.},
1198−author = {Augustsson, Lennart},
1199−booktitle = {International Conference on Functional Programming},
1200−doi = {10.1097/MEG.0b013e328342f213},
1201−file = {:Users/edwin/Documents/Mendeley Desktop/Augustsson/Cayenne - a language with dependent types/Augustsson - Cayenne - a language with dependent types - 1998.pdf:pdf},
1202−issn = {14735687},
1203−keywords = {Depe,Dependent Types},
1204−mendeley-tags = {Depe,Dependent Types},
1205−number = {1},
1206−pages = {239--250},
1207−pmid = {21139473},
1208−publisher = {ACM Press},
1209−title = {{Cayenne - a language with dependent types}},
1210−url = {http://www.cs.chalmers.se/$\sim$augustss/cayenne/paper.ps},
1211−volume = {23},
1212−year = {1998}
1213−}
1214−@article{OutsideIn,
1215−author = {Vytiniotis, D and {Peyton Jones}, Simon and Shrijvers, Tom and Sulzmann, Martin},
1216−file = {:Users/edwin/Documents/Mendeley Desktop/Vytiniotis et al/textsc{OutsideIn}(X) Modular type inference with local assumptions/Vytiniotis et al. - textsc{OutsideIn}(X) Modular type inference with local assumptions - 2011.pdf:pdf},
1217−journal = {Journal of Functional Programming},
1218−number = {4--5},
1219−pages = {333----412},
1220−title = {{OutsideIn (X) Modular type inference with local assumptions}},
1221−url = {http://journals.cambridge.org/production/action/cjoGetFulltext?fulltextid=8274818},
1222−volume = {21},
1223−year = {2011}
1224−}
1225−@inproceedings{fisher2005pads,
1226−author = {Fisher, K. and Gruber, R.},
1227−booktitle = {ACM SIGPLAN Notices},
1228−number = {6},
1229−pages = {295--304},
1230−publisher = {ACM},
1231−title = {{PADS: a domain-specific language for processing ad hoc data}},
1232−url = {http://dl.acm.org/citation.cfm?id=1065046},
1233−volume = {40},
1234−year = {2005}
1235−}
1236−@inproceedings{Levitation2010,
1237−author = {Chapman, James and Dagand, Pierre-Evariste and McBride, Conor and Morris, Peter},
1238−booktitle = {{15th ACM SIGPLAN International Conference on Functional programming (ICFP '10)}},
1239−doi = {10.1145/1932681.1863547},
1240−file = {:Users/edwin/Documents/Mendeley Desktop/Chapman et al/The gentle art of levitation/Chapman et al. - The gentle art of levitation - 2010.pdf:pdf},
1241−isbn = {978-1-60558-794-3},
1242−issn = {03621340},
1243−keywords = {Dependent Types,data structure,metaprogramming,monads,proof assistants,type systems},
1244−mendeley-tags = {Dependent Types},
1245−month = sep,
1246−number = {9},
1247−title = {{The gentle art of levitation}},
1248−url = {http://dl.acm.org/citation.cfm?id=1932681.1863547},
1249−volume = {45},
1250−year = {2010}
1251−}
1252−@book{While2012,
1253−author = {Hunt, Andrew and Thomas, David},
1254−booktitle = {Carcinogenesis},
1255−doi = {10.1093/carcin/bgs054},
1256−file = {:Users/edwin/Documents/Mendeley Desktop/Hunt, Thomas/The Pragmatic Programmer Chapter 6/Hunt, Thomas - The Pragmatic Programmer Chapter 6 - Unknown.pdf:pdf},
1257−isbn = {020161622X},
1258−issn = {1460-2180},
1259−number = {3},
1260−pmid = {22383472},
1261−title = {{The Pragmatic Programmer Chapter 6}},
1262−url = {http://www.ncbi.nlm.nih.gov/pubmed/22383472},
1263−volume = {33}
1264−}
1265−@article{Hughes1989,
1266−abstract = {As software becomes more and more complex, it is more and more important to structure it well. Well-structured software is easy to write, easy to debug, and provides a collection of modules that can be re-used to reduce future programming costs. Conventional languages place conceptual limits on the way problems can be modularised. Functional languages push those limits back. In this paper we show that two features of functional languages in particular, higher-order functions and lazy evaluation, can contribute greatly to modularity. As examples, we manipulate lists and trees, program several numerical algorithms, and implement the alpha-beta heuristic (an algorithm from Artificial Intelligence used in game-playing programs). Since modularity is the key to successful programming, functional languages are vitally important to the real world.},
1267−author = {Hughes, J},
1268−chapter = {2},
1269−doi = {10.1093/comjnl/32.2.98},
1270−editor = {Turner, David A},
1271−file = {:Users/edwin/Documents/Mendeley Desktop/Hughes/Why Functional Programming Matters/Hughes - Why Functional Programming Matters - 1989.pdf:pdf},
1272−institution = {Programming Methodology Group, University of {G\"{o}teborg} and Chalmers Institute of Technology, Sweden},
1273−isbn = {0201172364},
1274−issn = {00104620},
1275−journal = {The Computer Journal},
1276−number = {2},
1277−pages = {98--107},
1278−publisher = {Br Computer Soc},
1279−title = {{Why Functional Programming Matters}},
1280−url = {http://comjnl.oupjournals.org/cgi/doi/10.1093/comjnl/32.2.98},
1281−volume = {32},
1282−year = {1989}
1283−}
1284−@inproceedings{Asperti2011,
1285−author = {Asperti, Andrea and Ricciotti, Wilmer and Coen, Claudio Sacerdoti and Tassi, Enrico},
1286−booktitle = {{Automated Deduction --- CADE-23}},
1287−file = {:Users/edwin/Documents/Mendeley Desktop/Asperti et al/The Matita Interactive Theorem Prover/Asperti et al. - The Matita Interactive Theorem Prover - 2011.pdf:pdf},
1288−pages = {64----69},
1289−title = {{The Matita Interactive Theorem Prover}},
1290−year = {2011}
1291−}
1292−@article{Brady2006a,
1293−author = {Brady, E and Hammond, K},
1294−file = {:Users/edwin/Documents/Mendeley Desktop/Brady, Hammond/A verified staged interpreter is a verified compiler/Brady, Hammond - A verified staged interpreter is a verified compiler - 2006.pdf:pdf},
1295−journal = {\ldots of the 5th international conference on \ldots},
1296−keywords = {Dependent Types},
1297−mendeley-tags = {Dependent Types},
1298−title = {{A verified staged interpreter is a verified compiler}},
1299−url = {http://portal.acm.org/citation.cfm?id=1173706.1173724},
1300−year = {2006}
1301−}
1302−@article{Xi1998,
1303−abstract = {We present a type-based approach to eliminating array bound checking and list tag checking by conservatively extending Standard ML with a restricted form of dependent types. This enables the programmer to capture more invariants through types while type-checking remains decidable in theory and can still be performed efficiently in practice. We illustrate our approach through concrete examples and present the result of our preliminary experiments which support support the feasibility and effectiveness of our approach.},
1304−author = {Xi, Hongwei and Pfenning, Frank},
1305−doi = {10.1145/277652.277732},
1306−file = {:Users/edwin/Documents/Mendeley Desktop/Xi, Pfenning/Eliminating array bound checking through dependent types/Xi, Pfenning - Eliminating array bound checking through dependent types - 1998.pdf:pdf},
1307−isbn = {0897919874},
1308−issn = {03621340},
1309−journal = {ACM Sigplan Notices},
1310−keywords = {Dependent Types},
1311−mendeley-tags = {Dependent Types},
1312−number = {5},
1313−pages = {249--257},
1314−publisher = {ACM},
1315−series = {PLDI '98},
1316−title = {{Eliminating array bound checking through dependent types}},
1317−url = {http://portal.acm.org/citation.cfm?doid=277652.277732},
1318−volume = {33},
1319−year = {1998}
1320−}
1321−@inproceedings{Abel2013,
1322−author = {Abel, Andreas and Pientka, Brigitte and Thibodeau, David and Setzer, Anton},
1323−booktitle = {Principles of Programming Languages},
1324−file = {:Users/edwin/Documents/Mendeley Desktop/Abel et al/Copatterns Programming Infinite Structures by Observations/Abel et al. - Copatterns Programming Infinite Structures by Observations - 2013.pdf:pdf},
1325−isbn = {9781450318327},
1326−keywords = {2008,by the graduiertenkol-,coinduction,elimination,functional programming,introduction,leg programm und modellanalyse,message passing,of the deutsche,pattern matching,puma,thibodeau acknowledges financial support,vs},
1327−title = {{Copatterns: Programming Infinite Structures by Observations}},
1328−year = {2013}
1329−}
1330−@misc{pollack1997believe,
1331−author = {Pollack, R.},
1332−file = {:Users/edwin/Documents/Mendeley Desktop/Pollack/How to believe a machine-checked proof/Pollack - How to believe a machine-checked proof - 1997.pdf:pdf},
1333−title = {{How to believe a machine-checked proof}},
1334−url = {http://books.google.co.uk/books?hl=en&amp;lr=&amp;id=pLnKggT_In4C&amp;oi=fnd&amp;pg=PA205&amp;dq=how+to+believe+a+machine+checked+proof&amp;ots=c2OI8krqqA&amp;sig=EF3QonGFVdOpYdKO1KmW6ljCkjY},
1335−year = {1997}
1336−}
1337−@book{Searching2012,
1338−author = {Sedgewick, Robert and Wayne, Kevin},
1339−booktitle = {The Gerontologist},
1340−doi = {10.1093/geront/gns026},
1341−file = {:Users/edwin/Documents/Mendeley Desktop/Sedgewick, Wayne/Algorithms Chapter 3/Sedgewick, Wayne - Algorithms Chapter 3 - 2012.pdf:pdf},
1342−isbn = {9780132762571},
1343−issn = {1758-5341},
1344−month = dec,
1345−number = {6},
1346−pages = {NP},
1347−pmid = {23150082},
1348−title = {{Algorithms Chapter 3}},
1349−url = {http://www.ncbi.nlm.nih.gov/pubmed/23150082},
1350−volume = {52},
1351−year = {2012}
1352−}
1353−@book{Philosophy2012,
1354−author = {Hunt, Andrew and Thomas, David},
1355−booktitle = {Carcinogenesis},
1356−doi = {10.1093/carcin/bgs054},
1357−file = {:Users/edwin/Documents/Mendeley Desktop/Hunt, Thomas/The Pragmatic Programmer Chapter 1/Hunt, Thomas - The Pragmatic Programmer Chapter 1 - Unknown.pdf:pdf},
1358−isbn = {020161622X},
1359−issn = {1460-2180},
1360−number = {3},
1361−pmid = {22383472},
1362−title = {{The Pragmatic Programmer Chapter 1}},
1363−url = {http://www.ncbi.nlm.nih.gov/pubmed/22383472},
1364−volume = {33}
1365−}
1366−@article{Servers,
1367−author = {Totty, Brian and Gourley, David},
1368−file = {:Users/edwin/Documents/Mendeley Desktop/Totty, Gourley/HTTP The Definitive Guide Chapter 5/Totty, Gourley - HTTP The Definitive Guide Chapter 5 - Unknown.pdf:pdf},
1369−isbn = {1565925092},
1370−title = {{HTTP: The Definitive Guide Chapter 5}}
1371−}
1372−@article{Bird2012a,
1373−annote = {This new version of the paper is, I think, very clear and an entertaining read. It presents a neat example of program calculation and reasoning with each step in the calculation explained precisely - indeed the interesting thing to me is the calculation, rather than the problem itself, and it is nice that this works for an algorithm which requires in-place update (even if it does involve pretending // is in-place!).
1374−
1375−
1376−I'm not totally convinced about the condition of the algorithm being "discovered in a disciplined manner" since many of the steps in the calculation required some insight, but others will disagree and I don't think it really matters for the main point of this paper in any case - the point is the calculational development, which is sufficiently detailed that a careful reader should be able to develop that insight, with practice. I would recommend this paper for acceptance in its current form. },
1377−author = {Bird, Richard S},
1378−file = {:Users/edwin/Documents/Mendeley Desktop/Bird/An in-situ algorithm for expanding a graph/Bird - An in-situ algorithm for expanding a graph - 2012.pdf:pdf},
1379−keywords = {a href,journal of functional programming},
1380−title = {{An in-situ algorithm for expanding a graph}},
1381−year = {2012}
1382−}
1383−@inproceedings{Sculthorpe2009,
1384−author = {Sculthorpe, Neil and Nilsson, Henrik},
1385−booktitle = {International Conference on Functional Programming ({ICFP} '09)},
1386−file = {:Users/edwin/Documents/Mendeley Desktop/Sculthorpe, Nilsson/Safe functional reactive programming through dependent types/Sculthorpe, Nilsson - Safe functional reactive programming through dependent types - 2009.pdf:pdf;:Users/edwin/Documents/Mendeley Desktop/Sculthorpe, Nilsson/Safe functional reactive programming through dependent types/Sculthorpe, Nilsson - Safe functional reactive programming through dependent types - 2009(2).pdf:pdf},
1387−title = {{Safe functional reactive programming through dependent types}},
1388−url = {http://dl.acm.org/citation.cfm?id=1596558},
1389−year = {2009}
1390−}
1391−@article{landin1966next,
1392−author = {Landin, P.J.},
1393−file = {:Users/edwin/Documents/Mendeley Desktop/Landin/The next 700 programming languages/Landin - The next 700 programming languages - 1966.pdf:pdf},
1394−journal = {Communications of the ACM},
1395−number = {3},
1396−pages = {157--166},
1397−publisher = {ACM},
1398−title = {{The next 700 programming languages}},
1399−url = {http://dl.acm.org/citation.cfm?id=365257 )},
1400−volume = {9},
1401−year = {1966}
1402−}
1403−@inproceedings{Delahaye2000,
1404−author = {Delahaye, D},
1405−booktitle = {Logic for Programming and Automated Reasoning ({LPAR})},
1406−file = {:Users/edwin/Documents/Mendeley Desktop/Delahaye/A tactic language for the system Coq/Delahaye - A tactic language for the system Coq - 2000.pdf:pdf;:Users/edwin/Documents/Mendeley Desktop/Delahaye/A tactic language for the system Coq/Delahaye - A tactic language for the system Coq - 2000(2).pdf:pdf},
1407−pages = {85----95},
1408−publisher = {Springer},
1409−title = {{A tactic language for the system Coq}},
1410−url = {http://www.springerlink.com/index/EFQAH8J88K42VN8T.pdf},
1411−year = {2000}
1412−}
1413−@book{Messages,
1414−author = {Totty, Brian and Gourley, David},
1415−file = {:Users/edwin/Documents/Mendeley Desktop/Totty, Gourley/HTTP The Definitive Guide Chapter 3/Totty, Gourley - HTTP The Definitive Guide Chapter 3 - Unknown.pdf:pdf},
1416−isbn = {1565925092},
1417−title = {{HTTP: The Definitive Guide Chapter 3}}
1418−}
1419−@article{Asperti,
1420−author = {Asperti, Andrea and Ricciotti, Wilmer and Coen, Claudio Sacerdoti and Tassi, Enrico},
1421−doi = {10.2168/LMCS-},
1422−file = {:Users/edwin/Documents/Mendeley Desktop/Asperti et al/A bi-directional refinement algorithm for the calculus of (co)inductive constructions/Asperti et al. - A bi-directional refinement algorithm for the calculus of (co)inductive constructions - 2012.pdf:pdf},
1423−journal = {{Logical Methods in Computer Science}},
1424−keywords = {and phrases,calculus of inductive construc-,interactive theorem prover,refiner,type inference},
1425−pages = {1----49},
1426−title = {{A bi-directional refinement algorithm for the calculus of (co)inductive constructions}},
1427−volume = {8},
1428−year = {2012}
1429−}
1430−@inproceedings{Altenkirch2010,
1431−abstract = {The recent success of languages like Agda and Coq demonstrates the potential of using dependent types for programming. These systems rely on many high-level features like datatype definitions, pattern matching and implicit arguments to facilitate the use of the languages. However, these features complicate the metatheoretical study and are a potential source of bugs. To address these issues we introduce $\Pi$$\Sigma$, a dependently typed core language. It is small enough for metatheoretical study and the type checker is small enough to be formally verified. In this language there is only one mechanism for recursionused for types, functions and infinite objectsand an explicit mechanism to control unfolding, based on lifted types. Furthermore structural equality is used consistently for values and types; this is achieved by a new notion of $\alpha$-equality for recursive definitions. We show, by translating several high-level constructions, that $\Pi$$\Sigma$ is suitable as a core language for dependently typed programming.},
1432−author = {Altenkirch, Thorsten and Danielsson, Nils Anders and L\"{o}h, Andres and Oury, Nicolas},
1433−booktitle = {{FLOPS 2010}},
1434−doi = {10.1007/978-3-642-12251-4_5},
1435−editor = {Blume, Matthias and Kobayashi, Naoki and Vidal, Germ\'{a}n},
1436−file = {:Users/edwin/Documents/Mendeley Desktop/Altenkirch et al/Dependent Types without the Sugar/Altenkirch et al. - Dependent Types without the Sugar - 2010.pdf:pdf},
1437−isbn = {9783642122507},
1438−pages = {40----55},
1439−publisher = {Springer Berlin Heidelberg},
1440−series = {Lecture Notes in Computer Science},
1441−title = {{Dependent Types without the Sugar}},
1442−url = {http://www.springerlink.com/index/91W712G2806R575H.pdf},
1443−year = {2010}
1444−}
1445−@misc{Gobi2010,
1446−author = {Gobi, Attila and Shkaravska, Olha and {Van Eekelen}, Marko},
1447−booktitle = {Syntax},
1448−file = {:Users/edwin/Documents/Mendeley Desktop/Gobi, Shkaravska, Van Eekelen/Higher-Order Size Checking Without Subtyping/Gobi, Shkaravska, Van Eekelen - Higher-Order Size Checking Without Subtyping - 2010.pdf:pdf},
1449−number = {100039},
1450−title = {{Higher-Order Size Checking Without Subtyping}},
1451−year = {2010}
1452−}
1453−@book{Context2012,
1454−author = {Sedgewick, Robert and Wayne, Kevin},
1455−booktitle = {The Gerontologist},
1456−doi = {10.1093/geront/gns026},
1457−file = {:Users/edwin/Documents/Mendeley Desktop/Sedgewick, Wayne/Algorithms Chapter 6/Sedgewick, Wayne - Algorithms Chapter 6 - 2012.pdf:pdf},
1458−isbn = {9780132762571},
1459−issn = {1758-5341},
1460−month = dec,
1461−number = {6},
1462−pages = {NP},
1463−pmid = {23150082},
1464−title = {{Algorithms Chapter 6}},
1465−url = {http://www.ncbi.nlm.nih.gov/pubmed/23150082},
1466−volume = {52},
1467−year = {2012}
1468−}
1469−@misc{Protocols2012a,
1470−author = {Anderson, Ross},
1471−doi = {10.1093/epirev/mxr031},
1472−file = {:Users/edwin/Documents/Mendeley Desktop/Anderson/Security Engineering Chapter 3/Anderson - Security Engineering Chapter 3 - Unknown.pdf:pdf},
1473−isbn = {9780470068526},
1474−issn = {1478-6729},
1475−pmid = {22215642},
1476−title = {{Security Engineering Chapter 3}}
1477−}
1478−@inproceedings{Visser2008,
1479−author = {Visser, E},
1480−booktitle = {Generative and Transformational Techniques in Software Engineering},
1481−title = {{WebDSL: A case study in domain-specific language engineering}},
1482−url = {http://www.springerlink.com/index/A3213003X6268032.pdf},
1483−year = {2008}
1484−}
1485−@inproceedings{gibbons2011modularising,
1486−author = {Gibbons, J. and Ko, H.S. and Others},
1487−file = {:Users/edwin/Documents/Mendeley Desktop/Ko, Gibbons/Modularising inductive families/Ko, Gibbons - Modularising inductive families - 2011.pdf:pdf},
1488−title = {{Modularising inductive families}},
1489−url = {http://www.cs.ox.ac.uk/publications/publication5008-abstract.html},
1490−year = {2011}
1491−}
1492−@book{Synchronization2012,
1493−author = {Butenhof, David R.},
1494−booktitle = {Nicotine & tobacco research : official journal of the Society for Research on Nicotine and Tobacco},
1495−doi = {10.1093/ntr/nts035},
1496−file = {:Users/edwin/Documents/Mendeley Desktop/Butenhof/Programming with POSIX Threads Chapter 3/Butenhof - Programming with POSIX Threads Chapter 3 - Unknown.pdf:pdf},
1497−isbn = {0201633922},
1498−issn = {1469-994X},
1499−number = {10},
1500−pmid = {23012339},
1501−title = {{Programming with POSIX Threads Chapter 3}},
1502−url = {http://www.ncbi.nlm.nih.gov/pubmed/23012339},
1503−volume = {14}
1504−}
1505−@article{Pl,
1506−annote = {-2, 3
1507−
1508−
1509−This paper gives a type inference algorithm for Java extended with lambdas, extending earlier work on type inference for a small functional language with subtyping. It is interesting to see how this could work, and I'm sure this would be a welcome addition to Java. However, I didn't find the paper very well organised or presented so it was difficult to get very much from it. There is too much unnecessary detail (such as fragments of the parser or complete sets of coercions and substitutions) and not enough useful context such as syntax of Java_lambda with its typing rules.
1510−
1511−
1512−If there is an implementation, it would also be good to give a url to download it so that the reader can try out some of the ideas given in the paper, and try to reproduce your results!
1513−
1514−
1515−Other comments:
1516−
1517−
1518−p1 The opening sentences don't seem to make sense on their own. It would be useful to know what your language in [7] is.
1519−
1520−
1521−There are several typos which suggest that the paper could use a proof read and spell check. For example:
1522−p2 "The improvement is that, that" => remove a "that"
1523−"not necessary" => "not necessarily"
1524−"can also consists" => "can also consist"
1525−"remainig" => "remaining"
1526−
1527−
1528−p3 What does "The concrete syntax [...] is oriented at [3]" mean? Is the syntax defined in this reference? It would be better to give it explicitly to make the paper more self contained.
1529−
1530−
1531−p4 Is there some reason that you use tuples in the representation of classes, functions and expressions?
1532−
1533−
1534−p9 "Decomposition: ..." I don't understand this sentence.
1535−
1536−
1537−p10 "corecions" => "coercions" (several times)
1538−also "coersions" => "coercions"
1539−
1540−
1541−p14 (and other places similarly) I don't think it helps much to give the full set of substitutions here. A representative selection at most should be fine.
1542−
1543−
1544−
1545− },
1546−author = {Pl\"{u}micke, Martin},
1547−file = {:Users/edwin/Documents/Mendeley Desktop/Pl{u}micke/Functional implementation of well-typings in/Pl{u}micke - Functional implementation of well-typings in - Unknown.pdf:pdf},
1548−title = {{Functional implementation of well-typings in}}
1549−}
1550−@article{gordon2003authenticity,
1551−author = {Gordon, A.D. and Jeffrey, A.},
1552−file = {:Users/edwin/Documents/Mendeley Desktop/Gordon, Jeffrey/Authenticity by typing for security protocols/Gordon, Jeffrey - Authenticity by typing for security protocols - 2003.pdf:pdf},
1553−journal = {Journal of computer security},
1554−number = {4},
1555−pages = {451--520},
1556−publisher = {IOS Press},
1557−title = {{Authenticity by typing for security protocols}},
1558−url = {http://iospress.metapress.com/index/BHQQUFRA1C7W8TLY.pdf},
1559−volume = {11},
1560−year = {2003}
1561−}
1562−@book{Approach2012,
1563−author = {Hunt, Andrew and Thomas, David},
1564−booktitle = {Carcinogenesis},
1565−doi = {10.1093/carcin/bgs054},
1566−file = {:Users/edwin/Documents/Mendeley Desktop/Hunt, Thomas/The Pragmatic Programmer Chapter 2/Hunt, Thomas - The Pragmatic Programmer Chapter 2 - Unknown.pdf:pdf},
1567−isbn = {020161622X},
1568−issn = {1460-2180},
1569−number = {3},
1570−pmid = {22383472},
1571−title = {{The Pragmatic Programmer Chapter 2}},
1572−url = {http://www.ncbi.nlm.nih.gov/pubmed/22383472},
1573−volume = {33}
1574−}
1575−@inproceedings{barras2008implicit,
1576−author = {Barras, B. and Bernardo, B.},
1577−booktitle = {Foundations of Software Science and Computational Structures},
1578−file = {:Users/edwin/Documents/Mendeley Desktop/Barras, Bernardo/The implicit calculus of constructions as a programming language with dependent types/Barras, Bernardo - The implicit calculus of constructions as a programming language with dependent types - 2008.pdf:pdf},
1579−pages = {365--379},
1580−publisher = {Springer},
1581−title = {{The implicit calculus of constructions as a programming language with dependent types}},
1582−url = {http://www.springerlink.com/index/m84h82904546l265.pdf},
1583−year = {2008}
1584−}
1585−@article{Zanasi,
1586−author = {Zanasi, Fabio},
1587−file = {:Users/edwin/Documents/Mendeley Desktop/Zanasi/On the Expressive Power of MSO and WMSO on Trees of Arbitrary Degree ( Extended abstract )/Zanasi - On the Expressive Power of MSO and WMSO on Trees of Arbitrary Degree ( Extended abstract ) - Unknown.pdf:pdf},
1588−pages = {1--6},
1589−title = {{On the Expressive Power of MSO and WMSO on Trees of Arbitrary Degree ( Extended abstract )}}
1590−}
1591−@article{Thiemann,
1592−annote = {1, 4
1593−
1594−
1595−This paper is a case study in dependently typed programming, investigating how an existing Haskell library (Accelerate) could benefit from dependent types by implementing a version of the library in Agda. The Haskell version is a generative library, meaning that programs are constructed as Haskell ADTs, then compiled to code which will run on a GPU. The authos observe that type correctness of Accelerate programs is checked statically, as far as possible, by using advanced features of the Haskell type system such as GADTs, and hypothesise that a language with a stronger type system such as Agda would increase the static guarantees which are expressible.
1596−
1597−
1598−This is an interesting question, well worth asking, and the paper presents mixed results. The presentation of the Agda version is clear, and the relationship with the Haskell version is easy to see. However, some properties which one might hope to express turn out to be difficult in the current form. One conclusion I would draw from this is that to use dependent types well involves more than simply annotating an existing program. The difficulties with filter and fold in particular show that care must be taken to preserve information required for checking later.
1599−
1600−
1601−I wonder if the work has become too constrained by porting directly from the Haskell implementation. Perhaps a question to ask in future work would be - what would a dependently typed API to GPUs look like? What properties do we want to capture, and how can we do so with minimal work for the programmer?
1602−
1603−
1604−Nevertheless, I enjoyed reading the paper and I think this is a good first step towards data parallel programming with dependent types.
1605−
1606−
1607−Minor comments:
1608−
1609−
1610−p3 Given that proceedings are in black and white, maybe it'd be more distinctive to put the Haskell code in a box rather than just a vertical bar?
1611−
1612−
1613−p8 It would be useful to see the type of the zipWith function which corresponds to the Haskell version, if not the implementation (which I suspect is a little tricky).
1614−
1615−
1616−p9 Probably not relevant to this paper, but this comment about properties of floating point arithmetic makes me wonder if it'd be possible to represent floating point error bounds in the type to recover these properties.
1617−
1618−
1619−p10 Another alternative for the type of filter could be a type level function to calculate the length. However, this would probably make proofs even harder. I think this is evidence that dependently typed programming is more than Haskell plus extra type annotations!
1620−
1621−
1622−p14 "We have build" => "We have built"},
1623−author = {Thiemann, Peter and Chakravarty, Manuel M T},
1624−file = {:Users/edwin/Documents/Mendeley Desktop/Thiemann, Chakravarty/Agda Meets Accelerate/Thiemann, Chakravarty - Agda Meets Accelerate - Unknown.pdf:pdf},
1625−keywords = {data parallelism,programming with dependent types},
1626−pages = {1--16},
1627−title = {{Agda Meets Accelerate}}
1628−}
1629−@inproceedings{Delahaye,
1630−author = {Delahaye, David},
1631−booktitle = {Proceedings of Logic for Programming and Automated Reasoning ({LPAR})},
1632−file = {:Users/edwin/Documents/Mendeley Desktop/Delahaye/A Tactic Language for the System Coq/Delahaye - A Tactic Language for the System Coq - 2000(3).pdf:pdf},
1633−title = {{A Tactic Language for the System Coq}},
1634−url = {http://citeseerx.ist.psu.edu/viewdoc/summary?doi=10.1.1.66.9062},
1635−year = {2000}
1636−}
1637−@inproceedings{atkey2009unembedding,
1638−author = {Atkey, R. and Lindley, S. and Yallop, J.},
1639−booktitle = {Proceedings of the 2nd ACM SIGPLAN symposium on Haskell},
1640−pages = {37--48},
1641−publisher = {ACM},
1642−title = {{Unembedding domain-specific languages}},
1643−url = {http://dl.acm.org/citation.cfm?id=1596644},
1644−year = {2009}
1645−}
1646−@inproceedings{ko2011modularising,
1647−author = {Ko, H.S. and Gibbons, J.},
1648−booktitle = {Proceedings of the seventh ACM SIGPLAN workshop on Generic programming},
1649−file = {:Users/edwin/Documents/Mendeley Desktop/Ko, Gibbons/Modularising inductive families/Ko, Gibbons - Modularising inductive families - 2011.pdf:pdf},
1650−pages = {13--24},
1651−publisher = {ACM},
1652−title = {{Modularising inductive families}},
1653−url = {http://www.cs.ox.ac.uk/publications/publication5008-abstract.html http://dl.acm.org/citation.cfm?id=2036921},
1654−year = {2011}
1655−}
1656−@article{Chapman2005epigram,
1657−author = {Chapman, James and Altenkirch, Thorsten and McBride, Conor},
1658−file = {:Users/edwin/Documents/Mendeley Desktop/Chapman, Altenkirch, McBride/Epigram Reloaded A Standalone Typechecker for {ETT}/Chapman, Altenkirch, McBride - Epigram Reloaded A Standalone Typechecker for {ETT} - 2005.pdf:pdf},
1659−journal = {Trends in Functional Programming},
1660−publisher = {Intellect Books},
1661−title = {{Epigram Reloaded: A Standalone Typechecker for {ETT}}},
1662−url = {http://books.google.co.uk/books?hl=en&amp;lr=&amp;id=p0yV1sHLubcC&amp;oi=fnd&amp;pg=PA79&amp;dq=epigram+reloaded&amp;ots=x50ou0VMsm&amp;sig=7TjAGohIatNLTWsHcuNcK5hEGGY},
1663−year = {2005}
1664−}
1665−@article{Hutton,
1666−author = {Hutton, Graham and Fulger, Diana},
1667−file = {:Users/edwin/Documents/Mendeley Desktop/Hutton, Fulger/Reasoning About Effects Seeing the Wood Through the Trees/Hutton, Fulger - Reasoning About Effects Seeing the Wood Through the Trees - Unknown.pdf:pdf},
1668−title = {{Reasoning About Effects : Seeing the Wood Through the Trees}}
1669−}
1670−@article{dybjer1994inductive,
1671−author = {Dybjer, P.},
1672−journal = {Formal aspects of computing},
1673−number = {4},
1674−pages = {440--465},
1675−publisher = {Springer},
1676−title = {{Inductive families}},
1677−url = {http://www.springerlink.com/index/J17824H467X6J288.pdf},
1678−volume = {6},
1679−year = {1994}
1680−}
1681−@misc{TheMendeleySupportTeam2011a,
1682−abstract = {A quick introduction to Mendeley. Learn how Mendeley creates your personal digital library, how to organize and annotate documents, how to collaborate and share with colleagues, and how to generate citations and bibliographies.},
1683−address = {London},
1684−author = {{The Mendeley Support Team}},
1685−booktitle = {Mendeley Desktop},
1686−file = {:Users/edwin/Documents/Mendeley Desktop/The Mendeley Support Team/Getting Started with Mendeley/The Mendeley Support Team - Getting Started with Mendeley - 2011.pdf:pdf},
1687−keywords = {Mendeley,how-to,user manual},
1688−pages = {1--16},
1689−publisher = {Mendeley Ltd.},
1690−title = {{Getting Started with Mendeley}},
1691−url = {http://www.mendeley.com},
1692−year = {2011}
1693−}
1694−@misc{Brady2012b,
1695−author = {Brooks, Fred},
1696−doi = {10.1093/epirev/mxr031},
1697−file = {:Users/edwin/Documents/Mendeley Desktop/Brooks/The Design of Design Chapter 2/Brooks - The Design of Design Chapter 2 - Unknown.pdf:pdf},
1698−isbn = {9780321702081},
1699−issn = {1478-6729},
1700−pmid = {22215642},
1701−title = {{The Design of Design Chapter 2}}
1702−}
1703−@misc{Bove2008,
1704−abstract = {In these lecture notes we give an introduction to functional programming with dependent types. We use the dependently typed programming language Agda which is based on ideas in Martin-L\"{o}f type theory and Martin-L\"{o}fs logical framework. We begin by showing how to do simply typed functional programming, and discuss the differences between Agdas type system and the Hindley-Milner type system, which underlies mainstream typed functional programming languages like Haskell and ML. We then show how to employ dependent types for programming with functional data structures such as vectors and binary search trees. We go on to explain the Curry-Howard identification of propositions and types, and how it makes Agda not only a programming language but also a programming logic. According to Curry-Howard, we also identify programs and proofs, something which is possible only by requiring that all program terminate. However, we show in the final section a method for encoding general and possibly partial recursive functions as total functions using dependent types.},
1705−author = {Bove, Ana and Dybjer, Peter},
1706−booktitle = {Notes},
1707−doi = {10.1007/978-3-642-03153-3_2},
1708−file = {:Users/edwin/Documents/Mendeley Desktop/Bove, Dybjer/Dependent Types at Work/Bove, Dybjer - Dependent Types at Work - 2008.pdf:pdf},
1709−number = {February},
1710−pages = {57--99},
1711−publisher = {Springer},
1712−title = {{Dependent Types at Work}},
1713−url = {http://www.springerlink.com/index/1039q8qk71257677.pdf},
1714−volume = {5520},
1715−year = {2008}
1716−}
1717−@article{In2012,
1718−author = {Gulhati, Ashish},
1719−doi = {10.1093/geront/gns026},
1720−file = {:Users/edwin/Documents/Mendeley Desktop/Gulhati/Beautiful Code Chapter 11/Gulhati - Beautiful Code Chapter 11 - 2012.pdf:pdf},
1721−isbn = {9780596510046},
1722−issn = {1758-5341},
1723−month = dec,
1724−number = {6},
1725−pages = {NP},
1726−pmid = {23150082},
1727−title = {{Beautiful Code Chapter 11}},
1728−url = {http://www.ncbi.nlm.nih.gov/pubmed/23150082},
1729−volume = {52},
1730−year = {2012}
1731−}
1732−@article{McBride2002,
1733−author = {McBride, C},
1734−file = {:Users/edwin/Documents/Mendeley Desktop/McBride/Elimination with a Motive/McBride - Elimination with a Motive - 2000.pdf:pdf},
1735−journal = {Types for proofs and programs ({TYPES 2000})},
1736−title = {{Elimination with a Motive}},
1737−url = {http://www.springerlink.com/index/vbpg19305t46f6dm.pdf},
1738−year = {2000}
1739−}
1740−@inproceedings{lempsink2009type,
1741−author = {Lempsink, E. and Leather, S. and L\"{o}h, A.},
1742−booktitle = {Proceedings of the 2009 ACM SIGPLAN workshop on Generic programming},
1743−file = {:Users/edwin/Documents/Mendeley Desktop/Lempsink, Leather, L\"{o}h/Type-safe diff for families of datatypes/Lempsink, Leather, L\"{o}h - Type-safe diff for families of datatypes - 2009.pdf:pdf},
1744−pages = {61--72},
1745−publisher = {ACM},
1746−title = {{Type-safe diff for families of datatypes}},
1747−url = {http://dl.acm.org/citation.cfm?id=1596624},
1748−year = {2009}
1749−}
1750−@inproceedings{Brady2011a,
1751−address = {New York, New York, USA},
1752−author = {Brady, Edwin},
1753−booktitle = {{Proceedings of the 5th {ACM} workshop on Programming Languages Meets Program Verification - PLPV '11}},
1754−doi = {10.1145/1929529.1929536},
1755−file = {:Users/edwin/Documents/Mendeley Desktop/Brady/Idris --- Systems Programming Meets Full Dependent Types/Brady - Idris --- Systems Programming Meets Full Dependent Types - 2011.pdf:pdf},
1756−isbn = {9781450304870},
1757−keywords = {Dependent Types,data description,dependent types},
1758−mendeley-tags = {Dependent Types},
1759−month = jan,
1760−publisher = {ACM Press},
1761−title = {{Idris --- Systems Programming Meets Full Dependent Types}},
1762−url = {http://dl.acm.org/citation.cfm?id=1929529.1929536},
1763−year = {2011}
1764−}
1765−@misc{altenkirch2005dependent,
1766−author = {Altenkirch, T. and McBride, C. and McKinna, J.},
1767−booktitle = {Manuscript, available online},
1768−file = {:Users/edwin/Documents/Mendeley Desktop/Altenkirch, McBride, McKinna/Why dependent types matter/Altenkirch, McBride, McKinna - Why dependent types matter - 2005.pdf:pdf},
1769−title = {{Why dependent types matter}},
1770−url = {http://www.cs.nott.ac.uk/$\sim$txa/talks/splst11.pdf},
1771−year = {2005}
1772−}
1773−@misc{Nodes2012a,
1774−author = {Brooks, Fred},
1775−doi = {10.1093/epirev/mxr031},
1776−file = {:Users/edwin/Documents/Mendeley Desktop/Brooks/The Design of Design Chapter 3/Brooks - The Design of Design Chapter 3 - Unknown.pdf:pdf},
1777−isbn = {9780321702081},
1778−issn = {1478-6729},
1779−pmid = {22215642},
1780−title = {{The Design of Design Chapter 3}}
1781−}
1782−@article{danielsson2011parsing,
1783−author = {Danielsson, N. and Norell, U.},
1784−journal = {Implementation and Application of Functional Languages},
1785−pages = {80--99},
1786−publisher = {Springer},
1787−title = {{Parsing mixfix operators}},
1788−url = {http://www.springerlink.com/index/386243257W504252.pdf},
1789−year = {2011}
1790−}
1791−@book{Bird2010,
1792−author = {Bird, Richard},
1793−file = {:Users/edwin/Documents/Mendeley Desktop/Bird/Pearls of Functional Algorithm Design/Bird - Pearls of Functional Algorithm Design - 2010.pdf:pdf},
1794−isbn = {9780521513388},
1795−title = {{Pearls of Functional Algorithm Design}},
1796−year = {2010}
1797−}
1798−@article{Jones1999,
1799−abstract = {Haskell benefits from a sophisticated type system, but implementors, programmers, and researchers suffer because it has no formal description. To remedy this shortcoming, we present a Haskell program that implements a Haskell typechecker, thus providing a mathematically rigorous specification in a notation that is familiar to Haskell users. We expect this program to fill a serious gap in current descriptions of Haskell, both as a starting point for discussions about existing features of the type system, and as a platform from which to explore new proposals.},
1800−author = {Jones, Mark P},
1801−file = {:Users/edwin/Documents/Mendeley Desktop/Jones/Typing Haskell in Haskell/Jones - Typing Haskell in Haskell - 1999.pdf:pdf},
1802−journal = {October},
1803−publisher = {Citeseer},
1804−title = {{Typing Haskell in Haskell}},
1805−url = {http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.134.7274&amp;rep=rep1&amp;type=pdf},
1806−year = {1999}
1807−}
1808−@book{Security2012,
1809−author = {Pfleeger, Charles P and Pfleeger, S. L.},
1810−booktitle = {Nicotine & tobacco research : official journal of the Society for Research on Nicotine and Tobacco},
1811−doi = {10.1093/ntr/nts035},
1812−file = {:Users/edwin/Documents/Mendeley Desktop/Pfleeger, Pfleeger/Security in Computing Chapter 3/Pfleeger, Pfleeger - Security in Computing Chapter 3 - 2012.pdf:pdf},
1813−isbn = {0132390779},
1814−issn = {1469-994X},
1815−month = oct,
1816−number = {10},
1817−pages = {NP},
1818−pmid = {23012339},
1819−title = {{Security in Computing Chapter 3}},
1820−url = {http://www.ncbi.nlm.nih.gov/pubmed/23012339},
1821−volume = {14},
1822−year = {2012}
1823−}
1824−@article{Steiner1988,
1825−author = {Steiner, JG},
1826−file = {:Users/edwin/Documents/Mendeley Desktop/Steiner/Kerberos An authentication service for open network systems/Steiner - Kerberos An authentication service for open network systems - 1988.pdf:pdf},
1827−journal = {Proc. Winter USENIX Conference},
1828−title = {{Kerberos: An authentication service for open network systems}},
1829−url = {http://www.cse.nd.edu/$\sim$dthain/courses/cse598z/fall2004/papers/kerberos.pdf},
1830−year = {1988}
1831−}
1832−@inproceedings{stump2010resource,
1833−author = {Stump, A. and Austin, E.},
1834−booktitle = {Proceedings of the 4th ACM SIGPLAN workshop on Programming languages meets program verification},
1835−file = {:Users/edwin/Documents/Mendeley Desktop/Stump, Austin/Resource typing in Guru/Stump, Austin - Resource typing in Guru - 2010.pdf:pdf},
1836−pages = {27--38},
1837−publisher = {ACM},
1838−title = {{Resource typing in Guru}},
1839−url = {http://dl.acm.org/citation.cfm?id=1707796},
1840−year = {2010}
1841−}
1842−@article{fisher2006next,
1843−author = {Fisher, K. and Mandelbaum, Y. and Walker, D.},
1844−file = {:Users/edwin/Documents/Mendeley Desktop/Fisher, Mandelbaum, Walker/The next 700 data description languages/Fisher, Mandelbaum, Walker - The next 700 data description languages - 2010.pdf:pdf},
1845−journal = {Journal of the ACM},
1846−number = {2},
1847−pages = {1--51},
1848−publisher = {ACM},
1849−title = {{The next 700 data description languages}},
1850−url = {http://dl.acm.org/citation.cfm?id=1111039},
1851−volume = {15},
1852−year = {2010}
1853−}
1854−@inproceedings{brady2011epic,
1855−author = {Brady, Edwin},
1856−booktitle = {Trends in Functional Programming ({TFP}’11)},
1857−file = {:Users/edwin/Documents/Mendeley Desktop/Brady/Epic --- A Library for Generating Compilers/Brady - Epic --- A Library for Generating Compilers - 2011.pdf:pdf},
1858−title = {{Epic --- A Library for Generating Compilers}},
1859−url = {http://scholar.google.co.uk/scholar?cites=2588300990390214449&as_sdt=2005&sciodt=0,5&hl=en#1},
1860−year = {2011}
1861−}
1862−@inproceedings{Brady2006b,
1863−author = {Brady, Edwin},
1864−booktitle = {Implementation and Application of Functional Languages ({IFL}'06)},
1865−file = {:Users/edwin/Documents/Mendeley Desktop/Brady/Ivor, a proof engine/Brady - Ivor, a proof engine - 2006.pdf:pdf},
1866−isbn = {978-3-540-74129-9},
1867−month = sep,
1868−pages = {145----162},
1869−title = {{Ivor, a proof engine}},
1870−url = {http://dl.acm.org/citation.cfm?id=1757028.1757037},
1871−year = {2006}
1872−}
1873−@article{Reynolds1972,
1874−abstract = {Higher-order programming languages (i.e., languages in which procedures or labels can occur as values) are usually defined by interpreters which are themselves written in a programming language based on the lambda calculus (i.e., an applicative language such as pure LISP). Examples include McCarthy's definition of LISP, Landin's SECD machine, the Vienna definition of PL/I, Reynolds' definitions of GEDANKEN, and recent unpublished work by L. Morris and C. Wadsworth. Such definitions can be classified according to whether the interpreter contains higher-order functions, and whether the order of application (i.e., call-by-value versus call-by-name) in the defined language depends upon the order of application in the defining language. As an example, we consider the definition of a simple applicative programming language by means of an interpreter written in a similar language. Definitions in each of the above classifications are derived from one another by informal but constructive methods. The treatment of imperative features such as jumps and assignment is also discussed.},
1875−author = {Reynolds, John C},
1876−file = {:Users/edwin/Documents/Mendeley Desktop/Reynolds/Definitional interpreters for higher-order programming languages/Reynolds - Definitional interpreters for higher-order programming languages - 1972.pdf:pdf},
1877−journal = {Proceedings of the ACM annual conference on ACM 72},
1878−keywords = {applicative language,closure,continuation,gedanken,higher order function,interpreter,j operator,lambda calculus,language definition,lisp,order application,pal,programming language,reference,secd machine},
1879−number = {30602},
1880−pages = {717--740},
1881−publisher = {ACM Press},
1882−title = {{Definitional interpreters for higher-order programming languages}},
1883−volume = {2},
1884−year = {1972}
1885−}
1886−@book{Hunt,
1887−author = {Hunt, Andrew and Thomas, David},
1888−booktitle = {Design},
1889−file = {:Users/edwin/Documents/Mendeley Desktop/Hunt, Thomas/The Pragmatic Programmer Chapter 4/Hunt, Thomas - The Pragmatic Programmer Chapter 4 - Unknown.pdf:pdf},
1890−isbn = {020161622X},
1891−title = {{The Pragmatic Programmer Chapter 4}}
1892−}
1893−@article{Epstein2011,
1894−author = {Epstein, Jeff and Black, Andrew P and Peyton-jones, Simon},
1895−institution = {Microsoft Research},
1896−journal = {researchmicrosoftcom},
1897−number = {Section 8},
1898−pages = {1--12},
1899−title = {{Haskell for the cloud}},
1900−url = {http://research.microsoft.com/en-us/um/people/simonpj/papers/parallel/remote.pdf},
1901−year = {2011}
1902−}
1903−@book{Bertot2004,
1904−author = {Bertot, Yves and Cast\'{e}ran, Pierre},
1905−publisher = {Springer},
1906−title = {{Interactive theorem proving and program development: {Coq'Art}: the {Calculus of Inductive Constructions}}},
1907−url = {http://books.google.co.uk/books?hl=en&amp;lr=&amp;id=m5w5PRj5Nj4C&amp;oi=fnd&amp;pg=PA1&amp;dq=coq+theorem+prover&amp;ots=VHny1IYV0h&amp;sig=-K0FC67cdkhMDkAocFla8cZyRT4},
1908−year = {2004}
1909−}
1910−@article{Swierstra2011,
1911−author = {Swierstra, W},
1912−file = {:Users/edwin/Documents/Mendeley Desktop/Swierstra/Sorted Verifying the Problem of the {Dutch National} Flag in {Agda}/Swierstra - Sorted Verifying the Problem of the {Dutch National} Flag in {Agda} - 2011.pdf:pdf},
1913−journal = {Journal of Functional Programming},
1914−number = {6},
1915−pages = {575----583},
1916−title = {{Sorted: Verifying the Problem of the {Dutch National} Flag in {Agda}}},
1917−url = {http://journals.cambridge.org/abstract_S0956796811000207},
1918−volume = {21},
1919−year = {2011}
1920−}
1921−@misc{Casinghino2012,
1922−author = {Casinghino, Chris and Sj\"{o}berg, Vilhelm and Weirich, Stephanie},
1923−file = {:Users/edwin/Documents/Mendeley Desktop/Casinghino, Sj{o}berg, Weirich/Combining Proofs and Programs in a Dependently Typed Language/Casinghino, Sj{o}berg, Weirich - Combining Proofs and Programs in a Dependently Typed Language - 2012.pdf:pdf},
1924−keywords = {dependent types,general recursion,termination},
1925−pages = {1--12},
1926−title = {{Combining Proofs and Programs in a Dependently Typed Language}},
1927−year = {2012}
1928−}
1929−@article{Huet1997,
1930−author = {Huet, G},
1931−file = {:Users/edwin/Documents/Mendeley Desktop/Huet/The zipper/Huet - The zipper - 1997.pdf:pdf},
1932−journal = {{Journal of Functional Programming}},
1933−number = {5},
1934−pages = {549----554},
1935−title = {{The zipper}},
1936−url = {http://journals.cambridge.org/abstract_S0956796897002864},
1937−volume = {7},
1938−year = {1997}
1939−}
1940−@inproceedings{bradyresource,
1941−author = {Brady, Edwin and Hammond, Kevin},
1942−booktitle = {Practical Applications of Declarative Languages ({PADL} 2012)},
1943−file = {:Users/edwin/Documents/Mendeley Desktop/Brady, Hammond/Resource-safe Systems Programming with Embedded Domain Specific Languages/Brady, Hammond - Resource-safe Systems Programming with Embedded Domain Specific Languages - 2012.pdf:pdf},
1944−pages = {242----257},
1945−title = {{Resource-safe Systems Programming with Embedded Domain Specific Languages}},
1946−url = {http://www.cs.st-andrews.ac.uk/$\sim$eb/drafts/dsl-idris.pdf},
1947−year = {2012}
1948−}
1949−@book{Management,
1950−author = {Totty, Brian and Gourley, David},
1951−file = {:Users/edwin/Documents/Mendeley Desktop/Totty, Gourley/HTTP The Definitive Guide Chapter 4/Totty, Gourley - HTTP The Definitive Guide Chapter 4 - Unknown.pdf:pdf},
1952−isbn = {1565925092},
1953−title = {{HTTP: The Definitive Guide Chapter 4}}
1954−}
1955−@phdthesis{Brady2005,
1956−author = {Brady, Edwin},
1957−file = {:Users/edwin/Documents/Mendeley Desktop/Brady/Practical Implementation of a Dependently Typed Functional Programming Language/Brady - Practical Implementation of a Dependently Typed Functional Programming Language - 2005.pdf:pdf},
1958−keywords = {Dependent Types},
1959−mendeley-tags = {Dependent Types},
1960−school = {University of Durham},
1961−title = {{Practical Implementation of a Dependently Typed Functional Programming Language}},
1962−year = {2005}
1963−}
1964−@article{Lee2001,
1965−author = {Lee, Chin Soon and Jones, Neil D. and Ben-Amram, Amir M.},
1966−doi = {10.1145/373243.360210},
1967−file = {:Users/edwin/Documents/Mendeley Desktop/Lee, Jones, Ben-Amram/The size-change principle for program termination/Lee, Jones, Ben-Amram - The size-change principle for program termination - 2001.pdf:pdf},
1968−isbn = {1-58113-336-7},
1969−issn = {03621340},
1970−journal = {{ACM SIGPLAN Notices}},
1971−keywords = {PSPACE-completeness,omega automaton,partial evaluation,program analysis,termination},
1972−month = mar,
1973−number = {3},
1974−pages = {81--92},
1975−title = {{The size-change principle for program termination}},
1976−url = {http://dl.acm.org/citation.cfm?id=373243.360210},
1977−volume = {36},
1978−year = {2001}
1979−}
1980−@misc{Bloat,
1981−author = {Brooks, Fred},
1982−file = {:Users/edwin/Documents/Mendeley Desktop/Brooks/The Design of Design Chapter 4/Brooks - The Design of Design Chapter 4 - Unknown.pdf:pdf},
1983−isbn = {9780321702081},
1984−title = {{The Design of Design Chapter 4}}
1985−}
1986−@misc{Caldwell,
1987−author = {Caldwell, James and Roan, Ryan},
1988−file = {:Users/edwin/Documents/Mendeley Desktop/Caldwell, Roan/Type Checking SQL for Secure Database Access/Caldwell, Roan - Type Checking SQL for Secure Database Access - Unknown.pdf:pdf},
1989−title = {{Type Checking SQL for Secure Database Access}}
1990−}
1991−@inproceedings{Peterson1993,
1992−address = {New York, New York, USA},
1993−author = {Peterson, John and Jones, Mark},
1994−booktitle = {Proceedings of the ACM SIGPLAN 1993 conference on Programming Language Design and Implementation - PLDI '93},
1995−doi = {10.1145/155090.155112},
1996−file = {:Users/edwin/Documents/Mendeley Desktop/Peterson, Jones/Implementing type classes/Peterson, Jones - Implementing type classes - 1993.pdf:pdf},
1997−isbn = {0897915984},
1998−issn = {0362-1340},
1999−month = aug,
2000−number = {6},
2001−pages = {227--236},
2002−publisher = {ACM Press},
2003−title = {{Implementing type classes}},
2004−url = {http://dl.acm.org/citation.cfm?id=155090.155112},
2005−volume = {28},
2006−year = {1993}
2007−}
2008−@misc{Attacks2012a,
2009−author = {Anderson, Ross},
2010−doi = {10.1093/epirev/mxr031},
2011−file = {:Users/edwin/Documents/Mendeley Desktop/Anderson/Security Engineering Chapter 18/Anderson - Security Engineering Chapter 18 - Unknown.pdf:pdf},
2012−isbn = {9780470068526},
2013−issn = {1478-6729},
2014−number = {1},
2015−pages = {NP},
2016−pmid = {22215642},
2017−title = {{Security Engineering Chapter 18}},
2018−volume = {34}
2019−}
2020−@inproceedings{bhargavan2010modular,
2021−author = {Bhargavan, K. and Fournet, C. and Gordon, A.D.},
2022−booktitle = {ACM Sigplan Notices},
2023−number = {1},
2024−pages = {445--456},
2025−publisher = {ACM},
2026−title = {{Modular verification of security protocol code by typing}},
2027−url = {http://dl.acm.org/citation.cfm?id=1707801.1706350},
2028−volume = {45},
2029−year = {2010}
2030−}
2031−@article{Hoare1978,
2032−abstract = {This paper suggests that input and output are basic primitives of programming and that parallel composition of communicating sequential processes is a fundamental program structuring method. When combined with a development of Dijkstra's guarded command, these concepts are surprisingly versatile. Their use is illustrated by sample solutions of a variety of a familiar programming exercises.},
2033−author = {Hoare, C A R},
2034−doi = {10.1016/0167-6423(87)90028-1},
2035−editor = {McKeag, R M and Macnaghten, A M},
2036−file = {:Users/edwin/Documents/Mendeley Desktop/Hoare/Communicating sequential processes/Hoare - Communicating sequential processes - 1978.pdf:pdf},
2037−isbn = {0131532715},
2038−issn = {01676423},
2039−journal = {Communications of the ACM},
2040−number = {8},
2041−pages = {666--677},
2042−pmid = {2142694823583477576},
2043−publisher = {ACM},
2044−series = {International Series in Computer Science},
2045−title = {{Communicating sequential processes}},
2046−url = {http://linkinghub.elsevier.com/retrieve/pii/0167642387900281},
2047−volume = {21},
2048−year = {1978}
2049−}
2050−@article{Overview,
2051−author = {Totty, Brian and Gourley, David},
2052−file = {:Users/edwin/Documents/Mendeley Desktop/Totty, Gourley/HTTP The Definitive Guide Chapter 1/Totty, Gourley - HTTP The Definitive Guide Chapter 1 - Unknown.pdf:pdf},
2053−isbn = {1565925092},
2054−title = {{HTTP: The Definitive Guide Chapter 1}}
2055−}
2056−@inproceedings{Sozeau2008,
2057−author = {Sozeau, Matthieu and Oury, Nicolas},
2058−booktitle = {Theorem Proving in Higher Order Logics ({TPHOLs 2008})},
2059−file = {:Users/edwin/Documents/Mendeley Desktop/Sozeau, Oury/First-Class Type Classes/Sozeau, Oury - First-Class Type Classes - 2008.pdf:pdf},
2060−pages = {278----293},
2061−title = {{First-Class Type Classes}},
2062−year = {2008}
2063−}
2064−@book{Fogel,
2065−author = {Fogel, Karl},
2066−file = {:Users/edwin/Documents/Mendeley Desktop/Fogel/Producing Open Source Software How to Run a Successful Free Software Project/Fogel - Producing Open Source Software How to Run a Successful Free Software Project - Unknown.pdf:pdf},
2067−title = {{Producing Open Source Software: How to Run a Successful Free Software Project}}
2068−}
2069−@book{Brady2012,
2070−author = {Hunt, Andrew and Thomas, David},
2071−booktitle = {Carcinogenesis},
2072−doi = {10.1093/carcin/bgs054},
2073−file = {:Users/edwin/Documents/Mendeley Desktop/Hunt, Thomas/The Pragmatic Programmer Chapter 5/Hunt, Thomas - The Pragmatic Programmer Chapter 5 - Unknown.pdf:pdf},
2074−isbn = {020161622X},
2075−issn = {1460-2180},
2076−number = {3},
2077−pmid = {22383472},
2078−title = {{The Pragmatic Programmer Chapter 5}},
2079−url = {http://www.ncbi.nlm.nih.gov/pubmed/22383472},
2080−volume = {33}
2081−}
2082−@inproceedings{augustsson2008paradise,
2083−author = {Augustsson, L. and Mansell, H. and Sittampalam, G.},
2084−booktitle = {International Conference on Functional Programming},
2085−file = {:Users/edwin/Documents/Mendeley Desktop/Augustsson, Mansell, Sittampalam/Paradise a two-stage DSL embedded in Haskell/Augustsson, Mansell, Sittampalam - Paradise a two-stage DSL embedded in Haskell - 2008.pdf:pdf},
2086−number = {9},
2087−pages = {225--228},
2088−publisher = {ACM},
2089−title = {{Paradise: a two-stage DSL embedded in Haskell}},
2090−url = {http://dl.acm.org/citation.cfm?id=1411203.1411236},
2091−volume = {43},
2092−year = {2008}
2093−}
2094−@article{marlow2006making,
2095−author = {Marlow, S. and {Peyton Jones}, S.},
2096−file = {:Users/edwin/Documents/Mendeley Desktop/Marlow, Peyton Jones/Making a fast curry pushenter vs. evalapply for higher-order languages/Marlow, Peyton Jones - Making a fast curry pushenter vs. evalapply for higher-order languages - 2006.pdf:pdf},
2097−journal = {Journal of Functional Programming},
2098−number = {4-5},
2099−pages = {415--449},
2100−publisher = {Cambridge University Press},
2101−title = {{Making a fast curry: push/enter vs. eval/apply for higher-order languages}},
2102−url = {http://dl.acm.org/citation.cfm?id=1166018},
2103−volume = {16},
2104−year = {2006}
2105−}
2106−@misc{TheMendeleySupportTeam2011b,
2107−abstract = {A quick introduction to Mendeley. Learn how Mendeley creates your personal digital library, how to organize and annotate documents, how to collaborate and share with colleagues, and how to generate citations and bibliographies.},
2108−address = {London},
2109−author = {{The Mendeley Support Team}},
2110−booktitle = {Mendeley Desktop},
2111−file = {:Users/edwin/Documents/Mendeley Desktop/The Mendeley Support Team/Getting Started with Mendeley/The Mendeley Support Team - Getting Started with Mendeley - 2011.pdf:pdf},
2112−keywords = {Mendeley,how-to,user manual},
2113−pages = {1--16},
2114−publisher = {Mendeley Ltd.},
2115−title = {{Getting Started with Mendeley}},
2116−url = {http://www.mendeley.com},
2117−year = {2011}
2118−}
2119−@inproceedings{ko2011modularising,
2120−author = {Ko, H.S. and Gibbons, J.},
2121−booktitle = {Proceedings of the seventh ACM SIGPLAN workshop on Generic programming},
2122−pages = {13--24},
2123−publisher = {ACM},
2124−title = {{Modularising inductive families}},
2125−url = {http://dl.acm.org/citation.cfm?id=2036921},
2126−year = {2011}
2127−}
2128−@book{Fry1985,
2129−author = {Abelson, Harold and Sussman, Gerald and Sussman, Julie},
2130−booktitle = {Computer Music Journal},
2131−doi = {10.2307/3679579},
2132−file = {:Users/edwin/Documents/Mendeley Desktop/Abelson, Sussman, Sussman/Structure and Interpretation of Computer Programs/Abelson, Sussman, Sussman - Structure and Interpretation of Computer Programs - 1985.pdf:pdf},
2133−isbn = {0262011530},
2134−issn = {01489267},
2135−month = jan,
2136−number = {3},
2137−title = {{Structure and Interpretation of Computer Programs}},
2138−url = {http://www.jstor.org/stable/3679579?origin=crossref},
2139−volume = {9},
2140−year = {1985}
2141−}
2142−@article{Bird2012,
2143−annote = {I enjoyed reading this pearl. It describes, clearly and concisely, the calculation of a program for changing the way of representing a graph in response to a challenge of Donald Knuth's, who asked whether such an algorithm could be discovered in a "disciplined manner". The paper describes that disciplined manner.
2144−
2145−
2146−
2147−
2148−In general, I found the paper easy to follow. Section 2 sets up the problem, giving a purely functional representation of graphs and the definitions of some basic, important functions, in particular encode and decode. Section 3 gives a first example of program calculation, assuming the existence of a function 'lengthen' corresponding to 'shorten' and deriving an implementation from its required properties. Later, we see a definition using arrays rather than lists in order to improve the complexity to linear time. Section 4 addresses a condition Knuth imposes, namely that update must be in place and gives an imperative translation.
2149−
2150−
2151−I think this paper gives a nice example of program calculation leading from a functional specification to an imperative program. I do have a few suggestions though which I think would improve the paper:
2152−
2153−
2154−In the introduction, you say there is a reason why the code cannot be purely functional, but I don't see an explicit explanation of why this is. In place update perhaps? Can this be clarified?
2155−
2156−
2157−The equation numbering, e.g. (1) at the bottom of p1 - some equations are clearly important and referred to elsewhere, such as this one. Is it possible to make these stand out more? e.g. with an explicit heading "Equation 1"?
2158−
2159−
2160−p3 In the first examples of program calculation, it is easy to follow the reasoning of why the calculation is correct, but it is not so obvious what the insight was that led to the calculation. Is this simply a matter of experience?
2161−
2162−
2163−p6 I'm surprised to read that // updates an array in place. Is this really what is happening or is there a clever representation of Data.Array.Diff? It appears to use IO operations internally. So it might be nice to say a little more about what is really going on.
2164−
2165−
2166−p7 "...an observation that could have been made earlier" seems an odd thing to say. Why not either make it earlier, or just make it here where it is used?
2167−
2168−
2169−p9 There is no need to give the translation rules to the imperative code in detail, but it would still be useful to sketch what is going on. It seems that the foldr becomes the outer for loop, and apply the inner for loop. It would also be useful, in Figs 1-4 to give the functional code alongside the imperative versions. It is interesting to examine how the mapping works and I think an important point made by the paper (as indeed you say in the conclusion).
2170−
2171−
2172−p14 The last paragraph appears to be largely a comment to the present referees!
2173−
2174− },
2175−author = {Bird, Richard S},
2176−file = {:Users/edwin/Documents/Mendeley Desktop/Bird/An in-situ algorithm for expanding a graph/Bird - An in-situ algorithm for expanding a graph - 2012(2).pdf:pdf},
2177−journal = {Journal of Functional Programming},
2178−keywords = {a href,journal of functional programming},
2179−title = {{An in-situ algorithm for expanding a graph}},
2180−year = {2012}
2181−}
2182−@article{Ahn,
2183−annote = {-1,5
2184−
2185−
2186−The paper describes Nax, a new functional programming language with term indices which supports logical consistency and Hindley-Milner style type inference. The authors give four key features of Nax (1: strong normalization, 2: type inference, 3: expressivity and 4: support for term indices) and give several examples to demonstrate the simplicity of programming in Nax as compared with Haskell and Agda. Three examples are given, in each language: a type preserving evaluator for an expression language, a generic Path datatype which describes a path through an index type, and a stack safe compiler for the expression language.
2187−
2188−
2189−Presenting examples in this way gives a nice introduction to Nax, in that they are well understood examples already and it is easy to relate them to implementations with which the reader is already familiar. On the other hand, this leads to my main problem with this paper: it doesn't really tell us anything we don't already know, and the promising things about Nax which *would* be an interesting contribution are left out of the paper.
2190−
2191−
2192−Of the four features of Nax given above, 1 and 2 are described as "beyond the scope of this paper" which is a shame because these are the things I'm most interested in hearing about! Existing dependently typed languages lack type inference, and whlie I would argue that it is usually best to write types first in any case, there are still many situations where recovering type inference would be useful - typically small or simply typed helper functions. So this would have been a very nice technical contribution.
2193−
2194−
2195−The third feature (expressivity) is one that the authors claim as a contribution of the paper. They claim that programming in Nax is as "simple" as programming in Haskell or Agda. However, I think this is a strong claim to make given the available evidence - it is quite subjective. I agree that the programs are quite easy to read, but to say that *programming* is as simple really requires some externally verified evidence from other programmers! It seems to me that programming with Mendler-style combinators may take some practice, for example.
2196−
2197−
2198−In summary, I do like the idea behind Nax and some of its features sound as if they could be interesting, and I think this latest contribution to the design space of dependently typed functional programming is welcome. But this paper does not really provide any new insights as it stands.
2199−
2200−
2201−Minor comments:
2202−
2203−
2204−Fig 1,2 and 3 - I'm not sure I would like the rotation of these in print (it's pretty awkward on screen too).},
2205−author = {Ahn, Ki Yung and Sheard, Tim and Fiore, Marcelo and Pitts, Andrew M},
2206−file = {:Users/edwin/Documents/Mendeley Desktop/Ahn et al/Programming with Term-Indexed Types in Nax/Ahn et al. - Programming with Term-Indexed Types in Nax - Unknown.pdf:pdf},
2207−keywords = {gadts,indexed datatypes,lightweight dependent types,term-indexed types,universe polymorphism,universe subtyping},
2208−title = {{Programming with Term-Indexed Types in Nax}}
2209−}
2210−@article{Morrisett1999,
2211−author = {Morrisett, G and Walker, D},
2212−file = {:Users/edwin/Documents/Mendeley Desktop/Morrisett, Walker/From System F to typed assembly language/Morrisett, Walker - From System F to typed assembly language - 1999.pdf:pdf},
2213−journal = {ACM Transactions on \ldots},
2214−title = {{From System F to typed assembly language}},
2215−url = {http://dl.acm.org/citation.cfm?id=319345},
2216−year = {1999}
2217−}
2218−@article{Altenkirch2010a,
2219−abstract = {We begin by revisiting the idea of using a universe of types to write generic programs in a dependently typed setting by constructing a universe for Strictly Positive Types (SPTs). Here we extend this construction to cover dependent types, i.e. Strictly Positive Families (SPFs), thereby fixing a gap left open in previous work. Using the approach presented here we are able to represent all of Epigrams datatypes within Epigram including the universe of datatypes itself.},
2220−author = {Altenkirch, Thorsten and Mcbride, Conor and Morris, Peter},
2221−file = {:Users/edwin/Documents/Mendeley Desktop/Altenkirch, Mcbride, Morris/Generic Programming with Dependent Types/Altenkirch, Mcbride, Morris - Generic Programming with Dependent Types - 2010.pdf:pdf},
2222−journal = {Citeseer},
2223−publisher = {Citeseer},
2224−title = {{Generic Programming with Dependent Types}},
2225−url = {http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.129.2926&amp;rep=rep1&amp;type=pdf},
2226−year = {2010}
2227−}
2228−@book{Edition2012a,
2229−author = {Pfleeger, Charles P and Pfleeger, S. L.},
2230−booktitle = {Nicotine & tobacco research : official journal of the Society for Research on Nicotine and Tobacco},
2231−doi = {10.1093/ntr/nts035},
2232−file = {:Users/edwin/Documents/Mendeley Desktop/Pfleeger, Pfleeger/Security in Computer Chapter 12/Pfleeger, Pfleeger - Security in Computer Chapter 12 - 2012.pdf:pdf},
2233−isbn = {0132390779},
2234−issn = {1469-994X},
2235−month = oct,
2236−number = {10},
2237−pages = {NP},
2238−pmid = {23012339},
2239−title = {{Security in Computer Chapter 12}},
2240−url = {http://www.ncbi.nlm.nih.gov/pubmed/23012339},
2241−volume = {14},
2242−year = {2012}
2243−}
2244−@book{Pierce2004,
2245−author = {Pierce, Benjamin},
2246−editor = {Pierce, Benjamin},
2247−file = {:Users/edwin/Documents/Mendeley Desktop/Pierce/Advanced topics in types and programming languages/Pierce - Advanced topics in types and programming languages - 2004.pdf:pdf},
2248−publisher = {MIT Press},
2249−title = {{Advanced topics in types and programming languages}},
2250−year = {2004}
2251−}
2252−@inproceedings{taha1997multi,
2253−author = {Taha, W. and Sheard, T.},
2254−booktitle = {ACM SIGPLAN Notices},
2255−number = {12},
2256−pages = {203--217},
2257−publisher = {ACM},
2258−title = {{Multi-stage programming with explicit annotations}},
2259−url = {http://dl.acm.org/citation.cfm?id=259019},
2260−volume = {32},
2261−year = {1997}
2262−}
2263−@misc{Lorenzen,
2264−author = {Lorenzen, Florian},
2265−file = {:Users/edwin/Documents/Mendeley Desktop/Lorenzen/A Statically Typed Functional Language With Programmable Binders/Lorenzen - A Statically Typed Functional Language With Programmable Binders - Unknown.pdf:pdf},
2266−title = {{A Statically Typed Functional Language With Programmable Binders}}
2267−}
2268−@book{The2012,
2269−author = {Hunt, Andrew and Thomas, David},
2270−booktitle = {Carcinogenesis},
2271−doi = {10.1093/carcin/bgs054},
2272−file = {:Users/edwin/Documents/Mendeley Desktop/Hunt, Thomas/The Pragmatic Programmer Chapter 3/Hunt, Thomas - The Pragmatic Programmer Chapter 3 - Unknown.pdf:pdf},
2273−isbn = {020161622X},
2274−issn = {1460-2180},
2275−number = {3},
2276−pmid = {22383472},
2277−title = {{The Pragmatic Programmer Chapter 3}},
2278−url = {http://www.ncbi.nlm.nih.gov/pubmed/22383472},
2279−volume = {33}
2280−}
2281−@inproceedings{pollack1990implicit,
2282−author = {Pollack, R.},
2283−booktitle = {{Informal Proceedings of First Workshop on Logical Frameworks, Antibes}},
2284−file = {:Users/edwin/Documents/Mendeley Desktop/Pollack/Implicit syntax/Pollack - Implicit syntax - 1990.pdf:pdf},
2285−publisher = {Citeseer},
2286−title = {{Implicit syntax}},
2287−url = {http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.30.7361&amp;rep=rep1&amp;type=pdf},
2288−year = {1990}
2289−}
2290−@article{Bradya,
2291−author = {Hunt, Andrew and Thomas, David},
2292−file = {:Users/edwin/Documents/Mendeley Desktop/Hunt, Thomas/The Pragmatic Programmer Chapter 7/Hunt, Thomas - The Pragmatic Programmer Chapter 7 - Unknown.pdf:pdf},
2293−isbn = {020161622X},
2294−title = {{The Pragmatic Programmer Chapter 7}}
2295−}
papers/impl-paper/library.ltxdeleted−325
@@ -1,325 +0,0 @@
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{Nat}}
145− \newcommand{\Z}{\DC{Z}}
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}{\DC{Nil}}
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−}
papers/impl-paper/literature.bibdeleted−3846
@@ -1,3846 +0,0 @@
1−@article{lambdapi,
2− author = {Andres L\"{o}h and Conor McBride and Wouter Swierstra},
3− title = {A tutorial implementation of a dependently typed lambda calculus},
4− year = 2010,
5− journal = {Fundamenta Informaticae},
6− volume = 102,
7− number = 2
8−}
9−
10−@article{idioms,
11− author = {McBride, Conor and Paterson, Ross},
12− title = {Applicative programming with effects},
13− journal = {J. Funct. Program.},
14− volume = {18},
15− issue = {1},
16− month = {January},
17− year = {2008},
18− issn = {0956-7968},
19− pages = {1--13},
20− numpages = {13},
21− url = {http://portal.acm.org/citation.cfm?id=1348940.1348941},
22− doi = {10.1017/S0956796807006326},
23− acmid = {1348941},
24− publisher = {Cambridge University Press},
25− address = {New York, NY, USA},
26−}
27−
28−@inproceedings{lava,
29− author = {Bjesse, Per and Claessen, Koen and Sheeran, Mary and Singh, Satnam},
30− title = {Lava: hardware design in {Haskell}},
31− booktitle = {Proceedings of the third ACM SIGPLAN international conference on Functional programming},
32− series = {ICFP '98},
33− year = {1998},
34− isbn = {1-58113-024-4},
35− location = {Baltimore, Maryland, United States},
36− pages = {174--184},
37− numpages = {11},
38− url = {http://doi.acm.org/10.1145/289423.289440},
39− doi = {http://doi.acm.org/10.1145/289423.289440},
40− acmid = {289440},
41− publisher = {ACM},
42− address = {New York, NY, USA},
43−}
44−
45−@inproceedings{plpv11,
46− author = {Edwin Brady},
47− title = {Idris --- Systems programming meets full dependent types},
48− booktitle = {Programming Languages meets Program Verification {(PLPV 2011)}},
49− year = {2011},
50− pages = {43--54},
51− ee = {http://doi.acm.org/10.1145/1929529.1929536},
52− bibsource = {DBLP, http://dblp.uni-trier.de}
53−}
54−
55−@inproceedings{epic-tfp,
56− author = {Edwin Brady},
57− title = {Epic --- a library for generating compilers},
58− year = 2011,
59− booktitle = {{Trends in Functional Programming} ({TFP} '11)},
60− note = {To appear}
61−}
62−
63−@inproceedings{ynot08,
64− author = {Nanevski,, Aleksandar and Morrisett,, Greg and
65− Shinnar,, Avraham and Govereau,, Paul and Birkedal,,
66− Lars},
67− title = {Ynot: reasoning with the awkward squad},
68− booktitle = {{ICFP} '08: Proceeding of the 13th {ACM SIGPLAN}
69− international conference on Functional programming},
70− year = {2008},
71− isbn = {978-1-59593-919-7},
72− pages = {229--240},
73− location = {Victoria, BC, Canada},
74− doi = {http://doi.acm.org/10.1145/1411204.1411237},
75− publisher = {ACM},
76− address = {New York, NY, USA},
77−}
78−
79−@article{cbconc-fi,
80− author = {Edwin Brady and Kevin Hammond},
81− title = {Correct-by-Construction Concurrency: Using Dependent Types to Verify Implementations of Effectful Resource Usage Protocols},
82− year = 2010,
83− journal = {Fundamenta Informaticae},
84− volume = 102,
85− number = 2,
86− pages = {145--176}
87−}
88−
89−@inproceedings{devil-osdi00,
90− author = {Fabrice M{\'e}rillon and
91− Laurent R{\'e}veill{\`e}re and
92− Charles Consel and
93− Renaud Marlet and
94− Gilles Muller},
95− title = {Devil: An IDL for Hardware Programming},
96− booktitle = {4th USENIX Symposium on Operating Systems Design and Implementation (OSDI 2000)},
97− year = {2000}
98−}
99−
100−
101−@INPROCEEDINGS{device-osdi08,
102− author = {Dan Williams and Patrick Reynolds and Kevin Walsh and Emin Gün Sirer and Fred B. Schneider},
103− title = {Device driver safety through a reference validation mechanism},
104− booktitle = {8th USENIX Symposium on Operating Systems Design and Implementation (OSDI 2008)},
105− year = {2008}
106−}
107−
108−@inproceedings{sozeau-equations,
109− author = {Matthieu Sozeau},
110− title = {Equations: A Dependent Pattern-Matching Compiler},
111− booktitle = {First International Conference on Interactive Theorem Proving (ITP 2010)},
112− year = {2010},
113− pages = {419--434},
114− ee = {http://dx.doi.org/10.1007/978-3-642-14052-5_29},
115− crossref = {DBLP:conf/itp/2010},
116− bibsource = {DBLP, http://dblp.uni-trier.de}
117−}
118−
119−
120−@inproceedings{packet-type,
121− author = "Peter J. McCann and Satish Chandra",
122− title = "Packet Types: Abstract Specification of Network Protocol Messages",
123− year = 2000,
124− booktitle = "SIGCOMM '00",
125− publisher = {{ACM}}
126−}
127−
128−@inproceedings{qs-types,
129− author = {Eelis {van der Weegen} and James McKinna},
130−
131− title={A Machine-checked Proof of the Average-case Complexity of Quicksort in Coq},
132− year={2009},
133− pages={256--271},
134− series = {Lecture Notes in Computer Science},
135− publisher = {Springer}
136−
137−}
138−
139−@inproceedings{totalparser,
140− author = {Nils Anders Danielsson},
141− title = {Total Parser Combinators},
142− booktitle = {{ICFP} '10: Proceedings of the 15th {ACM} {SIGPLAN} International Conference on Functional Programming},
143− year = {2010},
144− isbn = {978-1-60558-794-3},
145− pages = {285--296},
146− location = {Baltimore, Maryland, USA},
147− doi = {http://doi.{ACM}.org/10.1145/1863543.1863587},
148− publisher = {{ACM}},
149− address = {New York, NY, USA},
150− }
151−
152−@misc{rfc791,
153− author="J. Postel",
154− title="{Internet Protocol}",
155− series="Request for Comments",
156− number="791",
157− howpublished="RFC 791 (Standard)",
158− publisher="IETF",
159− organization="Internet Engineering Task Force",
160− year=1981,
161− month=sep,
162− note="Updated by RFC 1349",
163− url="http://www.ietf.org/rfc/rfc791.txt",
164−}
165−
166−
167−@misc{rfc792,
168− author="J. Postel",
169− title="{Internet Control Message Protocol}",
170− series="Request for Comments",
171− number="792",
172− howpublished="RFC 792 (Standard)",
173− publisher="IETF",
174− organization="Internet Engineering Task Force",
175− year=1981,
176− month=sep,
177− note="Updated by RFCs 950, 4884",
178− url="http://www.ietf.org/rfc/rfc792.txt",
179−}
180−
181−@INPROCEEDINGS{Dybjer-indrec,
182− author = {Peter Dybjer and Anton Setzer},
183− title = {A Finite Axiomatization of Inductive-Recursive Definitions},
184− booktitle = {Tyed Lambda Calculi and Applications},
185− volume = {1581},
186− series = {Lecture Notes in Computer Science},
187− year = {1998},
188− pages = {129--146},
189− publisher = {Springer}
190−}
191−
192−@book{stevenstcpip,
193− author = {W. Richard Stevens},
194− title = {{TCP/IP} Illustrated Volume 1: The Protocols},
195− year = 1994,
196− publisher = {Addison Wesley},
197− isbn = {0-201-63346-9}
198−}
199−
200−@inproceedings{coqtypeclasses,
201− author = {Sozeau, Matthieu and Oury, Nicolas},
202− title = {First-Class Type Classes},
203− booktitle = {TPHOLs '08: Proceedings of the 21st International Conference on Theorem Proving in Higher Order Logics},
204− year = {2008},
205− isbn = {978-3-540-71065-3},
206− pages = {278--293},
207− location = {Montreal, P.Q., Canada},
208− doi = {http://dx.doi.org/10.1007/978-3-540-71067-7_23},
209− publisher = {Springer-Verlag},
210− address = {Berlin, Heidelberg},
211− }
212−
213−
214−@inproceedings{kipling,
215− author = {McBride, Conor},
216− title = {Outrageous but meaningful coincidences: dependent type-safe syntax and evaluation},
217− booktitle = {WGP '10: Proceedings of the 6th {ACM} {SIGPLAN} workshop on Generic programming},
218− year = {2010},
219− isbn = {978-1-4503-0251-7},
220− pages = {1--12},
221− location = {Baltimore, Maryland, USA},
222− doi = {http://doi.{ACM}.org/10.1145/1863495.1863497},
223− publisher = {{ACM}},
224− address = {New York, NY, USA},
225− }
226−
227−@inproceedings{padsml,
228− author = {Yitzhak Mandelbaum and
229− Kathleen Fisher and
230− David Walker and
231− Mary F. Fern{\'a}ndez and
232− Artem Gleyzer},
233− title = {{PADS/ML}: a functional data description language},
234− booktitle = {POPL '07: Proceedings of the 34th {ACM} {SIGPLAN}-SIGACT Symposium on
235− Principles of Programming Languages, POPL 2007, Nice, France,
236− January 17-19, 2007},
237− year = {2007},
238− pages = {77-83},
239− ee = {http://doi.{ACM}.org/10.1145/1190216.1190231},
240− crossref = {DBLP:conf/popl/2007},
241− bibsource = {DBLP, http://dblp.uni-trier.de}
242−}
243−
244−@proceedings{DBLP:conf/popl/2007,
245− editor = {Martin Hofmann and
246− Matthias Felleisen},
247− title = {Proceedings of the 34th {ACM} {SIGPLAN}-SIGACT Symposium on
248− Principles of Programming Languages, POPL 2007, Nice, France,
249− January 17-19, 2007},
250− booktitle = {POPL},
251− publisher = {{ACM}},
252− year = {2007},
253− isbn = {1-59593-575-4},
254− bibsource = {DBLP, http://dblp.uni-trier.de}
255−}
256−
257−@inproceedings{melange,
258− author = {Madhavapeddy, Anil and Ho, Alex and Deegan, Tim and Scott, David and Sohan, Ripduman},
259− title = {Melange: creating a "functional" internet},
260− booktitle = {EuroSys '07: Proceedings of the 2nd {ACM} SIGOPS/EuroSys European Conference on Computer Systems 2007},
261− year = {2007},
262− isbn = {978-1-59593-636-3},
263− location = {Lisbon, Portugal},
264− doi = {http://doi.{ACM}.org/10.1145/1272996.1273009},
265− publisher = {{ACM}},
266− address = {New York, NY, USA},
267− }
268−
269−
270−
271−@article{next700data,
272− author = {Fisher, Kathleen and Mandelbaum, Yitzhak and Walker, David},
273− title = {The next 700 data description languages},
274− journal = {{SIGPLAN} Not.},
275− volume = {41},
276− number = {1},
277− year = {2006},
278− issn = {0362-1340},
279− pages = {2--15},
280− doi = {http://doi.{ACM}.org/10.1145/1111320.1111039},
281− publisher = {{ACM}},
282− address = {New York, NY, USA},
283− }
284−
285−
286−@INPROCEEDINGS{xi-ats,
287− author = {Hongwei Xi},
288− title = {{Applied Type System} (extended abstract)},
289− booktitle = {Types for Proofs and Programs 2003},
290− editor = {Stefano Berardi and Mario Coppo and Ferruccio Damiani},
291− publisher = {Springer},
292− series = {Lecture Notes in Computer Science},
293− volume = {3085},
294− year = {2004},
295− pages = {394--408}
296−}
297−
298−@inproceedings{powerpi,
299− author = {Nicolas Oury and
300− Wouter Swierstra},
301− title = {The power of {Pi}},
302− booktitle = {{ICFP} '08: Proceedings of the 13th {ACM} {SIGPLAN} International Conference
303− on Functional Programming, {ICFP} 2008, Victoria, BC, Canada,
304− September 20-28, 2008},
305− year = {2008},
306− pages = {39--50},
307− ee = {http://doi.{ACM}.org/10.1145/1411204.1411213},
308− crossref = {DBLP:conf/{ICFP}/2008},
309− bibsource = {DBLP, http://dblp.uni-trier.de}
310−}
311−
312−@proceedings{DBLP:conf/{ICFP}/2008,
313− editor = {James Hook and
314− Peter Thiemann},
315− title = {Proceeding of the 13th {ACM} {SIGPLAN} international conference
316− on Functional programming, {ICFP} 2008, Victoria, BC, Canada,
317− September 20-28, 2008},
318− booktitle = {{ICFP}},
319− publisher = {{ACM}},
320− year = {2008},
321− isbn = {978-1-59593-919-7},
322− bibsource = {DBLP, http://dblp.uni-trier.de}
323−}
324−
325−
326−@inproceedings{security-types,
327− author = {Morgenstern, Jamie and Licata, Daniel R.},
328− title = {Security-typed programming within dependently typed programming},
329− booktitle = {{ICFP} '10: Proceedings of the 15th {ACM} {SIGPLAN} International Conference on Functional Programming},
330− year = {2010},
331− isbn = {978-1-60558-794-3},
332− pages = {169--180},
333− location = {Baltimore, Maryland, USA},
334− doi = {http://doi.{ACM}.org/10.1145/1863543.1863569},
335− publisher = {{ACM}},
336− address = {New York, NY, USA},
337− }
338−
339−@inproceedings{levitation,
340− author = {Chapman, James and Dagand, Pierre-\'{E}variste and McBride, Conor and Morris, Peter},
341− title = {The gentle art of levitation},
342− booktitle = {{ICFP} '10: Proceedings of the 15th {ACM} {SIGPLAN} International Conference on Functional Programming},
343− year = {2010},
344− isbn = {978-1-60558-794-3},
345− pages = {3--14},
346− location = {Baltimore, Maryland, USA},
347− doi = {http://doi.{ACM}.org/10.1145/1863543.1863547},
348− publisher = {{ACM}},
349− address = {New York, NY, USA},
350− }
351−
352−
353−
354−@INPROCEEDINGS{awkward,
355− author = {Simon {Peyton Jones}},
356− title = {Tackling the awkward squad: monadic input/output, concurrency, exceptions, and foreign-language calls in {Haskell}},
357− booktitle = {Engineering theories of software construction},
358− year = {2001},
359− pages = {47--96}
360−}
361−
362−@inproceedings{scrap-engine,
363− author = {Brady, Edwin and Hammond, Kevin},
364− title = {Scrapping your inefficient engine: using partial evaluation to improve domain-specific language implementation},
365− booktitle = {{ICFP} '10: Proceedings of the 15th {ACM} {SIGPLAN} International Conference on Functional Programming},
366− year = {2010},
367− isbn = {978-1-60558-794-3},
368− pages = {297--308},
369− location = {Baltimore, Maryland, USA},
370− doi = {http://doi.{ACM}.org/10.1145/1863543.1863587},
371− publisher = {{ACM}},
372− address = {New York, NY, USA},
373− }
374−
375−@article{urweb,
376− author = {Chlipala, Adam},
377− title = {Ur: statically-typed metaprogramming with type-level record computation},
378− journal = {{SIGPLAN} Not.},
379− volume = {45},
380− number = {6},
381− year = {2010},
382− issn = {0362-1340},
383− pages = {122--133},
384− doi = {http://doi.{ACM}.org/10.1145/1809028.1806612},
385− publisher = {{ACM}},
386− address = {New York, NY, USA},
387− }
388−
389−
390−
391−@phdthesis{norell-thesis,
392− author = {Ulf Norell},
393− title = {Towards a practical programming language based on dependent type
394− theory},
395− school = {Chalmers University of Technology},
396− year = 2007,
397− month = {September},
398−}
399−
400−@inproceedings{open-type,
401− author = {Schrijvers, Tom and Peyton Jones, Simon and Chakravarty, Manuel and Sulzmann, Martin},
402− title = {Type checking with open type functions},
403− booktitle = {International Conf. on Functional Programming ({ICFP} 2008)},
404− year = {2008},
405− pages = {51--62},
406− doi = {http://doi.{ACM}.org/10.1145/1411203.1411215},
407− publisher = {{ACM}},
408− address = {New York, NY, USA},
409− }
410−
411−@inproceedings{ngna-dsl,
412− title = {Domain Specific Languages ({DSL}s) for Network Protocols},
413− author = {Saleem Bhatti and Edwin Brady and Kevin Hammond and James McKinna},
414− year = {2009},
415− booktitle = {International Workshop on Next Generation Network Architecture ({NGNA} 2009)}
416−}
417−
418−@phdthesis{gill-thesis,
419− title = {Cheap deforestation for non-strict functional languages},
420− author = {A Gill},
421− institution = {University of Glasgow},
422− month = {January},
423− year = 1996
424−}
425−
426−@misc{llvm-haskell,
427− title = {Low Level Virtual Machine for {Glasgow Haskell Compiler}},
428− author = {David Terei},
429− year = 2009,
430− howpublished = {Bachelor's Thesis, Computer Science and Engineering Dept., The University of New South Wales, Sydney, Australia}
431−}
432−
433−@mastersthesis{llvm,
434− title = {{LLVM}: An Infrastructure for Multi-Stage Optimization},
435− author = {Chris Lattner},
436− year = 2002,
437− month = {December},
438− institution = {Computer Science Dept., University of Illinois at Urbana-Champaign}
439−}
440−
441−@inproceedings{gpu-arrays,
442− title = {GPU Kernels as Data-Parallel Array Computations in Haskell},
443− author = {Sean Lee and Manuel M. T. Chakravarty and Vinod Grover and Gabriele Keller.},
444− year = 2009,
445− booktitle = {Workshop on Exploiting Parallelism using GPUs and other Hardware-Assisted Methods (EPAHM 2009)}
446−}
447−
448−@misc{cryptol,
449− author = {Galois, Inc.},
450− title = {Cryptol},
451− year = {2009},
452− howpublished = {\url{http://cryptol.net/}}
453−}
454−
455−@inproceedings{paradise-dsl,
456− author = {Lennart Augustsson and Howard Mansell and Ganesh Sittampalam},
457− title = {{Paradise: a two-stage DSL embedded in Haskell}},
458− booktitle = {International Conf. on Functional Programming ({ICFP} 2008)},
459− year = {2008},
460− publisher = {{ACM}},
461− pages = {225--228}
462− }
463−
464−@misc{dsl-bib,
465− author = {Arie {van Deursen} and Paul Klint and Joost Visser},
466− title = {Domain-Specific Languages --- an annotated bibliography},
467− year = 2000,
468− howpublished = {\url{http://homepages.cwi.nl/~arie/papers/dslbib/}}
469−}
470−
471−@inproceedings{imperative-pe,
472− author = {Debois, S{\o}ren},
473− title = {Imperative program optimization by partial evaluation},
474− booktitle = {PEPM '04: Proceedings of the 2004 {ACM} {SIGPLAN} symposium on Partial evaluation and semantics-based program manipulation},
475− year = {2004},
476− isbn = {1-58113-835-0},
477− pages = {113--122},
478− location = {Verona, Italy},
479− doi = {http://doi.{ACM}.org/10.1145/1014007.1014019},
480− publisher = {{ACM}},
481− address = {New York, NY, USA},
482− }
483−
484−
485−@inproceedings{offline-pe-termination,
486− author = {Andersen, Peter Holst and Holst, Carsten Kehler},
487− title = {Termination Analysis for Offline Partial Evaluation of a Higher Order Functional Language},
488− booktitle = {Proc. SAS '96: Intl. Symp. on Static Analysis},
489− year = {1996},
490− isbn = {3-540-61739-6},
491− pages = {67--82},
492− publisher = {Springer},
493− notaddress = {London, UK},
494− }
495−
496−
497−@inproceedings{stage-duplication,
498− author = {Swadi, Kedar and Taha, Walid and Kiselyov, Oleg and Pasalic, Emir},
499− title = {A monadic approach for avoiding code duplication when staging memoized functions},
500− notbooktitle = {PEPM '06: Proceedings of the 2006 {ACM} {SIGPLAN} symposium on Partial evaluation and semantics-based program manipulation},
501− booktitle = {Proc. PEPM '06:{ACM} Symp. on Partial Evaluation and Semantics-based Program Manipulation},
502− year = {2006},
503− isbn = {1-59593-196-1},
504− pages = {160--169},
505− location = {Charleston, South Carolina},
506− doi = {http://doi.{ACM}.org/10.1145/1111542.1111570},
507− notpublisher = {{ACM}},
508− notaddress = {New York, NY, USA},
509− }
510−
511−
512−@inproceedings{concoqtion,
513− author = {Fogarty, Seth and Pasalic, Emir and Siek, Jeremy and Taha, Walid},
514− title = {Concoqtion: indexed types now!},
515− booktitle = {PEPM '07: Proceedings of the 2007 {ACM} {SIGPLAN} symposium on Partial evaluation and semantics-based program manipulation},
516− year = {2007},
517− isbn = {978-1-59593-620-2},
518− pages = {112--121},
519− location = {Nice, France},
520− doi = {http://doi.{ACM}.org/10.1145/1244381.1244400},
521− publisher = {{ACM}},
522− address = {New York, NY, USA},
523− }
524−
525−@inproceedings{metahaskell,
526− author = "Tim Sheard and Simon {Peyton Jones}",
527− title = "Template metaprogramming for {Haskell}",
528− booktitle = "{ACM} Haskell Workshop",
529− year = 2002,
530− month = oct,
531− pages = "1-16",
532− noteditor = "Manuel M. T. Chakravarty",
533− notpublisher = "{ACM} Press"
534−}
535−
536−@misc{shark-profiler,
537− title = {Optimizing your application with {Shark 4}},
538− year = 2009,
539− howpublished = {\url{http://developer.apple.com/tools/sharkoptimize.html}}
540−}
541−
542−@misc{shootout,
543− title = {The Computer Language Benchmark Game},
544− year = {2009},
545− howpublished = {\url{http://shootout.alioth.debian.org/}}
546−}
547−
548−@article{futamura,
549− author = {Yoshihiko Futamura},
550− year = 1971,
551− title = "Partial Evaluation of Computation Process --– An Approach to a Compiler-Compiler",
552− journal = {Systems, Comps., Controls},
553− volume = 2,
554− number = 5,
555− pages = {45-–50}
556−}
557−
558−@book{pebook,
559− title = {Partial Evaluation and Automatic Program Generation},
560− author = {N.D. Jones and C.K. Gomard and P. Sestoft},
561− year = 1993,
562− publisher = {Prentice Hall International}
563−}
564−
565−@inproceedings{pantheon,
566− author = {Sean Seefried and Manuel Chakravarty and Gabriele Keller},
567− title = {Optimising Embedded {DSLs} using {Template Haskell}},
568− year = {2004},
569− booktitle = {{Proc. GPCE~'04: Conf. Generative Prog. and Component Eng.}},
570− publisher = {Springer},
571− series = {LNCS}
572−}
573−
574−@article{pan,
575− author = {Elliott, Conal and Finne, Sigbj\orn and De Moor, Oege},
576− title = {Compiling embedded languages},
577− journal = {J. Funct. Program.},
578− volume = {13},
579− number = {3},
580− year = {2003},
581− issn = {0956-7968},
582− pages = {455--481},
583− doi = {http://dx.doi.org/10.1017/S0956796802004574},
584− publisher = {Cambridge University Press},
585− address = {New York, NY, USA},
586− }
587−
588−
589−@inproceedings{russell,
590− author = {Sozeau, Matthieu},
591− title = {Program-ing finger trees in Coq},
592− booktitle = {{ICFP} '07: Proceedings of the 12th {ACM} {SIGPLAN} international conference on Functional programming},
593− year = {2007},
594− isbn = {978-1-59593-815-2},
595− pages = {13--24},
596− location = {Freiburg, Germany},
597− doi = {http://doi.{ACM}.org/10.1145/1291151.1291156},
598− publisher = {{ACM}},
599− address = {New York, NY, USA},
600− }
601−
602−@inproceedings{turner-total,
603− author = {D. A. Turner},
604− title = {Elementary Strong Functional Programming},
605− year = 1995,
606− booktitle = "First International Symposium on Functional Programming Languages in Education",
607− publisher = {Springer},
608− series = {LNCS},
609− volume = {1022},
610− pages = {1--13}
611−}
612−
613−@incollection{free-theorems,
614− author = "P. Wadler",
615− title = "Theorems for Free!",
616− booktitle = "{Proc. 4th Int.\ Conf.\ on Funct.\ Prog.\ Languages and Computer Arch., {FPCA}'89, London, {UK}, 11--13 Sept 1989}",
617− publisher = "{ACM} Press",
618− address = "New York",
619− pages = "347--359",
620− year = "1989",
621− url = "citeseer.ist.psu.edu/wadler89theorems.html"
622−}
623−
624−@inproceedings{TrulyConcurrent,
625− author = {Naiyong Jin and Jifeng He},
626− title = {Towards A Truly Concurrent Model for Processes Sharing Resources},
627− booktitle = {Proc. 3rd {IEEE} International Conf. on Soft. Eng. and Formal Methods},
628− year = {2005},
629− isbn = {0-7695-2435-4},
630− pages = {231--239},
631− doi = {http://dx.doi.org/10.1109/SEFM.2005.50},
632− publisher = {{IEEE} Computer Society},
633− address = {Washington, DC, USA},
634− }
635−
636−@misc{GPCE2006,
637− note = {Omitted to preserve anonymity, contact PC chair for details}
638−}
639−
640−@misc{IFL2006,
641− note = {Omitted to preserve anonymity, contact PC chair for details}
642−}
643−
644−@misc{ivor-anon,
645− note = {Omitted to preserve anonymity, contact PC chair for details}
646−}
647−
648−@inproceedings{HaskellIO,
649− author = {Simon L. {Peyton Jones} and Philip Wadler},
650− title = {Imperative functional programming},
651− booktitle = {Proc. 20th {ACM} Symposium on Principles of programming languages},
652− year = {1993},
653− isbn = {0-89791-560-7},
654− pages = {71--84},
655− location = {Charleston, South Carolina, United States},
656− doi = {http://doi.{ACM}.org/10.1145/158511.158524},
657− publisher = {{ACM}},
658− address = {New York, NY, USA},
659− }
660−
661−@article{CorrectnessConstruction,
662−author = "P. Amey",
663−title = "{Correctness by Construction: Better can also be Cheaper}",
664−journal = "{CrossTalk: the Journal of Defense Software Engineering}",
665−month = mar,
666−year = 2002,
667−pages = "24--28"
668−}
669−
670−
671−
672−@INPROCEEDINGS{hj:popl03,
673− AUTHOR = {M. Hofmann and S. Jost},
674− TITLE = {Static Prediction of Heap Space Usage for First-Order Function
675−al Programs},
676−booktitle = "Proc. {POPL 2003 --- 2003 {ACM} Symp. on Principles of Programming La
677−nguages}",
678− KEY = {HJ_POPL03},
679− PAGES = {185--197},
680− YEAR = {2003},
681− ORGANIZATION = {{ACM}}
682−}
683−
684−
685−@article{kobayashi-lock,
686− author = {Naoki Kobayashi},
687− title = {A type system for lock-free processes},
688− journal = {Inf. Comput.},
689− volume = {177},
690− number = {2},
691− year = {2002},
692− issn = {0890-5401},
693− pages = {122--159},
694− doi = {http://dx.doi.org/10.1016/S0890-5401(02)93171-8},
695− publisher = {Academic Press, Inc.},
696− address = {Duluth, MN, USA},
697− }
698−
699−@techreport{linear-alias,
700− title = {Linear types for aliased resources},
701− author = {Chris Hawblitzel},
702− year = {2005},
703− institution = {Microsoft Research},
704− number = {MSR-TR-2005-141}
705−}
706−
707−@article{kobayashi-esop,
708− title = {Type-Based Analysis of Deadlock fora Concurrent Calculus with Interrupts},
709− author = {Kohei Suenaga and Naoki Kobayashi},
710− year = {2007},
711− booktitle = {ESOP}
712−}
713−
714−@inproceedings{res-c,
715− title = {A Path Sensitive Type System for Resource Usage Verification of C Like Languages},
716− author = {Hyun-Goo Kang and Youil Kim and Taisook Han and Hwansoo Han},
717− year = 2005,
718− publisher = {Springer-Verlag},
719− booktitle = {Programming Languages and Systems},
720− pages = {264--280},
721− series = {LNCS},
722− volume = {3780}
723−}
724−
725−@miscs{lsr,
726− title = {Lightweight static resources: Sexy types for embedded and systems programming},
727− author = {Oleg Kiselyov and Chung-Chieh Shan},
728− year = 2007,
729− note = {Draft}
730−}
731−
732−@inproceedings{scoped-res,
733− title = {Resource Usage Analysis Via Scoped Methods},
734− author = {Gang Tan and Xinming Ou and David Walker},
735− booktitle = {Foundations of Object-Oriented Languages},
736− year = {2003}
737−}
738−
739−@article{igarashi-res,
740− author = {Igarashi, Atsushi and Kobayashi, Naoki},
741− title = {Resource usage analysis},
742− journal = {ACM Trans. Program. Lang. Syst.},
743− volume = {27},
744− issue = {2},
745− month = {March},
746− year = {2005},
747− issn = {0164-0925},
748− pages = {264--313},
749− numpages = {50},
750− url = {http://doi.acm.org/10.1145/1057387.1057390},
751− doi = {http://doi.acm.org/10.1145/1057387.1057390},
752− acmid = {1057390},
753− publisher = {ACM},
754− address = {New York, NY, USA},
755− keywords = {Resource usage, type inference},
756−}
757−
758−@phdthesis{monitoring,
759− title = {Policy Enforcement via Program Monitoring},
760− author = {Jarred Adam Ligatti},
761− year = 2006,
762− month = {May}
763−}
764−
765−@inproceedings{sec-policy,
766− title = {A Type System for Expressive Security Policies},
767− author = {David Walker},
768− booktitle = {Twenty-Seventh {ACM} {SIGPLAN} Symposium on Principles of Programming Languages},
769− pages = {254--267},
770− year = 2000}
771−
772−@inproceedings{res-dfa,
773− author = {K. Marriott and P.J. Stuckey and M. Sulzmann},
774− title = {Resource Usage Verification},
775− year = 2003,
776− booktitle = {In Proc. of First Asian Symposium, APLAS 2003},
777− pages = {212--229},
778− publisher = {Springer-Verlag}
779−}
780−
781−@incollection{ hancock-interactive,
782− author = "Peter Hancock and Anton Setzer",
783− title = "Interactive Programs in Dependent Type Theory",
784− booktitle = "Proc.\ of 14th Ann.\ Conf.\ of {EACSL}, {CSL}'00, Fischbau, Germany, 21--26 Aug 2000",
785− volume = "1862",
786− publisher = "Springer-Verlag",
787− address = "Berlin",
788− editor = "P. Clote and H. Schwichtenberg",
789− pages = "317--331",
790− year = "2000",
791− url = "citeseer.ist.psu.edu/hancock00interactive.html" }
792−
793−@inproceedings{popeea-resources,
794− author = {Corneliu Popeea and Wei-Ngan Chin},
795− title = {A type system for resource protocol verification and its correctness proof},
796− booktitle = {PEPM '04: Proceedings of the 2004 {ACM} {SIGPLAN} symposium on Partial evaluation and semantics-based program manipulation},
797− year = {2004},
798− isbn = {1-58113-835-0},
799− pages = {135--146},
800− location = {Verona, Italy},
801− doi = {http://doi.{ACM}.org/10.1145/1014007.1014021},
802− publisher = {{ACM} Press},
803− address = {New York, NY, USA},
804− }
805−
806−@inproceedings{sheard-langfuture,
807− author = {Tim Sheard},
808− title = "Languages of the future",
809− booktitle = "{ACM} Conference on Object Orientated Programming Systems, Languages and Applicatioons (OOPSLA'04)",
810− year = "2004"
811−}
812−
813−@inproceedings{ivor,
814− author = {Edwin Brady},
815− title = {{Ivor}, a proof engine},
816− year = {2007},
817− publisher = {Springer-Verlag},
818− series = {LNCS},
819− booktitle = {Implementation and Application of Functional Languages 2006}
820−}
821−
822−@misc{coq-in-coq,
823− author = {Bruno Barras and Benjamin Werner},
824− year = 1997,
825− title = {{Coq} in {Coq}}
826−}
827−
828−@article{hudak-edsl,
829− author = {Paul Hudak},
830− title = {Building Domain-Specific Embedded Languages},
831− year = {1996},
832− month = {December},
833− journal = {{ACM} Computing Surveys},
834− volume = {28A},
835− number = {4}
836−}
837−
838−@inproceedings{concon,
839− author = {Conor McBride and Healfdene Goguen and James McKinna},
840− title = {Some Constructions On Constructors},
841− year = 2005,
842− booktitle = {TYPES 2004},
843− publisher = {Springer},
844− series = {LNCS},
845− volume = {3839}
846−}
847−
848−@InProceedings{Hume-GPCE,
849−author = {K. Hammond and G.J. Michaelson},
850−title = {{Hume: a Domain-Specific Language for Real-Time Embedded Systems}},
851−booktitle = {{Proc. Conf. Generative Programming and Component Engineering (GPCE~'03)}},
852−publisher = {Springer-Verlag},
853−series = {Lecture Notes in Computer Science},
854−year = {2003},
855−}
856−
857−@inproceedings{lcf-milner,
858− author = {Robin Milner},
859− title = {{LCF}: A Way of Doing Proofs with a Machine},
860− booktitle = {Mathematical Foundations of Computer Science 1978},
861− pages = {146-159},
862− year = 1979,
863− series = {LNCS},
864− volume = {64}
865−}
866−
867−
868−@inproceedings{epireloaded,
869− title = {Epigram Reloaded: A Standalone Typechecker for {ETT}},
870− author = {James Chapman and Thorsten Altenkirch and Conor McBride},
871− year = 2006,
872− booktitle = {Trends in Functional Programming 2005},
873− note = {To appear}
874−}
875−
876−@TECHREPORT{why-tool,
877− AUTHOR = {J.-C. Filli\^atre},
878− TITLE = {{Why: a multi-language multi-prover verification tool}},
879− INSTITUTION = {{LRI, Universit\'e Paris Sud}},
880− TYPE = {{Research Report}},
881− NUMBER = {1366},
882− MONTH = {March},
883− YEAR = 2003,
884− URL = {http://www.lri.fr/~filliatr/ftp/publis/why-tool.ps.gz}
885−}
886−
887−@misc{ large-extraction,
888− author = "Lu\'iz Cruz-Filipe and Bas Spitters",
889− title = "Program Extraction from Large Proof Developments",
890− year = 2003,
891− url = "citeseer.ist.psu.edu/cruz-filipe03program.html" }
892−
893−@inproceedings{ fta,
894− author = "Herman Geuvers and Freek Wiedijk and Jan Zwanenburg",
895− title = "A Constructive Proof of the Fundamental Theorem of Algebra without Using the Rationals",
896− booktitle = "{TYPES 2000}",
897− pages = "96--111",
898− year = "2000",
899− url = "citeseer.ist.psu.edu/geuvers01constructive.html" }
900−
901−@article{mckinna-expr,
902− title = {A type-correct, stack-safe, provably correct, expression compiler in {Epigram}},
903− author = {James McKinna and Joel Wright},
904− year = 2007,
905− journal = {Journal of Functional Programming},
906− note = {To appear}
907−}
908−
909−@article{pugh-omega,
910− title = "The {Omega} {Test}: a fast and practical integer programming algorithm for dependence analysis",
911− author = "William Pugh",
912− journal = "Communication of the {ACM}",
913− year = 1992,
914− pages = {102--114}
915−}
916−
917−@misc{four-colour,
918− author = "Georges Gonthier",
919− title = "A computer-checked proof of the {Four Colour Theorem}",
920− year = 2005,
921− howpublished = {\url{http://research.microsoft.com/~gonthier/4colproof.pdf}}}
922−
923−@inproceedings{sparkle,
924− author = "Maarten {de Mol} and Marko {van Eekelen} and Rinus Plasmeijer",
925− title = "Theorem Proving for Functional Programmers",
926− url = "citeseer.ist.psu.edu/654423.html",
927− BOOKTITLE = {Proc. Implementation of Functional Languages (IFL 2002)},
928− publisher = {Springer},
929− series = {LNCS},
930− volume = {2312},
931− year = 2002
932− }
933−
934−@misc{agda,
935− title = {Agda},
936− author = {Catarina Coquand},
937− howpublished= {\url{http://agda.sourceforge.net/}},
938− year = 2005
939−}
940−
941−@misc{cover,
942− title = {Cover Translator},
943− howpublished = {\url{http://coverproject.org/CoverTranslator/}}
944−}
945−
946−@misc{parsec,
947− title = {Parsec, a fast combinator parser},
948− author = {Daan Leijen},
949− year = {2001},
950− howpublished = {\url{http://www.cs.uu.nl/~daan/parsec.html}}
951−}
952−
953−@inproceedings{dtpmsp-gpce,
954− author = {Edwin Brady and Kevin Hammond},
955− title = {A Verified Staged Interpreter is a Verified Compiler},
956− booktitle = {{Proc. Conf. Generative Programming and Component Engineering (GPCE~'06)}},
957− year = 2006
958−}
959−
960−@misc{haddock,
961− title = {Haddock: A {Haskell} Documentation Tool},
962− howpublished = {\url{http://www.haskell.org/haddock/}}
963−}
964−
965−@inproceedings{offshoring,
966− title = {Implicitly Heterogeneous Multi-Stage Programming},
967− author = {Jason Eckhardt and Roumen Kaibachev and Emir Pa\v{s}al\'{i}c and Kedar Swadi and Walid Taha},
968− booktitle = {Proc. 2005 Conf. on Generative Programming and Component Engineering (GPCE 2005)},
969− publisher = {Springer},
970− series = {LNCS},
971− volume = {3676},
972− year = 2005
973−}
974−
975−@misc{alti-partial,
976− title = {Stop thinking about bottoms when writing programs},
977− author = {Thorsten Altenkirch},
978− year = 2006,
979− note = {Talk at BCTCS 2006}
980−}
981−
982−@misc{tarmo-partial,
983− title = {Partiality is an Effect},
984− author = {Tarmo Uustalu},
985− year = 2004,
986− note = {Talk at Dagstuhl workshop on Dependently Typed Progamming}
987−}
988−
989−@inproceedings{McKinnaPOPL06,
990− author = {James McKinna},
991− title = {Why dependent types matter},
992− booktitle = {Proc. {ACM} Symp. on Principles of Programming Languages (POPL 2006)},
993− year = {2006},
994− issn = {0362-1340},
995− pages = {1--1},
996− doi = {http://doi.{ACM}.org/10.1145/1111320.1111038},
997−}
998−
999−
1000−@inproceedings{leroy-compiler,
1001− title = {Formal Certification of a Compiler Back-end},
1002− author = {Xavier Leroy},
1003− year = 2006,
1004− booktitle = {Principles of Programming Languages 2006},
1005− pages = {42--54},
1006− publisher = {{ACM} Press}
1007−}
1008−
1009−@inproceedings{hutton-exceptions,
1010− title = {Compiling Exceptions Correctly},
1011− year = 2004,
1012− author = {Graham Hutton and Joel Wright},
1013− booktitle = {Mathematics of Program Construction},
1014− publisher = {Springer},
1015− series = {LNCS},
1016− volume = {3125}
1017−}
1018−
1019−@inproceedings{tagless-staged,
1020− title = {Tagless Staged Interpreters for Typed Languages},
1021− year = {2002},
1022− booktitle = {Proc. 2002 International Conf. on Functional Programming ({ICFP} 2002)},
1023− author = {Emir Pa\v{s}al\'{i}c and Walid Taha and Tim Sheard},
1024− publisher = {{ACM}}
1025−}
1026−
1027−@inproceedings{env-classifiers,
1028− title = {Environment Classifiers},
1029− year = 2003,
1030− author = {Walid Taha},
1031− booktitle = {Proc. {ACM} Symp. on Principles of Programming Languages (POPL 2003)},
1032− pages = {26--37},
1033−}
1034−
1035−@inproceedings{dsl-msp,
1036− title = {{DSL} Implementation in {MetaOCaml}, {Template Haskell}, {and C++}},
1037− booktitle = {Domain Specific Program Genearation 2004},
1038− author = {Krzysztof Czarnecki and John O'Donnell and J\"{o}rg Striegnitz and Walid Taha},
1039− publisher = {Springer},
1040− series = {LNCS},
1041− volume = {3016},
1042− year = 2004
1043−}
1044−
1045−@misc{ gadt-extk,
1046− author = {Tim Sheard and James Hook and Nathan Linger},
1047− title = {{GADTs} + Extensible Kinds = Dependent Programming},
1048− year = 2005,
1049− misc = {Submitted to {ICFP} '05}
1050−}
1051−
1052−@INPROCEEDINGS{dt-framework,
1053− TITLE = {A Dependently Typed Framework for Static Analysis of Program Execution Costs},
1054− YEAR = {2006},
1055− BOOKTITLE = {Proc. Implementation of Functional Languages (IFL 2005)},
1056− AUTHOR = {Edwin Brady and Kevin Hammond},
1057− VOLUME = {4015},
1058− SERIES = {LNCS},
1059− PAGES = {74--90},
1060− PUBLISHER = {Springer}
1061−}
1062−
1063−@INPROCEEDINGS{step-counting,
1064− TITLE = {Accurate Step Counting},
1065− YEAR = {2006},
1066− BOOKTITLE = {Proc. Implementation of Functional Languages (IFL 2005)},
1067− AUTHOR = {Catherine Hope and Graham Hutton},
1068− PUBLISHER = {Springer}
1069−}
1070−
1071−@misc{multi-taha,
1072− author = {Walid Taha},
1073− title = {{A Gentle Introduction to Multi-stage Programming}},
1074− year = {2003},
1075− note = {Available from \url{http://www.cs.rice.edu/~taha}},
1076− notnote = {Available from \url{http://www.cs.rice.edu/~taha/publications/journal/dspg04a.pdf}}
1077−}
1078−
1079−@misc{mckinnabrady-phase,
1080− title = {Phase Distinctions in the Compilation of {Epigram}},
1081− year = 2005,
1082− author = {James McKinna and Edwin Brady},
1083− note = {Draft}
1084−}
1085−
1086−@phdthesis{ brady-thesis,
1087− author = {Edwin Brady},
1088− title = {Practical Implementation of a Dependently Typed Functional Programming Language},
1089− year = 2005,
1090− school = {University of Durham}
1091−}
1092−
1093−@phdthesis{ taha-thesis,
1094− author = {Walid Taha},
1095− title = {Multi-stage Programming: Its Theory and Applications},
1096− year = 1999,
1097− school = {Oregon Graduate Inst. of Science and Technology}
1098−}
1099−
1100−@phdthesis{ pasalic-thesis,
1101− author = {Emir Pa\v{s}al\'{i}c},
1102− title = {The Role of Type-Equality in Meta-programming},
1103− year = 2004,
1104− school = {OGI School of Science and Engineering}
1105−}
1106−
1107−@misc{ydtm,
1108− author = {Thorsten Altenkirch and Conor McBride and James McKinna},
1109− title = {Why Dependent Types Matter},
1110− note = {Draft},
1111− year = 2005}
1112−
1113−
1114−@inproceedings { wadler-listless,
1115− author = {Philip Wadler},
1116− title = {Listlessness is better than laziness: {Lazy} evaluation and garbage collection at compile-time},
1117− booktitle = {Proceedings of the 1984 {ACM} Symposium on LISP and functional programming},
1118− year = 1984,
1119− pages = {45--52}
1120−}
1121−
1122−@techreport { gofer-impl,
1123− author = {Mark P. Jones},
1124− title = {The implementation of the Gofer functional programming system},
1125− month = {May},
1126− year = {1994},
1127− number = {YALEU/DCS/RR-1030},
1128− institution = {Yale University}
1129−}
1130−
1131−@techreport { pm-opt1,
1132− author = {Kevin Scott and Norman Ramsey},
1133− title = {When do match-compilation heuristics matter?},
1134− month = {May},
1135− year = {2000},
1136− number = {CS-2000-13},
1137− institution = {Department of Computer Science, University of Virginia}
1138−}
1139−
1140−@inproceedings{ pm-opt2,
1141− author = "Fabrice Le Fessant and Luc Maranget",
1142− title = "Optimizing Pattern Matching",
1143− booktitle = "International Conference on Functional Programming",
1144− pages = "26-37",
1145− year = "2001",
1146− url = "citeseer.ist.psu.edu/lefessant01optimizing.html" }
1147−
1148−@incollection{con-engine,
1149− author = {G\'{e}rard Huet},
1150− title = {The constructive engine},
1151− booktitle = {A Perspective in Theoreticak Computer Science},
1152− publisher = {World Scientific Publishing},
1153− year = {1989},
1154− editor = {R. Narasimhan},
1155− note = {Commemorative Volume for Gift Siromoney},
1156− pages = {38--69}
1157−}
1158−
1159−@inproceedings{gadts,
1160− title = {Simple unification-based type inference for {GADTs}},
1161− author = {Simon {Peyton Jones} and Dimitrios Vytiniotis and Stephanie Weirich and Geoffrey Washburn},
1162− year = {2006},
1163− booktitle = {Proc. 2006 International Conf. on Functional Programming ({ICFP} 2006)}
1164−}
1165−
1166−@misc{wobbly,
1167− author = {Simon {Peyton Jones} and Geoffrey Washburn and Stephanie Weirich},
1168− title = {Wobbly types: type inference for generalised algebraic data types},
1169− year = {2004},
1170− note = {Submitted to POPL 2005}
1171−}
1172−
1173−@misc{epigram-afp,
1174− author = {Conor McBride},
1175− title = {Epigram: Practical Programming with Dependent Types},
1176− year = {2004},
1177− howpublished = {Lecture Notes, International Summer School on Advanced Functional Programming}
1178−}
1179−
1180−@book{ml85,
1181− author = {Per Martin-L\"{o}f},
1182− title = "Intuitionistic Type Theory",
1183− year = "1985",
1184− publisher = "Bibliopolis"
1185−}
1186−
1187−@article{modular-fulllazy,
1188− title = {A Modular Fully Lazy Lambda Lifter in {Haskell}},
1189− author = {Simon {Peyton Jones} and David Lester},
1190− year = {1991},
1191− month = {May},
1192− journal = {Software Practice and Experience},
1193− volume = {21},
1194− number = {5},
1195− pages = {479--506}
1196−}
1197−
1198−@article{ghani-jay95,
1199− author = {Barry Jay and Neil Ghani},
1200− title = {The Virtues of Eta-Expansion},
1201− journal = {Journal of Functional Programming},
1202− year = {1995},
1203− volume = {5},
1204− number = {2},
1205− pages = {135-154},
1206−}
1207−
1208−@misc{nkpat,
1209− author = {Lennart Augustsson},
1210− title = {n+k patterns},
1211− year = {1993},
1212− howpublished = {Message to the haskell mailing list, Mon, 17 May 93}
1213−}
1214−
1215−@article{ danvy98functional,
1216− author = "Olivier Danvy",
1217− title = "Functional Unparsing",
1218− journal = "Journal of Functional Programming",
1219− volume = "8",
1220− number = "6",
1221− pages = "621-625",
1222− year = "1998",
1223− url = "citeseer.ist.psu.edu/danvy98functional.html" }
1224−
1225−@inproceedings{SeveriPoll94,
1226− author = {Paula Severi and Erik Poll},
1227− booktitle = {Logical Foundations of Computing Science, LFCS'94},
1228− editor = {A. Nerode and Yu. V. Matiyasevich},
1229− number = {813},
1230− pages = {316--328},
1231− publisher = {Springer},
1232− series = {LNCS},
1233− title = {{P}ure {T}ype {S}ystems with {D}efinitions},
1234− year = {1994}
1235−}
1236−
1237−@inproceedings{coinductive,
1238− title = {An Application of Co-Inductive Types in Coq: Verification of the Alternating Bit Protocol},
1239− booktitle = {Proceedings of the 1995 Workshop on Types for Proofs and Programs},
1240− series = {LNCS},
1241− year = {1995},
1242− volume = {1158},
1243− pages = {135-152},
1244− publisher = {Springer-Verlag},
1245− author = {Eduardo Gim\'{e}nez}
1246−}
1247−
1248−@book{erlang,
1249− author = "Joe Armstrong and Robert Virding and Claes Wikstr{\"o}m and Mike Williams",
1250− title = "Concurrent Programming in Erlang",
1251− edition = "Second",
1252− publisher = "Prentice-Hall",
1253− year = "1996",
1254− url = "citeseer.ist.psu.edu/armstrong93concurrent.html"
1255−}
1256−
1257−@PhdThesis{alti:phd93,
1258− author = "Thorsten Altenkirch",
1259− title = "Constructions, Inductive Types and Strong Normalization",
1260− school = "University of Edinburgh",
1261− year = "1993",
1262− month = "November",
1263−}
1264−
1265−@inproceedings{coq-modules,
1266− author = "Jacek Chrzaszcz",
1267− title = "Modules in {Coq} Are and Will Be Correct",
1268− year = {2004},
1269− booktitle = {Types for Proofs and Programs 2003},
1270− editor = {Stefano Berardi and Mario Coppo and Ferruccio Damiani},
1271− publisher = {Springer},
1272− volume = {3085}
1273−}
1274−
1275−@inproceedings{comp-polymorphism,
1276− author = "Robert Harper and Greg Morrisett",
1277− title = "Compiling Polymorphism Using Intensional Type Analysis",
1278− year = "1995",
1279− booktitle = "Proceedings of the 22nd {ACM} {SIGPLAN}-SIGACT symposium on Principles of programming languages",
1280− pages = "130 -- 141"
1281−}
1282−
1283−@misc{runtime-loader,
1284− author = "Andre Pang",
1285− title = "{GHC} Runtime Loading",
1286− year = "2004",
1287− howpublished = {Available from \verb+http://www.algorithm.com.au/wiki/hacking/haskell.ghc_runtime_loading+}
1288−}
1289−
1290−@article{mccarthy-lisp,
1291− author = "John McCarthy",
1292− title = "Recursive Functions of Symbolic Expressions and Their Computation By Machine",
1293− year = "1960",
1294− journal = "Communications of the {ACM}",
1295− volume = "3",
1296− number = "4",
1297− pages = "184--195"
1298−}
1299−
1300−@book{stl,
1301− author = " David R. Musser and Atul Saini and Gillmer J. Derge",
1302− title= "The {STL} Tutorial and Reference Guide: {C++} Programming with the Standard Template Library",
1303− year = "2001",
1304− publisher = "Addison Wesley"
1305−}
1306−
1307−@misc{ phase-distinction,
1308− author = "Luca Cardelli",
1309− title = "Phase Distinctions in Type Theory",
1310− howpublished = "Manuscript",
1311− year = "1988",
1312− url = "citeseer.ist.psu.edu/cardelli88phase.html" }
1313−
1314−@book {pierce-types,
1315− author = "Benjamin C. Pierce",
1316− title = "Type and Programming Languages",
1317− year = "2002",
1318− publisher = "MIT Press"
1319−}
1320−
1321−@article{ coqcc,
1322− Author = "Thierry Coquand and G\'{e}rard Huet",
1323− title = "The calculus of constructions",
1324− year = "1988",
1325− journal = "Information and Computation",
1326− volume = "76",
1327− pages = "95--120"
1328−}
1329−
1330−@article{ miller91jlc,
1331− Author = "Dale Miller",
1332− Title = "A Logic Programming Language with Lambda-Abstraction,
1333− Function Variables, and Simple Unification",
1334− Journal = "Journal of Logic and Computation",
1335− Volume = "1",
1336− Number = "4",
1337− Pages = "497-536",
1338− Year = "1991",
1339− URL = "citeseer.ist.psu.edu/miller91logic.html",
1340− URL = "file://ftp.cis.upenn.edu/pub/papers/miller/jlc91.dvi.Z" }
1341−
1342−@article{miller-unity,
1343− author = "Dale Miller",
1344− title = "Unification Under a Mixed Prefix",
1345− journal = "Journal of Symbolic Computation",
1346− volume = "14",
1347− pages = "321--358",
1348− year = 1992
1349−}
1350−
1351−@inproceedings{ cynthia,
1352− author = "Jon Whittle and Alan Bundy and Richard J. Boulton and Helen Lowe",
1353− title = "An {ML} Editor Based on Proofs-As-Programs",
1354− booktitle = "Automated Software Engineering",
1355− pages = "166-173",
1356− year = "1999",
1357− url = "citeseer.ist.psu.edu/whittle99ml.html" }
1358−
1359−
1360−@misc{ewd340,
1361− title={The Humble Programmer},
1362− author={Edsger Dijkstra},
1363− year={1972},
1364− note={Turing Award Lecture, EWD 340}
1365−}
1366−
1367−@misc{fortran,
1368− title={Specifications for the {IBM} Mathematical FORmula TRANslating System, {FORTRAN}},
1369− author={{IBM Applied Science Division}},
1370− key={IBM},
1371− year={1954},
1372− month={November}
1373−}
1374−
1375−@inproceedings{quickcheck,
1376− title = {{QuickCheck}: A Lightweight Tool For Random Testing Of {Haskell} Programs},
1377− author = {Koen Claessen and John Hughes},
1378− year = {2000},
1379− booktitle = {International Conference on Functional Programming}
1380−}
1381−
1382−@inproceedings{currylam,
1383− title = {Functionality in Combinatory Logic},
1384− author = {Haskell Curry},
1385− year = {1934},
1386− booktitle = {Proc. Nat. Acad. Sci, USA},
1387− volume = {20},
1388− pages = {584--590}
1389−}
1390−
1391−@article{churchsimplelam1,
1392− title = {A set of postulates for the foundation of logic},
1393− author = {Alonzo Church},
1394− year = {1932},
1395− journal = {Annals of Mathematics},
1396− volume = {2},
1397− number = {33},
1398− pages = {346--366}
1399−}
1400−
1401−@article{churchsimplelam2,
1402− title = {A set of postulates for the foundation of logic},
1403− author = {Alonzo Church},
1404− year = {1933},
1405− journal = {Annals of Mathematics},
1406− volume = {2},
1407− number = {34},
1408− pages = {839--864}
1409−}
1410−
1411−@article{churchlam,
1412− title = {A Formulation of the Simple Theory of Types},
1413− author = {Alonzo Church},
1414− year = {1940},
1415− journal = {Journal of Symbolic Logic},
1416− volume = {5},
1417− pages = {56--58}
1418−}
1419−
1420−@book{mitchell,
1421− title = {Concepts in Programming Languages},
1422− author = {John C. Mitchell},
1423− year = {2003},
1424− publisher = {Cambridge University Press}
1425−}
1426−
1427−@inproceedings{harrison-hol99,
1428− title = {A Machine-Checked Theory of Floating Point Arithmetic},
1429− year = {1999},
1430− booktitle = {Theorem Proving in Higher Order Logics: 12th International Conference, TP},
1431− pages = {113--130},
1432− author = {John Harrison},
1433− crossref = {hol99}
1434−}
1435−
1436−@inproceedings{c--,
1437− title = {C--: A portable assembly language},
1438− year = {1997},
1439− booktitle = {Workshop on Implementing Functional Languages, St Andrews},
1440− author = {Simon {Peyton Jones} and Thomas Nordin and Dino Oliva},
1441− crossref = {func-imp97}
1442−}
1443−
1444−@proceedings{func-imp97,
1445− title = {Workshop on Implementing Functional Languages, St Andrews},
1446− year = {1997},
1447− editor = {C Clack},
1448− publisher = {Springer-Verlag}
1449−}
1450−
1451−@proceedings{hol99,
1452− volume = {1690},
1453− title = {Theorem Proving in Higher Order Logics: 12th International Conference, TPHOLs'99},
1454− year = {1999},
1455− editor = {Yves Bertot and Gilles Dowek and Andr{\'e} Hirschowitz and Christine Paul},
1456− publisher = {Springer-Verlag},
1457− address = {Nice, France},
1458− series = {LNCS}
1459−}
1460−
1461−@book{mathlogic,
1462− title = {Mathematical Logic and Programming Languages},
1463− year = {1985},
1464− editor = {C.A.R. Hoare and J.C. Shepherdson},
1465− publisher = {Prentice-Hall}
1466−}
1467−
1468−@book{automath,
1469− title = {Selected Papers on Automath},
1470− year = {1994},
1471− editor = {S. Abramsky and J. Barwise and K. Fine and H.J. Keisler and A.S. Troelstr},
1472− publisher = {North-Holland}
1473−}
1474−
1475−@misc{gimps,
1476− howpublished = {http://www.mersenne.org/prime.htm},
1477− title = {Great Internet Mersenne Prime Search}
1478−}
1479−
1480−@misc{haskell-report,
1481− title = {Haskell 98 Language and Libraries --- The Revised Report},
1482− year = {2002},
1483− month = {December},
1484− author = {Simon {Peyton Jones} and others},
1485− howpublished = {Available from \verb+http://www.haskell.org/+}
1486−}
1487−
1488−@inproceedings{cayenne-{ICFP},
1489− author = "Lennart Augustsson",
1490− title = "Cayenne - a Language with Dependent Types",
1491− booktitle = "Proc. 1998 International Conf. on Functional Programming ({ICFP} '98)",
1492− pages = "239--250",
1493− year = "1998",
1494− url = "citeseer.nj.nec.com/augustsson98cayenne.html"
1495−}
1496−
1497−
1498−@misc{equality-cayenne,
1499− howpublished = {\verb+http://www.cs.chalmers.se/~augustss/cayenne/+},
1500− title = {Equality Proofs in Cayenne},
1501− year = {1999},
1502− author = {Lennart Augustsson}
1503−}
1504−
1505−@misc{interp-cayenne,
1506− title = {An exercise in dependent types: A well-typed interpreter},
1507− year = {1999},
1508− author = {Lennart Augustsson and Magnus Carlsson}
1509−}
1510−
1511−@inproceedings{balaa00fixpoint,
1512− title = {Fix-Point Equations for Well-Founded Recursion in Type Theory},
1513− year = {2000},
1514− booktitle = {Theorem Proving in Higher Order Logics},
1515− pages = {1-16},
1516− author = {Antonia Balaa and Yves Bertot}
1517−}
1518−
1519−@inproceedings{isabelle-maple,
1520− title = {Theorems and algorithms: An interface between Isabelle and Maple},
1521− year = {1995},
1522− booktitle = {International Symposium on Symbolic and Algebraic Computation},
1523− author = {Ballarin, C. and Homann, K., and Calmet, J.}
1524−}
1525−
1526−@book{barendregt-num,
1527− title = {The Lambda Calculus, Its Syntax and Semantics},
1528− year = {1984},
1529− publisher = {North-Holland},
1530− author = {Henk Barendregt}
1531−}
1532−
1533−@book{beiler,
1534− title = {Recreations in the Theory of Numbers},
1535− year = {1964},
1536− publisher = {Dover},
1537− author = {Albert H. Beiler}
1538−}
1539−
1540−@article{multidigit,
1541− journal = {Advances in Applied Mathematics},
1542− title = {Multidigit Multiplication for Mathematicians},
1543− year = {1998},
1544− author = {Daniel J. Bernstein}
1545−}
1546−
1547−@article{buhler-fox,
1548− journal = {{ACM} Crossroads 2.1.},
1549− month = {September},
1550− title = {The Fox project: A language-structured approach to networking software.},
1551− year = {1995},
1552− author = {Buhler, J.},
1553− note = {Available at http://www.{ACM}.org/crossroads/xrds2-1/foxnet.html}
1554−}
1555−
1556−@techreport{burstall91,
1557− title = {Computer Assisted Proof for Mathematics: an Introduction Using the \textsc{Lego} Proof System},
1558− year = {1991},
1559− institution = {University of Edinburgh},
1560− author = {Rod Burstall}
1561−}
1562−
1563−@article{plastic,
1564− title = {An Implementation of {LF} with Coercive Subtyping and Universes},
1565− author = {Paul Callaghan and Zhaohui Luo},
1566− journal = {Journal of Automated Reasoning},
1567− volume = {27},
1568− number = {1},
1569− pages = {3--27},
1570− year = {2001}
1571−}
1572−
1573−@article{coercive,
1574− title = {Coercive subtyping},
1575− author = {Zhaohui Luo},
1576− journal = {J. Logic Comput.},
1577− volume = {9},
1578− number = {1},
1579− year = {1991},
1580− pages = {105--130}
1581−}
1582−
1583−@inproceedings{calmet-homann,
1584− title = {Classification of communication and cooperation mechanisms for logical and symbolic computation systems},
1585− year = {1996},
1586− booktitle = {Proceedings of the First International Workshop 'Frontiers of Combining S},
1587− pages = {133-146},
1588− publisher = {Kluwer},
1589− author = {J. Calmet and K. Homann}
1590−}
1591−
1592−@techreport{comm-proofs,
1593− title = {On Communicating Proofs in Interactive Mathematical Documents},
1594− year = {2000},
1595− institution = {Eindhoven University of Technology},
1596− author = {Olga Caprotti and Martijn Oostdijk}
1597−}
1598−
1599−@article{prime2999,
1600− title = {How to formally and efficiently prove Prime(2999)},
1601− year = {2001},
1602− author = {Olga Caprotti and Martijn Oostdijk},
1603− journal = {Symbolic Computation and Automated Reasoning},
1604− pages = {114--125}
1605−}
1606−
1607−@book{church-num,
1608− title = {The Calculi of Lambda-Conversion},
1609− year = {1941},
1610− publisher = {Princeton University Press},
1611− author = {Alonzo Church}
1612−}
1613−
1614−@book{nuprl86,
1615− title = {Implementing Mathematics with the NuPrl Proof Development System},
1616− year = {1986},
1617− publisher = {Prentice-Hall},
1618− address = {NJ},
1619− author = {Constable, Robert L. and others}
1620−}
1621−
1622−@book{conway,
1623− title = {On Numbers and Games},
1624− year = {1976},
1625− publisher = {Academic Press},
1626− author = {J.H. Conway}
1627−}
1628−
1629−@misc{coq-manual,
1630− howpublished = {\verb+http://coq.inria.fr/+},
1631− title = {The {Coq} Proof Assistant --- Reference Manual},
1632− year = {2009},
1633− author = {{Coq Development Team}}
1634−}
1635−
1636−@misc{tt-prog,
1637− month = {June},
1638− title = {Type Theory and Programming},
1639− year = {1994},
1640− author = {Thierry Coquand and Bengt Nordstr\"{o}m and Jan M. Smith and Bj\"{o}rn von Sydow}
1641−}
1642−
1643−@book{func-appr,
1644− title = {The Functional Approach to Programming},
1645− year = {1998},
1646− publisher = {Cambridge University Press},
1647− author = {Guy Cousineau and Michel Mauny}
1648−}
1649−
1650−@misc{ibmspec,
1651− howpublished = {http://www2.hursley.ibm.com/decimal/},
1652− month = {January},
1653− title = {Standard Decimal Arithmetic Specification},
1654− year = {2001},
1655− author = {Mike Cowlishaw},
1656− note = {\copyright IBM Corporation 2001}
1657−}
1658−
1659−@book{dummett,
1660− title = {Elements of Intuitionism},
1661− year = {2000},
1662− edition = {2nd},
1663− publisher = {Oxford: Clarendon},
1664− author = {Michael A.E. Dummet}
1665−}
1666−
1667−@article{dybjer94,
1668− title = {Inductive Families},
1669− year = {1994},
1670− author = {Peter Dybjer},
1671− journal = {Formal Aspects Of Computing},
1672− volume = {6},
1673− pages = {440--465}
1674−}
1675−
1676−@misc{octave,
1677− howpublished = {http://www.octave.org/},
1678− month = {February},
1679− title = {GNU Octave -- A high-level interactive language for numerical computations},
1680− year = {1997},
1681− author = {John W. Eaton}
1682−}
1683−
1684−@book{comp-methods,
1685− title = {Computing methods for scientists and engineers},
1686− year = {1968},
1687− publisher = {Oxford : Clarendon Press},
1688− author = {L. Fox and D.F. Mayers}
1689−}
1690−
1691−@misc{guile,
1692− howpublished = {http://www.gnu.org/software/guile/guile.html},
1693− title = {Guile -- Project GNU's extension language},
1694− year = {2001},
1695− author = {{Free Software Foundation}}
1696−}
1697−
1698−@article{need-dep,
1699− journal = {Journal of Functional Programming},
1700− number = {4},
1701− volume = {10},
1702− title = {Do we need dependent types?},
1703− year = {2000},
1704− pages = {409-415},
1705− author = {Daniel Fridlender and Mia Indrika}
1706−}
1707−
1708−@book{primes-programming,
1709− title = {Primes and Programming -- An Introduction to Number Theory with Computing},
1710− year = {1993},
1711− publisher = {Cambridge University Press},
1712− author = {Peter Giblin}
1713−}
1714−
1715−@misc{rec-coq,
1716− month = {May},
1717− title = {A Tutorial on Recursive Types in \textsc{Coq}},
1718− year = {1998},
1719− author = {Eduardo Gim\'{e}nez}
1720−}
1721−
1722−@article{goldberg91,
1723− journal = {{ACM} Computing Surveys},
1724− number = {1},
1725− volume = {23},
1726− title = {What every computer scientist should know about floating point arithmetic},
1727− year = {1991},
1728− pages = {5-48},
1729− author = {D. Goldberg}
1730−}
1731−
1732−@article{binary-lambda,
1733− journal = {Journal of Functional Programming},
1734− number = {6},
1735− volume = {10},
1736− title = {An adequate and efficient left associated binary numeral system in the $\lambda$-calculus},
1737− year = {2000},
1738− author = {Mayer Goldberg}
1739−}
1740−
1741−@book{hol,
1742− title = {Introduction to HOL},
1743− year = {1993},
1744− publisher = {Cambridge University Press},
1745− author = {M. Gordon and T. Melham}
1746−}
1747−
1748−@misc{gmp,
1749− howpublished = {Available from \verb+http://www.swox.com/gmp/manual/+},
1750− title = {The {GNU Multiple Precision} Arithmetic Library 4.1.3 --- Manual},
1751− year = {2004},
1752− author = {Torbj\"{o}rn Granlund and others}
1753−}
1754−
1755−@article{harrison-fmsd94,
1756− journal = {Formal Methods in System Design},
1757− volume = {5},
1758− title = {Constructing the Real Numbers in {HOL}},
1759− year = {1994},
1760− pages = {35--59},
1761− author = {John Harrison}
1762−}
1763−
1764−@book{harrison-thesis,
1765− title = {Theorem Proving with the Real Numbers},
1766− year = {1998},
1767− publisher = {Springer-Verlag},
1768− author = {John Harrison}
1769−}
1770−
1771−@techreport{hol-maple,
1772− title = {Reasing about the Reals: the marriage of HOL and Maple},
1773− year = {1993},
1774− institution = {University of Cambridge Computer Laboratory},
1775− author = {John Harrison and Laurent Th\'{e}ry}
1776−}
1777−
1778−@misc{coq-tutorial,
1779− howpublished = {http://pauillac.inria.fr/coq},
1780− title = {The \textsc{Coq} Proof Assistant - A Tutorial},
1781− author = {G\'{e}rard Huet and Gilles Kahn and Christine Paulin-Mohring}
1782−}
1783−
1784−@misc{restr-haskell,
1785− howpublished = {http://citeseer.nj.nec.com/253599.html},
1786− month = {September},
1787− title = {Restricted Data Types in Haskell},
1788− year = {1999},
1789− author = {John Hughes}
1790−}
1791−
1792−@misc{javadec,
1793− howpublished = {http://www2.hursley.ibm.com/decimalj/decimald.html},
1794− month = {September},
1795− title = {Decimal Arithmetic for Java -- a Proposal},
1796− year = {2000},
1797− author = {{IBM Corporation}}
1798−}
1799−
1800−@misc{ieee754,
1801− title = {{IEEE} Standard for Binary Floating Point Arithmetic},
1802− year = {1985},
1803− author = {{IEEE Standard 754}}
1804−}
1805−
1806−@misc{ieee854,
1807− title = {IEEE Standard for Radix-Independent Floating-Point Arithmetic},
1808− year = {1987},
1809− author = {{IEEE Standard 854}}
1810−}
1811−
1812−@inproceedings{jon91,
1813− title = {Completing the Rational and Metric Spaces in \textsc{Lego}},
1814− year = {1991},
1815− booktitle = {Proceedings of the Second Workshop on Logical Frameworks},
1816− author = {Claire Jones}
1817−}
1818−
1819−@misc{ typinghaskell,
1820− author = "Mark Jones",
1821− title = "Typing {Haskell} in {Haskell}",
1822− howpublished = "In Haskell Workshop, September 1999.",
1823− year = "1999",
1824− url = "citeseer.ist.psu.edu/article/jones99typing.html" }
1825−
1826−@article{karatsuba,
1827− journal = {Soviet Physics-Doklady},
1828− volume = {7},
1829− title = {Multiplication of multidigit numbers by automata},
1830− year = {1963},
1831− pages = {595--596},
1832− author = {A. Karatsuba and Y. Ofman}
1833−}
1834−
1835−@book{knuth2,
1836− volume = {2},
1837− title = {The Art of Computer Programming - Seminumerical Algorithms},
1838− year = {1969},
1839− publisher = {Addison Wesley},
1840− author = {Donald E. Knuth}
1841−}
1842−
1843−@article{next700,
1844− journal = {Communications of the {ACM}},
1845− number = {3},
1846− month = {March},
1847− volume = {9},
1848− title = {The next 700 programming languages},
1849− year = {1966},
1850− author = {P.J. Landin}
1851−}
1852−
1853−@techreport{luo-spec,
1854− month = {January},
1855− title = {Program Specification and Data Refinement in Type Theory},
1856− year = {1993},
1857− institution = {Department of Computer Science, University of Edinburgh},
1858− author = {Zhaohui Luo}
1859−}
1860−
1861−@phdthesis{luo90,
1862− school = {University of Edinburgh},
1863− title = {An Extended Calculus Of Constructions},
1864− year = {1990},
1865− author = {Zhaohui Luo}
1866−}
1867−
1868−@techreport{lego-manual,
1869− title = {\textsc{Lego} Proof Development System: User's Manual},
1870− year = {1992},
1871− institution = {Department of Computer Science, University of Edinburgh},
1872− author = {Zhaohui Luo and Robert Pollack}
1873−}
1874−
1875−@inproceedings{alf,
1876− title = {The {ALF} proof editor and its proof engine},
1877− year = {1994},
1878− booktitle = {Formal Proceeding of the 1993 Workshop on Types for Proofs and Programs},
1879− author = {Lena Magnusson and Bengt N\"{o}rdstrom}
1880−}
1881−
1882−@misc{happy,
1883− howpublished = {http://www.haskell.org/happy/},
1884− title = {Happy User Guide},
1885− year = {2001},
1886− author = {Simon Marlow and Andy Gill}
1887−}
1888−
1889−@inproceedings{generic-haskell,
1890− title = {Generic Haskell, Specifically},
1891− author = {Dave Clarke and Andres L\"{o}h},
1892− editor = {Jeremy Gibbons and Johan Jeuring},
1893− booktitle = {Proceedings of the IFIP TC2 Working Conference on Generic Programming},
1894− year = {2002},
1895− publisher = {Kluwer Academic Publishers},
1896− pages = {21--48}
1897−}
1898−
1899−@article{faking-it,
1900− title = {Faking It -- Simulating Dependent Types in {Haskell}},
1901− year = {2002},
1902− author = {Conor McBride},
1903− journal = {Journal of Functional Programming},
1904− volume = {12},
1905− number = {4+5},
1906− pages = {375--392}
1907−}
1908−
1909−@misc{mcbride-inverting,
1910− title = {Inverting Inductively Defined Relations in \textsc{Lego}},
1911− year = {1996},
1912− author = {Conor McBride}
1913−}
1914−
1915−@phdthesis{mcbride-thesis,
1916− month = {May},
1917− school = {University of Edinburgh},
1918− title = {Dependently Typed Functional Programs and their proofs},
1919− year = {2000},
1920− author = {Conor McBride}
1921−}
1922−
1923−@article{mcbride-unification,
1924− title = {First-Order Unification by Structural Recursion},
1925− year = {2003},
1926− author = {Conor McBride},
1927− journal = {Journal of Functional Programming},
1928− volume = {13},
1929− number = {6},
1930− pages = {1061--1075}
1931−}
1932−
1933−@misc{mckinna-pollack,
1934− howpublished = {Kluwer Academic Publishers},
1935− title = {Some Lambda Calculus and Type Theory formalized},
1936− year = {1998},
1937− author = {James McKinna and Robert Pollack}
1938−}
1939−
1940−@book{num-theory,
1941− title = {An Introduction to the Theory of Numbers},
1942− year = {1980},
1943− publisher = {John Wiley and Sons},
1944− author = {Ivan Niven and Herbert S. Zuckerman}
1945−}
1946−
1947−@book{prog-mltt,
1948− title = {Programming in Martin-L\"{o}f's Type Theory -- An Introduction},
1949− year = {1990},
1950− publisher = {Oxford University Press},
1951− author = {Bengt Nordstr\"{o}m and Kent Petersson and Jan M. Smith},
1952− note = {Out of print. Available from http://www.cs.chalmers.se/Cs/Research/Logic}
1953−}
1954−
1955−@book{okasaki,
1956− title = {Purely Functional Data Structures},
1957− year = {1998},
1958− publisher = {Cambridge University Press},
1959− author = {Chris Okasaki}
1960−}
1961−
1962−@book{arith-systems,
1963− title = {Computer Arithmetic Systems},
1964− year = {1994},
1965− publisher = {Prentice-Hall},
1966− author = {Amos R. Omondi}
1967−}
1968−
1969−@book{pj-imp,
1970− title = {The Implementation of Functional Programming Languages},
1971− year = {1987},
1972− publisher = {Prentice-Hall},
1973− author = {Simon {Peyton Jones}}
1974−}
1975−
1976−@book{cp-bjc,
1977− title = {Computational Numerical Methods},
1978− year = {1986},
1979− publisher = {John Wiley and Sons},
1980− author = {C. Phillips and B. Cornelius}
1981−}
1982−
1983−@book{nag,
1984− title = {The NAG Library: a beginner's guide},
1985− year = {1986},
1986− publisher = {Oxford : Clarendon Press},
1987− author = {Jen Phillips}
1988−}
1989−
1990−@misc{believe,
1991− month = {September},
1992− title = {How to Believe a Machine-Checked Proof},
1993− year = {1996},
1994− author = {Robert Pollack}
1995−}
1996−
1997−@phdthesis{pollack94,
1998− school = {University of Edinburgh},
1999− title = {The Theory of LEGO -- A Proof Checker for the Extended Calculus of Constructions},
2000− year = {1994},
2001− author = {Robert Pollack}
2002−}
2003−
2004−@inproceedings{intel-bug,
2005− series = {LNCS},
2006− volume = {915},
2007− title = {Anatomy of the Pentium Bug},
2008− publisher = {Springer-Verlag},
2009− year = {1995},
2010− pages = {97--107},
2011− author = {V.R. Pratt}
2012−}
2013−
2014−@book{maple,
2015− title = {The Maple Handbook: Maple V Release 4},
2016− year = {1996},
2017− publisher = {Springer},
2018− author = {Darren Redfern}
2019−}
2020−
2021−@book{crypto,
2022− title = {Applied Cryptography: protocols, algorithms and source code in C.},
2023− year = {1996},
2024− publisher = {Wiley},
2025− author = {Bruce Schneier}
2026−}
2027−
2028−@article{adts,
2029− journal = {Mathematical Structures in Computer Science},
2030− number = {2},
2031− volume = {10},
2032− title = {On lists and other abstract data types in the calculus of construction},
2033− year = {2000},
2034− pages = {261-276},
2035− author = {Jonathan P. Seldin}
2036−}
2037−
2038−@article{seldin97,
2039− journal = {Annals of Pure and Applied Logic},
2040− number = {1},
2041− month = {January},
2042− volume = {83},
2043− title = {On the proof theory of Coquand's calculus of constructions},
2044− year = {1997},
2045− pages = {23--101},
2046− author = {Jonathan P. Seldin}
2047−}
2048−
2049−@article{wichmann,
2050− journal = {The Computer Journal},
2051− volume = {32},
2052− title = {Towards a Formal Specification of Floating Point},
2053− year = {1989},
2054− pages = {432-436},
2055− author = {B.A. Wichmann}
2056−}
2057−
2058−@book{mathematica,
2059− title = {Mathematica : a system for doing mathematics by computer},
2060− year = {1991},
2061− publisher = {Addison Wesley},
2062− author = {Stephen Wolfram}
2063−}
2064−
2065−@inproceedings{xi-imp,
2066−author = "Hongwei Xi",
2067−title = {{Imperative Programming with Dependent Types}},
2068−booktitle = "Proceedings of 15th {IEEE} Symposium on Logic in Computer Science",
2069−year = 2000,
2070−month = "June",
2071−address = "Santa Barbara",
2072−pages = "375--387"
2073−}
2074−
2075−@phdthesis{xi-thesis,
2076− month = {December},
2077− school = {Department of Mathematical Sciences, Carnegie Mellon University},
2078− title = {Dependent Types in Practical Programming},
2079− year = {1998},
2080− author = {Hongwei Xi}
2081−}
2082−
2083−
2084−@techreport{dtal,
2085−author = {Hongwei Xi and Robert Harper},
2086−title = {A Dependently Typed Assembly Language},
2087−institution = {Computer Science and Engineering Department, Oregon Graduate Institute},
2088−year = 1999,
2089−number = {OGI-CSE-99-008},
2090−month = {July},
2091−}
2092−
2093−@misc{bignum-cmp,
2094− month = {February},
2095− title = {Comparison of three public-domain multiprecision libraries: BigNum, Gmp and Pari},
2096− year = {1998},
2097− author = {Paul Zimmerman}
2098−}
2099−
2100−@book{perl,
2101− title = {Programming Perl},
2102− author = {Larry Wall and Tom Christiansen and Jon Orwant},
2103− year = {2000},
2104− edition = {3rd},
2105− publisher = {O'Reilly}
2106−}
2107−
2108−@misc{python,
2109− howpublished = {http://www.python.org/doc/current/tut/tut.html},
2110− month = {April},
2111− title = {Python Tutorial},
2112− year = {2001},
2113− author = {Guido van {Rossum} and Fred L. {Drake, Jr}}
2114−}
2115−
2116−@book{logic,
2117− title = {The Language of First Order Logic},
2118− year = {1992},
2119− publisher = {CSLI Lecture Notes},
2120− author = {Jon Barwise and John Etchemendy}
2121−}
2122−
2123−@book{haskell,
2124− title = {Haskell -- The Craft of Functional Programming},
2125− year = {1999},
2126− publisher = {Addison Wesley},
2127− author = {Simon Thompson}
2128−}
2129−
2130−@inproceedings{coq-hol,
2131− title = {A Comparative Study of Coq and HOL},
2132− year = {1997},
2133− booktitle = {Theorem Proving in Higher Order Logics},
2134− pages = {323-337},
2135− author = {Vincent Zammit}
2136−}
2137−
2138−@misc{gay90,
2139− month = {November},
2140− title = {Correctly Rounded Binary-Decimal and Decimal-Binary Conversions},
2141− year = {1990},
2142− author = {David M. Gay},
2143− note = {AT&T Bell Laboratories, Numerical Analysis Manuscript 90-10}
2144−}
2145−
2146−@article{hughes-matters,
2147− journal = {Computer Journal},
2148− number = {2},
2149− volume = {32},
2150− title = {Why Functional Programming Matters},
2151− year = {1989},
2152− pages = {98--107},
2153− author = {J. Hughes}
2154−}
2155−
2156−@inproceedings{proofpointing,
2157− title = {Proof by Pointing},
2158− year = {1994},
2159− booktitle = {Proceedings of the International Symposium on Theoretical Aspects of Computer So},
2160− pages = {141--160},
2161− editor = {M. Hagiya and J. C. Mitchell},
2162− publisher = {Springer-Verlag},
2163− series = {LNCS},
2164− volume = {789},
2165− address = {Sendai, Japan},
2166− author = {Yves Bertot and Gilles Kahn and Laurent Th{\'e}ry}
2167−}
2168−
2169−@misc{inductive-coq,
2170− month = {December},
2171− title = {Inductive Definitions in the System Coq -- Rules and Properties},
2172− year = {1992},
2173− author = {Christine Paulin-Mohring}
2174−}
2175−
2176−@misc{leiserson98,
2177− month = {July},
2178− title = {Using de Bruijn Sequences to Index a 1 in a Computer Word},
2179− year = {1998},
2180− author = {{Charles E. Leiserson} and {Harald Prokop} and {Keith H. Randall}}
2181−}
2182−
2183−@inproceedings{proofchecking,
2184− title = {A two-level approach towards lean proof-checking},
2185− year = {1996},
2186− booktitle = {TYPES},
2187− pages = {16--35},
2188− author = {G. Barthe and M.P.J. Ruys and H.P. Barendregt}
2189−}
2190−
2191−@inproceedings{congruence,
2192− title = {Congruence Types},
2193− year = {1995},
2194− booktitle = {CSL},
2195− pages = {36--51},
2196− author = {Gilles Barthe and Herman Geuvers}
2197−}
2198−
2199−@phdthesis{geuvers-thesis,
2200− title = {Logic and Type Systems},
2201− author = {Herman Geuvers},
2202− year = 1993,
2203− school = {Katholieke Universiteit Nijmegen}
2204−}
2205−
2206−@techreport{multiple-values,
2207− title = {Multiple Values in {Standard ML}},
2208− year = {1994},
2209− number = {94-312},
2210− institution = {LFCS, Dept of Computer Science, University of Edinburgh},
2211− author = {Kevin Mitchell}
2212−}
2213−
2214−@inproceedings{oracle-checking,
2215− month = {January},
2216− title = {Oracle-Based Checking of Untrusted Software},
2217− year = {2001},
2218− booktitle = {Proceedings of the 28th {ACM} Symposium on Principles of Programming Languages},
2219− pages = {142--154},
2220− author = {{George C. Necula} and {S.P. Rahul}}
2221−}
2222−
2223−@article{adams93jfp,
2224− journal = {Journal of Functional Programming},
2225− number = {4},
2226− volume = {3},
2227− title = {Efficient Sets -- A Balancing Act},
2228− year = {1993},
2229− pages = {553--561},
2230− author = {Stephen Adams}
2231−}
2232−
2233−@inproceedings{hughes-sized,
2234− title = {Proving the Correctness of Reactive Systems Using Sized Types},
2235− year = {1996},
2236− booktitle = {Proceedings of the 23rd {ACM} {SIGPLAN}-SIGACT symposium on Principles of programmin},
2237− pages = {410--423},
2238− author = {John Hughes and Lars Pareto and Amr Sabry}
2239−}
2240−
2241−@inproceedings{whittle99ml,
2242− title = {An {ML} Editor Based on Proofs-As-Programs},
2243− year = {1999},
2244− booktitle = {Automated Software Engineering},
2245− pages = {166--173},
2246− author = {Jon Whittle and Alan Bundy and Richard J. Boulton and Helen Lowe}
2247−}
2248−
2249−@book{efp-typeinf,
2250− title = {Elements of Functional Programming},
2251− year = {1989},
2252− publisher = {Addison-Wesley},
2253− author = {Chris Reade},
2254− series = {International Computer Science Series}
2255−}
2256−
2257−@incollection{ wadler-views,
2258− author = "Philip Wadler",
2259− title = "Views: {A} Way for Pattern Matching to Cohabit with Data Abstraction",
2260− booktitle = "Proceedings, 14th Symposium on Principles of Programming Languages",
2261− publisher = "Association for Computing Machinery",
2262− editor = "Steve Munchnik",
2263− pages = "307--312",
2264− year = "1987",
2265− url = "citeseer.nj.nec.com/wadler87views.html" }
2266−
2267−@article{ coquand-checking,
2268− author = "Thierry Coquand",
2269− title = "An Algorithm for Type-Checking Dependent Types",
2270− journal = "Science of Computer Programming",
2271− volume = "26",
2272− number = "1-3",
2273− pages = "167-177",
2274− year = "1996",
2275− url = "citeseer.nj.nec.com/coquand96algorithm.html" }
2276−
2277−@misc{coquand-pm,
2278− author = "Thierry Coquand",
2279− title = "Pattern Matching with Dependent Types",
2280− year = "1992",
2281− howpublished = "Available from \verb+http://www.cs.chalmers.se/~coquand/type.html+"
2282−}
2283−
2284−@misc{pollack-records,
2285− month = {August},
2286− title = {Dependently Typed Records for Representing Mathematical Structure},
2287− year = {2000},
2288− author = {Robert Pollack}
2289−}
2290−
2291−@article{checking-betarte,
2292− journal = {Journal of Functional Programming},
2293− number = {2},
2294− month = {March},
2295− volume = {10},
2296− title = {Type checking dependent (record) types and subtyping},
2297− year = {2000},
2298− pages = {137--166},
2299− author = {Gustavo Betarte}
2300−}
2301−
2302−
2303−@article{ gcode,
2304− author = "Thomas Johnsson",
2305− title = "Efficient Compilation of Lazy Evaluation",
2306− booktitle = "Proceedings of the {{ACM}} {{SIGPLAN}}'84 Symposium on Compiler Con struction",
2307− journal = "{SIGPLAN} Notices",
2308− volume = "19",
2309− number = "6",
2310− month = "June",
2311− publisher = "{ACM} Press",
2312− pages = "58--69",
2313− year = "1984",
2314− url = "citeseer.nj.nec.com/johnsson84efficient.html" }
2315−
2316−@misc{kamareddine01,
2317− month = {February},
2318− title = {Reviewing the classical and the de Bruijn notation for $\lambda$-calculus and pure type systems},
2319− year = {2001},
2320− author = {Fairouz Kamareddine}
2321−}
2322−
2323−@book{prooftheory,
2324− title = {Basic Proof Theory},
2325− year = {1996},
2326− publisher = {Cambridge University Press},
2327− author = {A.S. Troelstra and H. Schwichtenberg},
2328− series = {Cambridge Tracts in Theoretical Computer Science}
2329−}
2330−
2331−@misc{nbe_staged,
2332− title = {Integrating Normalization-by-Evaluation into a Staged Programming Language},
2333− year = {1998},
2334− author = {Tim Sheard}
2335−}
2336−
2337−@inproceedings{nbe2,
2338− title = {Normalization by evaluation},
2339− year = {1998},
2340− author = {Ulrich Berger and Matthias Eberl and Helmut Schwichtenberg},
2341− booktitle = {Prospects for Hardware Foundations 1998},
2342− pages = {117--137},
2343− series = {LNCS}
2344−}
2345−
2346−
2347−
2348−@misc{rtcg_jfp,
2349− title = {Compiling for Run-time Code Generation},
2350− year = {2000},
2351− author = {Frederick Smith and Dan Grossman and Greg Morrisett and Luke Hornof and Trevor J},
2352− note = {Under consideration for J. Functional Programming}
2353−}
2354−
2355−@phdthesis{fredsmith_thesis,
2356− month = {January},
2357− school = {Cornell University},
2358− title = {Certified Run-time Code Generation},
2359− year = {2002},
2360− author = {Frederick Smith}
2361−}
2362−
2363−@inproceedings{xi_arraybounds,
2364−author = "Hongwei Xi and Frank Pfenning",
2365−title = {Eliminating Array Bound Checking through Dependent Types},
2366−booktitle = "Proceedings of {ACM} {SIGPLAN} Conference on Programming Language Design and Implementation",
2367−year = 1998,
2368−month = "June",
2369−address = "Montreal",
2370−pages = "249--257",
2371−}
2372−
2373−@inproceedings{xi_deadcode,
2374−author = "Hongwei Xi",
2375−title = {Dead Code Elimination through Dependent Types},
2376−booktitle = "The First International Workshop on Practical Aspects of Declarative Languages",
2377−year = 1999,
2378−month = "January",
2379−address = "San Antonio",
2380−pages = "228--242"
2381−}
2382−
2383−@book{compilers,
2384− title = {Compilers --- Principles, Techniques and Tools},
2385− year = {1986},
2386− publisher = {Addison-Wesley},
2387− author = {Alfred Aho and Ravi Sethi and Jeffrey Ullman}
2388−}
2389−
2390−@inproceedings{nhc,
2391− title = {Highlights from nhc: A space efficient {Haskell} Compiler},
2392− year = {1995},
2393− author = "Niklas R{\"o}jemo",
2394− booktitle = "Functional Programming Languages and Computer Architecture",
2395− pages = "282--292"
2396−}
2397−
2398−
2399−@misc{mlmatch,
2400− title = {SML/NJ Match Compiler Notes},
2401− year = {1992},
2402− author = {William Aitken}
2403−}
2404−
2405−@misc{mlmatch_sestoft,
2406− title = {ML pattern match compilation and partial evaluation},
2407− year = {1992},
2408− author = {Peter Sestoft}
2409−}
2410−
2411−@inproceedings{compiledstrongreduction,
2412− title = {A Compiled Implementation of Strong Reduction},
2413− year = {2002},
2414− author = {Benjamin Gr\'{e}goire and Xavier Leroy},
2415− booktitle = {Proc. 2002 International Conf. on Functional Programming ({ICFP} 2002)},
2416− pages = {235--246}
2417−}
2418−
2419−@misc{tclhaskell,
2420− howpublished = {http://www.dcs.gla.ac.uk/~meurig/TclHaskell/usermanual.html},
2421− month = {August},
2422− title = {TclHaskell - User Manual},
2423− year = {1999},
2424− author = {Meurig Sage}
2425−}
2426−
2427−
2428−@InProceedings{nbe-cat,
2429− author = "Thorsten Altenkirch and Martin Hofmann and Thomas Streicher",
2430− title = "Categorical reconstruction of a reduction free
2431− normalization proof",
2432− year = "1995",
2433− booktitle = "Category Theory and Computer Science",
2434− editor = {David Pitt and David E. Rydeheard and Peter Johnstone},
2435− series = {LNCS},
2436− volume = {953},
2437− pages = {182-199}
2438−}
2439−
2440−@inproceedings{presburgerEFSM,
2441− title = {A Comparison of Presburger Engines for EFSM Reachability},
2442− year = {1998},
2443− booktitle = {Computer Aided Verification '98},
2444− pages = {280--292},
2445− author = {Thomas R. Shiple and James H. Kukula and Rajeev K. Ranjan}
2446−}
2447−
2448−@misc{typesafecast,
2449− title = {Type-Safe Cast},
2450− year = {2000},
2451− author = {Stephanie Weirich}
2452−}
2453−
2454−@phdthesis{grobauer-thesis,
2455− school = {University of Aarhus},
2456− title = {Topics in Semantics Based Program Manipulation},
2457− year = {2001},
2458− author = {Bernd Grobauer}
2459−}
2460−
2461−@misc{monads-moggi,
2462− title = {Computational Lambda Calculus and Monads},
2463− year = {1989},
2464− author = {Eugenio Moggi}
2465−}
2466−
2467−@article{gmp-proof,
2468− title = {A proof of {GMP} square root},
2469− year = {2002},
2470− journal = {Journal of Automated Reasoning},
2471− volume = {29},
2472− pages = {225--252},
2473− author = {Yves Bertot and Nicolas Magaud and Paul Zimmerman}
2474−}
2475−
2476−@article{F-tal,
2477− journal = {{ACM} Transactions on Programming Languages and Systems},
2478− number = {3},
2479− month = {May},
2480− volume = {21},
2481− title = {From {System F} to Typed Assembly Language},
2482− year = {1999},
2483− pages = {528--569},
2484− author = {Greg Morrisett and David Walker and Karl Crary and Neal Glew}
2485−}
2486−
2487−@techreport{nbe-rtcg,
2488− month = {December},
2489− title = {Strong Normalization by Type-Directed Partial Evaluation and Run-Time Code Generation},
2490− year = {1997},
2491− institution = {BRICS},
2492− author = {Vincent Balat and Oliver Danvy}
2493−}
2494−
2495−@misc{yong-schemata,
2496− howpublished = {http://www.dur.ac.uk/yong.luo/},
2497− title = {A Methodology for Implementing Inductive Schemata},
2498− year = {2002},
2499− author = {Yong Luo and Zhaohui Luo}
2500−}
2501−
2502−@inproceedings{harper93,
2503− title = {Explicit Polymorphism and CPS Conversion},
2504− year = {1993},
2505− booktitle = {20th {ACM} {SIGPLAN}-SIGACT Symposium on Principles of Programming Languages},
2506− pages = {206--219},
2507− publisher = {{ACM} Press, New York, NY, USA},
2508− author = {Robert Harper and Mark Lillibridge}
2509−}
2510−
2511−@techreport{backends,
2512− month = {November},
2513− title = {Functional Back-Ends within the Lambda-Sigma Calculus},
2514− year = {1996},
2515− institution = {INRIA},
2516− author = {Th\'{e}r\`{e}se Hardin and Luc Maranget and Bruno Pagano}
2517−}
2518−
2519−@article{stg,
2520− title = {Implementing lazy functional languages on stock hardware -- the {Spineless Tagless G-machine}},
2521− year = {1992},
2522− journal = {Journal of Functional Programming},
2523− volume = {2},
2524− number = {2},
2525− pages = {127--202},
2526− month = {April},
2527− author = {Simon {Peyton Jones}}
2528−}
2529−
2530−@article{debruijn,
2531− journal = {Indagationes Mathematicae},
2532− volume = {34},
2533− title = {Lambda calculus notation with nameless dummies},
2534− year = {1972},
2535− pages = {381--392},
2536− author = {N.G. de Bruijn}
2537−}
2538−
2539−@book{assembly,
2540− month = {January},
2541− title = {PC Assembly Language},
2542− year = {2002},
2543− publisher = {http://www.drpaulcarter.com/},
2544− author = {Paul A. Carter}
2545−}
2546−
2547−@inproceedings{poly99,
2548− title = {Once Upon A Polymorphic Type},
2549− year = {1999},
2550− booktitle = {26th {ACM} {SIGPLAN}-SIGACT Symposium on Principles of Programming Languages},
2551− publisher = {{ACM}},
2552− author = {Keith Wansbrough and Simon {Peyton Jones}}
2553−}
2554−
2555−@misc{lazy_intro,
2556− title = {Compiling Lazy Functional Languages: An introduction},
2557− year = {1986},
2558− author = {Thomas Johnsson}
2559−}
2560−
2561−@inproceedings{unboxed-fp,
2562− month = {Sept},
2563− title = {Unboxed Values as First Class Citizens in a Non-Strict Functional Language},
2564− year = {1991},
2565− author = {Simon {Peyton Jones} and John Launchbury},
2566− booktitle = {Functional Programming Languages and Computer Architecture (FPCA'91)},
2567− crossref = {fplca91},
2568− pages = {636--666}
2569−}
2570−
2571−@inproceedings{abc-machine,
2572− author = {Sjaak Smetsers and Eric N{\"{o}}cker and John {van Groningen} and Rinus Plasmeijer},
2573− title = {Generating efficient code for lazy functional languages},
2574− booktitle = {Functional programming Languages and Computer Architecture},
2575− year = {1991},
2576− pages = {592--617},
2577− crossref = {fplca91}
2578−}
2579−
2580−@proceedings{fplca91,
2581− title = {Functional programming Languages and Computer Architecture},
2582− year = {1991},
2583− volume = {523},
2584− series = {LNCS},
2585− publisher = {Springer-Verlag},
2586− editor = {John Hughes}
2587−}
2588−
2589−
2590−
2591−@inproceedings{nbe,
2592− title = {An inverse of the evaluation functional for typed $\lambda$-calculus},
2593− year = {1991},
2594− booktitle = {Proc. 1991 {IEEE} Symp. on Logic in Comp. Sci.},
2595− pages = {203--211},
2596− editor = {R. Vemuri},
2597− author = {Ulrich Berger and Helmut Schwichtenberg}
2598−}
2599−
2600−@inproceedings{typed-closure,
2601− title = {Typed Closure Conversion},
2602− year = {1996},
2603− booktitle = {Symposium on Principles of Programming Languages},
2604− pages = {271--283},
2605− author = {Yasuhiko Minamide and J. Gregory Morrisett and Robert Harper}
2606−}
2607−
2608−@misc{ghc-commentary,
2609− howpublished = {http://www.cse.unsw.edu.au/~chak/haskell/ghc/comm/},
2610− title = {The Glasgow Haskell Compiler (GHC) Commentary},
2611− year = {2002},
2612− author = {Manuel M. T. Chakravarty and Sigbjorn Finne and Simon Marlow and Simon {Peyton Jones} and Julian Seward and Reuben Thomas},
2613− note = {Available from GHC CVS repository}
2614−}
2615−
2616−@inproceedings{lambdalift,
2617− month = {September},
2618− title = {Lambda Lifting: Transforming Programs to Recursive Equations},
2619− year = {1985},
2620− booktitle = {Functional Programming Languages and Computer Architecture},
2621− pages = {190--203},
2622− editor = {Jean-Pierre Jouannaud},
2623− publisher = {Springer-Verlag},
2624− author = {Thomas Johnsson}
2625−}
2626−
2627−@inproceedings{til,
2628− title = {TIL: A Type-Directed Optimizing Compiler for ML},
2629− year = {1996},
2630− booktitle = {Proc. {{ACM}} {{SIGPLAN}} '96 Conference on Programming Language Design and Implementation},
2631− pages = {181--192},
2632− author = {D. Tarditi and G. Morrisett and P. Cheng and C. Stone and R. Harper and P. Lee}
2633−}
2634−
2635−@phdthesis{shao94,
2636− school = {Princeton University},
2637− title = {Compiling Standard {ML} for Efficient Execution on Modern Machines},
2638− year = {1994},
2639− author = {Zhong Shao}
2640−}
2641−
2642−@inproceedings{gmachine,
2643− month = {September},
2644− title = {The {G-Machine}: A fast, graph-reduction evaluator},
2645− year = {1985},
2646− booktitle = {Functional Programming Languages and Computer Architecture},
2647− pages = {400--413},
2648− editor = {Jean-Pierre Jouannaud},
2649− publisher = {Springer-Verlag},
2650− author = {R.B. Kieburtz}
2651−}
2652−
2653−@inproceedings{strictness,
2654− month = {September},
2655− title = {Strictness Analysis - A practical approach},
2656− year = {1985},
2657− booktitle = {Functional Programming Languages and Computer Hardware},
2658− pages = {35--49},
2659− editor = {Jean-Pierre Jouannaud},
2660− publisher = {Springer-Verlag},
2661− author = {Chris Clack and Simon {Peyton Jones}}
2662−}
2663−
2664−@book{fl-impl,
2665− title = {Implementing Functional Languages - A Tutorial},
2666− year = {1992},
2667− publisher = {Prentice Hall International},
2668− author = {Simon {Peyton Jones} and David Lester}
2669−}
2670−
2671−@phdthesis{capretta-thesis,
2672− school = {Katholieke Universiteit Nijmegen},
2673− title = {Abstraction and Computation},
2674− year = {2002},
2675− author = {Venanzio Capretta}
2676−}
2677−
2678−@article{bird-pointer,
2679− journal = {Journal of Functional Programming},
2680− number = {3},
2681− month = {May},
2682− volume = {11},
2683− title = {Unfolding Pointer Algorithms},
2684− year = {2001},
2685− pages = {347--358},
2686− author = {Richard S. Bird}
2687−}
2688−
2689−@article{impl-tp,
2690− journal = {Journal of Functional Programming},
2691− number = {2},
2692− month = {March},
2693− volume = {9},
2694− title = {Implementing Theorem Provers in a Purely Functional Style},
2695− year = {1999},
2696− pages = {147--166},
2697− author = {Keith Hanna}
2698−}
2699−
2700−@article{shrink-lambda,
2701− journal = {Journal of Functional Programming},
2702− number = {5},
2703− month = {September},
2704− volume = {7},
2705− title = {Shrinking Lambda Expressions in Linear Time},
2706− year = {1997},
2707− pages = {515--540},
2708− author = {Andrew W. Appel and Trevor Jim}
2709−}
2710−
2711−@article{stack-tal,
2712− journal = {Journal of Functional Programming},
2713− number = {1},
2714− month = {January},
2715− volume = {12},
2716− title = {Stack-based Typed Assembly Language},
2717− year = {2002},
2718− pages = {43--88},
2719− author = {Greg Morrisset and Karl Crart and Neal Glew and David Walker}
2720−}
2721−
2722−@article{runtime-lamsig,
2723− journal = {Journal of Functional Programming},
2724− number = {2},
2725− month = {March},
2726− volume = {8},
2727− title = {Functional Runtime Systems within the lambda-sigma Calculus},
2728− year = {1998},
2729− pages = {131--176},
2730− author = {Th\'{e}r\`{e}se Hardin and Luc Maranget and Bruno Pagano}
2731−}
2732−
2733−@article{busylazy,
2734− journal = {Journal of Functional Programming},
2735− number = {6},
2736− month = {November},
2737− volume = {11},
2738− title = {How to look busy while being as lazy as ever: the Implementation of a lazy functional debugger},
2739− year = {2001},
2740− pages = {629--671},
2741− author = {Henrik Nilsson}
2742−}
2743−
2744−@article{lazyveager,
2745− journal = {Journal of Functional Programming},
2746− number = {5},
2747− month = {September},
2748− volume = {7},
2749− title = {More haste, less speed: lazy versus eager evaluation},
2750− year = {1997},
2751− pages = {541--547},
2752− author = {Richard Bird and Geraint Jones and Oege {de Moor}}
2753−}
2754−
2755−@article{jvm-fp,
2756− journal = {Journal of Functional Programming},
2757− number = {6},
2758− month = {November},
2759− volume = {9},
2760− title = {Compiling lazy functional programs for the Java Virtual Machine},
2761− year = {1999},
2762− pages = {579--603},
2763− author = {David Wakeling}
2764−}
2765−
2766−@book{isabelle,
2767− publisher = {Springer-Verlag},
2768− series = {LNCS},
2769− volume = {2283},
2770− month = {March},
2771− title = {Isabelle/HOL - A proof assistant for higher order logic},
2772− year = {2002},
2773− author = {Tobias Nipkow and Lawrence C. Paulson and Markus Wenzel}
2774−}
2775−
2776−@article{ghc-inliner,
2777− journal = {Journal of Functional Programming},
2778− number = {4},
2779− month = {September},
2780− volume = {12},
2781− title = {Secrets of the {Glasgow Haskell Compiler} inliner},
2782− year = {2002},
2783− pages = {393--434},
2784− author = {Simon {Peyton Jones} and Simon Marlow}
2785−}
2786−
2787−@article{dynamic-fp,
2788− journal = {Journal of Functional Programming},
2789− number = {1},
2790− month = {January},
2791− volume = {8},
2792− title = {The dynamic compiliation of lazy functional programs},
2793− year = {1998},
2794− pages = {61--81},
2795− author = {David Wakeling}
2796−}
2797−
2798−@misc{isabelle-ref,
2799− month = {March},
2800− title = {Isabelle Reference Manual},
2801− year = {2002},
2802− author = {Lawrence C. Paulson}
2803−}
2804−
2805−@article{debruijn-nested,
2806− journal = {Journal of Functional Programming},
2807− number = {1},
2808− month = {January},
2809− volume = {9},
2810− title = {de Bruijn notation as a nested datatype},
2811− year = {1999},
2812− pages = {77--91},
2813− author = {Richard S. Bird and Ross Paterson}
2814−}
2815−
2816−@article{perfect-trees,
2817− journal = {Journal of Functional Programming},
2818− number = {3},
2819− month = {May},
2820− volume = {10},
2821− title = {Perfect trees and bit-reversal permutations},
2822− year = {2000},
2823− pages = {305--317},
2824− author = {Ralf Hinze}
2825−}
2826−
2827−@phdthesis{paulin-extraction,
2828− school = {Paris 7},
2829− title = {Extraction de programmes dans le Calcul des Constructions},
2830− year = {1989},
2831− author = {Christine Paulin-Mohring}
2832−}
2833−
2834−@phdthesis{santos95,
2835− school = {University of Glasgow},
2836− title = {Compilation By Transformation In Non-Strict Functional Languages},
2837− year = {1995},
2838− author = {{Andr\'{e} Lu\'{i}s de Medeiros} Santos}
2839−}
2840−
2841−@book{cps,
2842− title = {Compiling With Continuations},
2843− year = {1992},
2844− publisher = {Cambridge University Press},
2845− author = {Andrew W. Appel}
2846−}
2847−
2848−@techreport{SKIM,
2849− number = {31},
2850− title = {The {SKIM} microprogrammer's guide},
2851− year = {1983},
2852− institution = {University of Cambridge},
2853− author = {W.R. Stoye}
2854−}
2855−
2856−@misc{NORMA,
2857− title = {An Overview of Burroughs {NORMA}},
2858− year = {1985},
2859− author = {H. Richards}
2860−}
2861−
2862−@book{ml,
2863− title = {The Definition of Standard ML --- Revised},
2864− year = {1997},
2865− publisher = {MIT Press},
2866− author = {Robin Milner and Mads Tofte and Robert Harper and David MacQueen}
2867−}
2868−
2869−@misc{ml71,
2870− title = {An intuitionistic theory of types},
2871− year = {1971},
2872− author = {Per Martin-L\"{o}f}
2873−}
2874−
2875−@phdthesis{girard-thesis,
2876− school = {Universit\'{e} Paris VII},
2877− title = {Interpr\'{e}tation fonctionelle et \'{e}limination des coupures de l'arithm\'{e}tique d'ordre sup\'{e}rieur},
2878− year = {1972},
2879− author = {Jean-Yves Girard}
2880−}
2881−
2882−@inproceedings{ml75,
2883− title = {An intuitionistic theory of types: predicative part},
2884− year = {1975},
2885− booktitle = {Logic Colloquium '73},
2886− editor = {H. Rose and J.C. Shepherdson},
2887− publisher = {North-Holland},
2888− author = {Per Martin-L\"{o}f}
2889−}
2890−
2891−@inproceedings{cpm90,
2892− title = {Inductively defined types},
2893− year = {1990},
2894− author = {Thierry Coquand and Christine Paulin-Mohring},
2895− series = {LNCS},
2896− volume = {417},
2897− publusher = {Springer-Verlag}
2898−}
2899−
2900−@phdthesis{fpcustom,
2901− month = {May},
2902− school = {Computer Lab, University of Cambridge},
2903− title = {The Implementation of Functional Languages using Custom Hardware},
2904− year = {1985},
2905− author = {W.R. Stoye}
2906−}
2907−
2908−@phdthesis{hughesthesis,
2909− month = {September},
2910− school = {Programming Research Group, Oxford},
2911− title = {The design and implementation of programming languages},
2912− year = {1984},
2913− author = {John Hughes}
2914−}
2915−
2916−@inproceedings{tim,
2917− volume = {274},
2918− title = {{TIM} -- A simple lazy abstract machine to execute supercombinators},
2919− year = {1987},
2920− booktitle = {Functional Programming Languages and Computer Architecture},
2921− publisher = {Springer-Verlag},
2922− author = {John Fairbairn and Stuart Wray},
2923− pages = {34--45},
2924− series = {LNCS}
2925−}
2926−
2927−@techreport{abc,
2928− title = {The {ABC} machine -- A Sequential Stack-based Abstract Machine For Graph Rewriting},
2929− year = {1990},
2930− institution = {University of Nijmegen},
2931− 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}
2932−}
2933−
2934−@techreport{implicit,
2935− title = {On Implicit Arguments},
2936− year = {1994},
2937− institution = {Faculty of Science, University of Tokyo},
2938− author = {Masami Hagiya and Yozo Toda}
2939−}
2940−
2941−@book{semantics,
2942− title = {Denotational Semantics},
2943− year = {1986},
2944− publisher = {Wm. C. Brown},
2945− author = {David A. Schmidt}
2946−}
2947−
2948−@inproceedings{lazyml,
2949− month = {August},
2950− title = {A compiler for {Lazy} {ML}},
2951− year = {1984},
2952− booktitle = {Proceedings of the {{ACM}} Symposium on Lisp and Functional Programming},
2953− pages = {218--227},
2954− author = {Lennart Augustsson}
2955−}
2956−
2957−@inproceedings{nu-g,
2958− title = {Parallel graph reduction with the $\langle\nu,G\rangle$-machine},
2959− year = {1989},
2960− booktitle = {Functional Programming Languages and Computer Architecture},
2961− publisher = {{ACM} Press},
2962− author = {Lennart Augustsson and Thomas Johnsson}
2963−}
2964−
2965−@book{k&r,
2966− title = {The C programming language},
2967− year = {1988},
2968− publisher = {Prentice-Hall},
2969− author = {Brian W. Kernighan and Dennis M. Ritchie}
2970−}
2971−
2972−@misc{c--garbage,
2973− title = {C--: a portable assembly language that supports garbage collection},
2974− year = {1999},
2975− author = {Simon {Peyton Jones} and Norman Ramsey and Fermin Reig},
2976− note = {Invited talk at PPDP'99}
2977−}
2978−
2979−@misc{epigram,
2980− howpublished = {http://www.dur.ac.uk/CARG/epigram.html},
2981− title = {Project Proposal: {Epigram}: Innovative Programming via Inductive Families},
2982− year = {2002},
2983− author = {Zhaohui Luo and James McKinna and Paul Callaghan and Conor McBride}
2984−}
2985−
2986−@misc{ghc-rewrite,
2987− title = {Playing by the Rules: Rewriting as a practical optimisation technique in {GHC}},
2988− year = {2001},
2989− author = {Simon {Peyton Jones} and Andrew Tolmach and Tony Hoare}
2990−}
2991−
2992−@UNPUBLISHED{implicit-pollack,
2993− AUTHOR = {Robert Pollack},
2994− TITLE = {Implicit Syntax},
2995− NOTE = {Informal Proceedings of First Workshop on
2996− Logical Frameworks, Antibes},
2997− YEAR = {1990},
2998− MONTH = MAY
2999−}
3000−
3001−
3002−@article{transform-haskell,
3003− journal = {Science of Computer Programming},
3004− volume = {32},
3005− title = {A transformation-based optimiser for {Haskell}},
3006− year = {1998},
3007− pages = {3--47},
3008− author = {Simon {Peyton Jones} and Andr\'{e} L. M. Santos}
3009−}
3010−
3011−@inproceedings{knuth-bendix,
3012− title = {Simple Word Problems in Universal Algebras},
3013− year = {1970},
3014− booktitle = {Computational Problems in Abstract Algebra},
3015− pages = {263--298},
3016− editor = {John Leech},
3017− publisher = {Pergamon Press},
3018− author = {Donald E. Knuth and Peter B. Bendix}
3019−}
3020−
3021−@inproceedings{phantomfun,
3022− title = {Fun With Phantom Types},
3023− author = {Ralf Hinze},
3024− pages = {245--262},
3025− year = {2003},
3026− crossref = {funprogramming},
3027− booktitle = {The Fun Of Programming},
3028− publisher = {Palgrave}
3029−}
3030−
3031−@book{funprogramming,
3032− month = {March},
3033− title = {The Fun Of Programming},
3034− year = {2003},
3035− editor = {Jeremy Gibbons and Oege {de Moor}},
3036− publisher = {Palgrave},
3037− series = {Cornerstones of Computing}
3038−}
3039−
3040−@inproceedings{anderson-proof,
3041− title = {Representing Proof Transformations For Program Optimization},
3042− year = {1994},
3043− booktitle = {International Conference On Automated Deduction},
3044− publisher = {Springer Verlag},
3045− author = {Penny Anderson}
3046−}
3047−
3048−@phdthesis{daria-thesis,
3049− month = {April},
3050− school = {Institute of Informatics, Warsaw University},
3051− title = {Termination of Rewriting in the Calculus of Constructions},
3052− year = {2003},
3053− author = {Daria Walukiewicz-Chrzaszcz}
3054−}
3055−
3056−@inproceedings{change-data,
3057− title = {Changing Data Structures In Type Theory: A Study Of Natural Numbers},
3058− year = {2001},
3059− booktitle = {Types For Proofs And Programs 2000},
3060− pages = {181--196},
3061− editor = {Paul Callaghan and Zhaohui Luo and James McKinna and Robert Pollack},
3062− publisher = {Springer},
3063− author = {Nicolas Magaud and Yves Bertot}
3064−}
3065−
3066−@phdthesis{nico-thesis,
3067− title = {Changement de Representation des donn\'{e}es dans le Calcul de Constructions},
3068− author = {Nicolas Magaud},
3069− year = {2003},
3070− month = {October},
3071− school = {Universit\'{e} de Nice - Sophia Antipolis}
3072−}
3073−
3074−
3075−@book{patterns,
3076− title = {Design Patterns},
3077− year = {1995},
3078− publisher = {Addison Wesley},
3079− author = {Erich Gamma and Richard Helm and Ralph Johnson and John Vlissides}
3080−}
3081−
3082−@misc{ghchugs,
3083− month = {August},
3084− title = {The New {GHC}/{Hugs} Runtime System},
3085− year = {1998},
3086− author = {Simon Marlow and Simon {Peyton Jones}}
3087−}
3088−
3089−@misc{stgrevised,
3090− month = {February},
3091− title = {The {STG} runtime system (revised)},
3092− year = {1999},
3093− author = {Simon {Peyton Jones} and Simon Marlow and Alastair Reid},
3094− howpublished = {Available from \verb+http://www.haskell.org/ghc/documentation.html+}
3095−}
3096−
3097−@inproceedings{optimistic,
3098− month = {March},
3099− title = {Optimistic Evaluation --- an adaptive evaluation strategy for non-strict programs},
3100− year = {2003},
3101− author = {Robert Ennals and Simon {Peyton Jones}},
3102− booktitle = {International Conference on Functional Programming},
3103− pages = {287--298}
3104−}
3105−
3106−@phdthesis{ennals-thesis,
3107− title = {Adaptive Evaluation of Non-Strict Programs},
3108− author = {Robert Ennals},
3109− year = {2003},
3110− month = {December},
3111− school = {King's College, University of Cambridge}
3112−}
3113−
3114−@article{garbage,
3115− journal = {{ACM} Computing Surveys},
3116− number = {3},
3117− volume = {13},
3118− title = {Garbage Collection of Linked Data Structures},
3119− year = {1981},
3120− pages = {341--367},
3121− author = {Jacques Cohen}
3122−}
3123−
3124−@article{baker-gc,
3125− journal = {Communications of the {ACM}},
3126− number = {4},
3127− month = {April},
3128− volume = {21},
3129− title = {List Processing In Real Time On A Serial Computer},
3130− year = {1978},
3131− pages = {280--294},
3132− author = {Henry G. {Baker Jr}}
3133−}
3134−
3135−@misc{bc-rec,
3136− month = {February},
3137− title = {Modelling General Recursion in Type Theory},
3138− year = {2003},
3139− note = {Under consideration for publication in Math. Struct. in Comp. Science. Draft, DCS, CTH --- INRIA, Sophia Antipolis, France},
3140− author = {Ana Bove and Venanzio Capretta}
3141−}
3142−
3143−@misc{global-tag,
3144− title = {Global Tagging Optimization by Type Inference},
3145− year = {1992},
3146− author = {Fritz Henglein}
3147−}
3148−
3149−@book{esr,
3150− month = {October},
3151− title = {The Cathedral And The Bazaar},
3152− year = {1999},
3153− publisher = {O'Reilly},
3154− author = {Eric Raymond}
3155−}
3156−
3157−@book{manmonth,
3158− title = {The Mythical Man-month: Essays on Software Engineering},
3159− year = {1975},
3160− publisher = {Addison Wesley},
3161− author = {Frederick P. Brooks}
3162−}
3163−
3164−@inproceedings{evalpush,
3165− title = {How to make a fast curry: push/enter vs eval/apply},
3166− year = {2004},
3167− author = {Simon Marlow and Simon {Peyton Jones}},
3168− booktitle = {International Conference on Functional Programming, Snowbird},
3169− pages = {4--15}
3170−}
3171−
3172−@phdthesis{boquist-thesis,
3173− month = {April},
3174− school = {Chalmers University of Technology},
3175− title = {Code Optimisation Techniques for Lazy Functional Languages},
3176− year = {1999},
3177− author = {Urban Boquist}
3178−}
3179−
3180−@book{formal-spec,
3181− title = {Formal Specification Of Programming Languages},
3182− year = {1981},
3183− publisher = {Prentice-Hall},
3184− author = {Frank G. Pagan}
3185−}
3186−
3187−@inproceedings{elim-motive,
3188− title = {Elimination With A Motive},
3189− year = {2000},
3190− booktitle = {Types for Proofs and Programs},
3191− pages = {197--216},
3192− editor = {Paul Callaghan and Zhaohui Luo and James McKinna and Robert Pollack},
3193− publisher = {Springer},
3194− author = {Conor McBride}
3195−}
3196−
3197−@article{telescope,
3198− journal = {Information and Computation},
3199− number = {2},
3200− month = {April},
3201− volume = {91},
3202− title = {Telescoping Mappings in Typed Lambda Calculus},
3203− year = {1991},
3204− pages = {189--204},
3205− author = {N.G. de Bruijn}
3206−}
3207−
3208−@misc{typeintype,
3209− title = {Typechecking is undecidable when 'type' is a type},
3210− year = {1989},
3211− author = {Mark B. Reinhold}
3212−}
3213−
3214−@misc{core,
3215− month = {September},
3216− title = {An External Representation for the {GHC} Core Language},
3217− year = {2001},
3218− author = {Andrew Tolmach and {The GHC Team}}
3219−}
3220−
3221−@article{deforestation,
3222− journal = {Theoretical Computer Science},
3223− volume = {73},
3224− title = {Deforestation: Transforming programs to eliminate trees},
3225− year = {1990},
3226− pages = {231--248},
3227− author = {Philip Wadler}
3228−}
3229−
3230−@misc{hep,
3231− month = {July},
3232− title = {Architecture of the {Haskell} Execution Platform},
3233− year = {1999},
3234− author = {Julian Seward and Simon Marlow and Andy Gill and Sigbjorn Finne and Simon {Peyton Jones} },
3235− note = {Version 6},
3236− howpublished = {Available from \verb+http://www.haskell.org/ghc/documentation.html+}
3237−}
3238−
3239−@mastersthesis{wahlstedt-thesis,
3240− month = {October},
3241− school = {Chalmers University Of Technology},
3242− title = {Detecting Termination Using Size Change In Parameter Values},
3243− year = {2000},
3244− author = {David Wahlstedt}
3245−}
3246−
3247−@inproceedings{size-change,
3248− title = {The size-change principle for program termination},
3249− year = {2001},
3250− booktitle = {Proceedings of the 28th Annual {ACM} {SIGPLAN}-SIGACT Symposium on Principles of Programming Languages},
3251− author = {Chin Soon Lee and Neil D. Jones and Amir Ben-Amram. }
3252−}
3253−
3254−@article{ski-turner,
3255− journal = {Software -- Practice and Experience},
3256− volume = {9},
3257− title = {A new implementation technique for applicative languages},
3258− year = {1979},
3259− pages = {31--49},
3260− author = {David Turner}
3261−}
3262−
3263−@inproceedings{turner-strong,
3264− number = {1022},
3265− title = {Elementary Strong Functional Programming},
3266− year = {1996},
3267− booktitle = {First International Symposium on Functional Programming Languages in Education, Nijmegen, Netherlands, December 1995.},
3268− pages = {1--13},
3269− publisher = {Springer},
3270− author = {David Turner},
3271− series = {LNCS}
3272−}
3273−
3274−@misc{clean,
3275− title = {The {Concurrent CLEAN} Language Report (draft)},
3276− year = {2003},
3277− author = {Rinus Plasmeijer and Marko van Eekelen},
3278− howpublished = {Available from \verb+http://www.cs.kun.nl/~clean/+}
3279−}
3280−
3281−@article{burstall-struct,
3282− journal = {Computer Journal},
3283− number = {1},
3284− volume = {12},
3285− title = {Proving Properties of Programs By Structural Induction},
3286− year = {1969},
3287− pages = {41--48},
3288− author = {Rod Burstall}
3289−}
3290−
3291−@incollection{ barendregt-types,
3292− author = "Henk Barendregt",
3293− title = "Lambda Calculi with Types",
3294− booktitle = "Handbook of Logic in Computer Science, Volumes 1 (Background: Mathematical Structures) and 2 (Background: Computational Structures), Abramsky \& Gabbay \& Maibaum (Eds.)",
3295− publisher = "Clarendon",
3296− volume = "2",
3297− year = "1992",
3298− url = "citeseer.nj.nec.com/barendregt92lambda.html" }
3299−
3300−@book{curry-feys,
3301− title = {Combinatory Logic, volume 1},
3302− year = {1958},
3303− publisher = {North Holland},
3304− author = {Haskell B. Curry and Robert Feys}
3305−}
3306−
3307−@phdthesis{bove-thesis,
3308− month = {November},
3309− school = {Chalmers University of Technology},
3310− title = {General Recursion in Type Theory},
3311− year = {2002},
3312− author = {Ana Bove}
3313−}
3314−
3315−@inbook{ml-cm,
3316− title = {Constructive Mathematics and Computer Programming},
3317− year = {1985},
3318− booktitle = {Mathematical Logic and Programming Languages},
3319− publisher = {Prentice Hall},
3320− author = {Per Martin-L\"{o}f}
3321−}
3322−
3323−@inproceedings{howard,
3324− title = {The formulae-as-types notion of construction},
3325− year = {1980},
3326− booktitle = {To H.B.Curry: Essays on combinatory logic, lambda calculus and formalism},
3327− editor = {Jonathan P. Seldin and J. Roger Hindley},
3328− publisher = {Academic Press},
3329− author = {William A. Howard},
3330− note = {A reprint of an unpublished manuscript from 1969}
3331−}
3332−
3333−@inproceedings{talx86,
3334− title = {TALx86: A Realistic Typed Assembly Language},
3335− year = {1999},
3336− booktitle = {{ACM} {SIGPLAN} Workshop on Compiler Support for System Software},
3337− pages = {25--35},
3338− 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}
3339−}
3340−
3341−@inproceedings{bove-capretta,
3342− volume = {2152},
3343− title = {Nested General Recursion and Partiality in Type Theory},
3344− year = {2001},
3345− booktitle = {Theorem Proving in Higher Order Logics, 14th International Conference, TPHOLS 2001},
3346− pages = {121--135},
3347− editor = {Richard J. Boulton and Paul B. Jackson},
3348− publisher = {Springer-Verlag},
3349− author = {Ana Bove and Venanzio Capretta},
3350− series = {LNCS}
3351−}
3352−
3353−@misc{lvm,
3354− month = {November},
3355− title = {LVM, the lazy virtual machine},
3356− year = {2002},
3357− author = {Daan Leijen}
3358−}
3359−
3360−@misc{ocaml,
3361− howpublished = {\verb+http://caml.inria.fr/ocaml/htmlman/+},
3362− month = {August},
3363− title = {The {Objective Caml} system release 3.06},
3364− year = {2002},
3365− author = {Xavier Leroy}
3366−}
3367−
3368−@misc{lambdagoto,
3369− title = {Lambda : The Ultimate Goto},
3370− year = {1977},
3371− author = {Guy L. {Steele Jr}},
3372− note = {MIT AI Memo 443}
3373−}
3374−
3375−@inproceedings{ liu-tail,
3376− author = "Yanhong A. Liu and Scott D. Stoller",
3377− title = "From Recursion to Iteration: What are the Optimizations?",
3378− booktitle = "Partial Evaluation and Semantic-Based Program Manipulation",
3379− pages = "73-82",
3380− year = "2000",
3381− url = "citeseer.nj.nec.com/liu00from.html" }
3382−
3383−@inproceedings{aczel77,
3384− title = {An Introduction To Inductive Definitions},
3385− year = {1977},
3386− booktitle = {Handbook of Mathematical Logic},
3387− editor = {J. Barwise},
3388− publisher = {North Holland},
3389− author = {Peter Aczel}
3390−}
3391−
3392−@inproceedings{inductive-plastic,
3393− volume = {1956},
3394− title = {Implementation Techniques for Inductive Types in {Plastic}},
3395− year = {1999},
3396− booktitle = {Types for Proofs and Programs},
3397− pages = {94--113},
3398− editor = {Thierry Coquand and Peter Dybjer and Bengt Nordstr\"{o}m and Jan Smith},
3399− publisher = {Springer-Verlag},
3400− author = {Paul Callaghan and Zhaohui Luo},
3401− series = {LNCS}
3402−}
3403−
3404−@misc{graham,
3405− howpublished = {Available from \verb+http://www.paulgraham.com/+},
3406− month = {April},
3407− title = {The Hundred Year Language},
3408− year = {2003},
3409− author = {Paul Graham},
3410− note = {Keynote address at PyCon 2003}
3411−}
3412−
3413−@inproceedings{gimenez98,
3414− volume = {1443},
3415− title = {Structural Recursive Definitions in Type Theory},
3416− year = {1998},
3417− booktitle = {Proceedings of ICALP '98},
3418− publisher = {Springer-Verlag},
3419− author = {Eduardo Gim\'{e}nez},
3420− series = {LNCS}
3421−}
3422−
3423−@article{quicksort,
3424− journal = {Computer Journal},
3425− number = {1},
3426− volume = {5},
3427− title = {Quicksort},
3428− year = {1962},
3429− pages = {10--15},
3430− author = {C.A.R. Hoare}
3431−}
3432−
3433−@phdthesis{goguen-thesis,
3434− school = {University of Edinburgh},
3435− title = {A Typed Operational Semantics for Type Theory},
3436− year = {1994},
3437− author = {Healfdene Goguen}
3438−}
3439−
3440−@article{ph-universes,
3441− journal = {Theoretical Computer Science},
3442− number = {1},
3443− volume = {89},
3444− title = {Type Checking With Universes},
3445− year = {1991},
3446− pages = {107--136},
3447− author = {Robert Harper and Randy Pollack}
3448−}
3449−
3450−@inproceedings{pm-compile,
3451− month = {September},
3452− title = {Compiling Pattern Matching},
3453− year = {1985},
3454− booktitle = {Functional Programming Languages and Computer Architecture},
3455− pages = {368--381},
3456− editor = {Jean-Pierre Jouannaud},
3457− publisher = {Springer-Verlag},
3458− author = {Lennart Augustsson}
3459−}
3460−
3461−@phdthesis{lena-thesis,
3462− school = {Chalmers University of Technology, G\"{o}teborg},
3463− title = {The implementation of {ALF} -- A Proof Editor based on {Martin-L\"{o}f}'s Monomorphic Type Theory with Explicit Substitutions},
3464− year = {1994},
3465− author = {Lena Magnusson}
3466−}
3467−
3468−@article{view-left,
3469− journal = {Journal of Functional Programming},
3470− number = {1},
3471− volume = {14},
3472− title = {The View From The Left},
3473− year = {2004},
3474− author = {Conor McBride and James McKinna},
3475− pages = {69--111}
3476−}
3477−
3478−@inproceedings{not-a-number,
3479− author = {Conor McBride and James McKinna},
3480− title = {I am not a number, {I} am a free variable},
3481− year = {2004},
3482− booktitle = {Proceedings of the {ACM} {SIGPLAN} Haskell Workshop}
3483−}
3484−
3485−
3486−@misc{profiling,
3487− title = {Time and Space Profiling for Non-Strict, Higher Order Functional Languages},
3488− year = {1995},
3489− author = {Patrick M. Sansom and Simon {Peyton Jones}}
3490−}
3491−
3492−@inbook{pattern-matching,
3493− title = {The Implementation of Functional Programming Languages},
3494− year = {1987},
3495− booktitle = {The Implementation of Functional Programming Languages},
3496− pages = {78--103},
3497− editor = {Simon {Peyton Jones}},
3498− chapter = {5},
3499− publisher = {Prentice Hall},
3500− author = {Philip Wadler},
3501− crossref = {pj-imp}
3502−}
3503−
3504−@article{pe-problems,
3505− author = {Jones, N. D.},
3506− title = {Challenging problems in partial evaluation and mixed computation},
3507− journal = {New Gen. Comput.},
3508− volume = {6},
3509− number = {2-3},
3510− year = {1988},
3511− issn = {0288-3635},
3512− pages = {291--302},
3513− doi = {http://dx.doi.org/10.1007/BF03037143},
3514− publisher = {Ohmsha},
3515− address = {Tokyo, Japan, Japan},
3516− }
3517−
3518−@inproceedings{tag-elim,
3519− title = {Tag Elimination -- or -- Type Specialisation is a Type Indexed Effect},
3520− year = {2000},
3521− booktitle = {Subtyping and Dependent Types in Programming, APPSEM Workshop},
3522− author = {Walid Taha and Henning Makholm}
3523−}
3524−
3525−@inproceedings{extraction-coq,
3526− title = {A New Extraction for {Coq}},
3527− year = {2002},
3528− booktitle = {Types for proofs and programs},
3529− editor = {Herman Geuvers and Freek Wiedijk},
3530− publisher = {Springer},
3531− author = {Pierre Letouzey},
3532− series = {LNCS}
3533−}
3534−
3535−@phdthesis{mcbride-snr-thesis,
3536− school = {Queen's University of Belfast},
3537− title = {Computer Aided Manipulation of Symbols},
3538− year = {1970},
3539− author = {Fred McBride}
3540−}
3541−
3542−@article{ho-strictness,
3543− journal = {Science of Computer Programming},
3544− volume = {7},
3545− title = {Strictness analysis for higher-order functions},
3546− year = {1986},
3547− pages = {249--278},
3548− author = { Geoffrey L. Burn and Chris Hankin and Samson Abramsky}
3549−}
3550−
3551−@phdthesis{mycroft-thesis,
3552− school = {Dept Computer Science, University of Edinburgh},
3553− title = {Abstract interpretation and optimising transformations for applicative programs},
3554− year = {1981},
3555− author = {A. Mycroft}
3556−}
3557−
3558−@inproceedings{bc-nested,
3559− month = {September},
3560− volume = {2152},
3561− title = {Nested General Recursion and Partiality in Type Theory},
3562− year = {2001},
3563− booktitle = {Theorem Proving In Higher Order Logics: 14th International Conferences, TPHOLS 2001},
3564− pages = {121--135},
3565− publisher = {Springer--Verlag},
3566− author = {Ana Bove and Venanzio Capretta},
3567− series = {LNCS}
3568−}
3569−
3570−@techreport{bove-mutual,
3571− month = {May},
3572− title = {Mutual General Recursion in Type Theory},
3573− year = {2002},
3574− institution = {Department of Computing Science, Chalmers University of Technology},
3575− author = {Ana Bove}
3576−}
3577−
3578−@article{berardi-pruning,
3579− journal = {Journal of Logic and Computation},
3580− number = {5},
3581− volume = {6},
3582− title = {Pruning Simply Typed Lambda Terms},
3583− year = {1996},
3584− pages = {663--681},
3585− author = {Stefano Berardi}
3586−}
3587−
3588−@article{milner-tc,
3589− journal = {Journal of Computer and System Science},
3590− volume = {17},
3591− title = {A Theory of Type Polymorphism in Programming},
3592− year = {1978},
3593− pages = {348--75},
3594− author = {R. Milner}
3595−}
3596−
3597−@inproceedings{extt,
3598− title = {Inductive Families Need Not Store Their Indices},
3599− year = {2004},
3600− booktitle = {Types for Proofs and Programs 2003},
3601− author = {Edwin Brady and Conor McBride and James McKinna},
3602− editor = {Stefano Berardi and Mario Coppo and Ferruccio Damiani},
3603− series = {Lecture Notes in Computer Science},
3604− publisher = {Springer},
3605− volume = {3085},
3606− pages = {115--129}
3607−}
3608−
3609−@book{luo94,
3610− title = {Computation and Reasoning -- A Type Theory for Computer Science},
3611− year = {1994},
3612− publisher = {OUP},
3613− author = {Zhaohui Luo},
3614− series = {Intl. Series of Monographs on Comp. Sci.}
3615−}
3616−
3617−@article{backus78,
3618− journal = {Communications of the {ACM}},
3619− month = {August},
3620− volume = {21},
3621− title = {Can Programming Be Liberated From the {Von Neumann} Style?},
3622− year = {1978},
3623− pages = {280--294},
3624− author = {John Backus}
3625−}
3626−
3627−@misc{henk,
3628− month = {May},
3629− title = {Henk: A Typed Intermediate Language},
3630− year = {1997},
3631− author = {Simon {Peyton Jones} and Erik Meijer}
3632−}
3633−
3634−@article{thunks,
3635− journal = {Journal of Functional Programming},
3636− number = {3},
3637− month = {May},
3638− volume = {7},
3639− title = {Thunks and the $\lambda$-calculus},
3640− year = {1997},
3641− pages = {303--319},
3642− author = {John Hatcliff and Olivier Danvy}
3643−}
3644−
3645−@inproceedings{grin-project,
3646− author = "Urban Boquist and Thomas Johnsson",
3647− title = "The {GRIN} Project: A Highly Optimising Back End for Lazy Functional Languages",
3648− booktitle = "Implementation of Functional Languages",
3649− pages = "58--84",
3650− year = "1996",
3651− url = "citeseer.ist.psu.edu/boquist96grin.html" }
3652−
3653−@misc{boehm-gc,
3654− nothowpublished = {\url{http://www.hpl.hp.com/personal/Hans_Boehm/gc/}},
3655− title = {A garbage collector for {C} and {C++}},
3656− year = {2001},
3657− author = {Hans-J. Boehm and Alan J. Demers and {Xerox Corporation Silicon Graphic} and {Hewlett-Packard Company}}
3658−}
3659−
3660−@misc{art-interpreter,
3661− month = {May},
3662− title = {The Art of the Interpreter or, the Modularity Complex (Parts Zero, One, and Two)},
3663− year = {1978},
3664− author = {Guy Lewis {Steele, Jr.} and Gerald Jay Sussman},
3665− note = {MIT AI Lab. AI Lab Memo AIM-453}
3666−}
3667−
3668−@inproceedings{gimenez,
3669− title = {Codifying Guarded Definitions With Recursive Schemes},
3670− year = {1994},
3671− booktitle = {Proceedings of TYPES 1994},
3672− pages = {39--59},
3673− author = {Eduardo Gim\'{e}nez}
3674−}
3675−
3676−@manual{ghc-manual,
3677− title = {The Glasgow Haskell Compiler User's Guide, Version 6.0},
3678− year = {2003},
3679− author = {The {GHC Team}}
3680−}
3681−
3682−@article{rbtree,
3683− journal = {Journal of Functional Programming},
3684− number = {4},
3685− month = {May},
3686− volume = {9},
3687− title = {Red-Black Trees In A Functional Setting},
3688− year = {1999},
3689− pages = {471--477},
3690− author = {Chris Okasaki}
3691−}
3692−
3693−@inproceedings{dt-data,
3694−author = "Hongwei Xi",
3695−title = {{Dependently Typed Data Structures}},
3696−booktitle = "Proceedings of Workshop of Algorithmic Aspects of Advanced Programming Languages (WAAAPL '99)",
3697−year = 1999,
3698−month = "September",
3699−pages = "17--32",
3700−address = "Paris",
3701−}
3702−
3703−@misc{krivine,
3704− title = {On the Correctness and Efficiency of the {Krivine} Machine},
3705− year = {2003},
3706− month = {October},
3707− author = {Mitchell Wand and Daniel P. Friedman},
3708− howpublished = {Submitted for publication}
3709− }
3710−
3711−@inproceedings{nbe-filinski,
3712− title = {Normalization by Evaluation for the Computational Lambda-Calculus},
3713− year = {2001},
3714− month = {May},
3715− booktitle = {Typed Lambda Calculi and Applications: 5th International Conference, TLCA 2001},
3716− author = {Andrzej Filinski},
3717− pages = {151--165},
3718− publisher = {Springer-Verlag},
3719− series = {LNCS},
3720− volume = {2044}
3721−}
3722−
3723−@inproceedings{filinski-nbesem,
3724− title = {A semantic account of type-directed partial evaluation},
3725− year = {1999},
3726− author = {Andrzej Filinski},
3727− editor = {G. Nadathur},
3728− booktitle = {International Conference on Principles and Practice of Declarative Programming},
3729− volume = {1702},
3730− series = {LNCS},
3731− pages = {378--395},
3732− publisher = {Springer-Verlag}
3733−}
3734−
3735−@article{secd,
3736− title = {The mechanical evaluation of expressions},
3737− author = {P.J. Landin},
3738− year = {1964},
3739− journal = {Computer Journal},
3740− volume = {6},
3741− pages = {308--320}
3742−}
3743−
3744−@misc{lispkit,
3745− title = {The {LispKit} Manual},
3746− author = {Peter Henderson and Geraint Jones and Simon Jones},
3747− year = {1982},
3748− howpublished = {Oxford University Computing Laboratory}
3749−}
3750−
3751−@inproceedings{wells-undecidable,
3752− title = {Typability and Type Checking in the Second-order $\lambda$-calculus are equivalent and undecidable},
3753− author = {J. Wells},
3754− year = {1994},
3755− month = {July},
3756− booktitle = {Proc. 9th Ann. {IEEE} Symp. Logic Comput. Sci.}
3757−}
3758−
3759−@misc{patguards,
3760− title = {Pattern Guards and Transformational Patterns},
3761− author = {Martin Erwig and Simon {Peyton Jones}},
3762− year = {2000},
3763− howpublished = {Haskell Workshop}
3764−}
3765−
3766−@misc{alfa-manual,
3767− title = {Alfa Users' Guide},
3768− author = {Thomas Hallgren},
3769− year = {2001},
3770− howpublished = {Available from \verb+http://www.cs.chalmers.se/~hallgren/Alfa/+}
3771−}
3772−
3773−@inproceedings{nofib,
3774− title = {The nofib Benchmark Suite of {Haskell} Programs},
3775− author = {Will Partain},
3776− year = {1992},
3777− booktitle = {Functional Programming},
3778− editor = {J. Launchbury and P.L. Sansom},
3779− series = {Workshops in Computing},
3780− publisher = {Springer Verlag}
3781−}
3782−
3783−@article{shape,
3784− title = {Shape in Computing},
3785− author = {Barry Jay},
3786− journal = "{{ACM}} Computing Surveys",
3787− year = "1996",
3788− volume = "28",
3789− number = "2",
3790− pages = "355--357",
3791−}
3792−
3793−@misc{ffi,
3794− title = {The {Haskell 98} Foreign Function Interface 1.0: An Addendum to the {Haskell 98} Report},
3795− editor = {Manuel Chakravarty},
3796− key = {FFI},
3797− year = {2002},
3798− month = {December},
3799− howpublished = {Available from \verb+http://www.haskell.org/+}
3800−}
3801−
3802−@misc{perlxs,
3803− title = {Perl {XS} Reference Manual},
3804− author = {Dean Roehrich and {The Perl Porters}},
3805− year = {1996},
3806− howpublished = {\verb+http://www.perldoc.com/perl5.6/pod/perlxs.html+}
3807−}
3808−
3809−@misc{swig,
3810− title = {{SWIG} : An Easy to Use Tool for Integrating Scripting Languages with {C} and {C++}},
3811− author = {David M. Beazley},
3812− year = {1996},
3813− howpublished = {\verb+http://www.swig.org/papers/Tcl96/tcl96.html+}
3814−}
3815−
3816−@inproceedings{types-prog,
3817− title = {Type Systems for Programming Languages},
3818− booktitle = {Handbook of Theoretical Computer Science},
3819− author = {John C. Mitchell},
3820− pages = {365--458},
3821− year = {1990},
3822− crossref = {htcs}
3823−}
3824−
3825−@book{htcs,
3826− title = {Handbook of Theoretical Computer Science},
3827− editor = {J. van Leeuwen},
3828− publisher = {Elsevier Science},
3829− year = {1990}
3830−}
3831−
3832−@misc{r5rs,
3833− title = {Revised$^5$ Report on the Algorithmic Language Scheme},
3834− author = {Richard Kelsey and William Clinger and Jonathan Rees},
3835− year = {1998},
3836− month = {February},
3837− howpublished = {Available from \verb+http://www.schemers.org/+}
3838− }
3839−
3840−@misc{gmail-outage,
3841− title = {Update on today's {Gmail} Outage},
3842− author = {{Official Gmail Blog}},
3843− howpublished = {\url{http://gmailblog.blogspot.com/2009/02/update-on-todays-gmail-outage.html}},
3844− note = {Retrieved 26th February 2009},
3845− year = 2009
3846−}
papers/impl-paper/macros.ltxdeleted−1066
@@ -1,1066 +0,0 @@
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]{\mathtt{#1}}
112−\newcommand{\DC}[1]{\mathtt{#1}}
113−\newcommand{\VV}[1]{\mathit{#1}}
114−\newcommand{\FN}[1]{\mathtt{#1}}
115−\newcommand{\HFN}[1]{\mathtt{#1}}
116−\newcommand{\RW}[1]{\underline{\textrm{#1}}}
117−\newcommand{\MO}[1]{\mbox{\textsc{#1}}}
118−
119−\newcommand{\tTC}[1]{\texttt{#1}}
120−\newcommand{\tDC}[1]{\texttt{#1}}
121−\newcommand{\tFN}[1]{\texttt{#1}}
122−
123−\newcommand{\HF}[1]{\mathtt{#1}}
124−
125−\newcommand{\MV}[1]{\nhole\mathit{#1}}
126−\newcommand{\Lang}[1]{\mathsf{#1}}
127−\newcommand{\Name}[1]{\mathit{#1}}
128−
129−\newcommand{\demph}[1]{\textbf{#1}}
130−\newcommand{\remph}[1]{\emph{#1}}
131−
132−%%%% Keywords for meta operations
133−\newcommand{\IF}{\;\RW{if}\;\;}
134−\newcommand{\THEN}{\RW{then}}
135−\newcommand{\ELSE}{\RW{else}}
136−\newcommand{\AND}{\RW{and}}
137−\newcommand{\Otherwise}{\RW{otherwise}}
138−\newcommand{\Do}{\RW{do}}
139−\newcommand{\Return}{\RW{return}}
140−
141−\newcommand{\CASE}{\RW{case}}
142−\newcommand{\LET}{\RW{let}}
143−\newcommand{\IN}{\RW{in}}
144−\newcommand{\of}{\RW{of}}
145−
146−\newcommand{\CLASS}{\mathtt{class}}
147−\newcommand{\INSTANCE}{\mathtt{instance}}
148−
149−%%%%%%%%%%%% GROUPING
150−
151−\newcommand{\G}{
152−\setlength{\unitlength}{1pt}
153−\begin{picture}(4,10)(0,0)
154−\path(2,10)(2,-10)
155−\end{picture}
156−}
157−
158−\newcommand{\E}{
159−\setlength{\unitlength}{1pt}
160−\begin{picture}(4,10)(0,0)
161−\path(2,10)(2,-2)(4,-2)
162−\end{picture}
163−}
164−
165−%\newcommand{\C}{
166−%\setlength{\unitlength}{1pt}
167−%\begin{picture}(4,10)(0,0)
168−%\path(4,8)(2,8)(2,-2)(4,-2)
169−%\end{picture}
170−%}
171−
172−\newcommand{\M}{
173−\setlength{\unitlength}{1pt}
174−\begin{picture}(4,10)(0,0)
175−\path(2,10)(2,-2)(6,-2)
176−\end{picture}
177−}
178−
179−\newcommand{\F}{
180−\setlength{\unitlength}{1pt}
181−\begin{picture}(4,10)(0,0)
182−\path(4,8)(2,8)(2,-6)
183−\end{picture}
184−}
185−
186−\newcommand{\K}{
187−\setlength{\unitlength}{1pt}
188−\begin{picture}(4,10)(0,0)
189−\path(0,8)(4,8)
190−\end{picture}
191−}
192−
193−\newcommand{\J}{
194−\setlength{\unitlength}{1pt}
195−\begin{picture}(4,10)(0,0)
196−\path(0,-2)(4,-2)
197−\end{picture}
198−}
199−
200−\newcommand{\W}{
201−\setlength{\unitlength}{1pt}
202−\begin{picture}(4,10)(0,0)
203−\end{picture}
204−}
205−
206−
207−
208−%%%%%%%%%%%% GUBBINS
209−
210−\newcommand{\mathskip}{\medskip}
211−
212−\newcommand{\fbx}[1]{\fbox{$#1$}}
213−\newcommand{\stk}[1]{\begin{array}{c}#1\end{array}}
214−%\newcommand{\DM}[1]{\hg\mbox{$#1$}}
215−\newcommand{\DM}[1]{\mathskip\par\(#1\)\mathskip}
216−\newcommand{\mbx}[1]{\mathskip\par\noindent\(#1\)\mathskip}
217−\newcommand{\AR}[1]{\begin{array}[t]{@{}l}#1\end{array}}
218−\newcommand{\ARt}[1]{\begin{array}[t]{@{}l@{}cl}#1\end{array}}
219−\newcommand{\ARc}[1]{\begin{array}{@{}l}#1\end{array}}
220−\newcommand{\ARd}[1]{\begin{array}[t]{cl}#1\end{array}}
221−\newcommand{\DAR}[1]{\begin{array}{ll}\hg & #1\end{array}}
222−\newcommand{\Dor}{\\ \hg\mid & }
223−\newcommand{\EA}[1]{\begin{array}[t]{r@{}c@{}l}#1\end{array}}
224−\newcommand{\A}{@{\:}c}
225−%\newcommand{\R}{@{\:}r}
226−\newcommand{\CA}{c}
227−\newcommand{\LA}{l}
228−\newcommand{\PAc}[2]{\begin{array}{l#1@{}r@{}l}#2\end{array}}
229−\newcommand{\PA}[2]{\begin{array}[t]{l@{\:}l#1@{}r@{\:}l}#2\end{array}}
230−\newcommand{\DTREE}[3]{\begin{array}[t]{l#1@{}r@{\:}l#2}#3\end{array}}
231−\newcommand{\IDTREE}[2]{%
232− \begin{array}[t]{l@{\:}c@{\:}l@{\:}r@{\:}l#1}#2\end{array}}
233−\newcommand{\IA}[2]
234− {\begin{array}[t]{l@{\:}r@{\:}c@{\:}l@{\:}#1@{\:}r@{\:}l}#2\end{array}}
235−\newcommand{\IAc}[2]
236− {\begin{array}[c]{r@{\:}c@{\:}l@{\:}#1@{}r@{}l}#2\end{array}}
237−\newcommand{\CS}[1]{\left\lfloor\begin{array}{@{}l}#1\end{array}\right.}
238−\newcommand{\BY}[3]{\multicolumn{2}{l}{\;\RW{by}\; #1} \\ %
239− \multicolumn{#2}{l}{\CS{#3}} }
240−\newcommand{\WITH}[3]{\multicolumn{2}{l}{\;\RW{with}\; #1} \\ %
241− \multicolumn{#2}{l}{\CS{#3}} }
242−\newcommand{\WithBy}{\RW{with-by}}
243−\newcommand{\Wb}[1]{\WithBy& #1}
244−\newcommand{\By}[1]{\multicolumn{2}{l}{\Leftarrow #1}}
245−\newcommand{\andby}{\Leftarrow}
246−\newcommand{\MyWith}[1]{\multicolumn{2}{l}{|\;#1}}
247−\newcommand{\Byr}[1]{\;\RW{by}\; #1}
248−
249−\renewcommand{\Bar}{|}
250−\newcommand{\Bart}{\settowidth{\GapLength}{$\Bar$}%
251− \raisebox{6pt}[0pt][0pt]{$\Bar$}%
252− \hspace*{-1\GapLength}%
253− \Bar}
254−\newcommand{\With}[1]{\Bar & #1}
255−\newcommand{\Witt}[1]{\Bart & #1}
256−
257−\newcommand{\B}{@{\:}r@{\:}c}
258−\newcommand{\Ret}[1]{\multicolumn{2}{l}{\cq #1}}
259−\newcommand{\MRet}[2]{\multicolumn{#1}{l}{\cq #2}}
260−\newcommand{\HRet}[1]{\multicolumn{2}{l}{\hq #1}}
261−\newcommand{\MHRet}[2]{\multicolumn{#1}{l}{\hq #2}}
262−\newcommand{\IRet}[1]{\multicolumn{2}{l}{\iq #1}}
263−\newcommand{\IMRet}[2]{\multicolumn{#1}{l}{\iq #2}}
264−\newcommand{\MoRet}[1]{\multicolumn{2}{l}{= #1}}
265−\newcommand{\MMoRet}[2]{\multicolumn{#1}{l}{\mq #2}}
266−\newcommand{\Data}{\RW{data}}
267−\newcommand{\Codata}{\RW{codata}}
268−\newcommand{\Where}{\RW{where}}
269−\newcommand{\Let}{\RW{let}}
270−\newcommand{\Fact}{\RW{fact}}
271−\newcommand{\Rec}[1]{#1\textbf{-Rec}}
272−\newcommand{\Memo}[1]{#1\textbf{-Memo}}
273−\newcommand{\Elim}[1]{#1\textbf{-Elim}}
274−\newcommand{\Cases}[1]{#1\textbf{-Case}}
275−\newcommand{\View}[1]{#1\textbf{-View}}
276−\newcommand{\As}[2]{#1 \:\RW{as}\: #2}
277−\newcommand{\nhole}{\Box}
278−\newcommand{\turq}{\:\vdash_?\:}
279−\renewcommand{\split}{\;\lhd\;}
280−\newcommand{\CType}[2]{\{#1 \split\; #2\}}
281−\newcommand{\CC}[2]{(#1)\:#2}
282−\newcommand{\UP}[2]{#1 | \{#2\}}
283−\newcommand{\Ured}{\:\Downarrow\:}
284−\newcommand{\gdd}{\prec}
285−\newcommand{\HC}[1]{\left<#1\right>}
286−\newcommand{\HT}[2]{\left<#1 \hab #2\right>}
287−
288−\newcommand{\view}{\RW{view}}
289−\newcommand{\ecase}{\RW{case}}
290−\newcommand{\rec}{\RW{rec}}
291−
292−\newcommand{\If}{\mathsf{if}}
293−\newcommand{\Then}{\mathsf{then}}
294−\newcommand{\Else}{\mathsf{else}}
295−\newcommand{\elim}{\RW{elim}}
296−
297−\newcommand{\Payload}{\mathsf{type}}
298−\newcommand{\Any}{\mathsf{Some}}
299−
300−\newcommand{\lbl}[2]{\langle #1 \Hab #2 \rangle}
301−\newcommand{\call}[2]{\RW{call}\:\langle#1\rangle\:#2}
302−\newcommand{\return}[1]{\RW{return}\:#1}
303−
304−\newcommand{\Remark}[1]{\noindent\textbf{Remark:} #1}
305−
306−\newcommand{\DBOX}[2]{\fbox{\parbox{#1}{\textbf{Definition:}#2}}}
307−
308−\newcommand{\useverbtb}[1]{\begin{tiny}\BUseVerbatim{#1}\end{tiny}}
309−\newcommand{\useverb}[1]{\begin{small}\BUseVerbatim{#1}\end{small}}
310−\newcommand{\useverbb}[1]{\begin{small}\BUseVerbatim{#1}\end{small}}
311−
312−\newcommand{\diagfig}[3]{\begin{figure}[h]\begin{center}\includegraphics[width=#1]{#2}\end{center}
313−\caption{#3}\label{#2}\end{figure}}
314−\newcommand{\codefig}[2]{\begin{figure}[h]\useverb{#1}\caption{#2}\label{#1}\end{figure}}
315−\newcommand{\codefigt}[2]{\begin{figure}[t]\useverb{#1}\caption{#2}\label{#1}\end{figure}}
316−\newcommand{\codefigb}[2]{\begin{figure}[b]\useverb{#1}\caption{#2}\label{#1}\end{figure}}
317−\newcommand{\codefigtc}[2]{\begin{figure*}[t]\useverb{#1}\caption{#2}\label{#1}\end{figure}}
318−\newcommand{\diagfigtc}[3]{\begin{figure*}[t]\begin{center}\includegraphics[width=#1]{#2}\end{center}
319−\caption{#3}\label{#2}\end{figure*}}
320−
321−\newcommand{\FIG}[3]{\begin{figure}[h]\DM{#1}\caption{#2}\label{#3}\end{figure}}
322−\newcommand{\FFIG}[3]{\begin{figure}\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure}}
323−\newcommand{\FFIGB}[3]{\begin{figure}[b]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure}}
324−\newcommand{\FFIGTC}[3]{\begin{figure*}[t]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure*}}
325−\newcommand{\VFIG}[3]{\begin{figure}[h]\begin{boxedverbatim}#1\end{boxedverbatim}\caption{#2}\label{#3}\end{figure}}
326−\newcommand{\PFIG}[3]{\begin{figure}[p]\begin{center}\fbox{\DM{#1}}\end{center}\caption{#2}\label{#3}\end{figure}}
327−\newcommand{\CFIG}[3]{\begin{figure}[h]\begin{center}\DM{#1}\end{center}\caption{#2}\label{#3}\end{figure}}
328−
329−\newcommand{\TFIG}[4]{\begin{figure}[h]\begin{center}\begin{tabular}{#1}#2\end{tabular}\end{center}\caption{#3}\label{#4}\end{figure}}
330−\newcommand{\TFIGTC}[4]{\begin{figure*}[t]\begin{center}\begin{tabular}{#1}#2\end{tabular}\end{center}\caption{#3}\label{#4}\end{figure*}}
331−
332−\newcommand{\RESFIG}[3]{
333−\TFIG{|l|c|c|c|c|c|c|c|c|}{
334−\hline
335− & \multicolumn{4}{c|}{\Naive{} compilation} &
336− \multicolumn{4}{|c|}{Optimised compilation} \\
337−\cline{2-9}
338−\raisebox{1.5ex}[0pt]{Program} & Instrs & Thunks & Cells &
339−Accesses & Instructions & Thunks & Cells & Accesses \\
340−%\raisebox{1.5ex}[0pt]{Program} & I & T & C & M & I & T & C & M \\
341−\hline
342−#1
343−\hline
344−}{#2}{#3}}
345−
346−\newcommand{\NEWRESFIG}[3]{
347−\TFIG{|l|l|c|c|c|c|}{
348−\hline
349−% & \multicolumn{4}{c|}{\Naive{} compilation} &
350−% \multicolumn{4}{|c|}{Optimised compilation} \\
351−%\cline{2-9}
352−Program & Version & Instructions & Thunks & Memory Accesses & Cells \\
353−%\raisebox{1.5ex}[0pt]{Program} & I & T & C & M & I & T & C & M \\
354−\hline
355−#1
356−}{#2}{#3}}
357−
358−\newcommand{\NEWRESFIGTC}[3]{
359−\TFIGTC{|l|l|c|c|c|c|}{
360−\hline
361−% & \multicolumn{4}{c|}{\Naive{} compilation} &
362−% \multicolumn{4}{|c|}{Optimised compilation} \\
363−%\cline{2-9}
364−Program & Version & Instructions & Thunks & Memory Accesses & Cells \\
365−%\raisebox{1.5ex}[0pt]{Program} & I & T & C & M & I & T & C & M \\
366−\hline
367−#1
368−}{#2}{#3}}
369−
370−\newcommand{\RESLINE}[9]{
371−& \Naive{} & #2 & #3 & #5 & #4 \\
372−#1
373−& Optimised & #6 & #7 & #9 & #8 \\
374−}
375−\newcommand{\RESCHANGE}[4]{
376−& Change & \textbf{#1} & \textbf{#2} & \textbf{#4} & \textbf{#3} \\
377−\hline
378−}
379−\newcommand{\RESCHANGEa}[5]{
380−#5 & Change & \textbf{#1} & \textbf{#2} & \textbf{#4} & \textbf{#3} \\
381−\hline
382−}
383−
384−%%%%%%%%%%%% PUNCTUATION
385−
386−\newcommand{\pad}[2]{#1#2#1}
387−
388−\newcommand{\hab}{\pad{\,}{:}}
389−\newcommand{\Hab}{\pad{\;}{:}}
390−\newcommand{\HHab}{\pad{\;}{::}}
391−
392−%%%%%%%%%%%% TYPE
393−
394−\newcommand{\Type}{\mbox{\texttt{Type}}} %\star}
395−
396−
397−%%%%%%%%%%%%% ARROWS
398−
399−\newcommand{\To}{\pad{\:}{\rightarrow}}
400−\newcommand{\Gets}{\leftarrow}
401−%\newcommand{\car}{\vartriangleright}
402−
403−%%%%%%%%%%%%% QUANTIFIERS
404−
405−\newcommand{\lam}[2]{\lambda#1\pad{\!}{:}#2}
406−\newcommand{\fbind}[3]{(#1\Hab#2)\to#3}
407−\newcommand{\all}[2]{\forall#1\pad{\!}{:}#2}
408−\newcommand{\pat}[2]{\RW{var}\:#1\pad{\!}{:}#2}
409−\newcommand{\pty}[2]{\RW{pty}\:#1\pad{\!}{:}#2}
410−\newcommand{\hole}[2]{?#1\pad{\!}{:}#2}
411−\newcommand{\guess}[3]{?#1\pad{\!}\approx#3{:}#2}
412−\newcommand{\remlam}[2]{\lambda\{#1\pad{\!}{:}#2\}}
413−\newcommand{\remall}[2]{\forall\{#1\pad{\!}{:}#2\}}
414−\newcommand{\allpi}[2]{\Pi#1\pad{\!}{:}#2}
415−\newcommand{\ali}[2]{\forall#1|#2}
416−\newcommand{\exi}[2]{\exists#1\pad{\!}{:}#2}
417−\newcommand{\wit}[2]{\ang{#1,#2}}
418−\newcommand{\X}{\times}
419−\newcommand{\sig}[2]{\Sigma#1\pad{\!}{:}#2}
420−
421−\newcommand{\SC}{.\:}
422−
423−\newcommand{\letbind}[3]{\mathsf{let}\:#1{:}#2\:=\:#3\:\mathsf{in}}
424−\newcommand{\ifthen}[3]{\mathsf{if}\:#1\:\mathsf{then}\:#2\:\mathsf{else}\:#3}
425−
426−%%%%%%%%%%%%% EQUALITIES
427−
428−\newcommand{\cq}{\pad{\:}{\mapsto}}
429−\newcommand{\xq}{\pad{}{\doteq}}
430−\newcommand{\pq}{\pad{\:}{=}}
431−\newcommand{\dq}{\pad{\:}{:=}}
432−\newcommand{\iq}{\pad{\:}{\leadsto}}
433−\newcommand{\mq}{=} %\Longrightarrow}
434−\newcommand{\retq}{\Rightarrow}
435−\newcommand{\hq}{\pad{\:}{=}}
436−\newcommand{\defq}{\mapsto}
437−
438−\newcommand{\refl}{\TC{refl}}
439−
440−
441−
442−
443−%%%%%%%%%%%%% CATSTUFF
444−
445−\newlength{\Lwibrs}
446−\newlength{\Lwobrs}
447−\newsavebox{\Bwibrs}
448−\newsavebox{\Bwobrs}
449−\newcommand{\Db}[5]{%
450− \savebox{\Bwobrs}[\width][b]{$#5$}%
451− \savebox{\Bwibrs}[\width][b]{$\left#2\usebox{\Bwobrs}\right#3$}%
452− \settowidth{\Lwobrs}{\usebox{\Bwobrs}}%
453− \settowidth{\Lwibrs}{\usebox{\Bwibrs}}%
454− \addtolength{\Lwibrs}{-\Lwobrs}%
455− \left#1\pad{\hspace*{-0.25\Lwibrs}}{\usebox{\Bwibrs}}\right#4}
456−\newcommand{\LDb}[3]{%
457− \savebox{\Bwobrs}[\width][b]{$#3$}%
458− \savebox{\Bwibrs}[\width][b]{$\left#2\usebox{\Bwobrs}\right.$}%
459− \settowidth{\Lwobrs}{\usebox{\Bwobrs}}%
460− \settowidth{\Lwibrs}{\usebox{\Bwibrs}}%
461− \addtolength{\Lwibrs}{-\Lwobrs}%
462− \left#1\hspace*{-0.4\Lwibrs}\usebox{\Bwibrs}\right.}
463−\newcommand{\RDb}[3]{%
464− \savebox{\Bwobrs}[\width][b]{$#3$}%
465− \savebox{\Bwibrs}[\width][b]{$\left.\usebox{\Bwobrs}\right#1$}%
466− \settowidth{\Lwobrs}{\usebox{\Bwobrs}}%
467− \settowidth{\Lwibrs}{\usebox{\Bwibrs}}%
468− \addtolength{\Lwibrs}{-\Lwobrs}%
469− \left.\usebox{\Bwibrs}\hspace*{-0.4\Lwibrs}\right#2}
470−\newcommand{\Sc}{\Db{[}{[}{]}{]}}
471−\newcommand{\Mo}{\Db{|}{>}{<}{|}}
472−\newcommand{\MoL}{\LDb{|}{>}}
473−\newcommand{\MoR}{\RDb{<}{|}}
474−
475−\newcommand{\car}{\mbox{$-\!\triangleright$}}
476−\newcommand{\io}[1]{\iota_{#1}}
477−\newcommand{\cc}{\diamond}
478−
479−
480−%%%%%%%%%%%%% FNS
481−
482−\newcommand{\Wk}{\Uparrow}
483−
484−%%%%%%%%%%%%% Transformation
485−
486−\newcommand{\Transform}[3]{\textsc{Trans}\:_{\Name{#1}}
487− \interp{#2}\:\mq\:#3}
488−%\:[\:#2\:\Longrightarrow\:#3\:]}
489−\newcommand{\Morphism}[2]{\textsc{Morphism}\:#1\:\Longrightarrow\:#2}
490−\newcommand{\MI}[1]{\begin{array}{ll} #1 \end{array}\\}
491−\newcommand{\MorphItem}[2]{& #1 \:\Longrightarrow\: #2}
492−
493−%%%%%%%%%%%%% Stuff
494−
495−% Motive and methods
496−
497−\newcommand{\motive}{\vP}
498−\newcommand{\meth}[1]{\vm_{#1}}
499−
500−% Tuples
501−\newcommand{\tuple}[1]{\langle#1\rangle}
502−\newcommand{\Tuple}[1]{\mathsf{Tuple}}
503−\newcommand{\proj}{\mathsf{proj}}
504−\newcommand{\app}{\mathrm{+\!+}}
505−
506−% Commenting out
507−\newcommand{\ig}[1]{[#1]}
508−\newcommand{\rem}[1]{\{\!#1\!\}}
509−\newcommand{\igc}[1]{[#1]}
510−\newcommand{\remc}[1]{\{\!#1\!\}}
511−
512−
513−\newcommand{\ind}{\hspace*{0.1cm}}
514−
515−% Content free type
516−\newcommand{\CF}{\TC{CF}}
517−\newcommand{\cf}{\DC{cf}}
518−
519−% Error token
520−\newcommand{\error}{\DC{error}}
521−\newcommand{\fail}{\perp}
522−
523−% Constructor stripping
524−\newcommand{\conarg}[2]{#1!#2}
525−
526−\newcommand{\Vect}{\TC{Vect}}
527−\newcommand{\VectM}{\TC{Vect^-}}
528−\newcommand{\Vnil}{\DC{\epsilon}}
529−\newcommand{\Vcons}{\DC{::}}
530−
531−\newcommand{\Vsnoc}{\DC{::}}
532−
533−\newcommand{\VnilM}{\DC{\epsilon^-}}
534−\newcommand{\VconsM}{\DC{::^-}}
535−
536−\newcommand{\Vnilcase}{\VV{vNilCase}}
537−\newcommand{\Vconscase}{\VV{vConsCase}}
538−
539−\newcommand{\DSigma}{\TC{Sigma}}
540−\newcommand{\Exists}{\DC{Exists}}
541−
542−\newcommand{\ListPair}[2]{\sig{#1}{\List\:\vA}.#2 = \FN{length}\:#1}
543−\newcommand{\lpNilDef}{\lpNil{\FN{refl}\:\Z}}
544−\newcommand{\lpNil}[1]{(\nil\:\vA,#1)}
545−\newcommand{\lpConsDef}[3]{\lpCons{#1}{(\FN{fst\:#2})}{\FN{resp}\:(\FN{snd}\:#2)}}
546−\newcommand{\lpCons}[3]{(\cons\:#1\:#2,#3)}
547−\newcommand{\lp}[2]{(#1, #2)}
548−
549−\newcommand{\VnilTop}{\DC{vNil}^\ast}
550−\newcommand{\VconsTop}{\DC{vCons}^\ast}
551−
552−\newcommand{\VnilBot}{\DC{\epsilon}^-}
553−\newcommand{\VconsBot}{\DC{::}^-}
554−
555−\newcommand{\VectTop}{\TC{Vect}^\ast}
556−\newcommand{\VectBot}{\TC{Vect}^-}
557−
558−\newcommand{\VectDrop}{\FN{vectDropIdx}}
559−\newcommand{\VectRebuild}{\FN{vectRebuild}}
560−
561−\newcommand{\Prop}{\TC{Prop}}
562−\newcommand{\Set}{\TC{Type}}
563−\newcommand{\CoqType}{\TC{Type}}
564−
565−\newcommand{\List}{\TC{List}}
566−\newcommand{\nil}{\DC{Nil}}
567−\newcommand{\cons}{\DC{::}}
568−
569−\newcommand{\Zip}{\TC{Tsil}}
570−\newcommand{\zip}{\FN{tsil}}
571−\newcommand{\zipcons}{\FN{tsilcons}}
572−\newcommand{\snoc}{\DC{Snoc}}
573−\newcommand{\lin}{\DC{Empty}}
574−
575−\newcommand{\BigInt}{\TC{BigInt}}
576−\newcommand{\False}{\TC{False}}
577−\newcommand{\Unit}{\TC{Unit}}
578−\newcommand{\UnitI}{\DC{unit}}
579−
580−\newcommand{\genType}{\TC{X}}
581−\newcommand{\genIndicesDec}{\tb\Hab\tB}
582−\newcommand{\genIndices}{\tb}
583−\newcommand{\genConArgsDec}[1]{\vec{\VV{a_#1}}\Hab\vec{\VV{A_#1}}}
584−\newcommand{\genConArgs}[1]{\vec{\VV{a_#1}}}
585−\newcommand{\genConIndicesDec}[1]{\vec{\VV{b_#1}}\Hab\vec{\VV{B_#1}}}
586−\newcommand{\genConIndices}[1]{\vec{\VV{b_#1}}}
587−\newcommand{\genCon}[1]{\DC{x}_#1}
588−
589−\newcommand{\genTypeTop}{\TC{X^\ast}}
590−\newcommand{\genTypeBot}{\TC{X^-}}
591−
592−\newcommand{\genTypeDrop}{\FN{XDropIdx}}
593−\newcommand{\genTypeRebuild}{\FN{XRebuild}}
594−
595−\newcommand{\HTerm}{\texttt{Term}}
596−\newcommand{\Term}{\TC{Term}}
597−\newcommand{\Var}{\DC{var}}
598−\newcommand{\Lam}{\DC{lam}}
599−\newcommand{\App}{\DC{app}}
600−\newcommand{\TermM}{\TC{Term^-}}
601−\newcommand{\VarM}{\DC{var^-}}
602−\newcommand{\LamM}{\DC{lam^-}}
603−\newcommand{\AppM}{\DC{app^-}}
604−\newcommand{\Env}{\TC{Env}}
605−\newcommand{\SType}{\TC{STy}}
606−\newcommand{\farrow}{\Rightarrow}
607−\newcommand{\lookup}{\FN{lookup}}
608−
609−\newcommand{\source}{\Lang{TT}}
610−%\newcommand{\source}{\textbf{DT-Res}}
611−\newcommand{\target}{\Lang{ExTT}}
612−\newcommand{\runtime}{\Lang{RunTT}}
613−
614−\newcommand{\lt}{\TC{<}}
615−\newcommand{\ltO}{\DC{ltO}}
616−\newcommand{\ltS}{\DC{ltS}}
617−
618−\newcommand{\interp}[1]{\llbracket #1 \rrbracket}
619−\newcommand{\inferrable}[2]{\FN{inferrable}(#1,#2)}
620−\newcommand{\mkPat}{\FN{mkPat}}
621−
622−\newcommand{\FinM}{\TC{Fin^-}}
623−\newcommand{\fzM}{\DC{f0^-}}
624−\newcommand{\fsM}{\DC{fs^-}}
625−
626−\newcommand{\concat}{\mathrm{++}}
627−
628−%\newcommand{\bottom}{\perp}
629−
630−% Reductions
631−
632−\newcommand{\reduces}{\rhd}
633−\newcommand{\translation}{\Rightarrow}
634−%\newcommand{\reducesn}[1]{\reduces\hspace*{-0.15cm}_{#1}}
635−%\newcommand{\reducesto}{\reduces\hspace*{-0.15cm}^{*}}
636−\newcommand{\reducesn}[1]{\reduces_{#1}}
637−\newcommand{\reducesto}{\reduces^{*}}
638−
639−% Equality
640−
641−\newcommand{\Refl}{\DC{refl}}
642−\newcommand{\leZ}{\DC{O_{\le}}}
643−\newcommand{\leS}{\DC{S_{\le}}}
644−
645−% Random elimination things
646−
647−\newcommand{\lte}{\TC{\leq}}
648−\newcommand{\lten}{\DC{leN}}
649−\newcommand{\lteO}{\DC{leO}}
650−\newcommand{\lteS}{\DC{leS}}
651−
652−\newcommand{\ltelim}{\Elim{\lt}}
653−\newcommand{\leelim}{\Elim{\lte}}
654−
655−\newcommand{\dD}{\TC{D}}
656−\newcommand{\delim}{\Elim{\TC{D}}}
657−\newcommand{\drec}{\Rec{\TC{D}}}
658−\newcommand{\dcase}{\Cases{\TC{D}}}
659−\newcommand{\dview}{\View{\TC{D}}}
660−\newcommand{\dmemo}{\Memo{\TC{D}}}
661−\newcommand{\natrec}{\Rec{\Nat}}
662−\newcommand{\natmemo}{\Memo{\Nat}}
663−\newcommand{\natmemogen}{\Nat\textbf{-MemoGen}}
664−\newcommand{\natelim}{\Elim{\Nat}}
665−\newcommand{\boolcase}{\Cases{\Bool}}
666−\newcommand{\vectrec}{\Rec{\Vect}}
667−\newcommand{\vectelim}{\Elim{\Vect}}
668−\newcommand{\listrec}{\Rec{\List}}
669−\newcommand{\listelim}{\Elim{\List}}
670−\newcommand{\finrec}{\Rec{\Fin}}
671−\newcommand{\finelim}{\Elim{\Fin}}
672−\newcommand{\natcase}{\Cases{\Nat}}
673−\newcommand{\vectcase}{\Cases{\Vect}}
674−\newcommand{\natdoublerec}{\Nat\textbf{-double-elim}}
675−\newcommand{\eqelim}{=\textbf{-elim}}
676−\newcommand{\falsecase}{\Cases{\False}}
677−
678−% Code
679−\newcommand{\Haskell}[1]{\begin{quotation}\begin{verbatim}#1\end{verbatim}\end{quotation}}
680−
681−% Quicksort
682−
683−\newcommand{\QSView}{\TC{QuickSort}}
684−\newcommand{\qsempty}{\DC{empty}}
685−\newcommand{\partition}{\DC{partition}}
686−\newcommand{\qsview}{\FN{mkQuickSort}}
687−
688−% More gubbins
689−
690−\newcommand{\converts}{\simeq}
691−\newcommand{\cumul}{\preceq}
692−\newcommand{\whnf}{\Downarrow}
693−\newcommand{\elem}{\in}
694−\newcommand{\proves}{\vdash}
695−\newcommand{\biimplies}{\Longleftrightarrow}
696−
697−\newcommand{\lc}{\lambda_{\mathsf{AC}}}
698−\newcommand{\zed}{\mathbb{Z}}
699−
700−% Haskell keywords
701−
702−\newcommand{\hdata}{\mathtt{data}}
703−\newcommand{\newtype}{\mathtt{newtype}}
704−%\newcommand{\htype}{\mathtt{type}}
705−
706−\newcommand{\HTC}[1]{\mathtt{#1}}
707−\newcommand{\HDC}[1]{\mathtt{#1}}
708−
709−% Nobby
710−
711−\newcommand{\Value}{\HTC{Value}}
712−\newcommand{\VGamma}{\HTC{Env}}
713−\newcommand{\Ctxt}{\HTC{Ctxt}}
714−\newcommand{\Defs}{\HTC{Defs}}
715−\newcommand{\ECtxt}{\HTC{ECtxt}}
716−\newcommand{\TCtxt}{\HTC{TCtxt}}
717−\newcommand{\VG}{\HDC{Env}}
718−\newcommand{\Model}{\HTC{Model}}
719−\newcommand{\Const}{\HTC{Const}}
720−\newcommand{\Normal}{\HTC{Normal}}
721−\newcommand{\Scope}{\HTC{Scope}}
722−\newcommand{\Kripke}{\HTC{Kripke}}
723−\newcommand{\Weakening}{\HTC{Weakening}}
724−\newcommand{\Ready}{\HTC{Ready}}
725−%\newcommand{\Blocked}{\HTC{Blocked}}
726−\newcommand{\Spine}{\HTC{Spine}}
727−
728−\newcommand{\BV}{\HDC{BV}}
729−\newcommand{\BCon}{\HDC{BCon}}
730−\newcommand{\BTyCon}{\HDC{BTyCon}}
731−\newcommand{\RCon}{\HDC{RCon}}
732−\newcommand{\RTyCon}{\HDC{RTyCon}}
733−\newcommand{\BElim}{\HDC{BElim}}
734−\newcommand{\DV}{\HDC{V}}
735−\newcommand{\DP}{\HDC{P}}
736−
737−\newcommand{\MR}{\HDC{R}}
738−\newcommand{\MB}{\HDC{B}}
739−\newcommand{\DSc}{\HDC{Sc}}
740−\newcommand{\DKr}{\HDC{Kr}}
741−\newcommand{\DWk}{\HDC{Wk}}
742−\newcommand{\DSnoc}{\HDC{;}}
743−\newcommand{\DType}{\HDC{Type}}
744−\newcommand{\DName}{\HDC{Name}}
745−\newcommand{\DInt}{\HDC{Int}}
746−\newcommand{\DString}{\HDC{String}}
747−\newcommand{\DElim}{\HDC{Elim}}
748−\newcommand{\Empty}{\HDC{\emptyset}}
749−
750−\newcommand{\ConCode}{\HTC{ConCode}}
751−\newcommand{\ElimRule}{\HTC{ElimRule}}
752−
753−\newcommand{\DConst}{\HDC{Const}}
754−\newcommand{\DCon}{\HDC{Con}}
755−\newcommand{\DTyCon}{\HDC{TyCon}}
756−\newcommand{\RConst}{\HDC{RConst}}
757−\newcommand{\RLam}{\HDC{RLam}}
758−\newcommand{\RPi}{\HDC{RPi}}
759−\newcommand{\DLam}{\HDC{Lam}}
760−\newcommand{\DLet}{\HDC{Let}}
761−\newcommand{\DPi}{\HDC{Pi}}
762−\newcommand{\DApp}{\HDC{App}}
763−
764−\newcommand{\TMaybe}{\HTC{Maybe}}
765−\newcommand{\DNothing}{\HDC{Nothing}}
766−\newcommand{\DJust}{\HDC{Just}}
767−
768−
769−% G-machine and heap
770−
771−\newcommand{\PUSH}{\mathsf{PUSH}}
772−\newcommand{\PUSHNAME}{\mathsf{PUSHNAME}}
773−\newcommand{\POP}{\mathsf{DISCARD}}
774−\newcommand{\PUSHFUN}{\mathsf{PUSHFUN}}
775−\newcommand{\APPLY}{\mathsf{MKAP}}
776−\newcommand{\EVAL}{\mathsf{EVAL}}
777−\newcommand{\GCON}{\mathsf{MKCON}}
778−\newcommand{\GTUP}{\mathsf{MKTUP}}
779−\newcommand{\GTYPE}{\mathsf{MKTYPE}}
780−\newcommand{\UPDATE}{\mathsf{UPDATE}}
781−\newcommand{\RET}{\mathsf{RET}}
782−\newcommand{\UNWIND}{\mathsf{UNWIND}}
783−\newcommand{\CASEJUMP}{\mathsf{CASEJUMP}}
784−\newcommand{\LABEL}{\mathsf{LABEL}}
785−\newcommand{\MOVE}{\mathsf{MOVE}}
786−\newcommand{\JUMP}{\mathsf{JUMP}}
787−\newcommand{\SPLIT}{\mathsf{SPLIT}}
788−\newcommand{\SQUEEZE}{\mathsf{SQUEEZE}}
789−\newcommand{\JFUN}{\mathsf{JFUN}}
790−\newcommand{\PROJ}{\mathsf{PROJ}}
791−\newcommand{\ERROR}{\mathsf{ERROR}}
792−\newcommand{\SLIDE}{\mathsf{SLIDE}}
793−\newcommand{\ALLOC}{\mathsf{ALLOC}}
794−
795−\newcommand{\PUSHBIG}{\mathsf{PUSHBIG}}
796−\newcommand{\PUSHBASIC}{\mathsf{PUSHBASIC}}
797−\newcommand{\PUSHINT}{\mathsf{PUSHINT}}
798−\newcommand{\PUSHBOOL}{\mathsf{PUSHBOOL}}
799−\newcommand{\GET}{\mathsf{GET}}
800−\newcommand{\MKINT}{\mathsf{MKINT}}
801−\newcommand{\MKBOOL}{\mathsf{MKBOOL}}
802−\newcommand{\ADD}{\mathsf{ADD}}
803−\newcommand{\SUB}{\mathsf{SUB}}
804−\newcommand{\MULT}{\mathsf{MULT}}
805−\newcommand{\LT}{\mathsf{LT}}
806−\newcommand{\EQ}{\mathsf{EQ}}
807−\newcommand{\GT}{\mathsf{GT}}
808−\newcommand{\JTRUE}{\mathsf{JTRUE}}
809−
810−\newcommand{\APP}{\mathsf{APP}}
811−\newcommand{\FUN}{\mathsf{FUN}}
812−\newcommand{\CON}{\mathsf{CON}}
813−\newcommand{\TYCON}{\mathsf{TYCON}}
814−\newcommand{\TUP}{\mathsf{TUP}}
815−\newcommand{\TYPE}{\mathsf{TYPE}}
816−\newcommand{\INT}{\mathsf{INT}}
817−\newcommand{\BIGINT}{\mathsf{BIGINT}}
818−\newcommand{\BOOL}{\mathsf{BOOL}}
819−\newcommand{\HOLE}{\mathsf{HOLE}}
820−
821−% G machine translation scheme
822−
823−\newcommand{\sinterp}[1]{\mathcal{S}\interp{#1}}
824−\newcommand{\sinterpm}[1]{\mathcal{S}\AR{\interp{#1}}}
825−\newcommand{\einterp}[3]{\mathcal{E}\interp{#1}\:#2\:#3}
826−\newcommand{\cinterp}[3]{\mathcal{C}\interp{#1}\:#2\:#3}
827−\newcommand{\binterp}[3]{\mathcal{B}\interp{#1}\:#2\:#3}
828−\newcommand{\rinterp}[3]{\mathcal{R}\interp{#1}\:#2\:#3}
829−\newcommand{\iinterp}[3]{\mathcal{I}\interp{#1}\:#2\:#3}
830−\newcommand{\len}[1]{\MO{length}(#1)}
831−
832−\newcommand{\casecomp}[2]{\mathcal{I}(#1,\left\{\ARc{#2}\right\})}
833−\newcommand{\casecompA}[3]{\mathcal{I}(#1,\left\{\ARc{#2}\right\}[#3])}
834−\newcommand{\ischeme}{\mathcal{I}}
835−
836−% tail call markup
837−
838−\newcommand{\tailcall}{\mathsf{tail}}
839−
840−% Trees
841−
842−\newcommand{\Tree}{\TC{Tree}}
843−\newcommand{\Leaf}{\DC{Leaf}}
844−\newcommand{\Node}{\DC{Node}}
845−\newcommand{\treecase}{\Cases{\Tree}}
846−
847−% Languages
848−
849−\newcommand{\Coq}{\textsc{Coq}}
850−\newcommand{\Lego}{\textsc{Lego}}
851−\newcommand{\Oleg}{\textsc{Oleg}}
852−\newcommand{\Alf}{\textsc{Alf}}
853−\newcommand{\Epigram}{\textsc{Epigram}}
854−\newcommand{\SystemF}{System $\mathcal{F}$}
855−\newcommand{\Iswim}{\textsc{Iswim}}
856−\newcommand{\Cynthia}{\textit{C$^Y$\hspace*{-0.1cm}NTHIA}}
857−
858−% Accessibility
859−
860−\newcommand{\Acc}{\TC{Acc}}
861−\newcommand{\acc}{\DC{acc}}
862−\newcommand{\qsAcc}{\TC{qsAcc}}
863−\newcommand{\qsNil}{\DC{qsNil}}
864−\newcommand{\qsCons}{\DC{qsCons}}
865−\newcommand{\allQsAcc}{\FN{allQsAcc}}
866−
867−% Lazy shortcuts
868−
869−\newcommand{\naive}{na\"{\i}ve}
870−\newcommand{\Naive}{Na\"{\i}ve}
871−
872−% Conor's bits
873−
874−\newcommand{\remem}[1]{\left|#1\right|}
875−\newcommand{\idsb}{\MO{id}}
876−\newcommand{\ang}[1]{\langle#1\rangle}
877−
878−\newcommand{\vePm}[1]{\vP #1 \vm_{\Vnil} #1 \vm_{\Vcons}}%
879−\newcommand{\vcrhs}{\vm_{\Vcons}\:\vk\:\va\:\vv\:%
880− (\vectelim\:\vA\:\vk\:\vv\:\vePm{\:})}%
881−
882−\newcommand{\igV}[2]{#1^{\ig{#2}}}
883−\newcommand{\remV}[2]{#1^{\rem{#2}}}
884−
885−% More gubbins
886−
887−\newcommand{\Between}{\TC{between}}
888−\newcommand{\bZ}{\DC{bO}}
889−\newcommand{\bZZS}{\DC{bOOs}}
890−\newcommand{\bZSS}{\DC{b0ss}}
891−\newcommand{\bSSS}{\DC{bsss}}
892−\newcommand{\betelim}{\Elim{\Between}}
893−\newcommand{\betrhs}[1]{\motive#1\meth{\bZ}#1\meth{\bZZS}#1\meth{\bZSS}#1\meth{\bSSS}}
894−
895−
896−\newcommand{\valenv}{\TC{ValEnv}}
897−\newcommand{\vempty}{\DC{empty}}
898−\newcommand{\vextend}{\DC{extend}}
899−
900−\newcommand{\EpiVal}{\TC{Epigram}}
901−\newcommand{\unsafeCoerce}{\HF{unsafeCoerce\mbox{\texttt{\#}}}}
902−
903−\newcommand{\qq}{\mbox{\texttt{"}}}
904−\newcommand{\impossible}{\RW{Impossible}}
905−
906−\newcommand{\Real}{\mathbb{R}}
907−
908−\newcommand{\DoubleRec}{\TC{DoubleElim}}
909−\newcommand{\DoubleOn}{\DC{Double_{\Z\vn}}}
910−\newcommand{\DoubleSO}{\DC{Double_{\suc\Z}}}
911−\newcommand{\DoubleSS}{\DC{Double_{\suc\suc}}}
912−
913−\newcommand{\doublerec}{\textbf{double-elim}}
914−
915−\newcommand{\set}{\TC{DList}}
916−\newcommand{\setuser}{\TC{DListTop}}
917−\newcommand{\setempty}{\emptyset}
918−\newcommand{\setinsert}{\DC{insert}}
919−
920−
921−%%%% Type systems
922−
923−\newcommand{\stlc}{\lambda\hspace*{-0.15cm}\to}
924−\newcommand{\plc}{\lambda2}
925−\newcommand{\dlc}{\lambda{}P}
926−
927−\newcommand{\EC}{\mathcal{E}}
928−
929−%%%% reductions
930−
931−\newcommand{\betared}{\iq\hspace*{-0.15cm}_{\beta}}
932−\newcommand{\deltared}{\iq\hspace*{-0.15cm}_{\delta}}
933−\newcommand{\gammared}{\iq\hspace*{-0.15cm}_{\gamma}}
934−\newcommand{\etared}{\iq\hspace*{-0.15cm}_{\eta}}
935−\newcommand{\iotared}{\iq\hspace*{-0.15cm}_{\iota}}
936−\newcommand{\rhored}{\iq\hspace*{-0.15cm}_{\rho}}
937−
938−%%%% ExTT rules
939−
940−\newcommand{\exconverts}{\stackrel{\mathsf{Ex}}{\converts}}
941−\newcommand{\excumul}{\stackrel{\mathsf{Ex}}{\cumul}}
942−\newcommand{\exequiv}{\stackrel{\mathsf{Ex}}{\equiv}}
943−\newcommand{\exreduces}{\stackrel{\mathsf{Ex}}\reduces}
944−\newcommand{\exreducesto}{\stackrel{\mathsf{Ex}}{\reducesto}}
945−\newcommand{\exreducesn}[1]{\exreduces_{#1}}
946−
947−\newcommand{\ttequiv}{\stackrel{\mathsf{TT}}{\equiv}}
948−\newcommand{\ttreduces}{\stackrel{\mathsf{TT}}\reduces}
949−\newcommand{\ttreducesn}[1]{\ttreduces_{#1}}
950−
951−%%% Type synthesis
952−
953−\newcommand{\hastype}{\Longrightarrow}
954−\newcommand{\whnfs}{\twoheadrightarrow}
955−\newcommand{\conv}{\converts}
956−
957−\newcommand{\exhastype}{\stackrel{\mathsf{Ex}}{\hastype}}
958−\newcommand{\exwhnfs}{\stackrel{\mathsf{Ex}}{\whnfs}}
959−\newcommand{\exconv}{\stackrel{\mathsf{Ex}}{\conv}}
960−\newcommand{\exproves}{\stackrel{\mathsf{Ex}}{\proves}}
961−
962−\newcommand{\tthastype}{\stackrel{\mathsf{TT}}{\hastype}}
963−\newcommand{\ttwhnfs}{\stackrel{\mathsf{TT}}{\whnfs}}
964−\newcommand{\ttconv}{\stackrel{\mathsf{TT}}{\conv}}
965−\newcommand{\ttproves}{\stackrel{\mathsf{TT}}{\proves}}
966−
967−%%% Lightning
968−
969−\newcommand{\light}[1]{\lightning^{#1}}
970−\newcommand{\LHab}[1]{\pad{\;}{:^{#1}}}
971−\newcommand{\llam}[3]{\lambda#1\pad{\!}{:}^{#2}#3}
972−\newcommand{\lall}[3]{\forall#1\pad{\!}{:}^{#2}#3}
973−\newcommand{\lapp}[3]{#1(#2)^{#3}}
974−\newcommand{\larg}[2]{(#1)^{#2}}
975−
976−\newcommand{\RName}[1]{\hspace*{0.1in}\mathsf{#1}}
977−
978−%%% LOcal macros
979−
980−\newcommand{\ResState}{\TC{ResourceState}}
981−\newcommand{\Locked}{\DC{Locked}}
982−\newcommand{\ResHandle}{\TC{ResourceHandle}}
983−\newcommand{\Res}{\DC{Resource}}
984−\newcommand{\CLang}{\TC{CLang}}
985−\newcommand{\CFLang}{\TC{CFLang}}
986−\newcommand{\CFType}{\TC{CFType}}
987−\newcommand{\CLType}{\TC{CType}}
988−\newcommand{\RHandle}{\DC{RHandle}}
989−\newcommand{\RType}{\DC{RType}}
990−\newcommand{\RUnit}{\DC{RUnit}}
991−\newcommand{\LOCK}{\DC{LOCK}}
992−\newcommand{\UNLOCK}{\DC{UNLOCK}}
993−\newcommand{\ACTION}{\DC{ACTION}}
994−\newcommand{\FORK}{\DC{FORK}}
995−
996−\newcommand{\FSLang}{\TC{FSLang}}
997−\newcommand{\OPEN}{\DC{OPEN}}
998−\newcommand{\CLOSE}{\DC{CLOSE}}
999−\newcommand{\READ}{\DC{READ}}
1000−\newcommand{\WRITE}{\DC{WRITE}}
1001−\newcommand{\PRINT}{\DC{PRINT}}
1002−\newcommand{\BIND}{\DC{BIND}}
1003−
1004−\newcommand{\FSType}{\TC{FSType}}
1005−\newcommand{\FHandle}{\DC{FHandle}}
1006−\newcommand{\FString}{\DC{FString}}
1007−\newcommand{\FUnit}{\DC{FUnit}}
1008−\newcommand{\ElemIs}{\TC{ElemIs}}
1009−\newcommand{\elemHd}{\TC{atHead}}
1010−\newcommand{\elemTl}{\TC{inTail}}
1011−
1012−\newcommand{\emptyEnv}{\DC{empty}}
1013−\newcommand{\extendEnv}{\DC{extend}}
1014−
1015−\newcommand{\usera}{\FN{Alice}}
1016−\newcommand{\userb}{\FN{Bob}}
1017−\newcommand{\userc}{\FN{Charlie}}
1018−
1019−\newcommand{\FAcc}{\TC{FAcc}}
1020−\newcommand{\UserA}{\DC{UserAcc}}
1021−\newcommand{\GroupA}{\DC{GroupAcc}}
1022−\newcommand{\GlobalA}{\DC{GlobalAcc}}
1023−
1024−\newcommand{\Perm}{\TC{Perm}}
1025−\newcommand{\Username}{\TC{Username}}
1026−\newcommand{\GroupData}{\TC{GroupData}}
1027−\newcommand{\File}{\TC{File}}
1028−\newcommand{\FS}{\DC{file}}
1029−\newcommand{\Filepath}{\TC{Filepath}}
1030−
1031−\newcommand{\Read}{\DC{Read}}
1032−\newcommand{\Write}{\DC{Write}}
1033−\newcommand{\Execute}{\DC{Execute}}
1034−
1035−\newcommand{\Purpose}{\TC{Mode}}
1036−\newcommand{\Reading}{\DC{Reading}}
1037−\newcommand{\Writing}{\DC{Writing}}
1038−
1039−\newcommand{\FileState}{\TC{FileState}}
1040−\newcommand{\FileHandle}{\TC{FileHandle}}
1041−\newcommand{\OpenH}{\DC{OpenH}}
1042−\newcommand{\ClosedH}{\DC{ClosedH}}
1043−\newcommand{\Handle}{\TC{Handle}}
1044−\newcommand{\Open}{\DC{Open}}
1045−\newcommand{\Closed}{\DC{Closed}}
1046−
1047−\newcommand{\UserIO}{\TC{UserIO}}
1048−\newcommand{\uio}{\DC{uio}}
1049−
1050−\newcommand{\CFS}{\TC{C_{fs}}}
1051−\newcommand{\RFS}{\FN{R_{fs}}}
1052−
1053−\newcommand{\String}{\TC{String}}
1054−
1055−% inline idris code
1056−
1057−\newcommand{\Tcon}[1]{\texttt{#1}}
1058−\newcommand{\Dcon}[1]{\texttt{#1}}
1059−\newcommand{\Fname}[1]{\texttt{#1}}
1060−\newcommand{\Vv}[1]{\texttt{#1}}
1061−\newcommand{\TyTy}{\texttt{\#}}
1062−
1063−\newcommand{\direct}[1]{\texttt{\%#1}}
1064−
1065−\newcommand{\Feature}[1]{\textbf{Remark:}}
1066−%\newcommand{\Remark}[1]{\textbf{Remark:}}
papers/impl-paper/overview.texdeleted−35
@@ -1,35 +0,0 @@
1−\subsection{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−\begin{itemize}
11− \item It is extremely tempting to add implicit arguments and unification to the
12− type checker. This is what I did in the first Idris prototype: I learned
13− that it was a bad idea! Scope is a big problem.
14−\end{itemize}
15−\item The proof state and a tactic engine (Oleg style~\cite{McBride1999}).
16−\begin{itemize}
17− \item Dealing with names: typechecking and evaluation in a context, managing de Bruijn
18− indices becomes tricky. Instead: global names, local names during construction,
19− and de Bruijn indices when done.
20−\end{itemize}
21−\item Unification, and incorporation into the tactic engine.
22−\begin{itemize}
23− \item Note that this can introduce constraints on hole ordering. If we can't satisfy them,
24− report an error.
25−\end{itemize}
26−\item An Elaborator, as an EDSL, which is a language for applying primitive tactics and
27− constructing derived tactics, from a high level syntax withe implicit arguments.
28−\item Adding primitive operators and a link to Epic~\cite{brady2011epic}.
29−\item Advanced elaborations: using declarations, where clauses, type classes.
30−\end{itemize}
31−
32−For the high level language: we need nothing more than the core type theory,
33−and a way of putting stuff together. So we typecheck each pattern match clause
34−individually, in an appropriate context. There is no need for the core type
35−theory to have pattern matching.
papers/impl-paper/proofstate.texdeleted−7
@@ -1,7 +0,0 @@
1−\section{Proof State}
2−
3−\subsection{Tactics}
4−
5−\subsection{Unification}
6−
7−\subsection{The Elaboration DSL}
papers/impl-paper/syntax.texdeleted−10
@@ -1,10 +0,0 @@
1−\section{High Level Structures}
2−
3−\subsection{\texttt{where} clauses}
4−
5−\subsection{The \texttt{with} rule}
6−
7−\subsection{Type Classes}
8−
9−\subsection{Syntactic Sugar}
10−
papers/impl-paper/typechecking.texdeleted−718
@@ -1,718 +0,0 @@
1−\section{The Core Type Theory}
2−
3−\label{sect:typechecking}
4−
5−High-level \Idris{} programs, as described in Section \ref{sect:hll}, are
6−\remph{elaborated} to a small core language, \TT{}, then type checked.
7−\TT{} is a dependently-typed $\lambda$-calculus with inductive families
8−and pattern matching definitions similar to UTT~\cite{luo1994}, and building
9−on an earlier implementation, \Ivor{}~\cite{Brady2006b}.
10−The
11−core language is kept as small as is reasonably possible, which has several advantages: it is
12−easy to type check, since type checking dependent type theory is well understood
13−~\cite{loh2010tutorial}; and it is easy to transform, optimise and compile. Keeping
14−the core language small increases confidence that these important components of
15−the language are correct. In this section, we describe \TT{} and
16−its semantics.
17−
18−\subsection{\TT{} syntax}
19−
20−The syntax of \TT{} expressions is given in Figure \ref{ttsyn}. This defines:
21−
22−\begin{itemize}
23−\item \demph{Terms}, $\vt$, which can be variables, bindings, applications or constants.
24−\item \demph{Bindings}, $\vb$, which can be lambda abstractions, let bindings, or function spaces.
25−\item \demph{Constants}, $\vc$, which can be integer or string literals, or $\Type_i$, the
26−type of types, and may be extended with other primitives.
27−\end{itemize}
28−
29−The function space $\all{\vx}{\vS}\SC\vT$ may also be written as $(\vx\Hab\vS)\to\vT$,
30−or $\vS\to\vT$ if $\vx$ is not free in $\vT$, to make the notation more consistent with
31−the high-level language. Universe levels on types ($\Type_i$) may be left implicit and
32−inferred by the machine~\cite{pollack1990implicit}.
33−
34−\FFIG{
35−\begin{array}{rll@{\hg}rll}
36−\mbox{Terms,}\;\vt ::= & \vc & (\mbox{constant}) &
37−\;\mbox{Binders,}\;\vb ::= & \lam{\vx}{\vt} & (\mbox{abstraction}) \\
38−
39− \mid & \vx & (\mbox{variable}) &
40− \mid & \LET\;\vx\defq\vt\Hab\vt & (\mbox{let binding}) \\
41−
42− \mid & \vb\SC\;\vt & (\mbox{binding}) &
43− \mid & \all{\vx}{\vt} & (\mbox{function space}) \\
44−
45− \mid & \vt\;\vt & (\mbox{application}) & \\
46− \mid & \TC{T} & (\mbox{type constructor}) & \\
47− \mid & \TC{D} & (\mbox{data constructor}) &
48−% \mid & \pat{\vx}{\vt} & (\mbox{pattern variable}) \\
49−% & & &
50−% \mid & \pty{\vx}{\vt} & (\mbox{pattern type}) \\
51−\medskip\\
52−\mbox{Constants,}\;\vc ::= & \Type_i & (\mbox{type universes}) \\
53− \mid & \vi & (\mbox{integer literal}) \\
54− \mid & \VV{str} & (\mbox{string literal}) \\
55−\end{array}
56−}
57−{\TT{} expression syntax}
58−{ttsyn}
59−
60−A \TT{} program is a collection of \demph{inductive family} definitions (Section
61−\ref{sect:inductivefams}) and \demph{pattern matching} function definitions (Section
62−\ref{sect:patdefs}), as well as primitive operators on constants.
63−Before defining these, let us define the semantics of \TT{}
64−expressions.
65−
66−\subsection{\TT{} semantics}
67−
68−The static and dynamic semantics of \TT{} are defined mutually, since
69−evaluation relies on a well-typed term, and type checking relies on
70−evaluation. Everything is defined relative
71−to a context, $\Gamma$. The empty context
72−is valid, as is a context extended with a $\lambda$, $\forall$ or
73−$\LET$ binding:
74−
75−\DM{
76−\Axiom{\proves\RW{valid}}
77−\hg
78−\Rule{\Gamma\proves\vS\Hab\Type_i}
79−{\Gamma;\lam{\vx}{\vS}\proves\RW{valid}}
80−\hg
81−\Rule{\Gamma\proves\vS\Hab\Type_i}
82−{\Gamma;\all{\vx}{\vS}\proves\RW{valid}}
83−\hg
84−\Rule{\Gamma\proves\vS\Hab\Type_i\hg\Gamma\proves\vs\Hab\vS}
85−{\Gamma;\LET\;\vx\;\defq\;\vs\Hab\vS\proves\RW{valid}}
86−}
87−
88−\noindent
89−We record the binding form in the context, as well as the type,
90−because type checking relies on evaluation. In particular, $\LET$ bound
91−names may reduce.
92−
93−\subsubsection{Evaluation}
94−
95−\label{sect:evaluation}
96−
97−There are two distinct phases in which \TT{} evaluation occurs, namely
98−\demph{compile-time} and \demph{run-time}. Compile-time evaluation is primarily
99−to support type-checking, in which equivalence of two terms (or types) is
100−determined by comparing their normal forms. It is important that terms are
101−strongly normalising at compile-time, so any pattern matching definition which
102−is not guaranteed to be total does not reduce. In this section we discuss
103−compile-time evaluation; run-time evaluation differs in that there is no
104−reduction under binders, types and duplicated values have been
105−erased~\cite{Brady2003}, and non-normalising definitions may reduce.
106−
107−Compile-time evaluation of \TT{} is defined by contraction schemes, given in
108−Figure \ref{ttcontract}. \demph{Contraction}, relative to a context $\Gamma$,
109−is given by one of the following schemes:
110−
111−\begin{itemize}
112−\item $\beta$-contraction, which substitutes a value applied to a $\lambda$-binding for
113−the bound variable.
114−%We define $\beta$-contraction simply by replacing the $\lambda$-binding
115−%with a $\LET$ binding.
116−\item $\delta$-contraction, which replaces a $\LET$ bound variable with its value.
117−\end{itemize}
118−
119−\noindent
120−The following contextual closure rule reduces a $\LET$ binding by creating
121−a $\delta$-reducible expression:
122−
123−\DM{
124−\Rule{\Gamma;\LET\;\vx\defq\vs\Hab\vS\proves\vt\leadsto\vu}
125−{\Gamma\proves\LET\;\vx\defq\vs\Hab\vS\SC\vt\leadsto\vu}
126−}
127−
128−\demph{Reduction} ($\reduces$) is the structural closure of contraction, and evaluation
129−is ($\reducesto$) is the transitive closure of reduction. \demph{Conversion} ($\converts$)
130−is the smallest equivalence relation closed under reduction. If $\Gamma\proves\vx\converts\vy$
131−then $\vy$ can be obtained from $\vx$ by a finite, possibly empty, sequence of
132−contractions and reversed contractions. Terms which are convertible are also said to
133−be definitionally equal.
134−The evaluator can also be extended by defining pattern matching functions, which
135−will be described in more detail in Section \ref{sect:patdefs}. In principle, pattern
136−matching functions can be understood as extending the core language with high-level
137−reduction rules.
138−
139−\FFIG{
140−\begin{array}{lc}
141−\beta\mathrm{-contraction} &
142−\Axiom{
143−\Gamma\proves(\lam{\vx}{\vS}\SC\vt)\;\vs\leadsto
144−\vt[\vs/\vx]
145−%\LET\;\vx\defq\vs\Hab\vS\SC\vt
146−} \\
147−\delta\mathrm{-contraction} &
148−\Axiom{
149−\Gamma;\LET\;\vx\defq\vs\Hab\vS;\Gamma'
150−\proves
151−\vx\leadsto\vs
152−}
153−\end{array}
154−}
155−{\TT{} contraction schemes}
156−{ttcontract}
157−
158−
159−
160−\subsubsection{Typing rules}
161−
162−\label{sect:typerules}
163−
164−The type inference rules for \TT{} expressions are given in Figure
165−\ref{typerules}. These rules use the \demph{cumulativity} relation, defined in
166−Figure \ref{cumul}. The type of types, $\Type_i$ is parameterised by a universe
167−level, to prevent Girard's paradox~\cite{coquand1986analysis}. There is an
168−infinite hierarchy of predicative universes. Cumulativity allows programs at
169−lower universe levels to inhabit higher universe levels. In practice, universe levels
170−can be left implicit (and will be left implicit in the rest of this paper) ---
171−the type checker generates a graph of constraints between universe levels (such
172−as that produced by the $\mathsf{Forall}$ typing rule) and checks that there
173−are no cycles. This happens as the last stage of type checking, waiting until
174−we have all uses of a family to establish how many levels are needed in the
175−universe hierarchy.
176−Otherwise, the typing rules are standard and type inference can
177−be implemented in the usual way~\cite{loh2010tutorial}.
178−
179−\FFIG{\begin{array}{c}
180−\mathsf{Type}\;
181−\Rule{\Gamma\proves\RW{valid}}
182−{\Gamma\vdash\Type_n\Hab\Type_{n+1}}
183−\\
184−\mathsf{Const}_1\;
185−\Rule{\Gamma\proves\RW{valid}}
186−{\Gamma\vdash\vi\Hab\TC{Int}}
187−\hg
188−\mathsf{Const}_2\;
189−\Rule{\Gamma\proves\RW{valid}}
190−{\Gamma\vdash\VV{str}\Hab\TC{String}}
191−\\
192−\mathsf{Const}_3\;
193−\Rule{\Gamma\proves\RW{valid}}
194−{\Gamma\vdash\TC{Int}\Hab\Type_0}
195−\hg
196−\mathsf{Const}_4\;
197−\Rule{\Gamma\proves\RW{valid}}
198−{\Gamma\vdash\TC{String}\Hab\Type_0}
199−\\
200−%\mathsf{Pat}_1\;
201−%\Rule{(\pat{\vx}{\vS})\in\Gamma}
202−%{\Gamma\vdash\vx\Hab\vS}
203−%\hg
204−%\mathsf{Pat}_2\;
205−%\Rule{(\pty{\vx}{\vS})\in\Gamma}
206−%{\Gamma\vdash\vx\Hab\vS}
207−\\
208−\mathsf{Var}_1\;
209−\Rule{(\lam{\vx}{\vS})\in\Gamma}
210−{\Gamma\vdash\vx\Hab\vS}
211−\hg
212−\mathsf{Var}_2\;
213−\Rule{(\all{\vx}{\vS})\in\Gamma}
214−{\Gamma\vdash\vx\Hab\vS}
215−\hg
216−\mathsf{Val}\;
217−\Rule{(\LET\;\vx\defq\vs\Hab\vS)\in\Gamma}
218−{\Gamma\vdash\vx\Hab\vS}
219−\\
220−\mathsf{App}\;
221−\Rule{\Gamma\vdash\vf\Hab\fbind{\vx}{\vS}{\vT}\hg\Gamma\vdash\vs\Hab\vS}
222−{\Gamma\vdash\vf\;\vs\Hab\vT[\vs/\vx]} % \LET\;\vx\Hab\vS\;\defq\;\vs\;\IN\;\vT}
223−\\
224−\mathsf{Lam}\;
225−\Rule{\Gamma;\lam{\vx}{\vS}\vdash\ve\Hab\vT\hg\Gamma\proves\fbind{\vx}{\vS}{\vT}\Hab\Type_n}
226−{\Gamma\vdash\lam{\vx}{\vS}.\ve\Hab\fbind{\vx}{\vS}{\vT}}
227−\\
228−\mathsf{Forall}\;
229−\Rule{\Gamma;\all{\vx}{\vS}\vdash\vT\Hab\Type_m\hg\Gamma\vdash\vS\Hab\Type_n}
230−{\Gamma\vdash\fbind{\vx}{\vS}{\vT}\Hab\Type_p}
231−\;(\exists\vp.\vm\le\vp,\;\vn\le\vp)
232−\\
233−\mathsf{Let}\;
234−\Rule{\begin{array}{c}\Gamma\proves\ve_1\Hab\vS\hg
235− \Gamma;\LET\;\vx\defq\ve_1\Hab\vS\proves\ve_2\Hab\vT\\
236− \Gamma\proves\vS\Hab\Type_n\hg
237− \Gamma;\LET\;\vx\defq\ve_1\Hab\vS\proves\vT\Hab\Type_n\end{array}
238− }
239−{\Gamma\vdash\LET\;\vx\defq\ve_1\Hab\vS\SC\;\ve_2\Hab
240− \vT[\ve_1/\vx]}
241−%\Let\;\vx\Hab\vS\defq\ve_1\;\IN\;\vT}
242−\\
243−
244−\mathsf{Conv}\;
245−\Rule{\Gamma\proves\vx\Hab\vA\hg\Gamma\proves\vA'\Hab\Type_n\hg
246− \Gamma\proves\vA\cumul\vA'}
247− {\Gamma\proves\vx\Hab\vA'}
248−\end{array}
249−}
250−{Typing rules for \TT{}}
251−{typerules}
252−
253−\FFIG{
254−\begin{array}{c}
255−\Rule{\Gamma\proves\vS\converts\vT}
256−{\Gamma\proves\vS\cumul\vT}
257−\hg
258−\Axiom{\Gamma\proves\Type_n\cumul\Type_{n+1}}
259−\\
260−\Rule{\Gamma\proves\vR\cumul\vS\hg\Gamma\proves\vS\cumul\vT}
261−{\Gamma\proves\vR\cumul\vT}
262−\\
263−\Rule{\Gamma\proves\vS_1\converts\vS_2\hg\Gamma;\vx\Hab\vS_1\proves\vT_1\cumul\vT_2}
264−{\Gamma\proves\all{\vx}{\vS_1}\SC\vT_1\cumul\all{\vx}{\vS_2}{\vT_2}}
265−\end{array}
266−}
267−{Cumulativity}
268−{cumul}
269−
270−
271−\subsection{Inductive Families}
272−
273−\label{sect:inductivefams}
274−
275−Inductive families \cite{dybjer1994inductive} are a form of simultaneously
276−defined collection of algebraic data types which can be parameterised over
277−\remph{values} as well as types. An inductive family is declared
278−in a similar style to a Haskell GADT declaration~\cite{pj2006gadts}
279−as
280−follows:
281−
282−\DM{
283−\AR{
284−\Data\hg\TC{T}\Hab\vt\hg\Where\hg
285−\DC{D}_1\Hab\vt\;\mid\;\ldots\;\mid\;\DC{D}_n\Hab\vt
286−}
287−}
288−
289−A constructor $\TC{D}$ of a family $\TC{T}$ must return a value in the family
290−$\TC{T}$.
291−It may take recursive arguments in the family $\TC{T}$ which may be
292−higher order.
293−Using vector notation, $\tx$, to indicate a
294−sequence of zero or more $\vx$ (i.e., $\vx_1,\vx_2,\ldots,\vx_n$),
295−recursive arguments have types of the form
296−
297−\DM{
298−\all{\vx_1}{\vS_1}\SC\ldots\all{\vx_n}{\vS_n}\SC\TC{T}\:\ty
299−}
300−
301−where $\TC{T}$ does not occur in any of the $\tS$ or the $\ty$
302−This restriction is known as
303−\demph{strict positivity} and ensures that recursive arguments of the
304−constructor are structurally smaller than the value itself.
305−In
306−practice, this restriction can be relaxed when defining a family, but definitions
307−using families which do not satisfy strict positivity will not pass totality
308−checking.
309−
310−For example, the \Idris{} data type \tTC{Nat} would be declared in \TT{} as follows:
311−
312−\DM{
313−\Data\hg\Nat\Hab\Type\hg\Where\hg\Z\Hab\Nat\;\mid\;\suc\Hab\fbind{\vk}{\Nat}{\Nat}
314−}
315−
316−A data type may have zero or more parameters (which are invariant
317−across a structure) and a number of indices, given by the type. For example,
318−the \TT{} equivalent of \tTC{List} is parameterised over its element type:
319−
320−\DM{
321−\AR{
322−\Data\hg\List\Hab(\va\Hab\Type)\to\Type\hg\Where\\
323−\hg\hg
324−\ARd{
325−& \nil\Hab\List\;\va\\
326−\mid & (\cons)\Hab\fbind{\vx}{\va}{\fbind{\vxs}{\List\;\va}{\List\;\va}}
327−}
328−}
329−}
330−
331−Types can be
332−parameterised or indexed over values. Using this, we can declare the type of
333−vectors (lists with length), where the empty list is statically known
334−to have length zero, and the non empty list is statically known to
335−have a non zero length. The \TT{} equivalent of \tTC{Vect} is parameterised over its element type,
336−like $\List$, but \remph{indexed} over its length. Note also that the length
337−index $\vk$ is given \remph{explicitly}.
338−
339−\DM{
340−\AR{
341−\Data\hg\Vect\Hab\Nat\to(\va\Hab\Type)\to\Type\hg\Where \\
342−\hg\hg\ARd{
343−& \nil\Hab\Vect\;\Z\;\va\\
344−\mid & (\cons)\Hab\fbind{\vk}{\Nat}{
345−\fbind{\vx}{\va}{\fbind{\vxs}{\Vect\;\vk\;\va}{\Vect\;(\suc\;\vk)\;\va}}
346−}
347−}
348−}
349−}
350−
351−\subsection{Pattern matching definitions}
352−
353−\label{sect:patdefs}
354−
355−%\subsubsection{Syntax}
356−
357−
358−A pattern matching definition for a function named $\FN{f}$ takes the following form,
359−consisting of a type declaration followed by one or more pattern clauses:
360−
361−\DM{
362−\AR{
363−\FN{f}\Hab\vt\\
364−\pat{\tx_1}{\ttt_1}\SC\FN{f}\;\ttt_1\;=\;\vt_1\\
365−\ldots\\
366−\pat{\tx_n}{\ttt_n}\SC\FN{f}\;\ttt_n\;=\;\vt_n\\
367−}
368−}
369−
370−A pattern clause consists of a list of pattern variable bindings, introduced by
371−$\RW{var}$,
372−and a left and right hand side, both of which
373−are \TT{} expressions. Each side is type checked relative to the variable bindings,
374−and the types of each side must be convertible. Additionally, the
375−left hand side must take the form of $\FN{f}$ applied to a number of \TT{} expressions,
376−and the number of arguments must be the same in each clause. The right hand
377−sides may include applications of $\FN{f}$, i.e. pattern matching definitions may
378−be recursive. The validity of a pattern
379−clause is defined by the following rule:
380−
381−\DM{
382−\Rule{
383−\Gamma;\lam{\tx}{\tU}\proves\FN{f}\;\tts\Hab\vS\hg
384−\Gamma;\lam{\tx}{\tU}\proves\ve\Hab\vT\hg
385−\Gamma\proves\vS\converts\vT}
386−{
387−\Gamma\proves\pat{\tx}{\tU}\SC\FN{f}\;\tts\;=\;\ve\;\RW{valid}
388−}
389−}
390−
391−Patterns are separated into the accessible patterns (variables and constructor
392−forms which may be inspected) and inaccessible patterns, following
393−Agda~\cite{norell2007thesis} then implemented by compilation into case
394−trees~\cite{Augustsson1985}. Non-terminating definitions are permitted, but do
395−not reduce at compile-time, which means in particular that they cannot be used
396−to construct proofs.
397−Termination analysis is implemented separately.
398−
399−A valid pattern matching definition effectively extends \TT{} with a new
400−constant, with the given type (extending the initial typing rules given in
401−Section \ref{sect:typerules}) and reduction behaviour (extending the initial
402−reduction rules given in Section \ref{sect:evaluation}).
403−
404−
405−% \subsubsection{Semantics}
406−%
407−% Matching on an expression proceeds by comparing the expression to
408−% each match clause in order, resulting in either:
409−%
410−% \begin{itemize}
411−% \item \demph{Success}, with pattern variables mapping to expressions
412−% \item \demph{Failure}, with matching continuing by proceeding to the next match clause
413−% \item Matching being \demph{blocked}, for example by attempting to match a variable
414−% against a constructor pattern. In this case, no reduction occurs, because instantiating
415−% the variable may provide enough information for the clause to match.
416−% \end{itemize}
417−%
418−% % Pat(x args) => x (Pat' args)
419−% % Pat (x) => x
420−% % Pat _ => _
421−%
422−% In order to implement pattern matching, we must separate the \remph{accessible} and
423−% \remph{inaccessible} patterns. A pattern is \demph{accessible} (that is, it is possible
424−% to match against it) if it is constructor headed, or a variable. Inaccessible patterns
425−% are converted to ``match anything'' patterns. Clauses are converted to matchable pattern
426−% clauses with the $\MO{Clause}$ operation, given in Figure \ref{mkclause}.
427−% We extend the vector notation to meta-operations: the notation $\vec{\MO{Pat}}$ lifts the
428−% $\MO{Pat}$ operation across a list of arguments.
429−%
430−% \FFIG{
431−% \AR{
432−% \PA{\A}{
433−% & \MO{Clause} & (\pat{\tx}{\tU}\SC\FN{f}\;\tts\;=\;\ve)
434−% & \MoRet{\FN{f}\;(\vec{\MO{Pat}}\;\tts)\;=\;\ve}
435−% }
436−% \medskip\\
437−% \PA{\A}{
438−% & \MO{Pat} & (\vx\;\tts) & \MoRet{\vx\;(\vec{\MO{Pat}}\;\tts)
439−% \hg\mbox{(if $\MO{Con}\;\vx$ and $\MO{Arity}\;\vx = \MO{Length}\;\tts$)}} \\
440−% & \MO{Pat} & \vx & \MoRet{\vx} \hg\mbox(if $\vx$ is a pattern variable)\\
441−% & \MO{Pat} & \cdot & \MoRet{\_} \hg\mbox(in all other cases)\\
442−% }
443−% }
444−% }
445−% {Building matchable pattern clauses}
446−% {mkclause}
447−%
448−%
449−% % Match (c args, c args') => Match' (args, args')
450−% % Match (c args, x) => Blocked
451−% % Match (x, t) => Success (x => t)
452−% % Match (_, t) => Success ()
453−%
454−% \newcommand{\Blocked}{\mathsf{Blocked}}
455−% \newcommand{\Success}{\mathsf{Success}}
456−% \newcommand{\Failure}{\mathsf{Failure}}
457−%
458−% Pattern matching is invoked by the evaluator on encountering a function with
459−% a pattern matching definition applied to some arguments. If successful, pattern
460−% matching returns a new expression, which can then be reduced further.
461−% Figure \ref{pmatch} gives the semantics of pattern matching a collection of
462−% matchable clauses
463−% $\tc$ against an expression $\ve$. $\MO{Match}$ attempts to match each clause in
464−% turn against $\ve$. If matching a clause returns $\Success$ or $\Blocked$, then
465−% matching terminates. If matching a clause returns $\Failure$, then matching proceeds
466−% with the next clause. The algorithm uses the following meta-operations:
467−%
468−% \begin{itemize}
469−% \item $\MO{Con}\;\vx$, which returns true if $\vx$ is a constructor name
470−% \item $\MO{Arity}\;\vx$, which, if $\vx$ is a constructor name, returns the number of arguments
471−% $\vx$ requires.
472−% \item $\MO{Length}\;\tts$, which returns the length of the vector $\tts$
473−% \end{itemize}
474−%
475−%
476−% \FFIG{
477−% \AR{
478−% \PA{\A\A}{
479−% & \MO{MatchArg} & (\vx\;\tts) & (\vx\;\tts')
480−% & \MoRet{\vec{\MO{MatchArg}}\;\tts\;\tts'\hg\mbox{(if $\MO{Con}\;\vx$)}}\\
481−% & \MO{MatchArg} & (\vx\;\tts) & \vx & \MoRet{\Blocked} \\
482−% & \MO{MatchArg} & \vx & \vt & \MoRet{\Success\;(\vx\mapsto\vt)} \\
483−% & \MO{MatchArg} & \_ & \vt & \MoRet{\Success\;()} \\
484−% & \MO{MatchArg} & \cdot & \cdot & \MoRet{\Failure}
485−% }
486−% \medskip\\
487−% \PA{\A\A}{
488−% & \MO{MatchClause} & (\vf\;\tp = \ve) & (\vf\;\tts) &
489−% \MoRet{
490−% \AR{
491−% \Success\;\ve[\tx/\tv]\hg\mbox{(if $\vec{\MO{MatchArg}}\;\tp\;\tts \mq \Success\;(\tx,\tv)$)}\\
492−% \Blocked\;\;\;\hg\hg\mbox{(if $\vec{\MO{MatchArg}}\;\tp\;\tts \mq \Blocked$)}\\
493−% \Failure\;\;\;\;\;\hg\hg\mbox{(if $\vec{\MO{MatchArg}}\;\tp\;\tts \mq \Failure$)}\\
494−% }
495−% } \\
496−% & \MO{MatchClause} & (\vf\;\tp = \ve) & \cdot & \MoRet{\Failure} \\
497−% }
498−% \medskip\\
499−% \PA{\A\A}{
500−% & \MO{Match} & (\vc ; \tc) & \ve &
501−% \MoRet{
502−% \AR{
503−% \Success\;\vx\;\;\hg\mbox{(if $\MO{MatchClause}\;\vc\;\ve \mq \Success\;\vx)$} \\
504−% \Blocked\hg\;\;\;\;\mbox{(if $\MO{MatchClause}\;\vc\;\ve \mq \Blocked)$} \\
505−% \MO{Match}\;\tc\;\ve\hg\mbox{(otherwise)}
506−% }
507−% } \\
508−% & \MO{Match} & \cdot & \ve & \MoRet{\Failure}
509−% }
510−% }
511−% }
512−% {Pattern matching semantics}
513−% {pmatch}
514−%
515−% By convention, we write the application of a meta-operation $\MO{Op}$
516−% across a vector $\tx$ as $\vec{\MO{Op}}\;\tx$.
517−% In practice, for efficiency, pattern matching is implemented by compiling the match clauses to
518−% a tree of case expressions~\cite{Augustsson1985}.
519−
520−\subsection{Metatheory}
521−
522−\FFIG{
523−\begin{array}{ll}
524−\mbox{\textbf{Church-Rosser}} &
525−\begin{array}{ll}
526−\mbox{If}\hg\Gamma\proves\vs\converts\vt \\
527−\mbox{then there is a common reduct $\vr$ such that}\;\\
528−\Gamma\proves\vs\reducesto\vr\hg\Gamma\proves\vt\reducesto\vr
529−\end{array}
530−\medskip
531−\\
532−\mbox{\textbf{Subject Reduction}} &
533−\begin{array}{ll}
534−\mbox{If} & \Gamma\proves\vs\Hab\vS\hg\Gamma\proves\vs\reduces\vt\\
535−\mbox{then}& \Gamma\proves\vt\Hab\vS
536−\end{array}
537−\medskip
538−\\
539−\mbox{\textbf{Cut}} &
540−\begin{array}{ll}
541−\mbox{If} & \Gamma_0,\LET\;\vx\defq\vs\Hab\vS,\Gamma_1\proves\vt\Hab\vT\\
542−\mbox{then} & \Gamma_0, \Gamma_1[\vs/\vx]\proves\vt[\vs/\vx]\Hab\vT[\vs/\vx]
543−\end{array}
544−\medskip
545−\\
546−\mbox{\textbf{Strengthening}} &
547−\begin{array}{ll}
548−\mbox{If} & \Gamma_0,\mathcal{B}(\vx, \vT),\Gamma_1\proves\vs\Hab\vS
549−\hg\vx\not\in\Gamma_1,\vs,\vS\\
550−\mbox{then} & \Gamma_0,\Gamma_1\proves\vs\Hab\vS\\
551−(\mbox{where} & \mathcal{B}(\vx, \vT) \proves \vx\Hab\vT)
552−\end{array}
553−\medskip
554−\\
555−\mbox{\textbf{Strong normalisation}} &
556−\begin{array}{ll}
557−\mbox{If} & \Gamma\proves\vt\Hab\vT\\
558−\mbox{then} & \vt\:\mbox{is strongly normalising}\\
559−\end{array}
560−\\
561−\end{array}
562−}
563−{Metatheoretic properties of \TT{}}
564−{metatheory}
565−
566−We conjecture that \TT{} respects the usual metatheoretic properties,
567−as shown in
568−Figure \ref{metatheory}. Specifically: the \demph{Church-Rosser} property
569−(i.e. that distinct reduction sequences lead to the same normal form);
570−\demph{subject reduction} (i.e. that computation preserves type); the
571−\demph{cut} property (i.e. that $\RW{let}$-bound terms may be substituted into
572−their scope); and \demph{strengthening} (i.e. that removing unused definitions
573−from scope does not affect type checking).
574−\demph{Strong normalisation} holds at compile-time because pattern matching
575−definitions which cannot be shown to be terminating do not have compile-time
576−reduction behaviour.
577−
578−%One property which is noticeably absent is \demph{strong normalisation}.
579−%Although desirable to preserve termination and decidability of type checking,
580−%we allow diverging terms for pragmatic reasons as \Idris{} is primarily a
581−%programming language rather than a theorem prover. Nevertheless, we do
582−%\emph{check} for totality in order to be sure which terms are safe to
583−%evaluate at compile time.
584−
585−\subsection{Totality checking}
586−
587−In order to ensure termination of type checking we must distinguish terms for
588−which evaluation definitely terminates, and those which may diverge. \TT{}
589−takes a simple but pragmatic and effective approach to termination checking:
590−any functions which do not satisfy a syntactic constraint on recursive calls
591−are marked as \emph{partial}. Additionally, any function which calls a partial
592−function or uses a data type which is not strictly positive is also marked as
593−partial. We use the size change principle~\cite{Lee2001} to determine whether
594−(possibly mutually defined) recursive functions are guaranteed to
595−terminate. Higher order function arguments are assumed to be total, though
596−if a higher order function is called with a partial function as an argument,
597−the calling function will be marked partial.
598−\TT{} also marks functions which do not cover
599−all possible inputs as partial. This totality checking is independent of the
600−rest of the type theory, and can be extended.
601−
602−This approach, separating the termination requirement from the type theory,
603−means that an \Idris{} programmer makes the decision about the importance of
604−totality for each function rather than having the totality requirement imposed
605−by the type theory.
606−
607−\subsection{From \Idris{} to \TT{}}
608−
609−\TT{} is a very small language, consisting only of data declarations and pattern matching
610−function definitions. There is no significant innovation in the design of \TT{}, and this
611−is a deliberate choice --- it is a combination of small, well-understood components.
612−The kernel of the \TT{} implementation, consisting of a type checker, evaluator and
613−pattern match compiler, is less than 1000 lines of Haskell code. If we are confident
614−in the correctness of the kernel of \TT{}, and any higher level language feature
615−can be translated into \TT{}, we can be more confident of the correctness of
616−the high-level language implementation than if it were implemented directly.
617−
618−The process of elaborating a high-level language into a core type theory like \TT{} is,
619−however, less well understood, and presents several challenges depending on the
620−features of the high-level language.
621−%Elaboration has been implemented in various different ways,
622−%for example in Agda~\cite{norell2007thesis} and Epigram~\cite{McBride2004a}.
623−
624−\subsubsection{Example Elaboration}
625−
626−Recall the following \Idris{} function:
627−
628−\useverb{vadd}
629−
630−\noindent
631−In order to elaborate
632−this to \TT{}, we must resolve the implicit arguments, and make the type class explicit.
633−The first step is to make the implicit arguments explicit, using a placeholder
634−to stand for the arguments we have not yet resolved. The type class argument is
635−also treated as an implicit argument, to which we give the name \texttt{c}:
636−
637−\begin{SaveVerbatim}{vAddImp}
638−
639−vAdd : (a : _) -> (n : _) ->
640− Num a -> Vect n a -> Vect n a -> Vect n a
641−vAdd _ _ c (Nil _) (Nil _) = (Nil _)
642−vAdd _ _ c ((::) _ _ x xs) ((::) _ _ y ys)
643− = (::) _ _ ((+) _ x y) (vAdd _ _ _ xs ys)
644−
645−\end{SaveVerbatim}
646−\useverb{vAddImp}
647−
648−Next, we resolve the implicit arguments. Each implicit argument can only take
649−one value for this program to be type correct --- these are solved by a unification
650−algorithm:
651−
652−\begin{SaveVerbatim}{vAddImpSolve}
653−
654−vAdd : (a : Type) -> (n : Nat) ->
655− Num a -> Vect n a -> Vect n a -> Vect n a
656−vAdd a O c (Nil a) (Nil a) = Nil a
657−vAdd a (S k) c ((::) a k x xs) ((::) a k y ys)
658− = (::) a k ((+) c x y) (vAdd a k c xs ys)
659−
660−\end{SaveVerbatim}
661−\useverb{vAddImpSolve}
662−
663−Finally, to build the \TT{} definition, we need to find the type of each
664−pattern variable and state it explicitly. This leads to the following
665−\TT{} definition, switching to \TT{} notation from the ASCII \Idris{}
666−syntax:
667−
668−\DM{
669−\AR{
670−\FN{vAdd} \Hab(\va\Hab\Type)\to(\vn\Hab\Nat)\to\TC{Num}\;\va\to
671− \Vect\;\vn\;\va\to\Vect\;\vn\;\va\to\Vect\;\vn\;\va\\
672−\RW{var}\;\va\Hab\Type,\;\vc\Hab\TC{Num}\;\va\SC\\
673−\hg\FN{vAdd} \; \va \; \Z \; \vc \; (\DC{Nil}\;\va) \; (\DC{Nil}\;\va) \;
674−\cq\;\DC{Nil}\;\va \\
675−\RW{var}\;\AR{
676−\va\Hab\Type,\;\vk\Hab\Nat,\;\vc\Hab\TC{Num}\;\va,\\
677−\vx\Hab\va,\;\vxs\Hab\Vect\;\vk\;\va,\;
678−\vy\Hab\va,\;\vys\Hab\Vect\;\vk\;\va
679−\SC
680−\\
681−\FN{vAdd} \; \va \; (\suc\;\vk) \; \vc
682− \; ((\DC{::})\;\va\;\vk\;\vx\;\vxs)
683− \; ((\DC{::})\;\va\;\vk\;\vy\;\vys)
684− \\
685− \hg\hg\cq\:((\DC{::})\;\va\;\vk\;((+)\;\vc\;\vx\;\vy)\; (\FN{vAdd}\;\va\;\vk\;\vc\;\vxs\;\vys))
686−}
687−}
688−}
689−
690−\subsubsection{An Observation: Programming vs Theorem Proving}
691−
692−\Idris{} programs may contain several high-level constructs not present in \TT{}, such
693−as implicit arguments, type classes, \texttt{where} clauses, pattern matching \texttt{let}
694−and \texttt{case} constructs. We would like the high-level language to be as expressive
695−as possible, while remaining possible to translate to \TT{}.
696−
697−Before considering how to achieve this, we make an observation about the distinction between
698−programming and theorem proving with dependent types, and appropriate mechanisms for
699−constructing programs and theorems:
700−
701−\begin{itemize}
702−\item \remph{Pattern matching} is a convenient abstraction for humans to write
703−programs, in that it allows a programmer to express exactly the computational
704−behaviour of a function.
705−\item \remph{Tactics}, such as those used in the Coq theorem
706−prover~\cite{Bertot2004}, are a convenient abstraction for building proofs and
707−programs by \remph{refinement}.
708−\end{itemize}
709−
710−The idea behind the \Idris{} elaborator, therefore, is to use the high-level
711−program to direct \demph{tactics} to build \TT{} programs by refinement. The
712−elaborator is implemented as a Haskell monad capturing proof state, with a
713−collection of tactics for updating and refining the proof state. The remainder
714−of this paper describes this elaborator and demonstrates how it is used to
715−implement the high-level features of \Idris{}.
716−
717−
718−