diff options
Diffstat (limited to 'dev')
30 files changed, 11273 insertions, 217 deletions
diff --git a/dev/base_include b/dev/base_include index 17293776..30a6ed96 100644 --- a/dev/base_include +++ b/dev/base_include @@ -13,45 +13,51 @@ #directory "proofs";; #directory "tactics";; #directory "translate";; -#use "top_printers.ml";; - -#install_printer (* identifier *) prid;; -#install_printer (* label *) prlab;; -#install_printer prmsid;; -#install_printer prmbid;; -#install_printer prdir;; -#install_printer prmp;; -#install_printer (* section_path *) prsp;; -#install_printer (* qualid *) prqualid;; -#install_printer (* kernel_name *) prkn;; -#install_printer (* constr *) print_pure_constr;; -(* parsing of names *) +#use "top_printers.ml";; +#use "vm_printers.ml";; + +#install_printer (* identifier *) ppid;; +#install_printer (* identifier *) ppidset;; +#install_printer (* label *) pplab;; +#install_printer (* mod_self_id *) ppmsid;; +#install_printer (* mod_bound_id *) ppmbid;; +#install_printer (* dir_path *) ppdir;; +#install_printer (* module_path *) ppmp;; +#install_printer (* section_path *) ppsp;; +#install_printer (* qualid *) ppqualid;; +#install_printer (* kernel_name *) ppkn;; +#install_printer (* constant *) ppcon;; +#install_printer (* constr *) print_pure_constr;; +#install_printer (* patch *) ppripos;; +#install_printer (* values *) ppvalues;; +#install_printer ppzipper;; +#install_printer ppstack;; +#install_printer ppatom;; +#install_printer ppwhd;; +#install_printer ppvblock;; +#install_printer (* bigint *) ppbigint;; +#install_printer (* loc *) pploc;; let qid = Libnames.qualid_of_string;; (* parsing of terms *) -let parse_com = Pcoq.parse_string Pcoq.Constr.constr;; -let parse_tac = Pcoq.parse_string Pcoq.Tactic.tactic;; +let parse_constr = Pcoq.parse_string Pcoq.Constr.constr;; +let parse_tac = Pcoq.parse_string Pcoq.Tactic.tactic;; let parse_vernac = Pcoq.parse_string Pcoq.Vernac_.vernac;; -(* For compatibility reasons *) -let parse_ast = parse_com;; - (* build a term of type rawconstr without type-checking or resolution of implicit syntax *) -let e s = Constrintern.interp_rawconstr Evd.empty (Global.env()) (parse_ast s);; - -(* For compatibility *) -let raw_constr_of_string = e;; +let e s = + Constrintern.intern_constr Evd.empty (Global.env()) (parse_constr s);; (* build a term of type constr with type-checking and resolution of implicit syntax *) let constr_of_string s = - Constrintern.interp_constr Evd.empty (Global.env()) (parse_ast s);; + Constrintern.interp_constr Evd.empty (Global.env()) (parse_constr s);; (* get the body of a constant *) @@ -69,7 +75,7 @@ let get_nth_goal n = nth_goal_of_pftreestate n (Pfedit.get_pftreestate ());; let current_goal () = get_nth_goal 1;; let pf_e gl s = - Constrintern.interp_constr (project gl) (pf_env gl) (parse_ast s);; + Constrintern.interp_constr (project gl) (pf_env gl) (parse_constr s);; open Toplevel let go = loop @@ -1,35 +1,37 @@ load_printer "gramlib.cma" -load_printer "top_printers.cmo" -install_printer Top_printers.prid -install_printer Top_printers.prlab -install_printer Top_printers.prmsid -install_printer Top_printers.prmbid -install_printer Top_printers.prdir -install_printer Top_printers.prmp -install_printer Top_printers.prkn -install_printer Top_printers.prsp -install_printer Top_printers.prqualid -install_printer Top_printers.prast -install_printer Top_printers.prastpat -install_printer Top_printers.prastpatl +load_printer "printers.cma" + +install_printer Top_printers.ppid +install_printer Top_printers.ppidset +install_printer Top_printers.pplab +install_printer Top_printers.ppmsid +install_printer Top_printers.ppmbid +install_printer Top_printers.ppdir +install_printer Top_printers.ppmp +install_printer Top_printers.ppkn +install_printer Top_printers.ppcon +install_printer Top_printers.ppsp +install_printer Top_printers.ppqualid +install_printer Top_printers.ppbigint install_printer Top_printers.pppattern -install_printer Top_printers.pprawterm +install_printer Top_printers.pprawconstr -install_printer Top_printers.ppterm -install_printer Top_printers.print_uni -install_printer Top_printers.pp_universes +install_printer Top_printers.ppconstr +install_printer Top_printers.ppuni +install_printer Top_printers.ppuniverses install_printer Top_printers.pptype -install_printer Top_printers.prj +install_printer Top_printers.ppj +install_printer Top_printers.ppenv -install_printer Top_printers.prgoal -install_printer Top_printers.prsigmagoal +install_printer Top_printers.ppgoal +install_printer Top_printers.ppsigmagoal install_printer Top_printers.pproof -install_printer Top_printers.prevd -install_printer Top_printers.prevc -install_printer Top_printers.prwc -install_printer Top_printers.prclenv +install_printer Top_printers.ppevd +install_printer Top_printers.ppclenv install_printer Top_printers.pptac -install_printer Top_printers.pr_obj +install_printer Top_printers.ppobj +install_printer Top_printers.pploc + diff --git a/dev/deboguage.txt b/dev/deboguage.txt deleted file mode 100644 index eea7a0bc..00000000 --- a/dev/deboguage.txt +++ /dev/null @@ -1,30 +0,0 @@ - -Debuggage -========= - - dans Emacs. nécessite le mode tuareg. - Coq doit être configuré avec -debug et -local (./configure -debug -local) - - 1. M-x camldebug - 2. spécifier le binaire coqtop.byte - 3. spécifier dev/ocamldebug-v7 - 4. source db (pour avoir les pretty-printers) - 5. poser ses points d'arrêts avec C-x C-a C-b (penser "add breakpoint") - directement dans le source ocaml - 6. ensuite voir le man d'ocamldebug - run - step - next - last - print x - ... - - -Profiling -========= - - Coq doit être configuré avec -profile - - 1. Lancer Coq en natif, qui doit terminer normalement (utiliser Quit - ou l'option -batch) - 2. gprof ./coqtop gmon.out diff --git a/dev/debugging.txt b/dev/debugging.txt index d3fbf48a..4c04c42f 100644 --- a/dev/debugging.txt +++ b/dev/debugging.txt @@ -12,15 +12,20 @@ Debugging from Coq toplevel using Caml trace mechanism 6. Test your Coq command and observe the result of tracing your functions 7. Freely switch from Coq to Ocaml toplevels with 'Drop.' and 'go();;' + Hints: To remove high-level pretty-printing features (coercions, + notations, ...), use "Set Printing All". It will affect the #trace + printers too. + Debugging from Caml debugger ============================ + Preferably use ocaml 3.06 (pretty-printing is broken with ocaml 3.07/3.08) Needs tuareg mode in Emacs Coq must be configured with -debug and -local (./configure -debug -local) 1. M-x camldebug - 2. give the binary name coqtop.byte - 3. give dev/ocamldebug-v7 + 2. give the binary name bin/coqtop.byte + 3. give ../dev/ocamldebug-coq 4. source db (to get pretty-printers) 5. add breakpoints with C-x C-a C-b from the buffer displaying the ocaml source @@ -36,8 +41,9 @@ Debugging from Caml debugger 7. some hints: - To debug a failure/error/anomaly, add a breakpoint in - Vernacinterp.call just before "if !Options.debug" then go "back" to - find where the failure/error/anomaly has been raised + Vernac.vernac_com at the with clause of the "try ... interp com + with ..." block, then go "back" a few steps to find where the + failure/error/anomaly has been raised - If "source db" fails, first recompile top_printers.ml with "make dev/top_printers.cmo" diff --git a/dev/doc/Makefile b/dev/doc/Makefile new file mode 100644 index 00000000..a0bef897 --- /dev/null +++ b/dev/doc/Makefile @@ -0,0 +1,67 @@ + +# Makefile for doc/ + +all:: newparse +#newsyntax.dvi minicoq.dvi + + +OBJS=lex.cmo ast.cmo parse.cmo syntax.cmo + +newparse: $(OBJS) syntax.mli lex.ml syntax.ml + ocamlc -o newparse $(OBJS) + +.ml.cmo: + ocamlc -c $< + +.mli.cmi: + ocamlc -c $< + +.mll.ml: + ocamllex $< + +.mly.ml: + ocamlyacc -v $< + +.mly.mli: + ocamlyacc -v $< + +clean:: + rm -f *.cm* *.output syntax.ml syntax.mli lex.ml newparse + +parse.cmo: ast.cmo +syntax.cmi: parse.cmo +syntax.cmo: lex.cmo parse.cmo syntax.cmi +lex.cmo: syntax.cmi +ast.cmo: ast.ml + +newsyntax.dvi: newsyntax.tex + latex $< + latex $< + +coq.dvi: coq.tex + latex coq + latex coq + +coq.tex:: + make -C .. doc/coq.tex + +depend:: kernel.dep.ps library.dep.ps pretyping.dep.ps parsing.dep.ps \ + proofs.dep.ps tactics.dep.ps toplevel.dep.ps interp.dep.ps + +%.dot: ../% + (cd ../$*; ocamldep *.ml *.mli) | ocamldot -lr > $@ + +%.dep.ps: %.dot + dot -Tps $< -o $@ + +clean:: + rm -f *~ *.log *.aux + +.SUFFIXES: .tex .dvi .ps .cmo .cmi .mli .ml .mll .mly + +.tex.dvi: + latex $< && latex $< + +.dvi.ps: + dvips $< -o $@ + diff --git a/dev/doc/ast.ml b/dev/doc/ast.ml new file mode 100644 index 00000000..2153ef47 --- /dev/null +++ b/dev/doc/ast.ml @@ -0,0 +1,47 @@ + +type constr_ast = + Pair of constr_ast * constr_ast +| Prod of binder list * constr_ast +| Lambda of binder list * constr_ast +| Let of string * constr_ast * constr_ast +| LetCase of binder list * constr_ast * constr_ast +| IfCase of constr_ast * constr_ast * constr_ast +| Eval of red_fun * constr_ast +| Infix of string * constr_ast * constr_ast +| Prefix of string * constr_ast +| Postfix of string * constr_ast +| Appl of constr_ast * constr_arg list +| ApplExpl of string list * constr_ast list +| Scope of string * constr_ast +| Qualid of string list +| Prop | Set | Type +| Int of string +| Hole +| Meta of string +| Fixp of fix_kind * + (string * binder list * constr_ast * string option * constr_ast) list * + string +| Match of case_item list * constr_ast option * + (pattern list * constr_ast) list + +and red_fun = Simpl + +and binder = string * constr_ast + +and constr_arg = string option * constr_ast + +and fix_kind = Fix | CoFix + +and case_item = constr_ast * (string option * constr_ast option) + +and pattern = + PatAs of pattern * string +| PatType of pattern * constr_ast +| PatConstr of string * pattern list +| PatVar of string + +let mk_cast c t = + if t=Hole then c else Infix(":",c,t) + +let mk_lambda bl t = + if bl=[] then t else Lambda(bl,t) diff --git a/dev/doc/check-grammar b/dev/doc/check-grammar new file mode 100755 index 00000000..67da1bc5 --- /dev/null +++ b/dev/doc/check-grammar @@ -0,0 +1,50 @@ +#!/bin/bash +# This scripts checks that the new grammar of Coq as defined in syntax-v8.tex +# is consistent in the sense that all invoked non-terminals are defined + +defined-nt() { + grep "\\DEFNT{.*}" syntax-v8.tex | sed -e "s|.*DEFNT{\([^}]*\)}.*|\1|"|\ + sort | sort -u +} + +used-nt() { + cat syntax-v8.tex | tr \\\\ \\n | grep "^NT{.*}" |\ + sed -e "s|^NT{\([^}]*\)}.*|\1|" | egrep -v ^\#1\|non-terminal | sort -u +} + +used-term() { + cat syntax-v8.tex | tr \\\\ \\n | grep "^TERM{.*}" |\ + sed -e "s|^TERM{\([^}]*\)}.*|\1|" -e "s|\\$||g" | egrep -v ^\#1\|terminal | sort -u +} + +used-kwd() { + cat syntax-v8.tex | tr \\\\ \\n | grep "^KWD{.*}" |\ + sed -e "s|^KWD{\([^}]*\)}.*|\1|" -e "s|\\$||g" | egrep -v ^\#1 | sort -u +} + +defined-nt > def +used-nt > use +used-term > use-t +used-kwd > use-k +diff def use > df + +############################### +echo +if grep ^\> df > /dev/null 2>&1 ; then + echo Undefined non-terminals: + echo ======================== + echo + grep ^\> df | sed -e "s|^> ||" + echo +fi +if grep ^\< df > /dev/null 2>&1 ; then + echo Unused non-terminals: + echo ===================== + echo + grep ^\< df | sed -e "s|^< ||" + echo +fi +#echo Used terminals: +#echo =============== +#echo +#cat use-t
\ No newline at end of file diff --git a/dev/doc/interp.dep.ps b/dev/doc/interp.dep.ps new file mode 100644 index 00000000..b0554481 --- /dev/null +++ b/dev/doc/interp.dep.ps @@ -0,0 +1,583 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.2 (Wed Jan 19 21:09:25 UTC 2005) +%%For: (herbelin) Hugo Herbelin +%%Title: G +%%Pages: (atend) +%%BoundingBox: 35 35 577 160 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval + +EncodingVector + dup 306 /AE + dup 301 /Aacute + dup 302 /Acircumflex + dup 304 /Adieresis + dup 300 /Agrave + dup 305 /Aring + dup 303 /Atilde + dup 307 /Ccedilla + dup 311 /Eacute + dup 312 /Ecircumflex + dup 313 /Edieresis + dup 310 /Egrave + dup 315 /Iacute + dup 316 /Icircumflex + dup 317 /Idieresis + dup 314 /Igrave + dup 334 /Udieresis + dup 335 /Yacute + dup 376 /thorn + dup 337 /germandbls + dup 341 /aacute + dup 342 /acircumflex + dup 344 /adieresis + dup 346 /ae + dup 340 /agrave + dup 345 /aring + dup 347 /ccedilla + dup 351 /eacute + dup 352 /ecircumflex + dup 353 /edieresis + dup 350 /egrave + dup 355 /iacute + dup 356 /icircumflex + dup 357 /idieresis + dup 354 /igrave + dup 360 /dcroat + dup 361 /ntilde + dup 363 /oacute + dup 364 /ocircumflex + dup 366 /odieresis + dup 362 /ograve + dup 365 /otilde + dup 370 /oslash + dup 372 /uacute + dup 373 /ucircumflex + dup 374 /udieresis + dup 371 /ugrave + dup 375 /yacute + dup 377 /ydieresis + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 577 160 +%%PageOrientation: Portrait +gsave +35 35 542 125 boxprim clip newpath +36 36 translate +0 0 1 beginpage +0.9343 set_scale +0 0 translate 0 rotate +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font + +% Syntax_def +gsave 10 dict begin +303 110 45 18 ellipse_path +stroke +gsave 10 dict begin +271 105 moveto +(Syntax_def) +[7.68 6.96 6.96 4.08 6.24 6.96 6.96 6.96 6.24 4.56] +xshow +end grestore +end grestore + +% Notation +gsave 10 dict begin +422 60 38 18 ellipse_path +stroke +gsave 10 dict begin +397 55 moveto +(Notation) +[9.84 6.72 4.08 6.24 3.84 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Syntax_def -> Notation +newpath 334 97 moveto +350 90 369 83 385 76 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 386 79 moveto +394 72 lineto +383 73 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 386 79 moveto +394 72 lineto +383 73 lineto +closepath +stroke +end grestore + +% Ppextend +gsave 10 dict begin +537 60 39 18 ellipse_path +stroke +gsave 10 dict begin +511 55 moveto +(Ppextend) +[7.68 6.96 5.76 6.96 3.84 6.24 6.96 6.96] +xshow +end grestore +end grestore + +% Notation -> Ppextend +newpath 460 60 moveto +469 60 478 60 488 60 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 488 64 moveto +498 60 lineto +488 57 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 488 64 moveto +498 60 lineto +488 57 lineto +closepath +stroke +end grestore + +% Topconstr +gsave 10 dict begin +537 114 41 18 ellipse_path +stroke +gsave 10 dict begin +509 109 moveto +(Topconstr) +[7.2 6.96 6.96 6.24 6.96 6.96 5.28 3.84 4.56] +xshow +end grestore +end grestore + +% Notation -> Topconstr +newpath 449 73 moveto +464 80 483 89 500 97 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 498 100 moveto +509 101 lineto +501 94 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 498 100 moveto +509 101 lineto +501 94 lineto +closepath +stroke +end grestore + +% Modintern +gsave 10 dict begin +44 98 43 18 ellipse_path +stroke +gsave 10 dict begin +13 93 moveto +(Modintern) +[12.48 6.96 6.96 3.84 6.96 3.84 6.24 4.8 6.96] +xshow +end grestore +end grestore + +% Constrintern +gsave 10 dict begin +173 98 48 18 ellipse_path +stroke +gsave 10 dict begin +138 93 moveto +(Constrintern) +[9.36 6.96 6.96 5.28 3.84 4.8 3.84 6.96 3.84 6.24 4.8 6.96] +xshow +end grestore +end grestore + +% Modintern -> Constrintern +newpath 88 98 moveto +97 98 106 98 115 98 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 115 102 moveto +125 98 lineto +115 95 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 115 102 moveto +125 98 lineto +115 95 lineto +closepath +stroke +end grestore + +% Constrintern -> Syntax_def +newpath 220 102 moveto +229 103 239 104 249 105 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 249 108 moveto +259 106 lineto +249 102 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 249 108 moveto +259 106 lineto +249 102 lineto +closepath +stroke +end grestore + +% Reserve +gsave 10 dict begin +303 56 35 18 ellipse_path +stroke +gsave 10 dict begin +280 51 moveto +(Reserve) +[9.12 6.24 5.52 6.24 4.8 6.48 6.24] +xshow +end grestore +end grestore + +% Constrintern -> Reserve +newpath 210 86 moveto +227 81 246 75 263 69 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 264 72 moveto +273 66 lineto +262 66 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 264 72 moveto +273 66 lineto +262 66 lineto +closepath +stroke +end grestore + +% Genarg +gsave 10 dict begin +422 114 33 18 ellipse_path +stroke +gsave 10 dict begin +401 109 moveto +(Genarg) +[10.08 6.24 6.96 6.24 4.32 6.96] +xshow +end grestore +end grestore + +% Genarg -> Topconstr +newpath 456 114 moveto +465 114 476 114 486 114 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 486 118 moveto +496 114 lineto +486 111 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 486 118 moveto +496 114 lineto +486 111 lineto +closepath +stroke +end grestore + +% Coqlib +gsave 10 dict begin +44 21 32 18 ellipse_path +stroke +gsave 10 dict begin +24 16 moveto +(Coqlib) +[9.36 6.96 6.96 3.84 3.84 6.96] +xshow +end grestore +end grestore + +% Constrextern +gsave 10 dict begin +173 21 49 18 ellipse_path +stroke +gsave 10 dict begin +137 16 moveto +(Constrextern) +[9.36 6.96 6.96 5.28 3.84 4.56 5.76 6.96 3.84 6.24 4.8 6.96] +xshow +end grestore +end grestore + +% Coqlib -> Constrextern +newpath 77 21 moveto +88 21 101 21 114 21 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 114 25 moveto +124 21 lineto +114 18 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 114 25 moveto +124 21 lineto +114 18 lineto +closepath +stroke +end grestore + +% Constrextern -> Notation +newpath 222 19 moveto +257 18 307 20 348 29 curveto +361 31 375 37 388 42 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 386 45 moveto +397 46 lineto +389 39 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 386 45 moveto +397 46 lineto +389 39 lineto +closepath +stroke +end grestore + +% Constrextern -> Reserve +newpath 213 32 moveto +228 36 246 41 261 45 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 260 48 moveto +271 48 lineto +262 42 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 260 48 moveto +271 48 lineto +262 42 lineto +closepath +stroke +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/dev/doc/intro.tex b/dev/doc/intro.tex new file mode 100644 index 00000000..4cec8673 --- /dev/null +++ b/dev/doc/intro.tex @@ -0,0 +1,25 @@ + +\ocwsection This is \Coq, a proof assistant for the \CCI. +This document describes the implementation of \Coq. +It has been automatically generated from the source of +\Coq\ using \textsf{ocamlweb}, a literate programming tool for +\textsf{Objective Caml}\footnote{\Coq, \textsf{Objective Caml} and + \textsf{ocamlweb} are all freely available at + \textsf{http://coq.inria.fr/}, \textsf{http://caml.inria.fr/} and + \textsf{http://www.lri.fr/\~{}filliatr/ocamlweb}.}. +The source files are organized in several directories, which are +described here as separate chapters. + +\begin{center} + \begin{tabular}{p{10cm}rr} + Chapter & section & page \\[0.5em] + \hline\\[0.2em] + Utility libraries \dotfill & \refsec{lib} & \pageref{lib} \\[0.5em] + Kernel \dotfill & \refsec{kernel} & \pageref{kernel} \\[0.5em] + Library \dotfill & \refsec{library} & \pageref{library} \\[0.5em] + Pretyping \dotfill & \refsec{pretyping} & \pageref{pretyping} \\[0.5em] + Proof engine \dotfill & \refsec{proofs} & \pageref{proofs} \\[0.5em] + Tactics \dotfill & \refsec{tactics} & \pageref{tactics} \\[0.5em] + Toplevel \dotfill & \refsec{toplevel}& \pageref{toplevel}\\[0.5em] + \end{tabular} +\end{center}
\ No newline at end of file diff --git a/dev/doc/kernel.dep.ps b/dev/doc/kernel.dep.ps new file mode 100644 index 00000000..3c00121e --- /dev/null +++ b/dev/doc/kernel.dep.ps @@ -0,0 +1,1454 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.2 (Wed Jan 19 21:09:25 UTC 2005) +%%For: (herbelin) Hugo Herbelin +%%Title: G +%%Pages: (atend) +%%BoundingBox: 35 35 577 127 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval + +EncodingVector + dup 306 /AE + dup 301 /Aacute + dup 302 /Acircumflex + dup 304 /Adieresis + dup 300 /Agrave + dup 305 /Aring + dup 303 /Atilde + dup 307 /Ccedilla + dup 311 /Eacute + dup 312 /Ecircumflex + dup 313 /Edieresis + dup 310 /Egrave + dup 315 /Iacute + dup 316 /Icircumflex + dup 317 /Idieresis + dup 314 /Igrave + dup 334 /Udieresis + dup 335 /Yacute + dup 376 /thorn + dup 337 /germandbls + dup 341 /aacute + dup 342 /acircumflex + dup 344 /adieresis + dup 346 /ae + dup 340 /agrave + dup 345 /aring + dup 347 /ccedilla + dup 351 /eacute + dup 352 /ecircumflex + dup 353 /edieresis + dup 350 /egrave + dup 355 /iacute + dup 356 /icircumflex + dup 357 /idieresis + dup 354 /igrave + dup 360 /dcroat + dup 361 /ntilde + dup 363 /oacute + dup 364 /ocircumflex + dup 366 /odieresis + dup 362 /ograve + dup 365 /otilde + dup 370 /oslash + dup 372 /uacute + dup 373 /ucircumflex + dup 374 /udieresis + dup 371 /ugrave + dup 375 /yacute + dup 377 /ydieresis + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 577 127 +%%PageOrientation: Portrait +gsave +35 35 542 92 boxprim clip newpath +36 36 translate +0 0 1 beginpage +0.2845 set_scale +0 0 translate 0 rotate +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font + +% Vm +gsave 10 dict begin +801 294 27 18 ellipse_path +stroke +gsave 10 dict begin +789 289 moveto +(Vm) +[10.08 10.8] +xshow +end grestore +end grestore + +% Cemitcodes +gsave 10 dict begin +1427 200 46 18 ellipse_path +stroke +gsave 10 dict begin +1393 195 moveto +(Cemitcodes) +[9.36 6.24 10.8 3.84 3.84 6.24 6.96 6.96 6.24 5.52] +xshow +end grestore +end grestore + +% Vm -> Cemitcodes +newpath 826 287 moveto +871 276 969 254 1053 254 curveto +1053 254 1053 254 1174 254 curveto +1249 254 1332 231 1382 215 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1383 218 moveto +1392 212 lineto +1381 212 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1383 218 moveto +1392 212 lineto +1381 212 lineto +closepath +stroke +end grestore + +% Conv_oracle +gsave 10 dict begin +1053 300 48 18 ellipse_path +stroke +gsave 10 dict begin +1017 295 moveto +(Conv_oracle) +[9.36 6.96 6.48 6.96 6.96 6.96 4.56 6.24 6.24 3.84 6.24] +xshow +end grestore +end grestore + +% Vm -> Conv_oracle +newpath 828 295 moveto +868 296 942 298 995 299 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 995 303 moveto +1005 299 lineto +995 296 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 995 303 moveto +1005 299 lineto +995 296 lineto +closepath +stroke +end grestore + +% Mod_subst +gsave 10 dict begin +1556 146 45 18 ellipse_path +stroke +gsave 10 dict begin +1524 141 moveto +(Mod_subst) +[12.48 6.96 6.96 6.96 5.52 6.96 6.96 5.28 3.84] +xshow +end grestore +end grestore + +% Cemitcodes -> Mod_subst +newpath 1459 187 moveto +1476 180 1497 171 1516 163 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1517 166 moveto +1525 159 lineto +1514 160 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1517 166 moveto +1525 159 lineto +1514 160 lineto +closepath +stroke +end grestore + +% Cbytecodes +gsave 10 dict begin +1556 200 45 18 ellipse_path +stroke +gsave 10 dict begin +1523 195 moveto +(Cbytecodes) +[9.36 6.48 6.96 3.84 6.24 6.24 6.96 6.96 6.24 5.52] +xshow +end grestore +end grestore + +% Cemitcodes -> Cbytecodes +newpath 1474 200 moveto +1482 200 1491 200 1500 200 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1500 204 moveto +1510 200 lineto +1500 197 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1500 204 moveto +1510 200 lineto +1500 197 lineto +closepath +stroke +end grestore + +% Copcodes +gsave 10 dict begin +1556 254 41 18 ellipse_path +stroke +gsave 10 dict begin +1528 249 moveto +(Copcodes) +[9.36 6.96 6.96 6.24 6.96 6.96 6.24 5.52] +xshow +end grestore +end grestore + +% Cemitcodes -> Copcodes +newpath 1459 213 moveto +1476 221 1498 230 1517 237 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1515 240 moveto +1526 241 lineto +1518 234 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1515 240 moveto +1526 241 lineto +1518 234 lineto +closepath +stroke +end grestore + +% Names +gsave 10 dict begin +1865 270 33 18 ellipse_path +stroke +gsave 10 dict begin +1845 265 moveto +(Names) +[9.6 6.24 10.8 6.24 5.52] +xshow +end grestore +end grestore + +% Conv_oracle -> Names +newpath 1102 300 moveto +1151 300 1228 300 1295 300 curveto +1295 300 1295 300 1666 300 curveto +1722 300 1785 288 1825 279 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1826 282 moveto +1835 277 lineto +1825 276 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1826 282 moveto +1835 277 lineto +1825 276 lineto +closepath +stroke +end grestore + +% Vconv +gsave 10 dict begin +552 202 32 18 ellipse_path +stroke +gsave 10 dict begin +533 197 moveto +(Vconv) +[10.08 6.24 6.96 6.48 6.96] +xshow +end grestore +end grestore + +% Csymtable +gsave 10 dict begin +674 202 43 18 ellipse_path +stroke +gsave 10 dict begin +643 197 moveto +(Csymtable) +[9.36 5.52 6.96 10.8 4.08 6.24 6.96 3.84 6.24] +xshow +end grestore +end grestore + +% Vconv -> Csymtable +newpath 584 202 moveto +595 202 608 202 620 202 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 620 206 moveto +630 202 lineto +620 199 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 620 206 moveto +630 202 lineto +620 199 lineto +closepath +stroke +end grestore + +% Inductive +gsave 10 dict begin +674 110 39 18 ellipse_path +stroke +gsave 10 dict begin +647 105 moveto +(Inductive) +[4.56 6.96 6.96 6.96 6.24 3.84 3.84 6.48 6.24] +xshow +end grestore +end grestore + +% Vconv -> Inductive +newpath 571 187 moveto +591 172 622 149 645 132 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 647 135 moveto +653 126 lineto +643 129 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 647 135 moveto +653 126 lineto +643 129 lineto +closepath +stroke +end grestore + +% Csymtable -> Vm +newpath 696 218 moveto +717 234 751 258 775 275 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 773 278 moveto +783 281 lineto +777 272 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 773 278 moveto +783 281 lineto +777 272 lineto +closepath +stroke +end grestore + +% Cbytegen +gsave 10 dict begin +801 164 39 18 ellipse_path +stroke +gsave 10 dict begin +774 159 moveto +(Cbytegen) +[9.36 6.48 6.96 3.84 6.24 6.72 6.24 6.96] +xshow +end grestore +end grestore + +% Csymtable -> Cbytegen +newpath 709 191 moveto +724 187 742 181 758 177 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 759 180 moveto +768 174 lineto +757 174 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 759 180 moveto +768 174 lineto +757 174 lineto +closepath +stroke +end grestore + +% Type_errors +gsave 10 dict begin +801 110 47 18 ellipse_path +stroke +gsave 10 dict begin +767 105 moveto +(Type_errors) +[6.96 6.96 6.96 6.24 6.96 6.24 5.04 4.56 6.96 4.56 5.52] +xshow +end grestore +end grestore + +% Inductive -> Type_errors +newpath 714 110 moveto +724 110 734 110 744 110 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 744 114 moveto +754 110 lineto +744 107 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 744 114 moveto +754 110 lineto +744 107 lineto +closepath +stroke +end grestore + +% Univ +gsave 10 dict begin +1763 241 27 18 ellipse_path +stroke +gsave 10 dict begin +1748 236 moveto +(Univ) +[9.6 6.96 3.84 6.96] +xshow +end grestore +end grestore + +% Univ -> Names +newpath 1788 248 moveto +1800 251 1814 255 1826 259 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1825 262 moveto +1836 262 lineto +1827 256 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1825 262 moveto +1836 262 lineto +1827 256 lineto +closepath +stroke +end grestore + +% Typeops +gsave 10 dict begin +552 110 36 18 ellipse_path +stroke +gsave 10 dict begin +528 105 moveto +(Typeops) +[6.96 6.96 6.96 6.24 6.96 6.96 5.52] +xshow +end grestore +end grestore + +% Typeops -> Inductive +newpath 589 110 moveto +600 110 612 110 624 110 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 624 114 moveto +634 110 lineto +624 107 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 624 114 moveto +634 110 lineto +624 107 lineto +closepath +stroke +end grestore + +% Entries +gsave 10 dict begin +801 56 33 18 ellipse_path +stroke +gsave 10 dict begin +780 51 moveto +(Entries) +[8.4 6.96 3.84 4.8 3.84 6.24 5.52] +xshow +end grestore +end grestore + +% Typeops -> Entries +newpath 581 99 moveto +595 93 614 87 630 83 curveto +673 73 723 66 758 61 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 758 64 moveto +768 60 lineto +758 58 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 758 64 moveto +768 60 lineto +758 58 lineto +closepath +stroke +end grestore + +% Sign +gsave 10 dict begin +1427 100 27 18 ellipse_path +stroke +gsave 10 dict begin +1414 95 moveto +(Sign) +[7.68 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Entries -> Sign +newpath 834 61 moveto +882 68 974 79 1053 79 curveto +1053 79 1053 79 1174 79 curveto +1251 79 1342 89 1390 95 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1390 98 moveto +1400 96 lineto +1390 92 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1390 98 moveto +1400 96 lineto +1390 92 lineto +closepath +stroke +end grestore + +% Reduction +gsave 10 dict begin +926 208 42 18 ellipse_path +stroke +gsave 10 dict begin +897 203 moveto +(Reduction) +[9.12 6.24 6.96 6.96 6.24 3.84 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Type_errors -> Reduction +newpath 829 125 moveto +836 129 842 133 848 137 curveto +868 151 887 170 902 184 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 900 187 moveto +910 191 lineto +905 182 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 900 187 moveto +910 191 lineto +905 182 lineto +closepath +stroke +end grestore + +% Reduction -> Conv_oracle +newpath 948 224 moveto +968 239 999 261 1023 278 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1021 281 moveto +1031 284 lineto +1025 275 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1021 281 moveto +1031 284 lineto +1025 275 lineto +closepath +stroke +end grestore + +% Closure +gsave 10 dict begin +1053 208 35 18 ellipse_path +stroke +gsave 10 dict begin +1031 203 moveto +(Closure) +[9.36 3.84 6.96 5.52 6.96 4.56 6.24] +xshow +end grestore +end grestore + +% Reduction -> Closure +newpath 968 208 moveto +981 208 994 208 1008 208 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1008 212 moveto +1018 208 lineto +1008 205 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1008 212 moveto +1018 208 lineto +1008 205 lineto +closepath +stroke +end grestore + +% Term_typing +gsave 10 dict begin +313 110 49 18 ellipse_path +stroke +gsave 10 dict begin +277 105 moveto +(Term_typing) +[7.2 6.24 4.8 10.8 6.96 3.84 6.96 6.96 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Term_typing -> Cbytegen +newpath 347 123 moveto +363 128 381 134 398 137 curveto +524 161 675 165 752 165 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 752 169 moveto +762 165 lineto +752 162 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 752 169 moveto +762 165 lineto +752 162 lineto +closepath +stroke +end grestore + +% Cooking +gsave 10 dict begin +436 225 37 18 ellipse_path +stroke +gsave 10 dict begin +411 220 moveto +(Cooking) +[9.36 6.96 6.96 6.96 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Term_typing -> Cooking +newpath 331 127 moveto +352 147 387 179 410 202 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 408 205 moveto +418 209 lineto +413 200 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 408 205 moveto +418 209 lineto +413 200 lineto +closepath +stroke +end grestore + +% Indtypes +gsave 10 dict begin +436 110 37 18 ellipse_path +stroke +gsave 10 dict begin +411 105 moveto +(Indtypes) +[4.56 6.96 6.96 3.84 6.96 6.96 6.24 5.52] +xshow +end grestore +end grestore + +% Term_typing -> Indtypes +newpath 362 110 moveto +370 110 379 110 388 110 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 388 114 moveto +398 110 lineto +388 107 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 388 114 moveto +398 110 lineto +388 107 lineto +closepath +stroke +end grestore + +% Environ +gsave 10 dict begin +1174 181 36 18 ellipse_path +stroke +gsave 10 dict begin +1151 176 moveto +(Environ) +[8.4 6.48 6.96 3.84 4.56 6.96 6.96] +xshow +end grestore +end grestore + +% Cbytegen -> Environ +newpath 841 166 moveto +911 169 1054 175 1128 179 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1128 183 moveto +1138 179 lineto +1128 176 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1128 183 moveto +1138 179 lineto +1128 176 lineto +closepath +stroke +end grestore + +% Cooking -> Reduction +newpath 473 227 moveto +485 228 498 229 510 229 curveto +603 231 626 233 718 229 curveto +773 226 834 220 876 214 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 876 217 moveto +886 213 lineto +876 211 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 876 217 moveto +886 213 lineto +876 211 lineto +closepath +stroke +end grestore + +% Indtypes -> Typeops +newpath 474 110 moveto +484 110 495 110 505 110 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 505 114 moveto +515 110 lineto +505 107 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 505 114 moveto +515 110 lineto +505 107 lineto +closepath +stroke +end grestore + +% Term +gsave 10 dict begin +1666 173 28 18 ellipse_path +stroke +gsave 10 dict begin +1651 168 moveto +(Term) +[7.2 6.24 4.8 10.8] +xshow +end grestore +end grestore + +% Term -> Univ +newpath 1685 186 moveto +1699 196 1719 211 1736 222 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1734 225 moveto +1744 228 lineto +1738 219 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1734 225 moveto +1744 228 lineto +1738 219 lineto +closepath +stroke +end grestore + +% Esubst +gsave 10 dict begin +1763 173 32 18 ellipse_path +stroke +gsave 10 dict begin +1743 168 moveto +(Esubst) +[8.4 5.52 6.96 6.96 5.28 3.84] +xshow +end grestore +end grestore + +% Term -> Esubst +newpath 1694 173 moveto +1702 173 1711 173 1720 173 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1720 177 moveto +1730 173 lineto +1720 170 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1720 177 moveto +1730 173 lineto +1720 170 lineto +closepath +stroke +end grestore + +% Subtyping +gsave 10 dict begin +552 56 42 18 ellipse_path +stroke +gsave 10 dict begin +523 51 moveto +(Subtyping) +[7.68 6.96 6.96 3.84 6.96 6.96 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Subtyping -> Inductive +newpath 581 69 moveto +597 77 618 86 636 93 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 634 96 moveto +645 97 lineto +637 90 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 634 96 moveto +645 97 lineto +637 90 lineto +closepath +stroke +end grestore + +% Modops +gsave 10 dict begin +674 18 36 18 ellipse_path +stroke +gsave 10 dict begin +650 13 moveto +(Modops) +[12.48 6.96 6.96 6.96 6.96 5.52] +xshow +end grestore +end grestore + +% Subtyping -> Modops +newpath 586 45 moveto +601 41 618 35 633 31 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 634 34 moveto +643 28 lineto +632 28 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 634 34 moveto +643 28 lineto +632 28 lineto +closepath +stroke +end grestore + +% Modops -> Entries +newpath 705 27 moveto +722 32 743 39 761 44 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 760 47 moveto +771 47 lineto +762 41 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 760 47 moveto +771 47 lineto +762 41 lineto +closepath +stroke +end grestore + +% Modops -> Cbytegen +newpath 686 35 moveto +695 48 707 67 718 83 curveto +735 107 733 118 754 137 curveto +757 140 761 143 765 145 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 763 148 moveto +773 151 lineto +767 142 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 763 148 moveto +773 151 lineto +767 142 lineto +closepath +stroke +end grestore + +% Sign -> Term +newpath 1454 99 moveto +1489 98 1553 100 1602 119 curveto +1626 129 1637 135 1649 148 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1647 151 moveto +1656 156 lineto +1652 146 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1647 151 moveto +1656 156 lineto +1652 146 lineto +closepath +stroke +end grestore + +% Safe_typing +gsave 10 dict begin +47 85 46 18 ellipse_path +stroke +gsave 10 dict begin +13 80 moveto +(Safe_typing) +[7.68 6.24 4.08 6.24 6.96 3.84 6.96 6.96 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Mod_typing +gsave 10 dict begin +179 85 48 18 ellipse_path +stroke +gsave 10 dict begin +143 80 moveto +(Mod_typing) +[12.48 6.96 6.96 6.96 3.84 6.96 6.96 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Safe_typing -> Mod_typing +newpath 94 85 moveto +103 85 111 85 120 85 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 120 89 moveto +130 85 lineto +120 82 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 120 89 moveto +130 85 lineto +120 82 lineto +closepath +stroke +end grestore + +% Mod_typing -> Term_typing +newpath 223 93 moveto +235 95 248 98 260 100 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 260 103 moveto +270 102 lineto +261 97 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 260 103 moveto +270 102 lineto +261 97 lineto +closepath +stroke +end grestore + +% Mod_typing -> Subtyping +newpath 227 81 moveto +297 75 428 65 500 60 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 500 63 moveto +510 59 lineto +500 57 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 500 63 moveto +510 59 lineto +500 57 lineto +closepath +stroke +end grestore + +% Closure -> Environ +newpath 1085 201 moveto +1099 198 1116 194 1131 190 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1132 193 moveto +1141 188 lineto +1131 187 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1132 193 moveto +1141 188 lineto +1131 187 lineto +closepath +stroke +end grestore + +% Mod_subst -> Term +newpath 1594 155 moveto +1606 158 1618 161 1630 164 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1630 167 moveto +1640 166 lineto +1631 161 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1630 167 moveto +1640 166 lineto +1631 161 lineto +closepath +stroke +end grestore + +% Declarations +gsave 10 dict begin +1295 181 49 18 ellipse_path +stroke +gsave 10 dict begin +1259 176 moveto +(Declarations) +[10.08 6.24 6.24 3.84 6.24 4.56 6.24 3.84 3.84 6.96 6.96 5.52] +xshow +end grestore +end grestore + +% Environ -> Declarations +newpath 1210 181 moveto +1218 181 1227 181 1236 181 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1236 185 moveto +1246 181 lineto +1236 178 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1236 185 moveto +1246 181 lineto +1236 178 lineto +closepath +stroke +end grestore + +% Declarations -> Cemitcodes +newpath 1341 188 moveto +1351 189 1363 191 1373 192 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1373 195 moveto +1383 194 lineto +1374 189 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1373 195 moveto +1383 194 lineto +1374 189 lineto +closepath +stroke +end grestore + +% Declarations -> Sign +newpath 1320 165 moveto +1343 152 1375 132 1398 118 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1401 120 moveto +1407 112 lineto +1397 115 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1401 120 moveto +1407 112 lineto +1397 115 lineto +closepath +stroke +end grestore + +% Cbytecodes -> Term +newpath 1595 190 moveto +1607 188 1619 185 1630 182 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1631 185 moveto +1640 179 lineto +1629 179 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1631 185 moveto +1640 179 lineto +1629 179 lineto +closepath +stroke +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/dev/doc/lex.mll b/dev/doc/lex.mll new file mode 100644 index 00000000..617163e7 --- /dev/null +++ b/dev/doc/lex.mll @@ -0,0 +1,81 @@ + +{ + open Lexing + open Syntax + + let chan_out = ref stdout + + let comment_depth = ref 0 + let print s = output_string !chan_out s + + exception Fin_fichier + +} + +let space = [' ' '\t' '\n'] +let letter = ['a'-'z' 'A'-'Z'] +let digit = ['0'-'9'] + +let identifier = letter (letter | digit | ['_' '\''])* +let number = digit+ +let oper = ['-' '+' '/' '*' '|' '>' '<' '=' '%' '#' '$' ':' '\\' '?' + '.' '!' '@' ]+ + +rule token = parse + | "let" {LET} + | "in" {IN} + | "match" {MATCH} + | "with" {WITH} + | "end" {END} + | "and" {AND} + | "fun" {FUN} + | "if" {IF} + | "then" {THEN} + | "else" {ELSE} + | "eval" {EVAL} + | "for" {FOR} + | "Prop" {PROP} + | "Set" {SET} + | "Type" {TYPE} + | "fix" {FIX} + | "cofix" {COFIX} + | "struct" {STRUCT} + | "as" {AS} + + | "Simpl" {SIMPL} + + | "_" {WILDCARD} + | "(" {LPAR} + | ")" {RPAR} + | "{" {LBRACE} + | "}" {RBRACE} + | "!" {BANG} + | "@" {AT} + | ":" {COLON} + | ":=" {COLONEQ} + | "." {DOT} + | "," {COMMA} + | "->" {OPER "->"} + | "=>" {RARROW} + | "|" {BAR} + | "%" {PERCENT} + + | '?' { META(ident lexbuf)} + | number { INT(Lexing.lexeme lexbuf) } + | oper { OPER(Lexing.lexeme lexbuf) } + | identifier { IDENT (Lexing.lexeme lexbuf) } + | "(*" (*"*)"*) { comment_depth := 1; + comment lexbuf; + token lexbuf } + | space+ { token lexbuf} + | eof { EOF } + +and ident = parse + | identifier { Lexing.lexeme lexbuf } + +and comment = parse + | "(*" (*"*)"*) { incr comment_depth; comment lexbuf } + | (*"(*"*) "*)" + { decr comment_depth; if !comment_depth > 0 then comment lexbuf } + | eof { raise Fin_fichier } + | _ { comment lexbuf } diff --git a/dev/doc/library.dep.ps b/dev/doc/library.dep.ps new file mode 100644 index 00000000..1c68240e --- /dev/null +++ b/dev/doc/library.dep.ps @@ -0,0 +1,836 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.2 (Wed Jan 19 21:09:25 UTC 2005) +%%For: (herbelin) Hugo Herbelin +%%Title: G +%%Pages: (atend) +%%BoundingBox: 35 35 577 207 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval + +EncodingVector + dup 306 /AE + dup 301 /Aacute + dup 302 /Acircumflex + dup 304 /Adieresis + dup 300 /Agrave + dup 305 /Aring + dup 303 /Atilde + dup 307 /Ccedilla + dup 311 /Eacute + dup 312 /Ecircumflex + dup 313 /Edieresis + dup 310 /Egrave + dup 315 /Iacute + dup 316 /Icircumflex + dup 317 /Idieresis + dup 314 /Igrave + dup 334 /Udieresis + dup 335 /Yacute + dup 376 /thorn + dup 337 /germandbls + dup 341 /aacute + dup 342 /acircumflex + dup 344 /adieresis + dup 346 /ae + dup 340 /agrave + dup 345 /aring + dup 347 /ccedilla + dup 351 /eacute + dup 352 /ecircumflex + dup 353 /edieresis + dup 350 /egrave + dup 355 /iacute + dup 356 /icircumflex + dup 357 /idieresis + dup 354 /igrave + dup 360 /dcroat + dup 361 /ntilde + dup 363 /oacute + dup 364 /ocircumflex + dup 366 /odieresis + dup 362 /ograve + dup 365 /otilde + dup 370 /oslash + dup 372 /uacute + dup 373 /ucircumflex + dup 374 /udieresis + dup 371 /ugrave + dup 375 /yacute + dup 377 /ydieresis + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 577 207 +%%PageOrientation: Portrait +gsave +35 35 542 172 boxprim clip newpath +36 36 translate +0 0 1 beginpage +0.6750 set_scale +0 0 translate 0 rotate +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font + +% States +gsave 10 dict begin +30 18 30 18 ellipse_path +stroke +gsave 10 dict begin +13 13 moveto +(States) +[7.44 4.08 6.24 3.84 6.24 5.52] +xshow +end grestore +end grestore + +% Library +gsave 10 dict begin +132 18 34 18 ellipse_path +stroke +gsave 10 dict begin +110 13 moveto +(Library) +[8.4 3.84 6.96 4.56 6.24 4.8 6.96] +xshow +end grestore +end grestore + +% States -> Library +newpath 60 18 moveto +69 18 78 18 87 18 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 87 22 moveto +97 18 lineto +87 15 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 87 22 moveto +97 18 lineto +87 15 lineto +closepath +stroke +end grestore + +% Declaremods +gsave 10 dict begin +274 18 50 18 ellipse_path +stroke +gsave 10 dict begin +236 13 moveto +(Declaremods) +[10.08 6.24 6.24 3.84 6.24 4.56 6.24 10.8 6.96 6.96 5.52] +xshow +end grestore +end grestore + +% Library -> Declaremods +newpath 167 18 moveto +181 18 197 18 213 18 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 213 22 moveto +223 18 lineto +213 15 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 213 22 moveto +223 18 lineto +213 15 lineto +closepath +stroke +end grestore + +% Nametab +gsave 10 dict begin +523 134 39 18 ellipse_path +stroke +gsave 10 dict begin +497 129 moveto +(Nametab) +[9.6 6.24 10.8 6 4.08 6.24 6.96] +xshow +end grestore +end grestore + +% Libnames +gsave 10 dict begin +642 134 41 18 ellipse_path +stroke +gsave 10 dict begin +613 129 moveto +(Libnames) +[8.4 3.84 6.96 6.96 6.24 10.8 6.24 5.52] +xshow +end grestore +end grestore + +% Nametab -> Libnames +newpath 562 134 moveto +571 134 580 134 590 134 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 590 138 moveto +600 134 lineto +590 131 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 590 138 moveto +600 134 lineto +590 131 lineto +closepath +stroke +end grestore + +% Summary +gsave 10 dict begin +642 65 40 18 ellipse_path +stroke +gsave 10 dict begin +614 60 moveto +(Summary) +[7.68 6.96 10.8 10.8 6.24 4.8 6.96] +xshow +end grestore +end grestore + +% Nametab -> Summary +newpath 547 120 moveto +565 110 589 96 608 84 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 610 87 moveto +617 79 lineto +607 81 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 610 87 moveto +617 79 lineto +607 81 lineto +closepath +stroke +end grestore + +% Nameops +gsave 10 dict begin +760 134 40 18 ellipse_path +stroke +gsave 10 dict begin +733 129 moveto +(Nameops) +[9.6 6.24 10.8 6.24 6.96 6.96 5.52] +xshow +end grestore +end grestore + +% Libnames -> Nameops +newpath 684 134 moveto +693 134 701 134 710 134 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 710 138 moveto +720 134 lineto +710 131 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 710 138 moveto +720 134 lineto +710 131 lineto +closepath +stroke +end grestore + +% Lib +gsave 10 dict begin +413 153 27 18 ellipse_path +stroke +gsave 10 dict begin +402 148 moveto +(Lib) +[8.4 3.84 6.96] +xshow +end grestore +end grestore + +% Declaremods -> Lib +newpath 315 29 moveto +325 33 336 38 344 45 curveto +359 58 383 99 399 127 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 396 129 moveto +404 136 lineto +402 126 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 396 129 moveto +404 136 lineto +402 126 lineto +closepath +stroke +end grestore + +% Global +gsave 10 dict begin +413 65 32 18 ellipse_path +stroke +gsave 10 dict begin +393 60 moveto +(Global) +[10.08 3.84 6.96 6.96 6.24 3.84] +xshow +end grestore +end grestore + +% Declaremods -> Global +newpath 311 30 moveto +331 37 355 45 375 52 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 374 55 moveto +385 55 lineto +376 49 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 374 55 moveto +385 55 lineto +376 49 lineto +closepath +stroke +end grestore + +% Libobject +gsave 10 dict begin +523 188 40 18 ellipse_path +stroke +gsave 10 dict begin +495 183 moveto +(Libobject) +[8.4 3.84 6.96 6.96 6.96 3.84 6.24 6.24 3.84] +xshow +end grestore +end grestore + +% Libobject -> Libnames +newpath 552 175 moveto +567 168 587 159 604 151 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 605 154 moveto +613 147 lineto +602 148 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 605 154 moveto +613 147 lineto +602 148 lineto +closepath +stroke +end grestore + +% Lib -> Nametab +newpath 439 148 moveto +450 146 464 144 476 142 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 477 145 moveto +486 140 lineto +476 139 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 477 145 moveto +486 140 lineto +476 139 lineto +closepath +stroke +end grestore + +% Lib -> Libobject +newpath 437 161 moveto +450 165 466 170 480 174 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 479 177 moveto +490 177 lineto +481 171 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 479 177 moveto +490 177 lineto +481 171 lineto +closepath +stroke +end grestore + +% Impargs +gsave 10 dict begin +274 126 36 18 ellipse_path +stroke +gsave 10 dict begin +251 121 moveto +(Impargs) +[4.56 10.56 6.96 6.24 4.32 6.96 5.52] +xshow +end grestore +end grestore + +% Impargs -> Lib +newpath 308 133 moveto +329 137 355 142 377 146 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 377 149 moveto +387 148 lineto +378 143 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 377 149 moveto +387 148 lineto +378 143 lineto +closepath +stroke +end grestore + +% Impargs -> Global +newpath 304 116 moveto +316 111 331 105 344 99 curveto +357 94 369 88 381 82 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 382 85 moveto +390 78 lineto +379 79 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 382 85 moveto +390 78 lineto +379 79 lineto +closepath +stroke +end grestore + +% Global -> Libnames +newpath 443 73 moveto +473 81 522 94 564 107 curveto +576 111 589 115 600 119 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 599 122 moveto +610 122 lineto +601 116 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 599 122 moveto +610 122 lineto +601 116 lineto +closepath +stroke +end grestore + +% Global -> Summary +newpath 446 65 moveto +484 65 547 65 591 65 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 591 69 moveto +601 65 lineto +591 62 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 591 69 moveto +601 65 lineto +591 62 lineto +closepath +stroke +end grestore + +% Goptions +gsave 10 dict begin +274 180 39 18 ellipse_path +stroke +gsave 10 dict begin +248 175 moveto +(Goptions) +[10.08 6.96 6.96 3.84 3.84 6.96 6.96 5.52] +xshow +end grestore +end grestore + +% Goptions -> Lib +newpath 310 173 moveto +331 169 356 164 377 160 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 378 163 moveto +387 158 lineto +377 157 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 378 163 moveto +387 158 lineto +377 157 lineto +closepath +stroke +end grestore + +% Dischargedhypsmap +gsave 10 dict begin +274 234 70 18 ellipse_path +stroke +gsave 10 dict begin +217 229 moveto +(Dischargedhypsmap) +[10.08 3.84 5.52 6 6.96 6.24 4.32 6.72 6.24 6.96 6.48 6.96 6.96 5.52 10.8 6.24 6.96] +xshow +end grestore +end grestore + +% Dischargedhypsmap -> Lib +newpath 317 220 moveto +326 216 336 212 344 207 curveto +360 197 376 185 389 175 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 392 177 moveto +397 168 lineto +387 172 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 392 177 moveto +397 168 lineto +387 172 lineto +closepath +stroke +end grestore + +% Declare +gsave 10 dict begin +132 126 35 18 ellipse_path +stroke +gsave 10 dict begin +109 121 moveto +(Declare) +[10.08 6.24 6.24 3.84 6.24 4.56 6.24] +xshow +end grestore +end grestore + +% Declare -> Impargs +newpath 168 126 moveto +186 126 208 126 228 126 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 228 130 moveto +238 126 lineto +228 123 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 228 130 moveto +238 126 lineto +228 123 lineto +closepath +stroke +end grestore + +% Declare -> Dischargedhypsmap +newpath 144 143 moveto +157 161 179 189 204 207 curveto +209 210 215 213 221 216 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 219 219 moveto +230 220 lineto +222 213 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 219 219 moveto +230 220 lineto +222 213 lineto +closepath +stroke +end grestore + +% Decl_kinds +gsave 10 dict begin +274 72 45 18 ellipse_path +stroke +gsave 10 dict begin +241 67 moveto +(Decl_kinds) +[10.08 6.24 6.24 3.84 6.96 6.96 3.84 6.96 6.96 5.52] +xshow +end grestore +end grestore + +% Declare -> Decl_kinds +newpath 161 115 moveto +181 107 209 97 232 88 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 233 91 moveto +241 84 lineto +230 85 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 233 91 moveto +241 84 lineto +230 85 lineto +closepath +stroke +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/dev/doc/macros.tex b/dev/doc/macros.tex new file mode 100644 index 00000000..6beacf7b --- /dev/null +++ b/dev/doc/macros.tex @@ -0,0 +1,7 @@ + +% macros for coq.tex + +\newcommand{\Coq}{\textsf{Coq}} +\newcommand{\CCI}{Calculus of Inductive Constructions} + +\newcommand{\refsec}[1]{\textbf{\ref{#1}}}
\ No newline at end of file diff --git a/dev/doc/memo-v8.tex b/dev/doc/memo-v8.tex new file mode 100644 index 00000000..8d116de2 --- /dev/null +++ b/dev/doc/memo-v8.tex @@ -0,0 +1,286 @@ + +\documentclass{article} + +\usepackage{verbatim} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{array} +\usepackage{fullpage} + +\author{B.~Barras} +\title{An introduction to syntax of Coq V8} + +%% Le _ est un caractère normal +\catcode`\_=13 +\let\subscr=_ +\def_{\ifmmode\sb\else\subscr\fi} + +\def\NT#1{\langle\textit{#1}\rangle} +\def\NTL#1#2{\langle\textit{#1}\rangle_{#2}} +\def\TERM#1{\textsf{\bf #1}} + +\newenvironment{transbox} + {\begin{center}\tt\begin{tabular}{l|ll} \hfil\textrm{V7} & \hfil\textrm{V8} \\ \hline} + {\end{tabular}\end{center}} +\def\TRANS#1#2 + {\begin{tabular}[t]{@{}l@{}}#1\end{tabular} & + \begin{tabular}[t]{@{}l@{}}#2\end{tabular} \\} +\def\TRANSCOM#1#2#3 + {\begin{tabular}[t]{@{}l@{}}#1\end{tabular} & + \begin{tabular}[t]{@{}l@{}}#2\end{tabular} & #3 \\} + +\begin{document} + +\maketitle + +The goal of this document is to introduce by example to the new syntax of +Coq. It is strongly recommended to read first the definition of the new +syntax, but this document should also be useful for the eager user who wants +to start with the new syntax quickly. + + +\section{Changes in lexical conventions w.r.t. V7} + +\subsection{Identifiers} + +The lexical conventions changed: \TERM{_} is not a regular identifier +anymore. It is used in terms as a placeholder for subterms to be inferred +at type-checking, and in patterns as a non-binding variable. + +Furthermore, only letters (unicode letters), digits, single quotes and +_ are allowed after the first character. + +\subsection{Quoted string} + +Quoted strings are used typically to give a filename (which may not +be a regular identifier). As before they are written between double +quotes ("). Unlike for V7, there is no escape character: characters +are written normaly but the double quote which is doubled. + +\section{Main changes in terms w.r.t. V7} + + +\subsection{Precedence of application} + +In the new syntax, parentheses are not really part of the syntax of +application. The precedence of application (10) is tighter than all +prefix and infix notations. It makes it possible to remove parentheses +in many contexts. + +\begin{transbox} +\TRANS{(A x)->(f x)=(g y)}{A x -> f x = g y} +\TRANS{(f [x]x)}{f (fun x => x)} +\end{transbox} + + +\subsection{Arithmetics and scopes} + +The specialized notation for \TERM{Z} and \TERM{R} (introduced by +symbols \TERM{`} and \TERM{``}) have disappeared. They have been +replaced by the general notion of scope. + +\begin{center} +\begin{tabular}{l|l|l} +type & scope name & delimiter \\ +\hline +types & type_scope & \TERM{T} \\ +\TERM{bool} & bool_scope & \\ +\TERM{nat} & nat_scope & \TERM{nat} \\ +\TERM{Z} & Z_scope & \TERM{Z} \\ +\TERM{R} & R_scope & \TERM{R} \\ +\TERM{positive} & positive_scope & \TERM{P} +\end{tabular} +\end{center} + +In order to use notations of arithmetics on \TERM{Z}, its scope must be opened with command \verb+Open Scope Z_scope.+ Another possibility is using the scope change notation (\TERM{\%}). The latter notation is to be used when notations of several scopes appear in the same expression. + +In examples below, scope changes are not needed if the appropriate scope +has been opened. Scope nat_scope is opened in the initial state of Coq. +\begin{transbox} +\TRANSCOM{`0+x=x+0`}{0+x=x+0}{\textrm{Z_scope}} +\TRANSCOM{``0 + [if b then ``1`` else ``2``]``}{0 + if b then 1 else 2}{\textrm{R_scope}} +\TRANSCOM{(0)}{0}{\textrm{nat_scope}} +\end{transbox} + +Below is a table that tells which notation is available in which +scope. The relative precedences and associativity of operators is the +same as in usual mathematics. See the reference manual for more +details. However, it is important to remember that unlike V7, the type +operators for product and sum are left associative, in order not to +clash with arithmetic operators. + +\begin{center} +\begin{tabular}{l|l} +scope & notations \\ +\hline +nat_scope & $+ ~- ~* ~< ~\leq ~> ~\geq$ \\ +Z_scope & $+ ~- ~* ~/ ~\TERM{mod} ~< ~\leq ~> ~\geq ~?=$ \\ +R_scope & $+ ~- ~* ~/ ~< ~\leq ~> ~\geq$ \\ +type_scope & $* ~+$ \\ +bool_scope & $\TERM{\&\&} ~\TERM{$||$} ~\TERM{-}$ \\ +list_scope & $\TERM{::} ~\TERM{++}$ +\end{tabular} +\end{center} +(Note: $\leq$ is written \TERM{$<=$}) + + + +\subsection{Notation for implicit arguments} + +The explicitation of arguments is closer to the \emph{bindings} notation in +tactics. Argument positions follow the argument names of the head constant. + +\begin{transbox} +\TRANS{f 1!t1 2!t2}{f (x:=t1) (y:=t2)} +\TRANS{!f t1 t2}{@f t1 t2} +\end{transbox} + + +\subsection{Universal quantification} + +The universal quantification and dependent product types are now +materialized with the \TERM{forall} keyword before the binders and a +comma after the binders. + +The syntax of binders also changed significantly. A binder can simply be +a name when its type can be inferred. In other cases, the name and the type +of the variable are put between parentheses. When several consecutive +variables have the same type, they can be grouped. Finally, if all variables +have the same type parentheses can be omitted. + +\begin{transbox} +\TRANS{(x:A)B}{forall (x:~A), B ~~\textrm{or}~~ forall x:~A, B} +\TRANS{(x,y:nat)P}{forall (x y :~nat), P ~~\textrm{or}~~ forall x y :~nat, P} +\TRANS{(x,y:nat;z:A)P}{forall (x y :~nat) (z:A), P} +\TRANS{(x,y,z,t:?)P}{forall x y z t, P} +\TRANS{(x,y:nat;z:?)P}{forall (x y :~nat) z, P} +\end{transbox} + +\subsection{Abstraction} + +The notation for $\lambda$-abstraction follows that of universal +quantification. The binders are surrounded by keyword \TERM{fun} +and $\Rightarrow$ (\verb+=>+ in ascii). + +\begin{transbox} +\TRANS{[x,y:nat; z](f a b c)}{fun (x y:nat) z => f a b c} +\end{transbox} + + +\subsection{Pattern-matching} + +Beside the usage of the keyword pair \TERM{match}/\TERM{with} instead of +\TERM{Cases}/\TERM{of}, the main change is the notation for the type of +branches and return type. It is no longer written between \TERM{$<$ $>$} before +the \TERM{Cases} keyword, but interleaved with the destructured objects. + +The idea is that for each destructured object, one may specify a variable +name to tell how the branches types depend on this destructured objects (case +of a dependent elimination), and also how they depend on the value of the +arguments of the inductive type of the destructured objects. The type of +branches is then given after the keyword \TERM{return}, unless it can be +inferred. + +Moreover, when the destructured object is a variable, one may use this +variable in the return type. + +\begin{transbox} +\TRANS{Cases n of\\~~ O => O \\| (S k) => (1) end}{match n with\\~~ 0 => 0 \\| (S k) => 1 end} +\TRANS{Cases m n of \\~~0 0 => t \\| ... end}{match m, n with \\~~0, 0 => t \\| .. end} +\TRANS{<[n:nat](P n)>Cases T of ... end}{match T as n return P n with ... end} +\TRANS{<[n:nat][p:(even n)]\~{}(odd n)>Cases p of\\~~ ... \\end}{match p in even n return \~{} odd n with\\~~ ...\\end} +\end{transbox} + + +\subsection{Fixpoints and cofixpoints} + +An easier syntax for non-mutual fixpoints is provided, making it very close +to the usual notation for non-recursive functions. The decreasing argument +is now indicated by an annotation between curly braces, regardless of the +binders grouping. The annotation can be omitted if the binders introduce only +one variable. The type of the result can be omitted if inferable. + +\begin{transbox} +\TRANS{Fix plus\{plus [n:nat] : nat -> nat :=\\~~ [m]...\}}{fix plus (n m:nat) \{struct n\}: nat := ...} +\TRANS{Fix fact\{fact [n:nat]: nat :=\\ +~~Cases n of\\~~~~ O => (1) \\~~| (S k) => (mult n (fact k)) end\}}{fix fact + (n:nat) :=\\ +~~match n with \\~~~~0 => 1 \\~~| (S k) => n * fact k end} +\end{transbox} + +There is a syntactic sugar for mutual fixpoints associated to a local +definition: + +\begin{transbox} +\TRANS{let f := Fix f \{f [x:A] : T := M\} in\\(g (f y))}{let fix f (x:A) : T := M in\\g (f x)} +\end{transbox} + +The same applies to cofixpoints, annotations are not allowed in that case. + +\subsection{Notation for type cast} + +\begin{transbox} +\TRANS{O :: nat}{0 : nat} +\end{transbox} + +\section{Main changes in tactics w.r.t. V7} + +The main change is that all tactic names are lowercase. This also holds for +Ltac keywords. + +\subsection{Ltac} + +Definitions of macros are introduced by \TERM{Ltac} instead of +\TERM{Tactic Definition}, \TERM{Meta Definition} or \TERM{Recursive +Definition}. + +Rules of a match command are not between square brackets anymore. + +Context (understand a term with a placeholder) instantiation \TERM{inst} +became \TERM{context}. Syntax is unified with subterm matching. + +\begin{transbox} +\TRANS{match t with [C[x=y]] => inst C[y=x]}{match t with context C[x=y] => context C[y=x]} +\end{transbox} + +\subsection{Named arguments of theorems} + +\begin{transbox} +\TRANS{Apply thm with x:=t 1:=u}{apply thm with (x:=t) (1:=u)} +\end{transbox} + + +\subsection{Occurrences} + +To avoid ambiguity between a numeric literal and the optionnal +occurence numbers of this term, the occurence numbers are put after +the term itself. This applies to tactic \TERM{pattern} and also +\TERM{unfold} +\begin{transbox} +\TRANS{Pattern 1 2 (f x) 3 4 d y z}{pattern (f x at 1 2) (d at 3 4) y z} +\end{transbox} + +\section{Main changes in vernacular commands w.r.t. V7} + + +\subsection{Binders} + +The binders of vernacular commands changed in the same way as those of +fixpoints. This also holds for parameters of inductive definitions. + + +\begin{transbox} +\TRANS{Definition x [a:A] : T := M}{Definition x (a:A) : T := M} +\TRANS{Inductive and [A,B:Prop]: Prop := \\~~conj : A->B->(and A B)}% + {Inductive and (A B:Prop): Prop := \\~~conj : A -> B -> and A B} +\end{transbox} + +\subsection{Hints} + +The syntax of \emph{extern} hints changed: the pattern and the tactic +to be applied are separated by a \TERM{$\Rightarrow$}. +\begin{transbox} +\TRANS{Hint Extern 4 (toto ?) Apply lemma}{Hint Extern 4 (toto _) => apply lemma} +\end{transbox} + +\end{document} diff --git a/dev/doc/minicoq.tex b/dev/doc/minicoq.tex new file mode 100644 index 00000000..a34b03a4 --- /dev/null +++ b/dev/doc/minicoq.tex @@ -0,0 +1,98 @@ +\documentclass{article} + +\usepackage{fullpage} +\input{./macros.tex} +\newcommand{\minicoq}{\textsf{minicoq}} +\newcommand{\nonterm}[1]{\textit{#1}} +\newcommand{\terminal}[1]{\textsf{#1}} +\newcommand{\listzero}{\textit{LIST$_0$}} +\newcommand{\listun}{\textit{LIST$_1$}} +\newcommand{\sep}{\textit{SEP}} + +\title{Minicoq: a type-checker for the pure \\ + Calculus of Inductive Constructions} + + +\begin{document} + +\maketitle + +\section{Introduction} + +\minicoq\ is a minimal toplevel for the \Coq\ kernel. + + +\section{Grammar of terms} + +The grammar of \minicoq's terms is given in Figure~\ref{fig:terms}. + +\begin{figure}[htbp] + \hrulefill + \begin{center} + \begin{tabular}{lrl} + term & ::= & identifier \\ + & $|$ & \terminal{Rel} integer \\ + & $|$ & \terminal{Set} \\ + & $|$ & \terminal{Prop} \\ + & $|$ & \terminal{Type} \\ + & $|$ & \terminal{Const} identifier \\ + & $|$ & \terminal{Ind} identifier integer \\ + & $|$ & \terminal{Construct} identifier integer integer \\ + & $|$ & \terminal{[} name \terminal{:} term + \terminal{]} term \\ + & $|$ & \terminal{(} name \terminal{:} term + \terminal{)} term \\ + & $|$ & term \verb!->! term \\ + & $|$ & \terminal{(} \listun\ term \terminal{)} \\ + & $|$ & \terminal{(} term \terminal{::} term \terminal{)} \\ + & $|$ & \verb!<! term \verb!>! \terminal{Case} + term \terminal{of} \listzero\ term \terminal{end} + \\[1em] + name & ::= & \verb!_! \\ + & $|$ & identifier + \end{tabular} + \end{center} + \hrulefill + \caption{Grammar of terms} + \label{fig:terms} +\end{figure} + +\section{Commands} +The grammar of \minicoq's commands are given in +Figure~\ref{fig:commands}. All commands end with a dot. + +\begin{figure}[htbp] + \hrulefill + \begin{center} + \begin{tabular}{lrl} + command & ::= & \terminal{Definition} identifier \terminal{:=} term. \\ + & $|$ & \terminal{Definition} identifier \terminal{:} term + \terminal{:=} term. \\ + & $|$ & \terminal{Parameter} identifier \terminal{:} term. \\ + & $|$ & \terminal{Variable} identifier \terminal{:} term. \\ + & $|$ & \terminal{Inductive} \terminal{[} \listzero\ param + \terminal{]} \listun\ inductive \sep\ + \terminal{with}. \\ + & $|$ & \terminal{Check} term. + \\[1em] + param & ::= & identifier + \\[1em] + inductive & ::= & identifier \terminal{:} term \terminal{:=} + \listzero\ constructor \sep\ \terminal{$|$} + \\[1em] + constructor & ::= & identifier \terminal{:} term + \end{tabular} + \end{center} + \hrulefill + \caption{Commands} + \label{fig:commands} +\end{figure} + + +\end{document} + + +%%% Local Variables: +%%% mode: latex +%%% TeX-master: t +%%% End: diff --git a/dev/doc/newsyntax.tex b/dev/doc/newsyntax.tex new file mode 100644 index 00000000..96e61292 --- /dev/null +++ b/dev/doc/newsyntax.tex @@ -0,0 +1,725 @@ + +%% -*-french-tex-*- + +\documentclass{article} + +\usepackage{verbatim} +\usepackage[T1]{fontenc} +\usepackage[latin1]{inputenc} +\usepackage[french]{babel} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{array} + + +\author{B.~Barras} +\title{Proposition de syntaxe pour Coq} + +%% Le _ est un caractère normal +\catcode`\_=13 +\let\subscr=_ +\def_{\ifmmode\sb\else\subscr\fi} + +%% Macros pour les grammaires +\def\NT#1{\langle\textit{#1}\rangle} +\def\TERM#1{\textsf{#1}} +\def\STAR#1{#1\!*} +\def\PLUS#1{#1\!+} + +%% Tableaux de definition de non-terminaux +\newenvironment{cadre} + {\begin{array}{|c|}\hline\\} + {\\\\\hline\end{array}} +\newenvironment{rulebox} + {$$\begin{cadre}\begin{array}{r@{~}c@{~}l@{}r}} + {\end{array}\end{cadre}$$} +\def\DEFNT#1{\NT{#1} & ::= &} +\def\EXTNT#1{\NT{#1} & ::= & ... \\&|&} +\def\RNAME#1{(\textsc{#1})} +\def\SEPDEF{\\\\} +\def\nlsep{\\&|&} + + +\begin{document} + +\maketitle + +\section{Grammaire des tactiques} +\label{tacticsyntax} + +La réflexion de la rénovation de la syntaxe des tactiques n'est pas +encore aussi poussée que pour les termes (section~\ref{constrsyntax}), +mais cette section vise à énoncer les quelques principes que l'on +souhaite suivre. + +\begin{itemize} +\item Réutiliser les mots-clés de la syntaxe des termes (i.e. en + minuscules) pour les constructions similaires de tactiques (let_in, + match, and, etc.). Le connecteur logique \texttt{and} n'étant que + rarement utilisé autrement que sous la forme \texttt{$\wedge$} (sauf + dans le code ML), on pourrait dégager ce mot-clé. +\item Les arguments passés aux tactiques sont principalement des + termes, on préconise l'utilisation d'un symbole spécial (par exemple + l'apostrophe) pour passer une tactique ou une expression + (AST). L'idée étant que l'on écrit plus souvent des tactiques + prenant des termes en argument que des tacticals. +\end{itemize} + +\begin{figure} +\begin{rulebox} +\DEFNT{tactic} + \NT{tactic} ~\TERM{\&} ~\NT{tactic} & \RNAME{then} +\nlsep \TERM{[} ~\NT{tactic}~\TERM{|}~... + ~\TERM{|}~\NT{tactic}~\TERM{]} & \RNAME{par} +\nlsep \NT{ident} ~\STAR{\NT{tactic-arg}} ~~~ & \RNAME{apply} +\nlsep \TERM{fun} ~.... & \RNAME{function} +\nlsep \NT{simple-tactic} +\SEPDEF +\DEFNT{tactic-arg} + \NT{constr} +\nlsep \TERM{'} ~\NT{tactic} +\SEPDEF +\DEFNT{simple-tactic} + \TERM{Apply} ~\NT{binding-term} +\nlsep \NT{elim-kw} ~\NT{binding-term} +\nlsep \NT{elim-kw} ~\NT{binding-term} ~\TERM{using} ~\NT{binding-term} +\nlsep \TERM{Intros} ~\NT{intro-pattern} +\SEPDEF +\DEFNT{elim-kw} + \TERM{Elim} ~\mid~ \TERM{Case} ~\mid~ \TERM{Induction} + ~\mid~ \TERM{Destruct} +\end{rulebox} +\caption{Grammaire des tactiques} +\label{tactic} +\end{figure} + + +\subsection{Arguments de tactiques} + +La syntaxe actuelle des arguments de tactiques est que l'on parse par +défaut une expression de tactique, ou bien l'on parse un terme si +celui-ci est préfixé par \TERM{'} (sauf dans le cas des +variables). Cela est gênant pour les utilisateurs qui doivent écrire +des \TERM{'} pour leurs tactiques. + +À mon avis, il n'est pas souhaitable pour l'utilisateur de l'obliger à +marquer une différence entre les tactiques ``primitives'' (en fait +``système'') et les tactiques définies par Ltac. En effet, on se +dirige inévitablement vers une situation où il existera des librairies +de tactiques et il va devenir difficile de savoir facilement s'il faut +ou non mettre des \TERM{'}. + + + +\subsection{Bindings} + +Dans un premier temps, les ``bindings'' sont toujours considérés comme +une construction du langage des tactiques, mais il est intéressant de +prévoir l'extension de ce procédé aux termes, puisqu'il s'agit +simplement de construire un n{\oe}ud d'application dans lequel on +donne les arguments par nom ou par position, les autres restant à +inférer. Le principal point est de trouver comment combiner de manière +uniforme ce procédé avec les arguments implicites. + +Il est toutefois important de réfléchir dès maintenant à une syntaxe +pour éviter de rechanger encore la syntaxe. + +Intégrer la notation \TERM{with} aux termes peut poser des problèmes +puisque ce mot-clé est utilisé pour le filtrage: comment parser (en +LL(1)) l'expression: +\begin{verbatim} +Cases x with y ... +\end{verbatim} + +Soit on trouve un autre mot-clé, soit on joue avec les niveaus de +priorité en obligeant a parenthéser le \TERM{with} des ``bindings'': +\begin{verbatim} +Cases (x with y) with (C z) => ... +\end{verbatim} +ce qui introduit un constructeur moralement équivalent à une +application situé à une priorité totalement différente (les +``bindings'' seraient au plus haut niveau alors que l'application est +à un niveau bas). + + +\begin{figure} +\begin{rulebox} +\DEFNT{binding-term} + \NT{constr} ~\TERM{with} ~\STAR{\NT{binding}} +\SEPDEF +\DEFNT{binding} + \NT{constr} +\end{rulebox} +\caption{Grammaire des bindings} +\label{bindings} +\end{figure} + +\subsection{Enregistrements} + +Il faudrait aménager la syntaxe des enregistrements dans l'optique +d'avoir des enregistrements anonymes (termes de première classe), même +si pour l'instant, on ne dispose que d'enregistrements définis a +toplevel. + +Exemple de syntaxe pour les types d'enregistrements: +\begin{verbatim} +{ x1 : A1; + x2 : A2(x1); + _ : T; (* Pas de projection disponible *) + y; (* Type infere *) + ... (* ; optionnel pour le dernier champ *) +} +\end{verbatim} + +Exemple de syntaxe pour le constructeur: +\begin{verbatim} +{ x1 = O; + x2 : A2(x1) = v1; + _ = v2; + ... +} +\end{verbatim} +Quant aux dépendences, une convention pourrait être de considérer les +champs non annotés par le type comme non dépendants. + +Plusieurs interrogations: +\begin{itemize} +\item l'ordre des champs doit-il être respecté ? + sinon, que faire pour les champs sans projection ? +\item autorise-t-on \texttt{v1} a mentionner \texttt{x1} (comme dans + la définition d'un module), ce qui se comporterait comme si on avait + écrit \texttt{v1} à la place. Cela pourrait être une autre manière + de déclarer les dépendences +\end{itemize} + +La notation pointée pour les projections pose un problème de parsing, +sauf si l'on a une convention lexicale qui discrimine les noms de +modules des projections et identificateurs: \texttt{x.y.z} peut être +compris comme \texttt{(x.y).z} ou texttt{x.(y.z)}. + + +\section{Grammaire des termes} +\label{constrsyntax} + +\subsection{Quelques principes} + +\begin{enumerate} +\item Diminuer le nombre de niveaux de priorité en regroupant les + règles qui se ressemblent: infixes, préfixes, lieurs (constructions + ouvertes à droite), etc. +\item Éviter de surcharger la signification d'un symbole (ex: + \verb+( )+ comme parenthésage et produit dans la V7). +\item Faire en sorte que les membres gauches (motifs de Cases, lieurs + d'abstraction ou de produits) utilisent une syntaxe compatible avec + celle des membres droits (branches de Cases et corps de fonction). +\end{enumerate} + +\subsection{Présentation de la grammaire} + +\begin{figure} +\begin{rulebox} +\DEFNT{paren-constr} + \NT{cast-constr}~\TERM{,}~\NT{paren-constr} &\RNAME{pair} +\nlsep \NT{cast-constr} +\SEPDEF +\DEFNT{cast-constr} + \NT{constr}~\TERM{\!\!:}~\NT{cast-constr} &\RNAME{cast} +\nlsep \NT{constr} +\SEPDEF +\DEFNT{constr} + \NT{appl-constr}~\NT{infix}~\NT{constr} &\RNAME{infix} +\nlsep \NT{prefix}~\NT{constr} &\RNAME{prefix} +\nlsep \NT{constr}~\NT{postfix} &\RNAME{postfix} +\nlsep \NT{appl-constr} +\SEPDEF +\DEFNT{appl-constr} + \NT{appl-constr}~\PLUS{\NT{appl-arg}} &\RNAME{apply} +\nlsep \TERM{@}~\NT{global}~\PLUS{\NT{simple-constr}} &\RNAME{expl-apply} +\nlsep \NT{simple-constr} +\SEPDEF +\DEFNT{appl-arg} + \TERM{@}~\NT{int}~\TERM{\!:=}~\NT{simple-constr} &\RNAME{impl-arg} +\nlsep \NT{simple-constr} +\SEPDEF +\DEFNT{simple-constr} + \NT{atomic-constr} +\nlsep \TERM{(}~\NT{paren-constr}~\TERM{)} +\nlsep \NT{match-constr} +\nlsep \NT{fix-constr} +%% \nlsep \TERM{<\!\!:ast\!\!:<}~\NT{ast}~\TERM{>\!>} &\RNAME{quotation} +\end{rulebox} +\caption{Grammaire des termes} +\label{constr} +\end{figure} + +\begin{figure} +\begin{rulebox} +\DEFNT{prefix} + \TERM{!}~\PLUS{\NT{binder}}~\TERM{.}~ &\RNAME{prod} +\nlsep \TERM{fun} ~\PLUS{\NT{binder}} ~\TERM{$\Rightarrow$} &\RNAME{lambda} +\nlsep \TERM{let}~\NT{ident}~\STAR{\NT{binder}} ~\TERM{=}~\NT{constr} + ~\TERM{in} &\RNAME{let} +%\nlsep \TERM{let (}~\NT{comma-ident-list}~\TERM{) =}~\NT{constr} +% ~\TERM{in} &~~~\RNAME{let-case} +\nlsep \TERM{if}~\NT{constr}~\TERM{then}~\NT{constr}~\TERM{else} + &\RNAME{if-case} +\nlsep \TERM{eval}~\NT{red-fun}~\TERM{in} &\RNAME{eval} +\SEPDEF +\DEFNT{infix} + \TERM{$\rightarrow$} & \RNAME{impl} +\SEPDEF +\DEFNT{atomic-constr} + \TERM{_} +\nlsep \TERM{?}\NT{int} +\nlsep \NT{sort} +\nlsep \NT{global} +\SEPDEF +\DEFNT{binder} + \NT{ident} &\RNAME{infer} +\nlsep \TERM{(}~\NT{ident}~\NT{type}~\TERM{)} &\RNAME{binder} +\SEPDEF +\DEFNT{type} + \TERM{\!:}~\NT{constr} +\nlsep \epsilon +\end{rulebox} +\caption{Grammaires annexes aux termes} +\label{gram-annexes} +\end{figure} + +La grammaire des termes (correspondant à l'état \texttt{barestate}) +est décrite figures~\ref{constr} et~\ref{gram-annexes}. On constate +par rapport aux précédentes versions de Coq d'importants changements +de priorité, le plus marquant étant celui de l'application qui se +trouve désormais juste au dessus\footnote{La convention est de +considérer les opérateurs moins lieurs comme ``au dessus'', +c'est-à-dire ayant un niveau de priorité plus élévé (comme c'est le +cas avec le niveau de la grammaire actuelle des termes).} des +constructions fermées à gauche et à droite. + +La grammaire des noms globaux est la suivante: +\begin{eqnarray*} +\DEFNT{global} + \NT{ident} +%% \nlsep \TERM{\$}\NT{ident} +\nlsep \NT{ident}\TERM{.}\NT{global} +\end{eqnarray*} + +Le $\TERM{_}$ dénote les termes à synthétiser. Les métavariables sont +reconnues au niveau du lexer pour ne pas entrer en conflit avec le +$\TERM{?}$ de l'existentielle. + +Les opérateurs infixes ou préfixes sont tous au même niveau de +priorité du point de vue de Camlp4. La solution envisagée est de les +gérer à la manière de Yacc, avec une pile (voir discussions plus +bas). Ainsi, l'implication est un infixe normal; la quantification +universelle et le let sont vus comme des opérateurs préfixes avec un +niveau de priorité plus haut (i.e. moins lieur). Il subsiste des +problèmes si l'on ne veut pas écrire de parenthèses dans: +\begin{verbatim} + A -> (!x. B -> (let y = C in D)) +\end{verbatim} + +La solution proposée est d'analyser le membre droit d'un infixe de +manière à autoriser les préfixes et les infixes de niveau inférieur, +et d'exiger le parenthésage que pour les infixes de niveau supérieurs. + +En revanche, à l'affichage, certains membres droits seront plus +lisibles s'ils n'utilisent pas cette astuce: +\begin{verbatim} +(fun x => x) = fun x => x +\end{verbatim} + +La proposition est d'autoriser ce type d'écritures au parsing, mais +l'afficheur écrit de manière standardisée en mettant quelques +parenthèses superflues: $\TERM{=}$ serait symétrique alors que +$\rightarrow$ appellerait l'afficheur de priorité élevée pour son +sous-terme droit. + +Les priorités des opérateurs primitifs sont les suivantes (le signe +$*$ signifie que pour le membre droit les opérateurs préfixes seront +affichés sans parenthèses quel que soit leur priorité): +$$ +\begin{array}{c|l} +$symbole$ & $priorité$ \\ +\hline +\TERM{!} & 200\,R* \\ +\TERM{fun} & 200\,R* \\ +\TERM{let} & 200\,R* \\ +\TERM{if} & 200\,R \\ +\TERM{eval} & 200\,R \\ +\rightarrow & 90\,R* +\end{array} +$$ + +Il y a deux points d'entrée pour les termes: $\NT{constr}$ et +$\NT{simple-constr}$. Le premier peut être utilisé lorsqu'il est suivi +d'un séparateur particulier. Dans le cas où l'on veut une liste de +termes séparés par un espace, il faut lire des $\NT{simple-constr}$. + + + +Les constructions $\TERM{fix}$ et $\TERM{cofix}$ (voir aussi +figure~\ref{gram-fix}) sont fermées par end pour simplifier +l'analyse. Sinon, une expression de point fixe peut être suivie par un +\TERM{in} ou un \TERM{and}, ce qui pose les mêmes problèmes que le +``dangling else'': dans +\begin{verbatim} +fix f1 x {x} = fix f2 y {y} = ... and ... in ... +\end{verbatim} +il faut définir une stratégie pour associer le \TERM{and} et le +\TERM{in} au bon point fixe. + +Un autre avantage est de faire apparaitre que le \TERM{fix} est un +constructeur de terme de première classe et pas un lieur: +\begin{verbatim} +fix f1 ... and f2 ... +in f1 end x +\end{verbatim} +Les propositions précédentes laissaient \texttt{f1} et \texttt{x} +accolés, ce qui est source de confusion lorsque l'on fait par exemple +\texttt{Pattern (f1 x)}. + +Les corps de points fixes et co-points fixes sont identiques, bien que +ces derniers n'aient pas d'information de décroissance. Cela +fonctionne puisque l'annotation est optionnelle. Cela préfigure des +cas où l'on arrive à inférer quel est l'argument qui décroit +structurellement (en particulier dans le cas où il n'y a qu'un seul +argument). + +\begin{figure} +\begin{rulebox} +\DEFNT{fix-expr} + \TERM{fix}~\NT{fix-decls} ~\NT{fix-select} ~\TERM{end} &\RNAME{fix} +\nlsep \TERM{cofix}~\NT{cofix-decls}~\NT{fix-select} ~\TERM{end} &\RNAME{cofix} +\SEPDEF +\DEFNT{fix-decls} + \NT{fix-decl}~\TERM{and}~\NT{fix-decls} +\nlsep \NT{fix-decl} +\SEPDEF +\DEFNT{fix-decl} + \NT{ident}~\PLUS{\NT{binder}}~\NT{type}~\NT{annot} + ~\TERM{=}~\NT{constr} +\SEPDEF +\DEFNT{annot} + \TERM{\{}~\NT{ident}~\TERM{\}} +\nlsep \epsilon +\SEPDEF +\DEFNT{fix-select} + \TERM{in}~\NT{ident} +\nlsep \epsilon +\end{rulebox} +\caption{Grammaires annexes des points fixes} +\label{gram-fix} +\end{figure} + +La construction $\TERM{Case}$ peut-être considérée comme +obsolète. Quant au $\TERM{Match}$ de la V6, il disparaît purement et +simplement. + +\begin{figure} +\begin{rulebox} +\DEFNT{match-expr} + \TERM{match}~\NT{case-items}~\NT{case-type}~\TERM{with}~ + \NT{branches}~\TERM{end} &\RNAME{match} +\nlsep \TERM{match}~\NT{case-items}~\TERM{with}~ + \NT{branches}~\TERM{end} &\RNAME{infer-match} +%%\nlsep \TERM{case}~\NT{constr}~\NT{case-predicate}~\TERM{of}~ +%% \STAR{\NT{constr}}~\TERM{end} &\RNAME{case} +\SEPDEF +\DEFNT{case-items} + \NT{case-item} ~\TERM{\&} ~\NT{case-items} +\nlsep \NT{case-item} +\SEPDEF +\DEFNT{case-item} + \NT{constr}~\NT{pred-pattern} &\RNAME{dep-case} +\nlsep \NT{constr} &\RNAME{nodep-case} +\SEPDEF +\DEFNT{case-type} + \TERM{$\Rightarrow$}~\NT{constr} +\nlsep \epsilon +\SEPDEF +\DEFNT{pred-pattern} + \TERM{as}~\NT{ident} ~\TERM{\!:}~\NT{constr} +\SEPDEF +\DEFNT{branches} + \TERM{|} ~\NT{patterns} ~\TERM{$\Rightarrow$} + ~\NT{constr} ~\NT{branches} +\nlsep \epsilon +\SEPDEF +\DEFNT{patterns} + \NT{pattern} ~\TERM{\&} ~\NT{patterns} +\nlsep \NT{pattern} +\SEPDEF +\DEFNT{pattern} ... +\end{rulebox} +\caption{Grammaires annexes du filtrage} +\label{gram-match} +\end{figure} + +De manière globale, l'introduction de définitions dans les termes se +fait avec le symbole $=$, et le $\!:=$ est réservé aux définitions au +niveau vernac. Il y avait un manque de cohérence dans la +V6, puisque l'on utilisait $=$ pour le $\TERM{let}$ et $\!:=$ pour les +points fixes et les commandes vernac. + +% OBSOLETE: lieurs multiples supprimes +%On peut remarquer que $\NT{binder}$ est un sous-ensemble de +%$\NT{simple-constr}$, à l'exception de $\texttt{(a,b\!\!:T)}$: en tant +%que lieur, {\tt a} et {\tt b} sont tous deux contraints, alors qu'en +%tant que terme, seul {\tt b} l'est. Cela qui signifie que l'objectif +%de rendre compatibles les membres gauches et droits est {\it presque} +%atteint. + +\subsection{Infixes} + +\subsubsection{Infixes extensibles} + +Le problème de savoir si la liste des symboles pouvant apparaître en +infixe est fixée ou extensible par l'utilisateur reste à voir. + +Notons que la solution où les symboles infixes sont des +identificateurs que l'on peut définir paraît difficilement praticable: +par exemple $\texttt{Logic.eq}$ n'est pas un opérateur binaire, mais +ternaire. Il semble plus simple de garder des déclarations infixes qui +relient un symbole infixe à un terme avec deux ``trous''. Par exemple: + +$$\begin{array}{c|l} +$infixe$ & $identificateur$ \\ +\hline += & \texttt{Logic.eq _ ?1 ?2} \\ +== & \texttt{JohnMajor.eq _ ?1 _ ?2} +\end{array}$$ + +La syntaxe d'une déclaration d'infixe serait par exemple: +\begin{verbatim} +Infix "=" 50 := Logic.eq _ ?1 ?2; +\end{verbatim} + + +\subsubsection{Gestion des précédences} + +Les infixes peuvent être soit laissé à Camlp4, ou bien (comme ici) +considérer que tous les opérateurs ont la même précédence et gérer +soit même la recomposition des termes à l'aide d'une pile (comme +Yacc). + + +\subsection{Extensions de syntaxe} + +\subsubsection{Litéraux numériques} + +La proposition est de considerer les litéraux numériques comme de +simples identificateurs. Comme il en existe une infinité, il faut un +nouveau mécanisme pour leur associer une définition. Par exemple, en +ce qui concerne \texttt{Arith}, la définition de $5$ serait +$\texttt{S}~4$. Pour \texttt{ZArith}, $5$ serait $\texttt{xI}~2$. + +Comme les infixes, les constantes numériques peuvent être qualifiées +pour indiquer dans quels module est le type que l'on veut +référencer. Par exemple (si on renomme \texttt{Arith} en \texttt{N} et +\texttt{ZArith} en \texttt{Z}): \verb+N.5+, \verb+Z.5+. + +\begin{eqnarray*} +\EXTNT{global} + \NT{int} +\end{eqnarray*} + +\subsubsection{Nouveaux lieurs} + +$$ +\begin{array}{rclr} +\EXTNT{constr} + \TERM{ex}~\PLUS{\NT{binder}}~\TERM{.}~\NT{constr} &\RNAME{ex} +\nlsep \TERM{ex}~\PLUS{\NT{binder}}~\TERM{.}~\NT{constr}~\TERM{,}~\NT{constr} + &\RNAME{ex2} +\nlsep \TERM{ext}~\PLUS{\NT{binder}}~\TERM{.}~\NT{constr} &\RNAME{exT} +\nlsep \TERM{ext}~\PLUS{\NT{binder}}~\TERM{.}~\NT{constr}~\TERM{,}~\NT{constr} + &\RNAME{exT2} +\end{array} +$$ + +Pour l'instant l'existentielle n'admet qu'une seule variable, ce qui +oblige à écrire des cascades de $\TERM{ex}$. + +Pour parser les existentielles avec deux prédicats, on peut considérer +\TERM{\&} comme un infixe intermédiaire et l'opérateur existentiel en +présence de cet infixe se transforme en \texttt{ex2}. + +\subsubsection{Nouveaux infixes} + +Précédences des opérateurs infixes (les plus grands associent moins fort): +$$ +\begin{array}{l|l|c|l} +$identificateur$ & $module$ & $infixe/préfixe$ & $précédence$ \\ +\hline +\texttt{iff} & $Logic$ & \longleftrightarrow & 100 \\ +\texttt{or} & $Logic$ & \vee & 80\, R \\ +\texttt{sum} & $Datatypes$ & + & 80\, R \\ +\texttt{and} & $Logic$ & \wedge & 70\, R \\ +\texttt{prod} & $Datatypes$ & * & 70\, R \\ +\texttt{not} & $Logic$ & \tilde{} & 60\, L \\ +\texttt{eq _} & $Logic$ & = & 50 \\ +\texttt{eqT _} & $Logic_Type$ & = & 50 \\ +\texttt{identityT _} & $Data_Type$ & = & 50 \\ +\texttt{le} & $Peano$ & $<=$ & 50 \\ +\texttt{lt} & $Peano$ & $<$ & 50 \\ +\texttt{ge} & $Peano$ & $>=$ & 50 \\ +\texttt{gt} & $Peano$ & $>$ & 50 \\ +\texttt{Zle} & $zarith_aux$ & $<=$ & 50 \\ +\texttt{Zlt} & $zarith_aux$ & $<$ & 50 \\ +\texttt{Zge} & $zarith_aux$ & $>=$ & 50 \\ +\texttt{Zgt} & $zarith_aux$ & $>$ & 50 \\ +\texttt{Rle} & $Rdefinitions$ & $<=$ & 50 \\ +\texttt{Rlt} & $Rdefinitions$ & $<$ & 50 \\ +\texttt{Rge} & $Rdefinitions$ & $>=$ & 50 \\ +\texttt{Rgt} & $Rdefinitions$ & $>$ & 50 \\ +\texttt{plus} & $Peano$ & + & 40\,L \\ +\texttt{Zplus} & $fast_integer$ & + & 40\,L \\ +\texttt{Rplus} & $Rdefinitions$ & + & 40\,L \\ +\texttt{minus} & $Minus$ & - & 40\,L \\ +\texttt{Zminus} & $zarith_aux$ & - & 40\,L \\ +\texttt{Rminus} & $Rdefinitions$ & - & 40\,L \\ +\texttt{Zopp} & $fast_integer$ & - & 40\,L \\ +\texttt{Ropp} & $Rdefinitions$ & - & 40\,L \\ +\texttt{mult} & $Peano$ & * & 30\,L \\ +\texttt{Zmult} & $fast_integer$ & * & 30\,L \\ +\texttt{Rmult} & $Rdefinitions$ & * & 30\,L \\ +\texttt{Rdiv} & $Rdefinitions$ & / & 30\,L \\ +\texttt{pow} & $Rfunctions$ & \hat & 20\,L \\ +\texttt{fact} & $Rfunctions$ & ! & 20\,L \\ +\end{array} +$$ + +Notons qu'il faudrait découper {\tt Logic_Type} en deux car celui-ci +définit deux égalités, ou alors les mettre dans des modules différents. + +\subsection{Exemples} + +\begin{verbatim} +Definition not (A:Prop) := A->False; +Inductive eq (A:Set) (x:A) : A->Prop := + refl_equal : eq A x x; +Inductive ex (A:Set) (P:A->Prop) : Prop := + ex_intro : !x. P x -> ex A P; +Lemma not_all_ex_not : !(P:U->Prop). ~(!n. P n) -> ?n. ~ P n; +Fixpoint plus n m : nat {struct n} := + match n with + O => m + | (S k) => S (plus k m) + end; +\end{verbatim} + +\subsection{Questions ouvertes} + +Voici les points sur lesquels la discussion est particulièrement +ouverte: +\begin{itemize} +\item choix d'autres symboles pour les quantificateurs \TERM{!} et + \TERM{?}. En l'état actuel des discussions, on garderait le \TERM{!} + pour la qunatification universelle, mais on choisirait quelquechose + comme \TERM{ex} pour l'existentielle, afin de ne pas suggérer trop + de symétrie entre ces quantificateurs (l'un est primitif, l'autre + pas). +\item syntaxe particulière pour les \texttt{sig}, \texttt{sumor}, etc. +\item la possibilité d'introduire plusieurs variables du même type est + pour l'instant supprimée au vu des problèmes de compatibilité de + syntaxe entre les membres gauches et membres droits. L'idée étant + que l'inference de type permet d'éviter le besoin de déclarer tous + les types. +\end{itemize} + +\subsection{Autres extensions} + +\subsubsection{Lieur multiple} + +L'écriture de types en présence de polymorphisme est souvent assez +pénible: +\begin{verbatim} +Check !(A:Set) (x:A) (B:Set) (y:B). P A x B y; +\end{verbatim} + +On pourrait avoir des déclarations introduisant à la fois un type +d'une certaine sorte et une variable de ce type: +\begin{verbatim} +Check !(x:A:Set) (y:B:Set). P A x B y; +\end{verbatim} + +Noter que l'on aurait pu écrire: +\begin{verbatim} +Check !A x B y. P A (x:A:Set) B (y:B:Set); +\end{verbatim} + +\section{Syntaxe des tactiques} + +\subsection{Questions diverses} + +Changer ``Pattern nl c ... nl c'' en ``Pattern [ nl ] c ... [ nl ] c'' +pour permettre des chiffres seuls dans la catégorie syntaxique des +termes. + +Par uniformité remplacer ``Unfold nl c'' par ``Unfold [ nl ] c'' ? + +Même problème pour l'entier de Specialize (ou virer Specialize ?) ? + +\subsection{Questions en suspens} + +\verb=EAuto= : deux syntaxes différentes pour la recherche en largeur +et en profondeur ? Quelle recherche par défaut ? + +\section*{Remarques pêle-mêle (HH)} + +Autoriser la syntaxe + +\begin{verbatim} +Variable R (a : A) (b : B) : Prop. +Hypotheses H (a : A) (b : B) : Prop; Y (u : U) : V. +Variables H (a : A) (b : B), J (k : K) : nat; Z (v : V) : Set. +\end{verbatim} + +Renommer eqT, refl_eqT, eqT_ind, eqT_rect, eqT_rec en eq, refl_equal, etc. +Remplacer == en =. + +Mettre des \verb=?x= plutot que des \verb=?1= dans les motifs de ltac ?? + +\section{Moulinette} + +\begin{itemize} + +\item Mettre \verb=/= et * au même niveau dans R. + +\item Changer la précédence du - unaire dans R. + +\item Ajouter Require Arith par necessite si Require ArithRing ou Require ZArithRing. + +\item Ajouter Require ZArith par necessite si Require ZArithRing ou Require Omega. + +\item Enlever le Export de Bool, Arith et ZARith de Ring quand inapproprié et +l'ajouter à côté des Require Ring. + +\item Remplacer "Check n" par "n:Check ..." + +\item Renommer Variable/Hypothesis hors section en Parameter/Axiom. + +\item Renommer les \verb=command0=, \verb=command1=, ... \verb=lcommand= etc en +\verb=constr0=, \verb=constr1=, ... \verb=lconstr=. + +\item Remplacer les noms Coq.omega.Omega par Coq.Omega ... + +\item Remplacer AddPath par Add LoadPath (ou + court) + +\item Unify + and \{\}+\{\} and +\{\} using Prop $\leq$ Set ?? + +\item Remplacer Implicit Arguments On/Off par Set/Unset Implicit Arguments. + +\item La syntaxe \verb=Intros (a,b)= est inutile, \verb=Intros [a b]= fait l'affaire. + +\item Virer \verb=Goal= sans argument (synonyme de \verb=Proof= et sans effets). + +\item Remplacer Save. par Qed. + +\item Remplacer \verb=Zmult_Zplus_distr= par \verb=Zmult_plus_distr_r= +et \verb=Zmult_plus_distr= par \verb=Zmult_plus_distr_l=. + +\end{itemize} + +\end{document} diff --git a/dev/doc/parse.ml b/dev/doc/parse.ml new file mode 100644 index 00000000..e537b1f2 --- /dev/null +++ b/dev/doc/parse.ml @@ -0,0 +1,183 @@ + +open Ast + +type assoc = L | R | N + +let level = function + | "--" -> 70,L + | "=" -> 70,N + | "+" -> 60,L + | "++" -> 60,R + | "+++" -> 60,R + | "-" -> 60,L + | "*" -> 50,L + | "/" -> 50,L + | "**" -> 40,R + | ":" -> (100,R) + | "->" -> (90,R) + | s -> failwith ("unknowm operator '"^s^"'") + +let fixity = function + | "--" -> [L] + | "=" -> [N] + | ("+"|"-"|"*"|"/") -> [L;N] + | "++" -> [R] + | _ -> [L;N;R] + +let ground_oper = function + ("-"|"+") -> true + | _ -> false + +let is_prefix op = List.mem L (fixity op) +let is_infix op = List.mem N (fixity op) +let is_postfix op = List.mem R (fixity op) + +let mk_inf op t1 t2 = + if not (is_infix op) then failwith (op^" not infix"); + Infix(op,t1,t2) + +let mk_post op t = + if not (is_postfix op) then failwith (op^" not postfix"); + Postfix(op,t) + + +(* Pb avec ground_oper: pas de diff entre -1 et -(1) *) +let mk_pre op t = + if not (is_prefix op) then failwith (op^" not prefix"); + if ground_oper op then + match t with + | Int i -> Int (op^i) + | _ -> Prefix(op,t) + else Prefix(op,t) + +(* teste si on peut reduire op suivi d'un op de niveau (n,a) + si la reponse est false, c'est que l'op (n,a) doit se reduire + avant *) +let red_left_op (nl,al) (nr,ar) = + if nl < nr then true + else + if nl = nr then + match al,ar with + | (L|N), L -> true + | R, (R|N) -> false + | R, L -> failwith "conflit d'assoc: ambigu" + | (L|N), (R|N) -> failwith "conflit d'assoc: blocage" + else false + + +type level = int * assoc +type stack = + | PrefixOper of string list + | Term of constr_ast * stack + | Oper of string list * string * constr_ast * stack + +let rec str_ast = function + | Infix(op,t1,t2) -> str_ast t1 ^ " " ^ op ^ " " ^ str_ast t2 + | Postfix(op,t) -> str_ast t ^ " " ^ op + | Prefix(op,t) -> op ^ " " ^ str_ast t + | _ -> "_" + +let rec str_stack = function + | PrefixOper ops -> String.concat " " (List.rev ops) + | Term (t,s) -> str_stack s ^ " (" ^ str_ast t ^ ")" + | Oper(ops,lop,t,s) -> + str_stack (Term(t,s)) ^ " " ^ lop ^ " " ^ + String.concat " " (List.rev ops) + +let pps s = prerr_endline (str_stack s) +let err s stk = failwith (s^": "^str_stack stk) + + +let empty = PrefixOper [] + +let check_fixity_term stk = + match stk with + Term _ -> err "2 termes successifs" stk + | _ -> () + +let shift_term t stk = + check_fixity_term stk; + Term(t,stk) + +let shift_oper op stk = + match stk with + | Oper(ops,lop,t,s) -> Oper(op::ops,lop,t,s) + | Term(t,s) -> Oper([],op,t,s) + | PrefixOper ops -> PrefixOper (op::ops) + +let is_reducible lv stk = + match stk with + | Oper([],iop,_,_) -> red_left_op (level iop) lv + | Oper(op::_,_,_,_) -> red_left_op (level op) lv + | PrefixOper(op::_) -> red_left_op (level op) lv + | _ -> false + +let reduce_head (t,stk) = + match stk with + | Oper([],iop,t1,s) -> + (Infix(iop,t1,t), s) + | Oper(op::ops,lop,t',s) -> + (mk_pre op t, Oper(ops,lop,t',s)) + | PrefixOper(op::ops) -> + (Prefix(op,t), PrefixOper ops) + | _ -> assert false + +let rec reduce_level lv (t,s) = + if is_reducible lv s then reduce_level lv (reduce_head (t, s)) + else (t, s) + +let reduce_post op (t,s) = + let (t',s') = reduce_level (level op) (t,s) in + (mk_post op t', s') + +let reduce_posts stk = + match stk with + Oper(ops,iop,t,s) -> + let pts1 = reduce_post iop (t,s) in + List.fold_right reduce_post ops pts1 + | Term(t,s) -> (t,s) + | PrefixOper _ -> failwith "reduce_posts" + + +let shift_infix op stk = + let (t,s) = reduce_level (level op) (reduce_posts stk) in + Oper([],op,t,s) + +let is_better_infix op stk = + match stk with + | Oper(ops,iop,t,s) -> + is_postfix iop && + List.for_all is_postfix ops && + (not (is_prefix op) || red_left_op (level iop) (level op)) + | Term _ -> false + | _ -> assert false + +let parse_oper op stk = + match stk with + | PrefixOper _ -> + if is_prefix op then shift_oper op stk else failwith "prefix_oper" + | Oper _ -> + if is_infix op then + if is_better_infix op stk then shift_infix op stk + else shift_oper op stk + else if is_prefix op then shift_oper op stk + else if is_postfix op then + let (t,s) = reduce_post op (reduce_posts stk) in + Term(t,s) + else assert false + | Term(t,s) -> + if is_infix op then shift_infix op stk + else if is_postfix op then + let (t2,s2) = reduce_post op (t,s) in Term(t2,s2) + else failwith "infix/postfix" + +let parse_term = shift_term + +let rec close_stack stk = + match stk with + Term(t,PrefixOper []) -> t + | PrefixOper _ -> failwith "expression sans atomes" + | _ -> + let (t,s) = reduce_head (reduce_posts stk) in + close_stack (Term(t,s)) + diff --git a/dev/doc/parsing.dep.ps b/dev/doc/parsing.dep.ps new file mode 100644 index 00000000..723d8c69 --- /dev/null +++ b/dev/doc/parsing.dep.ps @@ -0,0 +1,1115 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.2 (Wed Jan 19 21:09:25 UTC 2005) +%%For: (herbelin) Hugo Herbelin +%%Title: G +%%Pages: (atend) +%%BoundingBox: 35 35 577 314 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval + +EncodingVector + dup 306 /AE + dup 301 /Aacute + dup 302 /Acircumflex + dup 304 /Adieresis + dup 300 /Agrave + dup 305 /Aring + dup 303 /Atilde + dup 307 /Ccedilla + dup 311 /Eacute + dup 312 /Ecircumflex + dup 313 /Edieresis + dup 310 /Egrave + dup 315 /Iacute + dup 316 /Icircumflex + dup 317 /Idieresis + dup 314 /Igrave + dup 334 /Udieresis + dup 335 /Yacute + dup 376 /thorn + dup 337 /germandbls + dup 341 /aacute + dup 342 /acircumflex + dup 344 /adieresis + dup 346 /ae + dup 340 /agrave + dup 345 /aring + dup 347 /ccedilla + dup 351 /eacute + dup 352 /ecircumflex + dup 353 /edieresis + dup 350 /egrave + dup 355 /iacute + dup 356 /icircumflex + dup 357 /idieresis + dup 354 /igrave + dup 360 /dcroat + dup 361 /ntilde + dup 363 /oacute + dup 364 /ocircumflex + dup 366 /odieresis + dup 362 /ograve + dup 365 /otilde + dup 370 /oslash + dup 372 /uacute + dup 373 /ucircumflex + dup 374 /udieresis + dup 371 /ugrave + dup 375 /yacute + dup 377 /ydieresis + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 577 314 +%%PageOrientation: Portrait +gsave +35 35 542 279 boxprim clip newpath +36 36 translate +0 0 1 beginpage +0.6027 set_scale +0 0 translate 0 rotate +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font + +% Pcoq +gsave 10 dict begin +557 280 27 18 ellipse_path +stroke +gsave 10 dict begin +543 275 moveto +(Pcoq) +[7.68 6.24 6.96 6.96] +xshow +end grestore +end grestore + +% Extend +gsave 10 dict begin +664 226 33 18 ellipse_path +stroke +gsave 10 dict begin +643 221 moveto +(Extend) +[8.4 6.96 3.84 6.24 6.96 6.96] +xshow +end grestore +end grestore + +% Pcoq -> Extend +newpath 579 269 moveto +593 261 613 252 630 243 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 632 246 moveto +639 238 lineto +629 240 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 632 246 moveto +639 238 lineto +629 240 lineto +closepath +stroke +end grestore + +% Ast +gsave 10 dict begin +764 172 27 18 ellipse_path +stroke +gsave 10 dict begin +753 167 moveto +(Ast) +[10.08 5.28 3.84] +xshow +end grestore +end grestore + +% Extend -> Ast +newpath 688 213 moveto +701 206 719 196 734 188 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 736 191 moveto +743 183 lineto +733 185 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 736 191 moveto +743 183 lineto +733 185 lineto +closepath +stroke +end grestore + +% Lexer +gsave 10 dict begin +764 226 29 18 ellipse_path +stroke +gsave 10 dict begin +747 221 moveto +(Lexer) +[8.4 5.76 6.48 6.24 4.56] +xshow +end grestore +end grestore + +% Extend -> Lexer +newpath 698 226 moveto +706 226 715 226 724 226 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 724 230 moveto +734 226 lineto +724 223 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 724 230 moveto +734 226 lineto +724 223 lineto +closepath +stroke +end grestore + +% Termast +gsave 10 dict begin +557 172 35 18 ellipse_path +stroke +gsave 10 dict begin +534 167 moveto +(Termast) +[7.2 6.24 4.8 10.8 6.24 5.28 3.84] +xshow +end grestore +end grestore + +% Termast -> Ast +newpath 593 172 moveto +630 172 689 172 727 172 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 727 176 moveto +737 172 lineto +727 169 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 727 176 moveto +737 172 lineto +727 169 lineto +closepath +stroke +end grestore + +% Coqast +gsave 10 dict begin +863 172 32 18 ellipse_path +stroke +gsave 10 dict begin +843 167 moveto +(Coqast) +[9.36 6.96 6.96 6.24 5.28 3.84] +xshow +end grestore +end grestore + +% Ast -> Coqast +newpath 791 172 moveto +800 172 810 172 820 172 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 820 176 moveto +830 172 lineto +820 169 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 820 176 moveto +830 172 lineto +820 169 lineto +closepath +stroke +end grestore + +% Tactic_printer +gsave 10 dict begin +53 126 52 18 ellipse_path +stroke +gsave 10 dict begin +13 121 moveto +(Tactic_printer) +[7.44 6.24 6.24 3.84 3.84 6.24 6.96 6.96 4.8 3.84 6.96 3.84 6.24 4.56] +xshow +end grestore +end grestore + +% Pptactic +gsave 10 dict begin +178 126 36 18 ellipse_path +stroke +gsave 10 dict begin +155 121 moveto +(Pptactic) +[7.68 6.96 4.08 6.24 6.24 3.84 3.84 6.24] +xshow +end grestore +end grestore + +% Tactic_printer -> Pptactic +newpath 106 126 moveto +114 126 123 126 132 126 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 132 130 moveto +142 126 lineto +132 123 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 132 130 moveto +142 126 lineto +132 123 lineto +closepath +stroke +end grestore + +% Printer +gsave 10 dict begin +289 72 32 18 ellipse_path +stroke +gsave 10 dict begin +269 67 moveto +(Printer) +[7.68 4.8 3.84 6.96 3.84 6.24 4.56] +xshow +end grestore +end grestore + +% Pptactic -> Printer +newpath 204 113 moveto +219 105 238 96 255 88 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 256 91 moveto +264 84 lineto +253 85 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 256 91 moveto +264 84 lineto +253 85 lineto +closepath +stroke +end grestore + +% Search +gsave 10 dict begin +178 72 32 18 ellipse_path +stroke +gsave 10 dict begin +159 67 moveto +(Search) +[7.68 6.24 6.24 4.56 6 6.96] +xshow +end grestore +end grestore + +% Search -> Printer +newpath 210 72 moveto +221 72 234 72 246 72 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 246 76 moveto +256 72 lineto +246 69 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 246 76 moveto +256 72 lineto +246 69 lineto +closepath +stroke +end grestore + +% Printer -> Termast +newpath 316 62 moveto +355 48 430 30 484 58 curveto +518 77 538 117 548 144 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 545 146 moveto +552 154 lineto +552 143 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 545 146 moveto +552 154 lineto +552 143 lineto +closepath +stroke +end grestore + +% Esyntax +gsave 10 dict begin +557 226 36 18 ellipse_path +stroke +gsave 10 dict begin +533 221 moveto +(Esyntax) +[8.4 5.52 6.96 6.96 4.08 6.24 6.96] +xshow +end grestore +end grestore + +% Printer -> Esyntax +newpath 322 71 moveto +370 70 460 72 484 91 curveto +489 95 516 193 520 197 curveto +527 204 532 203 538 204 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 536 207 moveto +547 208 lineto +539 201 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 536 207 moveto +547 208 lineto +539 201 lineto +closepath +stroke +end grestore + +% Ppconstr +gsave 10 dict begin +424 388 37 18 ellipse_path +stroke +gsave 10 dict begin +399 383 moveto +(Ppconstr) +[7.68 6.96 6.24 6.96 6.96 5.28 3.84 4.56] +xshow +end grestore +end grestore + +% Printer -> Ppconstr +newpath 292 90 moveto +300 147 329 319 364 361 curveto +369 367 375 371 382 375 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 380 378 moveto +391 379 lineto +383 372 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 380 378 moveto +391 379 lineto +383 372 lineto +closepath +stroke +end grestore + +% Esyntax -> Extend +newpath 594 226 moveto +602 226 611 226 620 226 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 620 230 moveto +630 226 lineto +620 223 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 620 230 moveto +630 226 lineto +620 223 lineto +closepath +stroke +end grestore + +% Ppconstr -> Pcoq +newpath 454 377 moveto +464 373 475 368 484 361 curveto +506 345 526 322 540 304 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 543 306 moveto +546 296 lineto +537 302 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 543 306 moveto +546 296 lineto +537 302 lineto +closepath +stroke +end grestore + +% Prettyp +gsave 10 dict begin +178 18 33 18 ellipse_path +stroke +gsave 10 dict begin +158 13 moveto +(Prettyp) +[7.68 4.56 6 3.84 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Prettyp -> Printer +newpath 203 30 moveto +218 38 238 47 255 55 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 254 58 moveto +264 60 lineto +257 52 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 254 58 moveto +264 60 lineto +257 52 lineto +closepath +stroke +end grestore + +% Printmod +gsave 10 dict begin +289 18 39 18 ellipse_path +stroke +gsave 10 dict begin +263 13 moveto +(Printmod) +[7.68 4.8 3.84 6.96 3.84 10.8 6.96 6.96] +xshow +end grestore +end grestore + +% Prettyp -> Printmod +newpath 211 18 moveto +220 18 230 18 240 18 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 240 22 moveto +250 18 lineto +240 15 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 240 22 moveto +250 18 lineto +240 15 lineto +closepath +stroke +end grestore + +% G_zsyntax +gsave 10 dict begin +424 172 43 18 ellipse_path +stroke +gsave 10 dict begin +393 167 moveto +(G_zsyntax) +[10.08 6.96 6.24 5.52 6.96 6.96 4.08 6.24 6.96] +xshow +end grestore +end grestore + +% G_zsyntax -> Pcoq +newpath 458 183 moveto +467 188 476 193 484 199 curveto +507 218 501 233 520 253 curveto +523 256 526 259 530 261 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 528 264 moveto +538 267 lineto +532 258 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 528 264 moveto +538 267 lineto +532 258 lineto +closepath +stroke +end grestore + +% G_zsyntax -> Termast +newpath 468 172 moveto +482 172 497 172 511 172 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 511 176 moveto +521 172 lineto +511 169 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 511 176 moveto +521 172 lineto +511 169 lineto +closepath +stroke +end grestore + +% G_zsyntax -> Esyntax +newpath 455 185 moveto +474 193 499 203 520 211 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 518 214 moveto +529 215 lineto +521 208 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 518 214 moveto +529 215 lineto +521 208 lineto +closepath +stroke +end grestore + +% G_string_syntax +gsave 10 dict begin +424 280 59 18 ellipse_path +stroke +gsave 10 dict begin +377 275 moveto +(G_string_syntax) +[10.08 6.96 5.28 3.84 4.8 3.84 6.96 6.96 6.96 5.52 6.96 6.96 4.08 6.24 6.96] +xshow +end grestore +end grestore + +% G_string_syntax -> Pcoq +newpath 484 280 moveto +496 280 509 280 520 280 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 520 284 moveto +530 280 lineto +520 277 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 520 284 moveto +530 280 lineto +520 277 lineto +closepath +stroke +end grestore + +% G_string_syntax -> Esyntax +newpath 460 266 moveto +478 258 501 249 520 242 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 521 245 moveto +529 238 lineto +518 239 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 521 245 moveto +529 238 lineto +518 239 lineto +closepath +stroke +end grestore + +% G_rsyntax +gsave 10 dict begin +424 118 42 18 ellipse_path +stroke +gsave 10 dict begin +394 113 moveto +(G_rsyntax) +[10.08 6.96 4.56 5.52 6.96 6.96 4.08 6.24 6.96] +xshow +end grestore +end grestore + +% G_rsyntax -> Pcoq +newpath 459 128 moveto +468 132 477 138 484 145 curveto +518 183 491 213 520 253 curveto +523 256 526 259 529 262 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 527 265 moveto +537 268 lineto +531 259 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 527 265 moveto +537 268 lineto +531 259 lineto +closepath +stroke +end grestore + +% G_rsyntax -> Termast +newpath 455 131 moveto +474 139 499 149 520 157 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 518 160 moveto +529 161 lineto +521 154 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 518 160 moveto +529 161 lineto +521 154 lineto +closepath +stroke +end grestore + +% G_rsyntax -> Esyntax +newpath 457 129 moveto +467 133 476 139 484 145 curveto +507 164 501 179 520 199 curveto +522 201 525 203 527 205 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 525 208 moveto +535 212 lineto +530 203 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 525 208 moveto +535 212 lineto +530 203 lineto +closepath +stroke +end grestore + +% G_natsyntax +gsave 10 dict begin +424 226 48 18 ellipse_path +stroke +gsave 10 dict begin +388 221 moveto +(G_natsyntax) +[10.08 6.96 6.96 6.24 3.84 5.52 6.96 6.96 4.08 6.24 6.96] +xshow +end grestore +end grestore + +% G_natsyntax -> Pcoq +newpath 457 239 moveto +478 248 504 259 525 266 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 523 269 moveto +534 270 lineto +526 263 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 523 269 moveto +534 270 lineto +526 263 lineto +closepath +stroke +end grestore + +% G_natsyntax -> Termast +newpath 457 213 moveto +476 205 500 195 520 187 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 521 190 moveto +529 183 lineto +518 184 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 521 190 moveto +529 183 lineto +518 184 lineto +closepath +stroke +end grestore + +% G_natsyntax -> Esyntax +newpath 473 226 moveto +485 226 498 226 510 226 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 510 230 moveto +520 226 lineto +510 223 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 510 230 moveto +520 226 lineto +510 223 lineto +closepath +stroke +end grestore + +% G_ascii_syntax +gsave 10 dict begin +424 334 56 18 ellipse_path +stroke +gsave 10 dict begin +380 329 moveto +(G_ascii_syntax) +[10.08 6.96 6.24 5.52 6.24 3.84 3.84 6.96 5.52 6.96 6.96 4.08 6.24 6.96] +xshow +end grestore +end grestore + +% G_ascii_syntax -> Pcoq +newpath 459 320 moveto +479 311 504 301 525 293 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 526 296 moveto +534 289 lineto +523 290 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 526 296 moveto +534 289 lineto +523 290 lineto +closepath +stroke +end grestore + +% G_ascii_syntax -> Esyntax +newpath 462 321 moveto +470 317 478 312 484 307 curveto +507 288 501 273 520 253 curveto +522 251 524 249 527 247 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 529 250 moveto +535 241 lineto +525 244 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 529 250 moveto +535 241 lineto +525 244 lineto +closepath +stroke +end grestore + +% Egrammar +gsave 10 dict begin +424 442 43 18 ellipse_path +stroke +gsave 10 dict begin +394 437 moveto +(Egrammar) +[8.4 7.2 4.56 6.24 10.8 10.8 6.24 4.56] +xshow +end grestore +end grestore + +% Egrammar -> Pcoq +newpath 458 431 moveto +467 427 477 422 484 415 curveto +516 385 537 337 548 308 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 551 309 moveto +551 298 lineto +545 307 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 551 309 moveto +551 298 lineto +545 307 lineto +closepath +stroke +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/dev/doc/preamble.tex b/dev/doc/preamble.tex new file mode 100644 index 00000000..2cd21f02 --- /dev/null +++ b/dev/doc/preamble.tex @@ -0,0 +1,8 @@ +\documentclass[11pt]{article} +\usepackage[latin1]{inputenc} +\usepackage[T1]{fontenc} +\usepackage{ocamlweb} +\pagestyle{ocamlweb} +\usepackage{fullpage} +\usepackage{epsfig} +\begin{document} diff --git a/dev/doc/pretyping.dep.ps b/dev/doc/pretyping.dep.ps new file mode 100644 index 00000000..02d1b8b5 --- /dev/null +++ b/dev/doc/pretyping.dep.ps @@ -0,0 +1,1259 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.2 (Wed Jan 19 21:09:25 UTC 2005) +%%For: (herbelin) Hugo Herbelin +%%Title: G +%%Pages: (atend) +%%BoundingBox: 35 35 577 146 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval + +EncodingVector + dup 306 /AE + dup 301 /Aacute + dup 302 /Acircumflex + dup 304 /Adieresis + dup 300 /Agrave + dup 305 /Aring + dup 303 /Atilde + dup 307 /Ccedilla + dup 311 /Eacute + dup 312 /Ecircumflex + dup 313 /Edieresis + dup 310 /Egrave + dup 315 /Iacute + dup 316 /Icircumflex + dup 317 /Idieresis + dup 314 /Igrave + dup 334 /Udieresis + dup 335 /Yacute + dup 376 /thorn + dup 337 /germandbls + dup 341 /aacute + dup 342 /acircumflex + dup 344 /adieresis + dup 346 /ae + dup 340 /agrave + dup 345 /aring + dup 347 /ccedilla + dup 351 /eacute + dup 352 /ecircumflex + dup 353 /edieresis + dup 350 /egrave + dup 355 /iacute + dup 356 /icircumflex + dup 357 /idieresis + dup 354 /igrave + dup 360 /dcroat + dup 361 /ntilde + dup 363 /oacute + dup 364 /ocircumflex + dup 366 /odieresis + dup 362 /ograve + dup 365 /otilde + dup 370 /oslash + dup 372 /uacute + dup 373 /ucircumflex + dup 374 /udieresis + dup 371 /ugrave + dup 375 /yacute + dup 377 /ydieresis + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 577 146 +%%PageOrientation: Portrait +gsave +35 35 542 111 boxprim clip newpath +36 36 translate +0 0 1 beginpage +0.3600 set_scale +0 0 translate 0 rotate +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font + +% Unification +gsave 10 dict begin +610 118 45 18 ellipse_path +stroke +gsave 10 dict begin +577 113 moveto +(Unification) +[9.6 6.96 3.84 4.8 3.84 6.24 6.24 3.84 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Evarutil +gsave 10 dict begin +728 72 36 18 ellipse_path +stroke +gsave 10 dict begin +705 67 moveto +(Evarutil) +[8.4 6.72 6.24 4.8 6.96 3.84 3.84 3.84] +xshow +end grestore +end grestore + +% Unification -> Evarutil +newpath 643 105 moveto +657 99 674 93 689 87 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 691 90 moveto +699 83 lineto +688 83 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 691 90 moveto +699 83 lineto +688 83 lineto +closepath +stroke +end grestore + +% Pattern +gsave 10 dict begin +728 210 33 18 ellipse_path +stroke +gsave 10 dict begin +708 205 moveto +(Pattern) +[7.44 6.24 3.84 3.84 6.24 4.8 6.96] +xshow +end grestore +end grestore + +% Unification -> Pattern +newpath 631 134 moveto +650 150 680 173 701 189 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 699 192 moveto +709 195 lineto +703 186 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 699 192 moveto +709 195 lineto +703 186 lineto +closepath +stroke +end grestore + +% Retyping +gsave 10 dict begin +839 118 38 18 ellipse_path +stroke +gsave 10 dict begin +813 113 moveto +(Retyping) +[9.12 6 3.84 6.96 6.96 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Unification -> Retyping +newpath 656 118 moveto +695 118 750 118 790 118 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 790 122 moveto +800 118 lineto +790 115 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 790 122 moveto +800 118 lineto +790 115 lineto +closepath +stroke +end grestore + +% Typing +gsave 10 dict begin +839 64 32 18 ellipse_path +stroke +gsave 10 dict begin +819 59 moveto +(Typing) +[6.96 6.96 6.96 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Evarutil -> Typing +newpath 764 69 moveto +775 68 786 67 797 67 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 797 70 moveto +807 66 lineto +797 64 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 797 70 moveto +807 66 lineto +797 64 lineto +closepath +stroke +end grestore + +% Rawterm +gsave 10 dict begin +1109 110 39 18 ellipse_path +stroke +gsave 10 dict begin +1083 105 moveto +(Rawterm) +[9.36 5.76 10.08 3.84 6.24 4.8 10.8] +xshow +end grestore +end grestore + +% Pattern -> Rawterm +newpath 759 216 moveto +816 226 939 239 1024 191 curveto +1049 176 1038 155 1060 138 curveto +1069 131 1077 130 1084 129 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1085 132 moveto +1094 127 lineto +1084 126 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1085 132 moveto +1094 127 lineto +1084 126 lineto +closepath +stroke +end grestore + +% Inductiveops +gsave 10 dict begin +1109 164 49 18 ellipse_path +stroke +gsave 10 dict begin +1073 159 moveto +(Inductiveops) +[4.56 6.96 6.96 6.96 6.24 3.84 3.84 6.48 6.24 6.96 6.96 5.52] +xshow +end grestore +end grestore + +% Retyping -> Inductiveops +newpath 878 120 moveto +915 122 974 126 1024 137 curveto +1037 139 1051 144 1064 148 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1063 151 moveto +1074 151 lineto +1065 145 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1063 151 moveto +1074 151 lineto +1065 145 lineto +closepath +stroke +end grestore + +% Pretype_errors +gsave 10 dict begin +969 72 54 18 ellipse_path +stroke +gsave 10 dict begin +927 67 moveto +(Pretype_errors) +[7.68 4.56 6 3.84 6.96 6.96 6.24 6.96 6.24 5.04 4.56 6.96 4.56 5.52] +xshow +end grestore +end grestore + +% Typing -> Pretype_errors +newpath 871 66 moveto +881 67 893 68 905 68 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 905 71 moveto +915 69 lineto +905 65 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 905 71 moveto +915 69 lineto +905 65 lineto +closepath +stroke +end grestore + +% Pretype_errors -> Inductiveops +newpath 998 87 moveto +1007 92 1016 98 1024 104 curveto +1042 116 1043 124 1060 137 curveto +1063 139 1067 142 1071 144 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1070 147 moveto +1080 149 lineto +1073 141 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1070 147 moveto +1080 149 lineto +1073 141 lineto +closepath +stroke +end grestore + +% Pretype_errors -> Rawterm +newpath 1011 84 moveto +1029 88 1048 94 1065 98 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1064 101 moveto +1075 101 lineto +1066 95 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1064 101 moveto +1075 101 lineto +1066 95 lineto +closepath +stroke +end grestore + +% Tacred +gsave 10 dict begin +728 18 32 18 ellipse_path +stroke +gsave 10 dict begin +709 13 moveto +(Tacred) +[7.44 6.24 6.24 4.56 6.24 6.96] +xshow +end grestore +end grestore + +% Tacred -> Retyping +newpath 748 32 moveto +754 36 759 41 764 45 curveto +783 63 782 73 800 91 curveto +802 93 805 95 808 97 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 806 100 moveto +816 103 lineto +810 94 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 806 100 moveto +816 103 lineto +810 94 lineto +closepath +stroke +end grestore + +% Tacred -> Typing +newpath 754 29 moveto +769 35 787 43 803 49 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 802 53 moveto +813 53 lineto +805 46 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 802 53 moveto +813 53 lineto +805 46 lineto +closepath +stroke +end grestore + +% Cbv +gsave 10 dict begin +1246 41 27 18 ellipse_path +stroke +gsave 10 dict begin +1234 36 moveto +(Cbv) +[9.36 6.48 6.96] +xshow +end grestore +end grestore + +% Tacred -> Cbv +newpath 760 19 moveto +852 23 1111 35 1209 40 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1209 44 moveto +1219 40 lineto +1209 37 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1209 44 moveto +1219 40 lineto +1209 37 lineto +closepath +stroke +end grestore + +% Evd +gsave 10 dict begin +1361 110 27 18 ellipse_path +stroke +gsave 10 dict begin +1349 105 moveto +(Evd) +[8.4 6.96 6.96] +xshow +end grestore +end grestore + +% Cbv -> Evd +newpath 1266 53 moveto +1284 64 1312 80 1332 93 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1331 96 moveto +1341 98 lineto +1334 90 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1331 96 moveto +1341 98 lineto +1334 90 lineto +closepath +stroke +end grestore + +% Reductionops +gsave 10 dict begin +1246 164 51 18 ellipse_path +stroke +gsave 10 dict begin +1207 159 moveto +(Reductionops) +[9.12 6.24 6.96 6.96 6.24 3.84 3.84 6.96 6.96 6.96 6.96 5.52] +xshow +end grestore +end grestore + +% Inductiveops -> Reductionops +newpath 1158 164 moveto +1167 164 1175 164 1184 164 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1184 168 moveto +1194 164 lineto +1184 161 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1184 168 moveto +1194 164 lineto +1184 161 lineto +closepath +stroke +end grestore + +% Reductionops -> Evd +newpath 1277 150 moveto +1294 142 1313 133 1330 125 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1331 128 moveto +1339 121 lineto +1328 122 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1331 128 moveto +1339 121 lineto +1328 122 lineto +closepath +stroke +end grestore + +% Termops +gsave 10 dict begin +1462 110 37 18 ellipse_path +stroke +gsave 10 dict begin +1437 105 moveto +(Termops) +[7.2 6.24 4.8 10.8 6.96 6.96 5.52] +xshow +end grestore +end grestore + +% Evd -> Termops +newpath 1388 110 moveto +1396 110 1405 110 1414 110 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1414 114 moveto +1424 110 lineto +1414 107 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1414 114 moveto +1424 110 lineto +1414 107 lineto +closepath +stroke +end grestore + +% Recordops +gsave 10 dict begin +485 24 43 18 ellipse_path +stroke +gsave 10 dict begin +455 19 moveto +(Recordops) +[9.12 6.24 6.24 6.96 4.32 6.96 6.96 6.96 5.52] +xshow +end grestore +end grestore + +% Classops +gsave 10 dict begin +610 20 38 18 ellipse_path +stroke +gsave 10 dict begin +584 15 moveto +(Classops) +[9.36 3.84 6.24 5.52 5.52 6.96 6.96 5.52] +xshow +end grestore +end grestore + +% Recordops -> Classops +newpath 528 23 moveto +538 22 550 22 561 22 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 561 25 moveto +571 21 lineto +561 19 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 561 25 moveto +571 21 lineto +561 19 lineto +closepath +stroke +end grestore + +% Classops -> Tacred +newpath 649 19 moveto +661 19 674 19 686 19 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 686 23 moveto +696 19 lineto +686 16 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 686 23 moveto +696 19 lineto +686 16 lineto +closepath +stroke +end grestore + +% Rawterm -> Evd +newpath 1148 110 moveto +1196 110 1277 110 1324 110 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1324 114 moveto +1334 110 lineto +1324 107 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1324 114 moveto +1334 110 lineto +1324 107 lineto +closepath +stroke +end grestore + +% Pretyping +gsave 10 dict begin +40 183 40 18 ellipse_path +stroke +gsave 10 dict begin +13 178 moveto +(Pretyping) +[7.68 4.56 6 3.84 6.96 6.96 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Pretyping -> Pattern +newpath 78 189 moveto +121 194 191 202 251 202 curveto +251 202 251 202 485 202 curveto +556 202 636 205 685 208 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 685 212 moveto +695 208 lineto +685 205 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 685 212 moveto +695 208 lineto +685 205 lineto +closepath +stroke +end grestore + +% Cases +gsave 10 dict begin +146 64 30 18 ellipse_path +stroke +gsave 10 dict begin +129 59 moveto +(Cases) +[9.36 6.24 5.52 6.24 5.52] +xshow +end grestore +end grestore + +% Pretyping -> Cases +newpath 53 166 moveto +68 147 93 115 116 91 curveto +118 89 119 88 121 86 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 124 88 moveto +129 79 lineto +119 83 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 124 88 moveto +129 79 lineto +119 83 lineto +closepath +stroke +end grestore + +% Detyping +gsave 10 dict begin +969 164 39 18 ellipse_path +stroke +gsave 10 dict begin +942 159 moveto +(Detyping) +[10.08 6 3.84 6.96 6.96 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Pretyping -> Detyping +newpath 78 177 moveto +121 172 191 164 251 164 curveto +251 164 251 164 728 164 curveto +794 164 870 164 919 164 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 919 168 moveto +929 164 lineto +919 161 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 919 168 moveto +929 164 lineto +919 161 lineto +closepath +stroke +end grestore + +% Indrec +gsave 10 dict begin +251 271 31 18 ellipse_path +stroke +gsave 10 dict begin +233 266 moveto +(Indrec) +[4.56 6.96 6.96 4.56 6.24 6.24] +xshow +end grestore +end grestore + +% Pretyping -> Indrec +newpath 69 195 moveto +83 202 101 209 116 216 curveto +150 230 188 246 216 257 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 214 260 moveto +225 261 lineto +217 254 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 214 260 moveto +225 261 lineto +217 254 lineto +closepath +stroke +end grestore + +% Coercion +gsave 10 dict begin +251 67 39 18 ellipse_path +stroke +gsave 10 dict begin +225 62 moveto +(Coercion) +[9.36 6.96 6.24 4.56 6.24 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Cases -> Coercion +newpath 176 65 moveto +184 65 193 66 202 66 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 202 70 moveto +212 66 lineto +202 63 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 202 70 moveto +212 66 lineto +202 63 lineto +closepath +stroke +end grestore + +% Detyping -> Inductiveops +newpath 1009 164 moveto +1022 164 1036 164 1050 164 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1050 168 moveto +1060 164 lineto +1050 161 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1050 168 moveto +1060 164 lineto +1050 161 lineto +closepath +stroke +end grestore + +% Detyping -> Rawterm +newpath 999 152 moveto +1020 144 1047 133 1069 125 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1070 128 moveto +1079 122 lineto +1068 122 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1070 128 moveto +1079 122 lineto +1068 122 lineto +closepath +stroke +end grestore + +% Indrec -> Inductiveops +newpath 281 276 moveto +325 283 412 294 485 294 curveto +485 294 485 294 839 294 curveto +937 294 1036 225 1082 188 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1085 190 moveto +1090 181 lineto +1080 185 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1085 190 moveto +1090 181 lineto +1080 185 lineto +closepath +stroke +end grestore + +% Matching +gsave 10 dict begin +610 248 40 18 ellipse_path +stroke +gsave 10 dict begin +582 243 moveto +(Matching) +[12.48 6.24 3.84 6 6.96 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Matching -> Pattern +newpath 643 237 moveto +658 232 675 227 689 222 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 690 225 moveto +699 219 lineto +688 219 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 690 225 moveto +699 219 lineto +688 219 lineto +closepath +stroke +end grestore + +% Matching -> Reductionops +newpath 650 250 moveto +696 253 773 256 839 256 curveto +839 256 839 256 969 256 curveto +1059 256 1159 212 1210 184 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1212 187 moveto +1219 179 lineto +1209 181 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1212 187 moveto +1219 179 lineto +1209 181 lineto +closepath +stroke +end grestore + +% Evarconv +gsave 10 dict begin +366 67 40 18 ellipse_path +stroke +gsave 10 dict begin +339 62 moveto +(Evarconv) +[8.4 6.72 6.24 4.56 6.24 6.96 6.48 6.96] +xshow +end grestore +end grestore + +% Evarconv -> Evarutil +newpath 406 68 moveto +474 69 610 71 682 72 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 682 76 moveto +692 72 lineto +682 69 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 682 76 moveto +692 72 lineto +682 69 lineto +closepath +stroke +end grestore + +% Evarconv -> Recordops +newpath 397 56 moveto +411 51 428 45 442 39 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 443 42 moveto +452 36 lineto +441 36 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 443 42 moveto +452 36 lineto +441 36 lineto +closepath +stroke +end grestore + +% Coercion -> Evarconv +newpath 290 67 moveto +299 67 307 67 316 67 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 316 71 moveto +326 67 lineto +316 64 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 316 71 moveto +326 67 lineto +316 64 lineto +closepath +stroke +end grestore + +% Clenv +gsave 10 dict begin +146 118 30 18 ellipse_path +stroke +gsave 10 dict begin +129 113 moveto +(Clenv) +[9.36 3.84 6.24 6.48 6.96] +xshow +end grestore +end grestore + +% Clenv -> Unification +newpath 176 118 moveto +252 118 455 118 554 118 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 554 122 moveto +564 118 lineto +554 115 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 554 122 moveto +564 118 lineto +554 115 lineto +closepath +stroke +end grestore + +% Clenv -> Coercion +newpath 170 107 moveto +183 100 200 93 215 85 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 217 88 moveto +224 80 lineto +214 82 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 217 88 moveto +224 80 lineto +214 82 lineto +closepath +stroke +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/dev/doc/proofs.dep.ps b/dev/doc/proofs.dep.ps new file mode 100644 index 00000000..0e78f422 --- /dev/null +++ b/dev/doc/proofs.dep.ps @@ -0,0 +1,638 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.2 (Wed Jan 19 21:09:25 UTC 2005) +%%For: (herbelin) Hugo Herbelin +%%Title: G +%%Pages: (atend) +%%BoundingBox: 35 35 577 136 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval + +EncodingVector + dup 306 /AE + dup 301 /Aacute + dup 302 /Acircumflex + dup 304 /Adieresis + dup 300 /Agrave + dup 305 /Aring + dup 303 /Atilde + dup 307 /Ccedilla + dup 311 /Eacute + dup 312 /Ecircumflex + dup 313 /Edieresis + dup 310 /Egrave + dup 315 /Iacute + dup 316 /Icircumflex + dup 317 /Idieresis + dup 314 /Igrave + dup 334 /Udieresis + dup 335 /Yacute + dup 376 /thorn + dup 337 /germandbls + dup 341 /aacute + dup 342 /acircumflex + dup 344 /adieresis + dup 346 /ae + dup 340 /agrave + dup 345 /aring + dup 347 /ccedilla + dup 351 /eacute + dup 352 /ecircumflex + dup 353 /edieresis + dup 350 /egrave + dup 355 /iacute + dup 356 /icircumflex + dup 357 /idieresis + dup 354 /igrave + dup 360 /dcroat + dup 361 /ntilde + dup 363 /oacute + dup 364 /ocircumflex + dup 366 /odieresis + dup 362 /ograve + dup 365 /otilde + dup 370 /oslash + dup 372 /uacute + dup 373 /ucircumflex + dup 374 /udieresis + dup 371 /ugrave + dup 375 /yacute + dup 377 /ydieresis + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 577 136 +%%PageOrientation: Portrait +gsave +35 35 542 101 boxprim clip newpath +36 36 translate +0 0 1 beginpage +0.6923 set_scale +0 0 translate 0 rotate +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font + +% Tactic_debug +gsave 10 dict begin +163 72 51 18 ellipse_path +stroke +gsave 10 dict begin +125 67 moveto +(Tactic_debug) +[7.44 6.24 6.24 3.84 3.84 6.24 6.96 6.96 6.24 6.96 6.96 6.96] +xshow +end grestore +end grestore + +% Refiner +gsave 10 dict begin +287 72 34 18 ellipse_path +stroke +gsave 10 dict begin +266 67 moveto +(Refiner) +[9.12 6.24 4.8 3.84 6.96 6.24 4.56] +xshow +end grestore +end grestore + +% Tactic_debug -> Refiner +newpath 214 72 moveto +223 72 233 72 243 72 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 243 76 moveto +253 72 lineto +243 69 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 243 76 moveto +253 72 lineto +243 69 lineto +closepath +stroke +end grestore + +% Logic +gsave 10 dict begin +390 72 30 18 ellipse_path +stroke +gsave 10 dict begin +373 67 moveto +(Logic) +[8.4 6.96 6.96 3.84 6.24] +xshow +end grestore +end grestore + +% Refiner -> Logic +newpath 321 72 moveto +330 72 340 72 350 72 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 350 76 moveto +360 72 lineto +350 69 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 350 76 moveto +360 72 lineto +350 69 lineto +closepath +stroke +end grestore + +% Tacmach +gsave 10 dict begin +163 126 38 18 ellipse_path +stroke +gsave 10 dict begin +137 121 moveto +(Tacmach) +[7.44 6.24 6.24 10.8 6.24 6 6.96] +xshow +end grestore +end grestore + +% Tacmach -> Refiner +newpath 191 114 moveto +209 106 232 96 251 88 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 253 91 moveto +261 84 lineto +250 84 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 253 91 moveto +261 84 lineto +250 84 lineto +closepath +stroke +end grestore + +% Redexpr +gsave 10 dict begin +287 126 36 18 ellipse_path +stroke +gsave 10 dict begin +263 121 moveto +(Redexpr) +[9.12 6.24 6.96 5.76 6.96 6.96 4.56] +xshow +end grestore +end grestore + +% Tacmach -> Redexpr +newpath 202 126 moveto +214 126 227 126 240 126 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 240 130 moveto +250 126 lineto +240 123 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 240 130 moveto +250 126 lineto +240 123 lineto +closepath +stroke +end grestore + +% Proof_trees +gsave 10 dict begin +502 72 45 18 ellipse_path +stroke +gsave 10 dict begin +469 67 moveto +(Proof_trees) +[7.68 4.56 6.96 6.96 4.56 6.96 3.84 4.56 6.24 6.24 5.52] +xshow +end grestore +end grestore + +% Logic -> Proof_trees +newpath 420 72 moveto +428 72 437 72 446 72 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 446 76 moveto +456 72 lineto +446 69 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 446 76 moveto +456 72 lineto +446 69 lineto +closepath +stroke +end grestore + +% Proof_type +gsave 10 dict begin +628 72 44 18 ellipse_path +stroke +gsave 10 dict begin +597 67 moveto +(Proof_type) +[7.68 4.56 6.96 6.96 4.56 6.96 3.84 6.96 6.96 6.24] +xshow +end grestore +end grestore + +% Tacexpr +gsave 10 dict begin +744 72 35 18 ellipse_path +stroke +gsave 10 dict begin +721 67 moveto +(Tacexpr) +[7.44 6.24 6.24 5.76 6.96 6.96 4.56] +xshow +end grestore +end grestore + +% Proof_type -> Tacexpr +newpath 672 72 moveto +680 72 689 72 698 72 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 698 76 moveto +708 72 lineto +698 69 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 698 76 moveto +708 72 lineto +698 69 lineto +closepath +stroke +end grestore + +% Proof_trees -> Proof_type +newpath 548 72 moveto +557 72 565 72 574 72 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 574 76 moveto +584 72 lineto +574 69 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 574 76 moveto +584 72 lineto +574 69 lineto +closepath +stroke +end grestore + +% Pfedit +gsave 10 dict begin +38 112 29 18 ellipse_path +stroke +gsave 10 dict begin +21 107 moveto +(Pfedit) +[7.68 4.08 6.24 6.96 3.84 3.84] +xshow +end grestore +end grestore + +% Pfedit -> Tacmach +newpath 67 115 moveto +81 117 99 118 115 120 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 115 123 moveto +125 122 lineto +116 117 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 115 123 moveto +125 122 lineto +116 117 lineto +closepath +stroke +end grestore + +% Evar_refiner +gsave 10 dict begin +163 18 49 18 ellipse_path +stroke +gsave 10 dict begin +127 13 moveto +(Evar_refiner) +[8.4 6.72 6.24 4.56 6.96 4.56 6.24 4.8 3.84 6.96 6.24 4.56] +xshow +end grestore +end grestore + +% Pfedit -> Evar_refiner +newpath 53 96 moveto +67 82 90 60 112 45 curveto +116 42 120 40 124 37 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 126 40 moveto +133 32 lineto +123 34 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 126 40 moveto +133 32 lineto +123 34 lineto +closepath +stroke +end grestore + +% Evar_refiner -> Refiner +newpath 195 32 moveto +212 40 233 49 251 57 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 249 60 moveto +260 61 lineto +252 54 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 249 60 moveto +260 61 lineto +252 54 lineto +closepath +stroke +end grestore + +% Clenvtac +gsave 10 dict begin +38 45 38 18 ellipse_path +stroke +gsave 10 dict begin +13 40 moveto +(Clenvtac) +[9.36 3.84 6.24 6.48 6.96 4.08 6.24 6.24] +xshow +end grestore +end grestore + +% Clenvtac -> Tacmach +newpath 58 61 moveto +73 72 93 87 112 99 curveto +117 102 123 105 128 108 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 127 111 moveto +137 113 lineto +130 105 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 127 111 moveto +137 113 lineto +130 105 lineto +closepath +stroke +end grestore + +% Clenvtac -> Evar_refiner +newpath 73 37 moveto +85 35 98 32 110 29 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 111 32 moveto +120 27 lineto +110 26 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 111 32 moveto +120 27 lineto +110 26 lineto +closepath +stroke +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/dev/doc/syntax-v8.tex b/dev/doc/syntax-v8.tex new file mode 100644 index 00000000..97973df2 --- /dev/null +++ b/dev/doc/syntax-v8.tex @@ -0,0 +1,1268 @@ + +\documentclass{article} + +\usepackage{verbatim} +\usepackage{amsmath} +\usepackage{amssymb} +\usepackage{array} +\usepackage{fullpage} + +\author{B.~Barras} +\title{Syntax of Coq V8} + +%% Le _ est un caractère normal +\catcode`\_=13 +\let\subscr=_ +\def_{\ifmmode\sb\else\subscr\fi} + +\def\bfbar{\ensuremath{|\hskip -0.22em{}|\hskip -0.24em{}|}} +\def\TERMbar{\bfbar} +\def\TERMbarbar{\bfbar\bfbar} +\def\notv{\text{_}} +\def\infx#1{\notv#1\notv} + + +%% Macros pour les grammaires +\def\GR#1{\text{\large(}#1\text{\large)}} +\def\NT#1{\langle\textit{#1}\rangle} +\def\NTL#1#2{\langle\textit{#1}\rangle_{#2}} +\def\TERM#1{{\bf\textrm{\bf #1}}} +%\def\TERM#1{{\bf\textsf{#1}}} +\def\KWD#1{\TERM{#1}} +\def\ETERM#1{\TERM{#1}} +\def\CHAR#1{\TERM{#1}} + +\def\STAR#1{#1*} +\def\STARGR#1{\GR{#1}*} +\def\PLUS#1{#1+} +\def\PLUSGR#1{\GR{#1}+} +\def\OPT#1{#1?} +\def\OPTGR#1{\GR{#1}?} +%% Tableaux de definition de non-terminaux +\newenvironment{cadre} + {\begin{array}{|c|}\hline\\} + {\\\\\hline\end{array}} +\newenvironment{rulebox} + {$$\begin{cadre}\begin{array}{r@{~}c@{~}l@{}l@{}r}} + {\end{array}\end{cadre}$$} +\def\DEFNT#1{\NT{#1} & ::= &} +\def\EXTNT#1{\NT{#1} & ::= & ... \\&|&} +\def\RNAME#1{(\textsc{#1})} +\def\SEPDEF{\\\\} +\def\nlsep{\\&|&} +\def\nlcont{\\&&} +\newenvironment{rules} + {\begin{center}\begin{rulebox}} + {\end{rulebox}\end{center}} + +\begin{document} + +\maketitle + +\section{Meta notations used in this document} + +Non-terminals are printed between angle brackets (e.g. $\NT{non-terminal}$) and +terminal symbols are printed in bold font (e.g. $\ETERM{terminal}$). Lexemes +are displayed as non-terminals. + +The usual operators on regular expressions: +\begin{center} +\begin{tabular}{l|l} +\hfil notation & \hfil meaning \\ +\hline +$\STAR{regexp}$ & repeat $regexp$ 0 or more times \\ +$\PLUS{regexp}$ & repeat $regexp$ 1 or more times \\ +$\OPT{regexp}$ & $regexp$ is optional \\ +$regexp_1~\mid~regexp_2$ & alternative +\end{tabular} +\end{center} + +Parenthesis are used to group regexps. Beware to distinguish this operator +$\GR{~}$ from the terminals $\ETERM{( )}$, and $\mid$ from terminal +\TERMbar. + +Rules are optionaly annotated in the right margin with: +\begin{itemize} +\item a precedence and associativity (L for left, R for right and N for no associativity), indicating how to solve conflicts; + lower levels are tighter; +\item a rule name. +\end{itemize} +In order to solve some conflicts, a non-terminal may be invoked with a +precedence (notation: $\NTL{entry}{prec}$), meaning that rules with higher +precedence do not apply. + +\section{Lexical conventions} + +Lexical categories are: +\begin{rules} +\DEFNT{ident} + \STARGR{\NT{letter}\mid\CHAR{_}} + \STARGR{\NT{letter}\mid \NT{digit} \mid \CHAR{'} \mid \CHAR{_}} +\SEPDEF +\DEFNT{field} \CHAR{.}\NT{ident} +\SEPDEF +\DEFNT{meta-ident} \CHAR{?}\NT{ident} +\SEPDEF +\DEFNT{num} \PLUS{\NT{digit}} +\SEPDEF +\DEFNT{int} \NT{num} \mid \CHAR{-}\NT{num} +\SEPDEF +\DEFNT{digit} \CHAR{0}-\CHAR{9} +\SEPDEF +\DEFNT{letter} \CHAR{a}-\CHAR{z}\mid\CHAR{A}-\CHAR{Z} + \mid\NT{unicode-letter} + +\SEPDEF +\DEFNT{string} \CHAR{"}~\STARGR{\CHAR{""}\mid\NT{unicode-char-but-"}}~\CHAR{"} +\end{rules} + +Reserved identifiers for the core syntax are: +\begin{quote} +\KWD{as}, +\KWD{cofix}, +\KWD{else}, +\KWD{end}, +\KWD{fix}, +\KWD{for}, +\KWD{forall}, +\KWD{fun}, +\KWD{if}, +\KWD{in}, +\KWD{let}, +\KWD{match}, +\KWD{Prop}, +\KWD{return}, +\KWD{Set}, +\KWD{then}, +\KWD{Type}, +\KWD{with} +\end{quote} + +Symbols used in the core syntax: +$$ \KWD{(} +~~ \KWD{)} +~~ \KWD{\{} +~~ \KWD{\}} +~~ \KWD{:} +~~ \KWD{,} +~~ \Rightarrow +~~ \rightarrow +~~ \KWD{:=} +~~ \KWD{_} +~~ \TERMbar +~~ \KWD{@} +~~ \KWD{\%} +~~ \KWD{.(} +$$ + +Note that \TERM{struct} is not a reserved identifier. + +\section{Syntax of terms} + +\subsection{Core syntax} + +The main entry point of the term grammar is $\NTL{constr}{9}$. When no +conflict can appear, $\NTL{constr}{200}$ is also used as entry point. + +\begin{rules} +\DEFNT{constr} + \NT{binder-constr} &200R~~ &\RNAME{binders} +\nlsep \NT{constr}~\KWD{:}~\NT{constr} &100R &\RNAME{cast} +\nlsep \NT{constr}~\KWD{:}~\NT{binder-constr} &100R &\RNAME{cast'} +\nlsep \NT{constr}~\KWD{$\rightarrow$}~\NT{constr} &80R &\RNAME{arrow} +\nlsep \NT{constr}~\KWD{$\rightarrow$}~\NT{binder-constr} &80R &\RNAME{arrow'} +\nlsep \NT{constr}~\PLUS{\NT{appl-arg}} &10L &\RNAME{apply} +\nlsep \KWD{@}~\NT{reference}~\STAR{\NTL{constr}{9}} &10L &\RNAME{expl-apply} +\nlsep \NT{constr}~\KWD{.(} + ~\NT{reference}~\STAR{\NT{appl-arg}}~\TERM{)} &1L & \RNAME{proj} +\nlsep \NT{constr}~\KWD{.(}~\TERM{@} + ~\NT{reference}~\STAR{\NTL{constr}{9}}~\TERM{)} &1L & \RNAME{expl-proj} +\nlsep \NT{constr} ~ \KWD{\%} ~ \NT{ident} &1L &\RNAME{scope-chg} +\nlsep \NT{atomic-constr} &0 +\nlsep \NT{match-expr} &0 +\nlsep \KWD{(}~\NT{constr}~\KWD{)} &0 +\SEPDEF +\DEFNT{binder-constr} + \KWD{forall}~\NT{binder-list}~\KWD{,}~\NTL{constr}{200} + &&\RNAME{prod} +\nlsep \KWD{fun} ~\NT{binder-list} ~\KWD{$\Rightarrow$}~\NTL{constr}{200} + &&\RNAME{lambda} +\nlsep \NT{fix-expr} +\nlsep \KWD{let}~\NT{ident-with-params} ~\KWD{:=}~\NTL{constr}{200} + ~\KWD{in}~\NTL{constr}{200} &&\RNAME{let} +\nlsep \KWD{let}~\NT{single-fix} ~\KWD{in}~\NTL{constr}{200} + &&\RNAME{rec-let} +\nlsep \KWD{let}~\KWD{(}~\OPT{\NT{let-pattern}}~\KWD{)}~\OPT{\NT{return-type}} + ~\KWD{:=}~\NTL{constr}{200}~\KWD{in}~\NTL{constr}{200} + &&\RNAME{let-case} +\nlsep \KWD{if}~\NT{if-item} + ~\KWD{then}~\NTL{constr}{200}~\KWD{else}~\NTL{constr}{200} + &&\RNAME{if-case} +\SEPDEF +\DEFNT{appl-arg} + \KWD{(}~\NT{ident}~\!\KWD{:=}~\NTL{constr}{200}~\KWD{)} + &&\RNAME{impl-arg} +\nlsep \KWD{(}~\NT{num}~\!\KWD{:=}~\NTL{constr}{200}~\KWD{)} + &&\RNAME{impl-arg} +\nlsep \NTL{constr}{9} +\SEPDEF +\DEFNT{atomic-constr} + \NT{reference} && \RNAME{variables} +\nlsep \NT{sort} && \RNAME{CIC-sort} +\nlsep \NT{num} && \RNAME{number} +\nlsep \KWD{_} && \RNAME{hole} +\nlsep \NT{meta-ident} && \RNAME{meta/evar} +\end{rules} + + + +\begin{rules} +\DEFNT{ident-with-params} + \NT{ident}~\STAR{\NT{binder-let}}~\NT{type-cstr} +\SEPDEF +\DEFNT{binder-list} + \NT{binder}~\STAR{\NT{binder-let}} +\nlsep \PLUS{\NT{name}}~\KWD{:}~\NT{constr} +\SEPDEF +\DEFNT{binder} + \NT{name} &&\RNAME{infer} +\nlsep \KWD{(}~\PLUS{\NT{name}}~\KWD{:}~\NT{constr} + ~\KWD{)} &&\RNAME{binder} +\SEPDEF +\DEFNT{binder-let} + \NT{binder} +\nlsep \KWD{(}~\NT{name}~\NT{type-cstr}~\KWD{:=}~\NT{constr}~\KWD{)} +\SEPDEF +\DEFNT{let-pattern} + \NT{name} +\nlsep \NT{name} ~\KWD{,} ~\NT{let-pattern} +\SEPDEF +\DEFNT{type-cstr} + \OPTGR{\KWD{:}~\NT{constr}} +\SEPDEF +\DEFNT{reference} + \NT{ident} && \RNAME{short-ident} +\nlsep \NT{ident}~\PLUS{\NT{field}} && \RNAME{qualid} +\SEPDEF +\DEFNT{sort} + \KWD{Prop} ~\mid~ \KWD{Set} ~\mid~ \KWD{Type} +\SEPDEF +\DEFNT{name} + \NT{ident} ~\mid~ \KWD{_} +\end{rules} + +\begin{rules} +\DEFNT{fix-expr} + \NT{single-fix} +\nlsep \NT{single-fix}~\PLUSGR{\KWD{with}~\NT{fix-decl}} + ~\KWD{for}~\NT{ident} +\SEPDEF +\DEFNT{single-fix} + \NT{fix-kw}~\NT{fix-decl} +\SEPDEF +\DEFNT{fix-kw} \KWD{fix} ~\mid~ \KWD{cofix} +\SEPDEF +\DEFNT{fix-decl} + \NT{ident}~\STAR{\NT{binder-let}}~\OPT{\NT{annot}}~\NT{type-cstr} + ~\KWD{:=}~\NTL{constr}{200} +\SEPDEF +\DEFNT{annot} + \KWD{\{}~\TERM{struct}~\NT{ident}~\KWD{\}} +\end{rules} + + +\begin{rules} +\DEFNT{match-expr} + \KWD{match}~\NT{match-items}~\OPT{\NT{return-type}}~\KWD{with} + ~\OPT{\TERMbar}~\OPT{\NT{branches}}~\KWD{end} &&\RNAME{match} +\SEPDEF +\DEFNT{match-items} + \NT{match-item} ~\KWD{,} ~\NT{match-items} +\nlsep \NT{match-item} +\SEPDEF +\DEFNT{match-item} + \NTL{constr}{100}~\OPTGR{\KWD{as}~\NT{name}} + ~\OPTGR{\KWD{in}~\NTL{constr}{100}} +\SEPDEF +\DEFNT{return-type} + \KWD{return}~\NTL{constr}{100} +\SEPDEF +\DEFNT{if-item} + \NT{constr}~\OPTGR{\OPTGR{\KWD{as}~\NT{name}}~\NT{return-type}} +\SEPDEF +\DEFNT{branches} + \NT{eqn}~\TERMbar~\NT{branches} +\nlsep \NT{eqn} +\SEPDEF +\DEFNT{eqn} + \NT{pattern} ~\STARGR{\KWD{,}~\NT{pattern}} + ~\KWD{$\Rightarrow$}~\NT{constr} +\SEPDEF +\DEFNT{pattern} + \NT{reference}~\PLUS{\NT{pattern}} &1L~~ & \RNAME{constructor} +\nlsep \NT{pattern}~\KWD{as}~\NT{ident} &1L & \RNAME{alias} +\nlsep \NT{pattern}~\KWD{\%}~\NT{ident} &1L & \RNAME{scope-change} +\nlsep \NT{reference} &0 & \RNAME{pattern-var} +\nlsep \KWD{_} &0 & \RNAME{hole} +\nlsep \NT{num} &0 +\nlsep \KWD{(}~\NT{tuple-pattern}~\KWD{)} +\SEPDEF +\DEFNT{tuple-pattern} + \NT{pattern} +\nlsep \NT{tuple-pattern}~\KWD{,}~\NT{pattern} && \RNAME{pair} +\end{rules} + +\subsection{Notations of the prelude (logic and basic arithmetic)} + +Reserved notations: + +$$ +\begin{array}{l|c} +\text{Symbol} & \text{precedence} \\ +\hline +\infx{,} & 250L \\ +\KWD{IF}~\notv~\KWD{then}~\notv~\KWD{else}~\notv + & 200R \\ +\infx{:} & 100R \\ +\infx{\leftrightarrow} & 95N \\ +\infx{\rightarrow} & 90R \\ +\infx{\vee} & 85R \\ +\infx{\wedge} & 80R \\ +\tilde{}\notv & 75R \\ +\begin{array}[c]{@{}l@{}} + \infx{=}\quad \infx{=}\KWD{$:>$}\notv \quad \infx{=}=\notv + \quad \infx{\neq} \quad \infx{\neq}\KWD{$:>$}\notv \\ + \infx{<}\quad\infx{>} \quad \infx{\leq}\quad\infx{\geq} + \quad \infx{<}<\notv \quad \infx{<}\leq\notv + \quad \infx{\leq}<\notv \quad \infx{\leq}\leq\notv +\end{array} & 70N \\ +\infx{+}\quad\infx{-}\quad -\notv & 50L \\ +\infx{*}\quad\infx{/}\quad /\notv & 40L \\ +\end{array} +$$ + +Existential quantifiers follows the \KWD{forall} notation (with same +precedence 200), but only one quantified variable is allowed. + +\begin{rules} +\EXTNT{binder-constr} + \NT{quantifier-kwd}~\NT{name}~\NT{type-cstr}~\KWD{,}~\NTL{constr}{200} \\ +\SEPDEF +\DEFNT{quantifier-kwd} + \TERM{exists} && \RNAME{ex} +\nlsep \TERM{exists2} && \RNAME{ex2} +\end{rules} + +$$ +\begin{array}{l|c|l} +\text{Symbol} & \text{precedence} \\ +\hline +\notv+\{\notv\} & 50 & \RNAME{sumor} \\ +\{\notv:\notv~|~\notv\} & 0 & \RNAME{sig} \\ +\{\notv:\notv~|~\notv \& \notv \} & 0 & \RNAME{sig2} \\ +\{\notv:\notv~\&~\notv \} & 0 & \RNAME{sigS} \\ +\{\notv:\notv~\&~\notv \& \notv \} & 0 & \RNAME{sigS2} \\ +\{\notv\}+\{\notv\} & 0 & \RNAME{sumbool} \\ +\end{array} +$$ + +%% Strange: nat + {x:nat|x=x} * nat == ( + ) * + +\section{Grammar of tactics} + +\def\tacconstr{\NTL{constr}{9}} +\def\taclconstr{\NTL{constr}{200}} + +Additional symbols are: +$$ \TERM{'} +~~ \KWD{;} +~~ \TERM{()} +~~ \TERMbarbar +~~ \TERM{$\vdash$} +~~ \TERM{[} +~~ \TERM{]} +~~ \TERM{$\leftarrow$} +$$ +Additional reserved keywords are: +$$ \KWD{at} +~~ \TERM{using} +$$ + +\subsection{Basic tactics} + +\begin{rules} +\DEFNT{simple-tactic} + \TERM{intros}~\TERM{until}~\NT{quantified-hyp} +\nlsep \TERM{intros}~\NT{intro-patterns} +\nlsep \TERM{intro}~\OPT{\NT{ident}}~\OPTGR{\TERM{after}~\NT{ident}} +%% +\nlsep \TERM{assumption} +\nlsep \TERM{exact}~\tacconstr +%% +\nlsep \TERM{apply}~\NT{constr-with-bindings} +\nlsep \TERM{elim}~\NT{constr-with-bindings}~\OPT{\NT{eliminator}} +\nlsep \TERM{elimtype}~\tacconstr +\nlsep \TERM{case}~\NT{constr-with-bindings} +\nlsep \TERM{casetype}~\tacconstr +\nlsep \KWD{fix}~\OPT{\NT{ident}}~\NT{num} +\nlsep \KWD{fix}~\NT{ident}~\NT{num}~\KWD{with}~\PLUS{\NT{fix-spec}} +\nlsep \KWD{cofix}~\OPT{\NT{ident}} +\nlsep \KWD{cofix}~\NT{ident}~\PLUS{\NT{fix-spec}} +%% +\nlsep \TERM{cut}~\tacconstr +\nlsep \TERM{assert}~\tacconstr +\nlsep \TERM{assert}~ + \TERM{(}~\NT{ident}~\KWD{:}~\taclconstr~\TERM{)} +\nlsep \TERM{assert}~ + \TERM{(}~\NT{ident}~\KWD{:=}~\taclconstr~\TERM{)} +\nlsep \TERM{pose}~\tacconstr +\nlsep \TERM{pose}~ + \TERM{(}~\NT{ident}~\KWD{:=}~\taclconstr~\TERM{)} +\nlsep \TERM{generalize}~\PLUS{\tacconstr} +\nlsep \TERM{generalize}~\TERM{dependent}~\tacconstr +\nlsep \TERM{set}~\tacconstr~\OPT{\NT{clause}} +\nlsep \TERM{set}~ + \TERM{(}~\NT{ident}~\KWD{:=}~\taclconstr~\TERM{)}~\OPT{\NT{clause}} +\nlsep \TERM{instantiate}~ + \TERM{(}~\NT{num}~\TERM{:=}~\taclconstr~\TERM{)}~\OPT{\NT{clause}} +%% +\nlsep \TERM{specialize}~\OPT{\NT{num}}~\NT{constr-with-bindings} +\nlsep \TERM{lapply}~\tacconstr +%% +\nlsep \TERM{simple}~\TERM{induction}~\NT{quantified-hyp} +\nlsep \TERM{induction}~\NT{induction-arg}~\OPT{\NT{with-names}} + ~\OPT{\NT{eliminator}} +\nlsep \TERM{double}~\TERM{induction}~\NT{quantified-hyp}~\NT{quantified-hyp} +\nlsep \TERM{simple}~\TERM{destruct}~\NT{quantified-hyp} +\nlsep \TERM{destruct}~\NT{induction-arg}~\OPT{\NT{with-names}} + ~\OPT{\NT{eliminator}} +\nlsep \TERM{decompose}~\TERM{record}~\tacconstr +\nlsep \TERM{decompose}~\TERM{sum}~\tacconstr +\nlsep \TERM{decompose}~\TERM{[}~\PLUS{\NT{reference}}~\TERM{]} + ~\tacconstr +%% +\nlsep ... +\end{rules} + +\begin{rules} +\EXTNT{simple-tactic} + \TERM{trivial}~\OPT{\NT{hint-bases}} +\nlsep \TERM{auto}~\OPT{\NT{num}}~\OPT{\NT{hint-bases}} +%% +%%\nlsep \TERM{autotdb}~\OPT{\NT{num}} +%%\nlsep \TERM{cdhyp}~\NT{ident} +%%\nlsep \TERM{dhyp}~\NT{ident} +%%\nlsep \TERM{dconcl} +%%\nlsep \TERM{superauto}~\NT{auto-args} +\nlsep \TERM{auto}~\OPT{\NT{num}}~\TERM{decomp}~\OPT{\NT{num}} +%% +\nlsep \TERM{clear}~\PLUS{\NT{ident}} +\nlsep \TERM{clearbody}~\PLUS{\NT{ident}} +\nlsep \TERM{move}~\NT{ident}~\TERM{after}~\NT{ident} +\nlsep \TERM{rename}~\NT{ident}~\TERM{into}~\NT{ident} +%% +\nlsep \TERM{left}~\OPT{\NT{with-binding-list}} +\nlsep \TERM{right}~\OPT{\NT{with-binding-list}} +\nlsep \TERM{split}~\OPT{\NT{with-binding-list}} +\nlsep \TERM{exists}~\OPT{\NT{binding-list}} +\nlsep \TERM{constructor}~\NT{num}~\OPT{\NT{with-binding-list}} +\nlsep \TERM{constructor}~\OPT{\NT{tactic}} +%% +\nlsep \TERM{reflexivity} +\nlsep \TERM{symmetry}~\OPTGR{\KWD{in}~\NT{ident}} +\nlsep \TERM{transitivity}~\tacconstr +%% +\nlsep \NT{inversion-kwd}~\NT{quantified-hyp}~\OPT{\NT{with-names}}~\OPT{\NT{clause}} +\nlsep \TERM{dependent}~\NT{inversion-kwd}~\NT{quantified-hyp} + ~\OPT{\NT{with-names}}~\OPTGR{\KWD{with}~\tacconstr} +\nlsep \TERM{inversion}~\NT{quantified-hyp}~\TERM{using}~\tacconstr~\OPT{\NT{clause}} +%% +\nlsep \NT{red-expr}~\OPT{\NT{clause}} +\nlsep \TERM{change}~\NT{conversion}~\OPT{\NT{clause}} +\SEPDEF +\DEFNT{red-expr} + \TERM{red} ~\mid~ \TERM{hnf} ~\mid~ \TERM{compute} +\nlsep \TERM{simpl}~\OPT{\NT{pattern-occ}} +\nlsep \TERM{cbv}~\PLUS{\NT{red-flag}} +\nlsep \TERM{lazy}~\PLUS{\NT{red-flag}} +\nlsep \TERM{unfold}~\NT{unfold-occ}~\STARGR{\KWD{,}~\NT{unfold-occ}} +\nlsep \TERM{fold}~\PLUS{\tacconstr} +\nlsep \TERM{pattern}~\NT{pattern-occ}~\STARGR{\KWD{,}~\NT{pattern-occ}} +\SEPDEF +\DEFNT{conversion} + \NT{pattern-occ}~\KWD{with}~\tacconstr +\nlsep \tacconstr +\SEPDEF +\DEFNT{inversion-kwd} + \TERM{inversion} ~\mid~ \TERM{invesion_clear} ~\mid~ + \TERM{simple}~\TERM{inversion} +\end{rules} + +Conflicts exists between integers and constrs. + +\begin{rules} +\DEFNT{quantified-hyp} + \NT{int}~\mid~\NT{ident} +\SEPDEF +\DEFNT{induction-arg} + \NT{int}~\mid~\tacconstr +\SEPDEF +\DEFNT{fix-spec} + \KWD{(}~\NT{ident}~\STAR{\NT{binder}}~\OPT{\NT{annot}} + ~\KWD{:}~\taclconstr~\KWD{)} +\SEPDEF +\DEFNT{intro-patterns} + \STAR{\NT{intro-pattern}} +\SEPDEF +\DEFNT{intro-pattern} + \NT{name} +\nlsep \TERM{[}~\NT{intro-patterns}~\STARGR{\TERMbar~\NT{intro-patterns}} + ~\TERM{]} +\nlsep \KWD{(}~\NT{intro-pattern}~\STARGR{\KWD{,}~\NT{intro-pattern}} + ~\KWD{)} +\SEPDEF +\DEFNT{with-names} +% \KWD{as}~\TERM{[}~\STAR{\NT{ident}}~\STARGR{\TERMbar~\STAR{\NT{ident}}} +% ~\TERM{]} + \KWD{as}~\NT{intro-pattern} +\SEPDEF +\DEFNT{eliminator} + \TERM{using}~\NT{constr-with-bindings} +\SEPDEF +\DEFNT{constr-with-bindings} + % dangling ``with'' of ``fix'' can conflict with ``with'' + \tacconstr~\OPT{\NT{with-binding-list}} +\SEPDEF +\DEFNT{with-binding-list} + \KWD{with}~\NT{binding-list} +\SEPDEF +\DEFNT{binding-list} + \PLUS{\tacconstr} +\nlsep \PLUS{\NT{simple-binding}} +\SEPDEF +\DEFNT{simple-binding} + \KWD{(}~\NT{quantified-hyp}~\KWD{:=}~\taclconstr~\KWD{)} +\SEPDEF +\DEFNT{red-flag} + \TERM{beta} ~\mid~ \TERM{iota} ~\mid~ \TERM{zeta} + ~\mid~ \TERM{delta} ~\mid~ + \TERM{delta}~\OPT{\TERM{-}}~\TERM{[}~\PLUS{\NT{reference}}~\TERM{]} +\SEPDEF +\DEFNT{clause} + \KWD{in}~\TERM{*} +\nlsep \KWD{in}~\TERM{*}~\KWD{$\vdash$}~\OPT{\NT{concl-occ}} +\nlsep \KWD{in}~\OPT{\NT{hyp-ident-list}} ~\KWD{$\vdash$} ~\OPT{\NT{concl-occ}} +\nlsep \KWD{in}~\OPT{\NT{hyp-ident-list}} +\SEPDEF +\DEFNT{hyp-ident-list} + \NT{hyp-ident} +\nlsep \NT{hyp-ident}~\KWD{,}~\NT{hyp-ident-list} +\SEPDEF +\DEFNT{hyp-ident} + \NT{ident} +\nlsep \KWD{(}~\TERM{type}~\TERM{of}~\NT{ident}~\KWD{)} +\nlsep \KWD{(}~\TERM{value}~\TERM{of}~\NT{ident}~\KWD{)} +\SEPDEF +\DEFNT{concl-occ} + \TERM{*} ~\NT{occurrences} +\SEPDEF +\DEFNT{pattern-occ} + \tacconstr ~\NT{occurrences} +\SEPDEF +\DEFNT{unfold-occ} + \NT{reference}~\NT{occurrences} +\SEPDEF +\DEFNT{occurrences} + ~\OPTGR{\KWD{at}~\PLUS{\NT{int}}} +\SEPDEF +\DEFNT{hint-bases} + \KWD{with}~\TERM{*} +\nlsep \KWD{with}~\PLUS{\NT{ident}} +\SEPDEF +\DEFNT{auto-args} + \OPT{\NT{num}}~\OPTGR{\TERM{adding}~\TERM{[}~\PLUS{\NT{reference}} + ~\TERM{]}}~\OPT{\TERM{destructuring}}~\OPTGR{\TERM{using}~\TERM{tdb}} +\end{rules} + +\subsection{Ltac} + +%% Currently, there are conflicts with keyword \KWD{in}: in the following, +%% has the keyword to be associated to \KWD{let} or to tactic \TERM{simpl} ? +%% \begin{center} +%% \texttt{let x := simpl in ...} +%% \end{center} + + +\begin{rules} +\DEFNT{tactic} + \NT{tactic} ~\KWD{;} ~\NT{tactic} &5 &\RNAME{Then} +\nlsep \NT{tactic} ~\KWD{;}~\TERM{[} ~\OPT{\NT{tactic-seq}} ~\TERM{]} + &5 &\RNAME{Then-seq} +%% +\nlsep \TERM{try} ~\NT{tactic} &3R &\RNAME{Try} +\nlsep \TERM{do} ~\NT{int-or-var} ~\NT{tactic} +\nlsep \TERM{repeat} ~\NT{tactic} +\nlsep \TERM{progress} ~\NT{tactic} +\nlsep \TERM{info} ~\NT{tactic} +\nlsep \TERM{abstract}~\NTL{tactic}{2}~\OPTGR{\TERM{using}~\NT{ident}} +%% +\nlsep \NT{tactic} ~\TERMbarbar ~\NT{tactic} &2R &\RNAME{Orelse} +%% +\nlsep \KWD{fun} ~\PLUS{\NT{name}} ~\KWD{$\Rightarrow$} + ~\NT{tactic} &1 &\RNAME{Fun-tac} +\nlsep \KWD{let} ~\NT{let-clauses} ~\KWD{in} ~\NT{tactic} +\nlsep \KWD{let} ~\TERM{rec} ~\NT{rec-clauses} ~\KWD{in} ~\NT{tactic} +\nlsep \KWD{match}~\OPT{\TERM{reverse}}~\TERM{goal}~\KWD{with} + ~\OPT{\TERMbar}~\OPT{\NT{match-goal-rules}} ~\KWD{end} +\nlsep \KWD{match} ~\NT{tactic} ~\KWD{with} + ~\OPT{\TERMbar}~\OPT{\NT{match-rules}} ~\KWD{end} +\nlsep \TERM{first}~\TERM{[} ~\NT{tactic-seq} ~\TERM{]} +\nlsep \TERM{solve}~\TERM{[} ~\NT{tactic-seq} ~\TERM{]} +\nlsep \TERM{idtac} +\nlsep \TERM{fail} ~\OPT{\NT{num}} ~\OPT{\NT{string}} +\nlsep \TERM{constr}~\KWD{:}~\tacconstr +\nlsep \TERM{ipattern}~\KWD{:}~\NT{intro-pattern} +\nlsep \NT{term-ltac} +\nlsep \NT{reference}~\STAR{\NT{tactic-arg}} &&\RNAME{call-tactic} +\nlsep \NT{simple-tactic} +%% +\nlsep \NT{tactic-atom} &0 &\RNAME{atomic} +\nlsep \KWD{(} ~\NT{tactic} ~\KWD{)} +\SEPDEF +\DEFNT{tactic-arg} + \TERM{ltac}~\KWD{:}~\NTL{tactic}{0} +\nlsep \TERM{ipattern}~\KWD{:}~\NT{intro-pattern} +\nlsep \NT{term-ltac} +\nlsep \NT{tactic-atom} +\nlsep \tacconstr +\SEPDEF +\DEFNT{term-ltac} + \TERM{fresh} ~\OPT{\NT{string}} +\nlsep \TERM{context} ~\NT{ident} ~\TERM{[} ~\taclconstr ~\TERM{]} +\nlsep \TERM{eval} ~\NT{red-expr} ~\KWD{in} ~\tacconstr +\nlsep \TERM{type} ~\tacconstr +\SEPDEF +\DEFNT{tactic-atom} + \NT{reference} +\nlsep \TERM{()} +\SEPDEF +\DEFNT{tactic-seq} + \NT{tactic} ~\TERMbar ~\NT{tactic-seq} +\nlsep \NT{tactic} +\end{rules} + + + +\begin{rules} +\DEFNT{let-clauses} + \NT{let-clause} ~\STARGR{\KWD{with}~\NT{let-clause}} +\SEPDEF +\DEFNT{let-clause} + \NT{ident} ~\STAR{\NT{name}} ~\KWD{:=} ~\NT{tactic} +\SEPDEF +\DEFNT{rec-clauses} + \NT{rec-clause} ~\KWD{with} ~\NT{rec-clauses} +\nlsep \NT{rec-clause} +\SEPDEF +\DEFNT{rec-clause} + \NT{ident} ~\PLUS{\NT{name}} ~\KWD{:=} ~\NT{tactic} +\SEPDEF +\DEFNT{match-goal-rules} + \NT{match-goal-rule} +\nlsep \NT{match-goal-rule} ~\TERMbar ~\NT{match-goal-rules} +\SEPDEF +\DEFNT{match-goal-rule} + \NT{match-hyps-list} ~\TERM{$\vdash$} ~\NT{match-pattern} + ~\KWD{$\Rightarrow$} ~\NT{tactic} +\nlsep \KWD{[}~\NT{match-hyps-list} ~\TERM{$\vdash$} ~\NT{match-pattern} + ~\KWD{]}~\KWD{$\Rightarrow$} ~\NT{tactic} +\nlsep \KWD{_} ~\KWD{$\Rightarrow$} ~\NT{tactic} +\SEPDEF +\DEFNT{match-hyps-list} + \NT{match-hyps} ~\KWD{,} ~\NT{match-hyps-list} +\nlsep \NT{match-hyps} +\SEPDEF +\DEFNT{match-hyps} + \NT{name} ~\KWD{:} ~\NT{match-pattern} +\SEPDEF +\DEFNT{match-rules} + \NT{match-rule} +\nlsep \NT{match-rule} ~\TERMbar ~\NT{match-rules} +\SEPDEF +\DEFNT{match-rule} + \NT{match-pattern} ~\KWD{$\Rightarrow$} ~\NT{tactic} +\nlsep \KWD{_} ~\KWD{$\Rightarrow$} ~\NT{tactic} +\SEPDEF +\DEFNT{match-pattern} + \TERM{context}~\OPT{\NT{ident}} + ~\TERM{[} ~\NT{constr-pattern} ~\TERM{]} &&\RNAME{subterm} +\nlsep \NT{constr-pattern} +\SEPDEF +\DEFNT{constr-pattern} + \tacconstr +\end{rules} + +\subsection{Other tactics} + +\begin{rules} +\EXTNT{simple-tactic} + \TERM{rewrite} ~\NT{orient} ~\NT{constr-with-bindings} + ~\OPTGR{\KWD{in}~\NT{ident}} +\nlsep \TERM{replace} ~\tacconstr ~\KWD{with} ~\tacconstr + ~\OPTGR{\KWD{in}~\NT{ident}} +\nlsep \TERM{replace} ~\OPT{\NT{orient}} ~\tacconstr + ~\OPTGR{\KWD{in}~\NT{ident}} +\nlsep \TERM{symplify_eq} ~\OPT{\NT{quantified-hyp}} +\nlsep \TERM{discriminate} ~\OPT{\NT{quantified-hyp}} +\nlsep \TERM{injection} ~\OPT{\NT{quantified-hyp}} +\nlsep \TERM{conditional}~\NT{tactic}~\TERM{rewrite}~\NT{orient} + ~\NT{constr-with-bindings}~\OPTGR{\KWD{in}~\NT{ident}} +\nlsep \TERM{dependent}~\TERM{rewrite}~\NT{orient}~\NT{ident} +\nlsep \TERM{cutrewrite}~\NT{orient}~\tacconstr + ~\OPTGR{\KWD{in}~\NT{ident}} +\nlsep \TERM{absurd} ~\tacconstr +\nlsep \TERM{contradiction} +\nlsep \TERM{autorewrite}~\NT{hint-bases}~\OPTGR{\KWD{using}~\NT{tactic}} +\nlsep \TERM{refine}~\tacconstr +\nlsep \TERM{setoid_replace} ~\tacconstr ~\KWD{with} ~\tacconstr +\nlsep \TERM{setoid_rewrite} ~\NT{orient} ~\tacconstr +\nlsep \TERM{subst} ~\STAR{\NT{ident}} +%% eqdecide.ml4 +\nlsep \TERM{decide}~\TERM{equality} ~\OPTGR{\tacconstr~\tacconstr} +\nlsep \TERM{compare}~\tacconstr~\tacconstr +%% eauto +\nlsep \TERM{eexact}~\tacconstr +\nlsep \TERM{eapply}~\NT{constr-with-bindings} +\nlsep \TERM{prolog}~\TERM{[}~\STAR{\tacconstr}~\TERM{]} + ~\NT{quantified-hyp} +\nlsep \TERM{eauto}~\OPT{\NT{quantified-hyp}}~\OPT{\NT{quantified-hyp}} + ~\NT{hint-bases} +\nlsep \TERM{eautod}~\OPT{\NT{quantified-hyp}}~\OPT{\NT{quantified-hyp}} + ~\NT{hint-bases} +%% tauto +\nlsep \TERM{tauto} +\nlsep \TERM{simplif} +\nlsep \TERM{intuition}~\OPT{\NTL{tactic}{0}} +\nlsep \TERM{linearintuition}~\OPT{\NT{num}} +%% contrib/cc +\nlsep \TERM{cc} +%% contrib/field +\nlsep \TERM{field}~\STAR{\tacconstr} +%% contrib/first-order +\nlsep \TERM{ground}~\OPT{\NTL{tactic}{0}} +\nlsep \TERM{ground}~\OPT{\NTL{tactic}{0}}~\KWD{with}~\PLUS{\NT{reference}} +\nlsep \TERM{ground}~\OPT{\NTL{tactic}{0}}~\KWD{using}~\PLUS{\NT{ident}} +%%\nlsep \TERM{gtauto} +\nlsep \TERM{gintuition}~\OPT{\NTL{tactic}{0}} +%% contrib/fourier +\nlsep \TERM{fourierZ} +%% contrib/funind +\nlsep \TERM{functional}~\TERM{induction}~\tacconstr~\PLUS{\tacconstr} +%% contrib/jprover +\nlsep \TERM{jp}~\OPT{\NT{num}} +%% contrib/omega +\nlsep \TERM{omega} +%% contrib/ring +\nlsep \TERM{quote}~\NT{ident}~\OPTGR{\KWD{[}~\PLUS{\NT{ident}}~\KWD{]}} +\nlsep \TERM{ring}~\STAR{\tacconstr} +%% contrib/romega +\nlsep \TERM{romega} +\SEPDEF +\DEFNT{orient} + \KWD{$\rightarrow$}~\mid~\KWD{$\leftarrow$} +\end{rules} + +\section{Grammar of commands} + +New symbols: +$$ \TERM{.} +~~ \TERM{..} +~~ \TERM{\tt >->} +~~ \TERM{:$>$} +~~ \TERM{$<$:} +$$ + +New keyword: +$$ \KWD{where} +$$ + +\subsection{Classification of commands} + +\begin{rules} +\DEFNT{vernac} + \TERM{Time}~\NT{vernac} &2~~ &\RNAME{Timing} +%% +\nlsep \NT{gallina}~\TERM{.} &1 +\nlsep \NT{command}~\TERM{.} +\nlsep \NT{syntax}~\TERM{.} +\nlsep \TERM{[}~\PLUS{\NT{vernac}}~\TERM{]}~\TERM{.} +%% +\nlsep \OPTGR{\NT{num}~\KWD{:}}~\NT{subgoal-command}~\TERM{.} ~~~&0 +\SEPDEF +\DEFNT{subgoal-command} + \NT{check-command} +\nlsep %\OPT{\TERM{By}}~ + \NT{tactic}~\OPT{\KWD{..}} +\end{rules} + +\subsection{Gallina and extensions} + +\begin{rules} +\DEFNT{gallina} + \NT{thm-token}~\NT{ident}~\STAR{\NT{binder-let}}~\KWD{:}~\NT{constr} +\nlsep \NT{def-token}~\NT{ident}~\NT{def-body} +\nlsep \NT{assum-token}~\NT{assum-list} +\nlsep \NT{finite-token}~\NT{inductive-definition} + ~\STARGR{\KWD{with}~\NT{inductive-definition}} +\nlsep \TERM{Fixpoint}~\NT{fix-decl}~\STARGR{\KWD{with}~\NT{fix-decl}} +\nlsep \TERM{CoFixpoint}~\NT{fix-decl}~\STARGR{\KWD{with}~\NT{fix-decl}} +\nlsep \TERM{Scheme}~\NT{scheme}~\STARGR{\KWD{with}~\NT{scheme}} +%% Extension: record +\nlsep \NT{record-tok}~\OPT{\TERM{$>$}}~\NT{ident}~\STAR{\NT{binder-let}} + ~\KWD{:}~\NT{constr}~\KWD{:=} + ~\OPT{\NT{ident}}~\KWD{\{}~\NT{field-list}~\KWD{\}} +\nlsep \TERM{Ltac}~\NT{ltac-def}~\STARGR{~\TERM{with}~\NT{ltac-def}} +\end{rules} + +\begin{rules} +\DEFNT{thm-token} + \TERM{Theorem} ~\mid~ \TERM{Lemma} ~\mid~ \TERM{Fact} ~\mid~ \TERM{Remark} +\SEPDEF +\DEFNT{def-token} + \TERM{Definition} ~\mid~ \TERM{Let} ~\mid~ + \OPT{\TERM{Local}}~\TERM{SubClass} +\SEPDEF +\DEFNT{assum-token} + \TERM{Hypothesis} ~\mid~ \TERM{Variable} ~\mid~ \TERM{Axiom} ~\mid~ + \TERM{Parameter} +\SEPDEF +\DEFNT{finite-token} + \TERM{Inductive} ~\mid~ \TERM{CoInductive} +\SEPDEF +\DEFNT{record-tok} + \TERM{Record} ~\mid~ \TERM{Structure} +\end{rules} + + +\begin{rules} +\DEFNT{def-body} + \STAR{\NT{binder-let}}~\NT{type-cstr}~\KWD{:=} + ~\OPT{\NT{reduce}}~\NT{constr} +\nlsep \STAR{\NT{binder-let}}~\KWD{:}~\NT{constr} +\SEPDEF +\DEFNT{reduce} + \TERM{Eval}~\NT{red-expr}~\KWD{in} +\SEPDEF +\DEFNT{ltac-def} + \NT{ident}~\STAR{\NT{name}}~\KWD{:=}~\NT{tactic} +\SEPDEF +\DEFNT{rec-definition} + \NT{fix-decl}~\OPT{\NT{decl-notation}} +\SEPDEF +\DEFNT{inductive-definition} + \OPT{\NT{string}}~\NT{ident}~\STAR{\NT{binder-let}}~\KWD{:} + ~\NT{constr}~\KWD{:=} + ~\OPT{\TERMbar}~\OPT{\NT{constructor-list}} + ~\OPT{\NT{decl-notation}} +\SEPDEF +\DEFNT{constructor-list} + \NT{constructor}~\TERMbar~\NT{constructor-list} +\nlsep \NT{constructor} +\SEPDEF +\DEFNT{constructor} + \NT{ident}~\STAR{\NT{binder-let}}\OPTGR{\NT{coerce-kwd}~\NT{constr}} +\SEPDEF +\DEFNT{decl-notation} + \TERM{where}~\NT{string}~\TERM{:=}~\NT{constr} +\SEPDEF +\DEFNT{field-list} + \NT{field}~\KWD{;}~\NT{field-list} +\nlsep \NT{field} +\SEPDEF +\DEFNT{field} + \NT{ident}~\OPTGR{\NT{coerce-kwd}~\NT{constr}} +\nlsep \NT{ident}~\NT{type-cstr-coe}~\KWD{:=}~\NT{constr} +\SEPDEF +\DEFNT{assum-list} + \PLUS{\GR{\KWD{(}~\NT{simple-assum-coe}~\KWD{)}}} +\nlsep \NT{simple-assum-coe} +\SEPDEF +\DEFNT{simple-assum-coe} + \PLUS{\NT{ident}}~\NT{coerce-kwd}~\NT{constr} +\SEPDEF +\DEFNT{coerce-kwd} \TERM{:$>$} ~\mid~ \KWD{:} +\SEPDEF +\DEFNT{type-cstr-coe} \OPTGR{\NT{coerce-kwd}~\NT{constr}} +\SEPDEF +\DEFNT{scheme} + \NT{ident}~\KWD{:=}~\NT{dep-scheme}~\KWD{for}~\NT{reference} + ~\TERM{Sort}~\NT{sort} +\SEPDEF +\DEFNT{dep-scheme} + \TERM{Induction}~\mid~\TERM{Minimality} +\end{rules} + +\subsection{Modules and sections} + +\begin{rules} +\DEFNT{gallina} + \TERM{Module}~\NT{ident}~\STAR{\NT{mbinder}}~\OPT{\NT{of-mod-type}} + ~\OPTGR{\KWD{:=}~\NT{mod-expr}} +\nlsep \TERM{Module}~\KWD{Type}~\NT{ident}~\STAR{\NT{mbinder}} + ~\OPTGR{\KWD{:=}~\NT{mod-type}} +\nlsep \TERM{Declare}~\TERM{Module}~\NT{ident}~\STAR{\NT{mbinder}} + ~\OPT{\NT{of-mod-type}} + ~\OPTGR{\KWD{:=}~\NT{mod-expr}} +\nlsep \TERM{Section}~\NT{ident} +\nlsep \TERM{Chapter}~\NT{ident} +\nlsep \TERM{End}~\NT{ident} +%% +\nlsep \TERM{Require}~\OPT{\NT{export-token}}~\OPT{\NT{specif-token}} + ~\PLUS{\NT{reference}} +\nlsep \TERM{Require}~\OPT{\NT{export-token}}~\OPT{\NT{specif-token}} + ~\NT{string} +\nlsep \TERM{Import}~\PLUS{\NT{reference}} +\nlsep \TERM{Export}~\PLUS{\NT{reference}} +\SEPDEF +\DEFNT{export-token} + \TERM{Import} ~\mid~ \TERM{Export} +\SEPDEF +\DEFNT{specif-token} + \TERM{Implementation} ~\mid~ \TERM{Specification} +\SEPDEF +\DEFNT{mod-expr} + \NT{reference} +\nlsep \NT{mod-expr}~\NT{mod-expr} & L +\nlsep \KWD{(}~\NT{mod-expr}~\KWD{)} +\SEPDEF +\DEFNT{mod-type} + \NT{reference} +\nlsep \NT{mod-type}~\KWD{with}~\NT{with-declaration} +\SEPDEF +\DEFNT{with-declaration} + %on forcera les ( ) + %si exceptionnellemt + %un fixpoint ici + \TERM{Definition}~\NT{ident}~\KWD{:=}~\NTL{constr}{} %{100} +\nlsep \TERM{Module}~\NT{ident}~\KWD{:=}~\NT{reference} +\SEPDEF +\DEFNT{of-mod-type} + \KWD{:}~\NT{mod-type} +\nlsep \TERM{$<$:}~\NT{mod-type} +\SEPDEF +\DEFNT{mbinder} + \KWD{(}~\PLUS{\NT{ident}}~\KWD{:}~\NT{mod-type}~\KWD{)} +\end{rules} + +\begin{rules} +\DEFNT{gallina} + \TERM{Transparent}~\PLUS{\NT{reference}} +\nlsep \TERM{Opaque}~\PLUS{\NT{reference}} +\nlsep \TERM{Canonical}~\TERM{Structure}~\NT{reference}~\OPT{\NT{def-body}} +\nlsep \TERM{Coercion}~\OPT{\TERM{Local}}~\NT{reference}~\NT{def-body} +\nlsep \TERM{Coercion}~\OPT{\TERM{Local}}~\NT{reference}~\KWD{:} + ~\NT{class-rawexpr}~\TERM{$>->$}~\NT{class-rawexpr} +\nlsep \TERM{Identity}~\TERM{Coercion}~\OPT{\TERM{Local}}~\NT{ident}~\KWD{:} + ~\NT{class-rawexpr}~\TERM{$>->$}~\NT{class-rawexpr} +\nlsep \TERM{Implicit}~\TERM{Arguments}~\NT{reference}~\TERM{[}~\STAR{\NT{num}}~\TERM{]} +\nlsep \TERM{Implicit}~\TERM{Arguments}~\NT{reference} +\nlsep \TERM{Implicit}~\KWD{Type}~\PLUS{\NT{ident}}~\KWD{:}~\NT{constr} +\SEPDEF +\DEFNT{command} + \TERM{Comments}~\STAR{\NT{comment}} +\nlsep \TERM{Pwd} +\nlsep \TERM{Cd}~\OPT{\NT{string}} +\nlsep \TERM{Drop} ~\mid~ \TERM{ProtectedLoop} ~\mid~\TERM{Quit} +%% +\nlsep \TERM{Load}~\OPT{\TERM{Verbose}}~\NT{ident} +\nlsep \TERM{Load}~\OPT{\TERM{Verbose}}~\NT{string} +\nlsep \TERM{Declare}~\TERM{ML}~\TERM{Module}~\PLUS{\NT{string}} +\nlsep \TERM{Dump}~\TERM{Universes}~\OPT{\NT{string}} +\nlsep \TERM{Locate}~\NT{locatable} +\nlsep \TERM{Add}~\OPT{\TERM{Rec}}~\TERM{LoadPath}~\NT{string}~\OPT{\NT{as-dirpath}} +\nlsep \TERM{Remove}~\TERM{LoadPath}~\NT{string} +\nlsep \TERM{Add}~\OPT{\TERM{Rec}}~\TERM{ML}~\TERM{Path}~\NT{string} +%% +\nlsep \KWD{Type}~\NT{constr} +\nlsep \TERM{Print}~\NT{printable} +\nlsep \TERM{Print}~\NT{reference} +\nlsep \TERM{Inspect}~\NT{num} +\nlsep \TERM{About}~\NT{reference} +%% +\nlsep \TERM{Search}~\NT{reference}~\OPT{\NT{in-out-modules}} +\nlsep \TERM{SearchPattern}~\NT{constr-pattern}~\OPT{\NT{in-out-modules}} +\nlsep \TERM{SearchRewrite}~\NT{constr-pattern}~\OPT{\NT{in-out-modules}} +\nlsep \TERM{SearchAbout}~\NT{reference}~\OPT{\NT{in-out-modules}} +\nlsep \TERM{SearchAbout}~\TERM{[}~\STAR{\NT{ref-or-string}}~\TERM{]}\OPT{\NT{in-out-modules}} +\nlsep \KWD{Set}~\NT{ident}~\OPT{\NT{opt-value}} +\nlsep \TERM{Unset}~\NT{ident} +\nlsep \KWD{Set}~\NT{ident}~\NT{ident}~\OPT{\NT{opt-value}} +\nlsep \KWD{Set}~\NT{ident}~\NT{ident}~\PLUS{\NT{opt-ref-value}} +\nlsep \TERM{Unset}~\NT{ident}~\NT{ident}~\STAR{\NT{opt-ref-value}} +%% +\nlsep \TERM{Print}~\TERM{Table}~\NT{ident}~\NT{ident} +\nlsep \TERM{Print}~\TERM{Table}~\NT{ident} +\nlsep \TERM{Add}~\NT{ident}~\OPT{\NT{ident}}~\PLUS{\NT{opt-ref-value}} +%% +\nlsep \TERM{Test}~\NT{ident}~\OPT{\NT{ident}}~\STAR{\NT{opt-ref-value}} +%% +\nlsep \TERM{Remove}~\NT{ident}~\OPT{\NT{ident}}~\PLUS{\NT{opt-ref-value}} +\SEPDEF +\DEFNT{check-command} + \TERM{Eval}~\NT{red-expr}~\KWD{in}~\NT{constr} +\nlsep \TERM{Check}~\NT{constr} +\SEPDEF +\DEFNT{ref-or-string} + \NT{reference} +\nlsep \NT{string} +\end{rules} + +\begin{rules} +\DEFNT{printable} + \TERM{Term}~\NT{reference} +\nlsep \TERM{All} +\nlsep \TERM{Section}~\NT{reference} +\nlsep \TERM{Grammar}~\NT{ident} +\nlsep \TERM{LoadPath} +\nlsep \TERM{Module}~\OPT{\KWD{Type}}~\NT{reference} +\nlsep \TERM{Modules} +\nlsep \TERM{ML}~\TERM{Path} +\nlsep \TERM{ML}~\TERM{Modules} +\nlsep \TERM{Graph} +\nlsep \TERM{Classes} +\nlsep \TERM{Coercions} +\nlsep \TERM{Coercion}~\TERM{Paths}~\NT{class-rawexpr}~\NT{class-rawexpr} +\nlsep \TERM{Tables} +% \nlsep \TERM{Proof}~\NT{reference} % Obsolete, useful in V6.3 ?? +\nlsep \TERM{Hint}~\OPT{\NT{reference}} +\nlsep \TERM{Hint}~\TERM{*} +\nlsep \TERM{HintDb}~\NT{ident} +\nlsep \TERM{Scopes} +\nlsep \TERM{Scope}~\NT{ident} +\nlsep \TERM{Visibility}~\OPT{\NT{ident}} +\nlsep \TERM{Implicit}~\NT{reference} +\SEPDEF +\DEFNT{class-rawexpr} + \TERM{Funclass}~\mid~\TERM{Sortclass}~\mid~\NT{reference} +\SEPDEF +\DEFNT{locatable} + \NT{reference} +\nlsep \TERM{File}~\NT{string} +\nlsep \TERM{Library}~\NT{reference} +\nlsep \NT{string} +\SEPDEF +\DEFNT{opt-value} + \NT{ident} ~\mid~ \NT{string} +\SEPDEF +\DEFNT{opt-ref-value} + \NT{reference} ~\mid~ \NT{string} +\SEPDEF +\DEFNT{as-dirpath} + \KWD{as}~\NT{reference} +\SEPDEF +\DEFNT{in-out-modules} + \TERM{inside}~\PLUS{\NT{reference}} +\nlsep \TERM{outside}~\PLUS{\NT{reference}} +\SEPDEF +\DEFNT{comment} + \NT{constr} +\nlsep \NT{string} +\end{rules} + +\subsection{Other commands} + +%% TODO: min/maj pas a jour +\begin{rules} +\EXTNT{command} + \TERM{Debug}~\TERM{On} +\nlsep \TERM{Debug}~\TERM{Off} +%% TODO: vernac +\nlsep \TERM{Add}~\TERM{setoid}~\tacconstr~\tacconstr~\tacconstr +\nlsep \TERM{Add}~\TERM{morphism}~\tacconstr~\KWD{:}~\NT{ident} +\nlsep \TERM{Derive}~\TERM{inversion_clear} + ~\OPT{\NT{num}}~\NT{ident}~\NT{ident} +\nlsep \TERM{Derive}~\TERM{inversion_clear} + ~\NT{ident}~\KWD{with}~\tacconstr~\OPTGR{\TERM{Sort}~\NT{sort}} +\nlsep \TERM{Derive}~\TERM{inversion} + ~\OPT{\NT{num}}~\NT{ident}~\NT{ident} +\nlsep \TERM{Derive}~\TERM{inversion} + ~\NT{ident}~\KWD{with}~\tacconstr~\OPTGR{\TERM{Sort}~\NT{sort}} +\nlsep \TERM{Derive}~\TERM{dependent}~\TERM{inversion_clear} + ~\NT{ident}~\KWD{with}~\tacconstr~\OPTGR{\TERM{Sort}~\NT{sort}} +\nlsep \TERM{Derive}~\TERM{dependent}~\TERM{inversion} + ~\NT{ident}~\KWD{with}~\tacconstr~\OPTGR{\TERM{Sort}~\NT{sort}} +%% Correctness: obsolete ? +%\nlsep Correctness +%\nlsep Global Variable +%% TODO: extraction +\nlsep Extraction ... +%% field +\nlsep \TERM{Add}~\TERM{Field}~\tacconstr~\tacconstr~\tacconstr + ~\tacconstr~\tacconstr~\tacconstr +\nlcont~~~~\tacconstr~\tacconstr~\OPT{\NT{minus-div}} +%% funind +\nlsep \TERM{Functional}~\TERM{Scheme}~\NT{ident}~\KWD{:=} + ~\TERM{Induction}~\KWD{for}~\tacconstr + ~\OPTGR{\KWD{with}~\PLUS{\tacconstr}} +%% ring +\nlsep \TERM{Add}~\TERM{Ring}~\tacconstr~\tacconstr~\tacconstr + ~\tacconstr~\tacconstr~\tacconstr +\nlcont~~~~\tacconstr~\tacconstr~\KWD{[}~\PLUS{\tacconstr}~\KWD{]} +\nlsep \TERM{Add}~\TERM{Semi}~\TERM{Ring}~\tacconstr~\tacconstr~\tacconstr + ~\tacconstr~\tacconstr~\tacconstr +\nlcont~~~~\tacconstr~\KWD{[}~\PLUS{\tacconstr}~\KWD{]} +\nlsep \TERM{Add}~\TERM{Abstract}~\TERM{Ring}~\tacconstr~\tacconstr~\tacconstr + ~\tacconstr~\tacconstr~\tacconstr +\nlcont~~~~\tacconstr~\tacconstr +\nlsep \TERM{Add}~\TERM{Abstract}~\TERM{Semi}~\TERM{Ring}~\tacconstr + ~\tacconstr~\tacconstr~\tacconstr~\tacconstr~\tacconstr +\nlcont~~~~\tacconstr +\nlsep \TERM{Add}~\TERM{Setoid}~\TERM{Ring}~\tacconstr~\tacconstr~\tacconstr + ~\tacconstr~\tacconstr~\tacconstr +\nlcont~~~~\tacconstr~\tacconstr~\tacconstr~\tacconstr~\tacconstr~\tacconstr + ~\tacconstr~\KWD{[}~\PLUS{\tacconstr}~\KWD{]} +\nlsep \TERM{Add}~\TERM{Setoid}~\TERM{Semi}~\TERM{Ring}~\tacconstr~\tacconstr + ~\tacconstr~\tacconstr~\tacconstr~\tacconstr +\nlcont~~~~\tacconstr~\tacconstr~\tacconstr~\tacconstr~\tacconstr + ~\KWD{[}~\PLUS{tacconstr}~\KWD{]} +\SEPDEF +\DEFNT{minus-div} + \KWD{with}~\NT{minus-arg}~\NT{div-arg} +\nlsep \KWD{with}~\NT{div-arg}~\NT{minus-arg} +\SEPDEF +\DEFNT{minus-arg} + \TERM{minus}~\KWD{:=}~\tacconstr +\SEPDEF +\DEFNT{div-arg} + \TERM{div}~\KWD{:=}~\tacconstr +\end{rules} + +\begin{rules} +\EXTNT{command} + \TERM{Write}~\TERM{State}~\NT{ident} +\nlsep \TERM{Write}~\TERM{State}~\NT{string} +\nlsep \TERM{Restore}~\TERM{State}~\NT{ident} +\nlsep \TERM{Restore}~\TERM{State}~\NT{string} +\nlsep \TERM{Reset}~\NT{ident} +\nlsep \TERM{Reset}~\TERM{Initial} +\nlsep \TERM{Back}~\OPT{\NT{num}} +\end{rules} + +\subsection{Proof-editing commands} + +\begin{rules} +\EXTNT{command} + \TERM{Goal}~\NT{constr} +\nlsep \TERM{Proof}~\OPT{\NT{constr}} +\nlsep \TERM{Proof}~\KWD{with}~\NT{tactic} +\nlsep \TERM{Abort}~\OPT{\TERM{All}} +\nlsep \TERM{Abort}~\NT{ident} +\nlsep \TERM{Existential}~\NT{num}~\KWD{:=}~\NT{constr-body} +\nlsep \TERM{Qed} +\nlsep \TERM{Save}~\OPTGR{\NT{thm-token}~\NT{ident}} +\nlsep \TERM{Defined}~\OPT{\NT{ident}} +\nlsep \TERM{Suspend} +\nlsep \TERM{Resume}~\OPT{\NT{ident}} +\nlsep \TERM{Restart} +\nlsep \TERM{Undo}~\OPT{\NT{num}} +\nlsep \TERM{Focus}~\OPT{\NT{num}} +\nlsep \TERM{Unfocus} +\nlsep \TERM{Show}~\OPT{\NT{num}} +\nlsep \TERM{Show}~\TERM{Implicit}~\TERM{Arguments}~\OPT{\NT{num}} +\nlsep \TERM{Show}~\TERM{Node} +\nlsep \TERM{Show}~\TERM{Script} +\nlsep \TERM{Show}~\TERM{Existentials} +\nlsep \TERM{Show}~\TERM{Tree} +\nlsep \TERM{Show}~\TERM{Conjecture} +\nlsep \TERM{Show}~\TERM{Proof} +\nlsep \TERM{Show}~\TERM{Intro} +\nlsep \TERM{Show}~\TERM{Intros} +%% Correctness: obsolete ? +%%\nlsep \TERM{Show}~\TERM{Programs} +\nlsep \TERM{Explain}~\TERM{Proof}~\OPT{\TERM{Tree}}~\STAR{\NT{num}} +%% Go not documented +\nlsep \TERM{Hint}~\OPT{\TERM{Local}}~\NT{hint}~\OPT{\NT{inbases}} +%% PrintConstr not documented +\end{rules} + + +\begin{rules} +\DEFNT{constr-body} + \NT{type-cstr}~\KWD{:=}~\NT{constr} +\SEPDEF +\DEFNT{hint} + \TERM{Resolve}~\PLUS{\NTL{constr}{9}} +\nlsep \TERM{Immediate}~\PLUS{\NTL{constr}{9}} +\nlsep \TERM{Unfold}~\PLUS{\NT{reference}} +\nlsep \TERM{Constructors}~\PLUS{\NT{reference}} +\nlsep \TERM{Extern}~\NT{num}~\NT{constr}~\KWD{$\Rightarrow$}~\NT{tactic} +\nlsep \TERM{Destruct}~\NT{ident}~\KWD{:=}~\NT{num}~\NT{destruct-loc} + ~\NT{constr}~\KWD{$\Rightarrow$}~\NT{tactic} +\nlsep \TERM{Rewrite}~\NT{orient}~\PLUS{\NTL{constr}{9}} + ~\OPTGR{\KWD{using}~\NT{tactic}} +\SEPDEF +\DEFNT{inbases} + \KWD{:}~\PLUS{\NT{ident}} +\SEPDEF +\DEFNT{destruct-loc} + \TERM{Conclusion} +\nlsep \OPT{\TERM{Discardable}}~\TERM{Hypothesis} +\end{rules} + + +\subsection{Syntax extensions} + +\begin{rules} +\DEFNT{syntax} + \TERM{Open}~\TERM{Scope}~\NT{ident} +\nlsep \TERM{Close}~\TERM{Scope}~\NT{ident} +\nlsep \TERM{Delimit}~\TERM{Scope}~\NT{ident}~\KWD{with}~\NT{ident} +\nlsep \TERM{Bind}~\TERM{Scope}~\NT{ident}~\KWD{with}~\PLUS{\NT{class-rawexpr}} +\nlsep \TERM{Arguments}~\TERM{Scope}~\NT{reference} + ~\TERM{[}~\PLUS{\NT{name}}~\TERM{]} +\nlsep \TERM{Infix}~\OPT{\TERM{Local}} %%% ~\NT{prec}~\OPT{\NT{num}} + ~\NT{string}~\KWD{:=}~\NT{reference}~\OPT{\NT{modifiers}} + ~\OPT{\NT{in-scope}} +\nlsep \TERM{Notation}~\OPT{\TERM{Local}}~\NT{string}~\KWD{:=}~\NT{constr} + ~\OPT{\NT{modifiers}}~\OPT{\NT{in-scope}} +\nlsep \TERM{Notation}~\OPT{\TERM{Local}}~\NT{ident}~\KWD{:=}~\NT{constr} + ~\OPT{\KWD{(}\TERM{only~\TERM{parsing}\KWD{)}}} +\nlsep \TERM{Reserved}~\TERM{Notation}~\OPT{\TERM{Local}}~\NT{string} + ~\OPT{\NT{modifiers}} +\nlsep \TERM{Tactic}~\TERM{Notation}~\NT{string}~\STAR{\NT{tac-production}} + ~\KWD{:=}~\NT{tactic} +\SEPDEF +\DEFNT{modifiers} + \KWD{(}~\NT{mod-list}~\KWD{)} +\SEPDEF +\DEFNT{mod-list} + \NT{modifier} +\nlsep \NT{modifier}~\KWD{,}~\NT{mod-list} +\SEPDEF +\DEFNT{modifier} + \NT{ident}~\KWD{at}~\NT{num} +\nlsep \NT{ident}~\STARGR{\KWD{,}~\NT{ident}}~\KWD{at}~\NT{num} +\nlsep \KWD{at}~\TERM{next}~\TERM{level} +\nlsep \KWD{at}~\TERM{level}~\NT{num} +\nlsep \TERM{left}~\TERM{associativity} +\nlsep \TERM{right}~\TERM{associativity} +\nlsep \TERM{no}~\TERM{associativity} +\nlsep \NT{ident}~\NT{syntax-entry} +\nlsep \TERM{only}~\TERM{parsing} +\nlsep \TERM{format}~\NT{string} +\SEPDEF +\DEFNT{in-scope} + \KWD{:}~\NT{ident} +\SEPDEF +\DEFNT{syntax-entry} + \TERM{ident}~\mid~\TERM{global}~\mid~\TERM{bigint} +\SEPDEF +\DEFNT{tac-production} + \NT{string} +\nlsep \NT{ident}~\TERM{(}~\NT{ident}~\TERM{)} +%%% \SEPDEF +%%% \DEFNT{prec} +%%% \TERM{LeftA}~\mid~\TERM{RightA}~\mid~\TERM{NonA} +\end{rules} + +\end{document} diff --git a/dev/doc/syntax.mly b/dev/doc/syntax.mly new file mode 100644 index 00000000..bfc7d5cc --- /dev/null +++ b/dev/doc/syntax.mly @@ -0,0 +1,224 @@ +%{ +open Ast +open Parse +%} + +%token <string> META INT IDENT +%token <string> OPER +%token LPAR RPAR BAR COMMA COLON BANG FUN DOT RARROW LET COLONEQ IN IF +%token THEN ELSE EVAL AT FOR PROP SET TYPE WILDCARD FIX +%token COFIX MATCH WITH END AND LBRACE RBRACE STRUCT AS SIMPL PERCENT +%token EOF + +%start main +%type <Ast.constr_ast> main + +%start constr +%type <Ast.constr_ast> constr + +%start simple_constr +%type <Ast.constr_ast> simple_constr + +%% + +main: + constr EOF { $1 } +; + + +paren_constr: + constr COMMA paren_constr { Pair($1,$3) } + | constr { $1 } +; + +constr: + binder_constr { $1 } + | oper_constr { close_stack $1 } +; + +binder_constr: + BANG ne_binders DOT constr { Prod($2, $4) } + | FUN ne_binders type_cstr RARROW constr { Lambda($2,mk_cast $5 $3) } + | LET IDENT binders type_cstr COLONEQ constr IN constr + { Let($2,mk_lambda $3 (mk_cast $6 $4),$8) } + | LET LPAR comma_binders RPAR COLONEQ constr IN constr + { LetCase($3,$6,$8) } + | IF constr THEN constr ELSE constr { IfCase($2,$4,$6) } + | fix_constr { $1 } + | EVAL rfun IN constr { Eval($2,$4) } +; + +comma_binders: + ne_comma_binders { $1 } + | { [] } +; + +ne_comma_binders: + binder COMMA ne_comma_binders { $1 :: $3 } + | binder { [$1] } +; + +rfun: + SIMPL { Simpl } +; + + +/* 2 Conflits shift/reduce */ +oper_constr: + oper_constr oper appl_constr + { parse_term $3 (parse_oper $2 $1) } + | oper_constr oper binder_constr + { parse_term $3 (parse_oper $2 $1) } + | oper_constr oper { parse_oper $2 $1 } + | { empty } + | appl_constr { parse_term $1 empty } +; + +oper: + OPER {$1} + | COLON {":"} +; + +appl_constr: + simple_constr ne_appl_args { Appl($1,$2) } + | AT global simple_constrs { ApplExpl($2,$3) } + | simple_constr { $1 } +; + +appl_arg: + AT INT COLONEQ simple_constr { (Some $2,$4) } + | simple_constr { (None,$1) } +; + +ne_appl_args: + appl_arg { [$1] } + | appl_arg ne_appl_args { $1::$2 } +; + +simple_constr: + atomic_constr { $1 } + | match_constr { $1 } + | LPAR paren_constr RPAR { $2 } + | simple_constr PERCENT IDENT { Scope($3,$1) } +; + +simple_constrs: + simple_constr simple_constrs { $1::$2 } + | { [] } +; + +atomic_constr: + global { Qualid $1 } + | PROP { Prop } + | SET { Set } + | TYPE { Type } + | INT { Int $1 } + | WILDCARD { Hole } + | META { Meta $1 } +; + +global: + IDENT DOT global { $1 :: $3 } + | IDENT { [$1] } +; + +/* Conflit normal */ +fix_constr: + fix_kw fix_decl + { let (id,_,_,_,_ as fx) = $2 in Fixp($1,[fx],id) } + | fix_kw fix_decl fix_decls FOR IDENT { Fixp($1, $2::$3, $5) } +; + +fix_kw: FIX {Fix} | COFIX {CoFix} +; + +fix_decl: + IDENT binders type_cstr annot COLONEQ constr { ($1,$2,$3,$4,$6) } +; + +fix_decls: + AND fix_decl fix_decls { $2::$3 } + | AND fix_decl { [$2] } +; + +annot: + LBRACE STRUCT IDENT RBRACE { Some $3 } + | { None } +; + +match_constr: + MATCH case_items case_type WITH branches END { Match($2,$3,$5) } +; + +case_items: + case_item { [$1] } + | case_item COMMA case_items { $1::$3 } +; + +case_item: + constr pred_pattern { ($1,$2) } +; + +case_type: + RARROW constr { Some $2 } + | { None } +; + +pred_pattern: + AS IDENT COLON constr { (Some $2, Some $4) } + | AS IDENT { (Some $2, None) } + | COLON constr { (None, Some $2) } + | { (None,None) } +; + +branches: + BAR branch_list { $2 } + | branch_list { $1 } + | { [] } +; + +branch_list: + patterns RARROW constr { [$1, $3] } + | patterns RARROW constr BAR branch_list { ($1,$3)::$5 } +; + +patterns: + pattern { [$1] } + | pattern COMMA patterns { $1::$3 } +; + +pattern: + pattern AS IDENT { PatAs($1,$3) } + | pattern COLON constr { PatType($1,$3) } + | IDENT simple_patterns { PatConstr($1,$2) } + | simple_pattern { $1 } +; + +simple_pattern: + IDENT { PatVar $1 } + | LPAR pattern RPAR { $2 } +; + +simple_patterns: + simple_pattern { [$1] } + | simple_pattern simple_patterns { $1::$2 } +; + +binder: + IDENT { ($1,Hole) } + | LPAR IDENT type_cstr RPAR { ($2,$3) } +; + +binders: + ne_binders { $1 } + | { [] } + +ne_binders: + binder { [$1] } + | binder ne_binders { $1::$2 } +; + +type_cstr: + COLON constr { $2 } + | { Hole } +; diff --git a/dev/doc/tactics.dep.ps b/dev/doc/tactics.dep.ps new file mode 100644 index 00000000..f4de22b7 --- /dev/null +++ b/dev/doc/tactics.dep.ps @@ -0,0 +1,991 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.2 (Wed Jan 19 21:09:25 UTC 2005) +%%For: (herbelin) Hugo Herbelin +%%Title: G +%%Pages: (atend) +%%BoundingBox: 35 35 577 165 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval + +EncodingVector + dup 306 /AE + dup 301 /Aacute + dup 302 /Acircumflex + dup 304 /Adieresis + dup 300 /Agrave + dup 305 /Aring + dup 303 /Atilde + dup 307 /Ccedilla + dup 311 /Eacute + dup 312 /Ecircumflex + dup 313 /Edieresis + dup 310 /Egrave + dup 315 /Iacute + dup 316 /Icircumflex + dup 317 /Idieresis + dup 314 /Igrave + dup 334 /Udieresis + dup 335 /Yacute + dup 376 /thorn + dup 337 /germandbls + dup 341 /aacute + dup 342 /acircumflex + dup 344 /adieresis + dup 346 /ae + dup 340 /agrave + dup 345 /aring + dup 347 /ccedilla + dup 351 /eacute + dup 352 /ecircumflex + dup 353 /edieresis + dup 350 /egrave + dup 355 /iacute + dup 356 /icircumflex + dup 357 /idieresis + dup 354 /igrave + dup 360 /dcroat + dup 361 /ntilde + dup 363 /oacute + dup 364 /ocircumflex + dup 366 /odieresis + dup 362 /ograve + dup 365 /otilde + dup 370 /oslash + dup 372 /uacute + dup 373 /ucircumflex + dup 374 /udieresis + dup 371 /ugrave + dup 375 /yacute + dup 377 /ydieresis + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 577 165 +%%PageOrientation: Portrait +gsave +35 35 542 130 boxprim clip newpath +36 36 translate +0 0 1 beginpage +0.4696 set_scale +0 0 translate 0 rotate +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font + +% Extraargs +gsave 10 dict begin +483 110 40 18 ellipse_path +stroke +gsave 10 dict begin +455 105 moveto +(Extraargs) +[8.4 6.96 3.84 4.56 6.24 6.24 4.32 6.96 5.52] +xshow +end grestore +end grestore + +% Setoid_replace +gsave 10 dict begin +615 64 54 18 ellipse_path +stroke +gsave 10 dict begin +573 59 moveto +(Setoid_replace) +[7.68 6 3.84 6.96 3.84 6.96 6.96 4.56 6.24 6.96 3.84 6.24 6.24 6.24] +xshow +end grestore +end grestore + +% Extraargs -> Setoid_replace +newpath 515 99 moveto +531 93 550 87 567 81 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 569 84 moveto +577 77 lineto +566 77 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 569 84 moveto +577 77 lineto +566 77 lineto +closepath +stroke +end grestore + +% Tactics +gsave 10 dict begin +884 110 33 18 ellipse_path +stroke +gsave 10 dict begin +864 105 moveto +(Tactics) +[7.44 6.24 6.24 3.84 3.84 6.24 5.52] +xshow +end grestore +end grestore + +% Setoid_replace -> Tactics +newpath 669 66 moveto +709 68 764 72 810 83 curveto +823 85 837 90 848 94 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 847 98 moveto +858 98 lineto +850 91 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 847 98 moveto +858 98 lineto +850 91 lineto +closepath +stroke +end grestore + +% Termdn +gsave 10 dict begin +998 256 35 18 ellipse_path +stroke +gsave 10 dict begin +976 251 moveto +(Termdn) +[7.2 6.24 4.8 10.8 6.96 6.96] +xshow +end grestore +end grestore + +% Dn +gsave 10 dict begin +1112 256 27 18 ellipse_path +stroke +gsave 10 dict begin +1102 251 moveto +(Dn) +[10.08 6.96] +xshow +end grestore +end grestore + +% Termdn -> Dn +newpath 1033 256 moveto +1047 256 1061 256 1075 256 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1075 260 moveto +1085 256 lineto +1075 253 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1075 260 moveto +1085 256 lineto +1075 253 lineto +closepath +stroke +end grestore + +% Hipattern +gsave 10 dict begin +998 110 40 18 ellipse_path +stroke +gsave 10 dict begin +971 105 moveto +(Hipattern) +[10.08 3.84 6.96 6.24 3.84 3.84 6.24 4.8 6.96] +xshow +end grestore +end grestore + +% Tactics -> Hipattern +newpath 917 110 moveto +927 110 938 110 948 110 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 948 114 moveto +958 110 lineto +948 107 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 948 114 moveto +958 110 lineto +948 107 lineto +closepath +stroke +end grestore + +% Tacticals +gsave 10 dict begin +1112 110 38 18 ellipse_path +stroke +gsave 10 dict begin +1087 105 moveto +(Tacticals) +[7.44 6.24 6.24 3.84 3.84 6.24 6.24 3.84 5.52] +xshow +end grestore +end grestore + +% Hipattern -> Tacticals +newpath 1038 110 moveto +1047 110 1055 110 1064 110 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1064 114 moveto +1074 110 lineto +1064 107 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1064 114 moveto +1074 110 lineto +1064 107 lineto +closepath +stroke +end grestore + +% Tacinterp +gsave 10 dict begin +170 191 39 18 ellipse_path +stroke +gsave 10 dict begin +143 186 moveto +(Tacinterp) +[7.44 6.24 6.24 3.84 6.96 3.84 6.24 4.8 6.96] +xshow +end grestore +end grestore + +% Auto +gsave 10 dict begin +483 218 27 18 ellipse_path +stroke +gsave 10 dict begin +468 213 moveto +(Auto) +[9.6 6.96 3.84 6.96] +xshow +end grestore +end grestore + +% Tacinterp -> Auto +newpath 209 194 moveto +269 200 386 210 445 215 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 445 218 moveto +455 216 lineto +445 212 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 445 218 moveto +455 216 lineto +445 212 lineto +closepath +stroke +end grestore + +% Leminv +gsave 10 dict begin +281 166 35 18 ellipse_path +stroke +gsave 10 dict begin +259 161 moveto +(Leminv) +[8.4 6.24 10.8 3.84 6.48 6.96] +xshow +end grestore +end grestore + +% Tacinterp -> Leminv +newpath 205 183 moveto +216 181 228 178 239 175 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 240 178 moveto +249 173 lineto +239 172 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 240 178 moveto +249 173 lineto +239 172 lineto +closepath +stroke +end grestore + +% Hiddentac +gsave 10 dict begin +615 164 42 18 ellipse_path +stroke +gsave 10 dict begin +585 159 moveto +(Hiddentac) +[10.08 3.84 6.96 6.96 6.24 6.96 4.08 6.24 6.24] +xshow +end grestore +end grestore + +% Auto -> Hiddentac +newpath 507 208 moveto +526 200 553 189 574 181 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 576 184 moveto +584 177 lineto +573 177 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 576 184 moveto +584 177 lineto +573 177 lineto +closepath +stroke +end grestore + +% Dhyp +gsave 10 dict begin +615 218 29 18 ellipse_path +stroke +gsave 10 dict begin +599 213 moveto +(Dhyp) +[10.08 6.48 6.96 6.96] +xshow +end grestore +end grestore + +% Auto -> Dhyp +newpath 511 218 moveto +530 218 555 218 576 218 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 576 222 moveto +586 218 lineto +576 215 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 576 222 moveto +586 218 lineto +576 215 lineto +closepath +stroke +end grestore + +% Inv +gsave 10 dict begin +379 164 27 18 ellipse_path +stroke +gsave 10 dict begin +369 159 moveto +(Inv) +[4.56 6.48 6.96] +xshow +end grestore +end grestore + +% Leminv -> Inv +newpath 316 165 moveto +324 165 333 165 342 165 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 342 169 moveto +352 165 lineto +342 162 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 342 169 moveto +352 165 lineto +342 162 lineto +closepath +stroke +end grestore + +% Refine +gsave 10 dict begin +758 110 32 18 ellipse_path +stroke +gsave 10 dict begin +739 105 moveto +(Refine) +[9.12 6.24 4.8 3.84 6.96 6.24] +xshow +end grestore +end grestore + +% Refine -> Tactics +newpath 790 110 moveto +805 110 824 110 841 110 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 841 114 moveto +851 110 lineto +841 107 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 841 114 moveto +851 110 lineto +841 107 lineto +closepath +stroke +end grestore + +% Nbtermdn +gsave 10 dict begin +758 256 42 18 ellipse_path +stroke +gsave 10 dict begin +729 251 moveto +(Nbtermdn) +[10.08 6.96 3.84 6.24 4.8 10.8 6.96 6.96] +xshow +end grestore +end grestore + +% Btermdn +gsave 10 dict begin +884 256 38 18 ellipse_path +stroke +gsave 10 dict begin +859 251 moveto +(Btermdn) +[9.36 3.84 6.24 4.8 10.8 6.96 6.96] +xshow +end grestore +end grestore + +% Nbtermdn -> Btermdn +newpath 800 256 moveto +812 256 824 256 836 256 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 836 260 moveto +846 256 lineto +836 253 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 836 260 moveto +846 256 lineto +836 253 lineto +closepath +stroke +end grestore + +% Btermdn -> Termdn +newpath 922 256 moveto +932 256 943 256 953 256 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 953 260 moveto +963 256 lineto +953 253 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 953 260 moveto +963 256 lineto +953 253 lineto +closepath +stroke +end grestore + +% Elim +gsave 10 dict begin +483 164 27 18 ellipse_path +stroke +gsave 10 dict begin +468 159 moveto +(Elim) +[8.4 3.84 3.84 10.8] +xshow +end grestore +end grestore + +% Inv -> Elim +newpath 406 164 moveto +418 164 432 164 445 164 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 445 168 moveto +455 164 lineto +445 161 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 445 168 moveto +455 164 lineto +445 161 lineto +closepath +stroke +end grestore + +% Equality +gsave 10 dict begin +483 56 37 18 ellipse_path +stroke +gsave 10 dict begin +459 51 moveto +(Equality) +[8.4 6.72 6.96 6.24 3.84 3.84 3.84 6.96] +xshow +end grestore +end grestore + +% Inv -> Equality +newpath 390 147 moveto +401 130 421 102 442 83 curveto +445 80 448 78 451 76 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 453 79 moveto +459 70 lineto +449 73 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 453 79 moveto +459 70 lineto +449 73 lineto +closepath +stroke +end grestore + +% Elim -> Hiddentac +newpath 511 164 moveto +526 164 545 164 562 164 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 562 168 moveto +572 164 lineto +562 161 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 562 168 moveto +572 164 lineto +562 161 lineto +closepath +stroke +end grestore + +% Equality -> Setoid_replace +newpath 520 58 moveto +530 59 540 60 551 60 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 551 63 moveto +561 61 lineto +551 57 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 551 63 moveto +561 61 lineto +551 57 lineto +closepath +stroke +end grestore + +% Evar_tactics +gsave 10 dict begin +758 164 48 18 ellipse_path +stroke +gsave 10 dict begin +722 159 moveto +(Evar_tactics) +[8.4 6.72 6.24 4.56 6.96 4.08 6.24 6.24 3.84 3.84 6.24 5.52] +xshow +end grestore +end grestore + +% Hiddentac -> Evar_tactics +newpath 658 164 moveto +671 164 685 164 699 164 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 699 168 moveto +709 164 lineto +699 161 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 699 168 moveto +709 164 lineto +699 161 lineto +closepath +stroke +end grestore + +% Evar_tactics -> Tactics +newpath 790 150 moveto +808 142 830 132 849 125 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 850 128 moveto +858 121 lineto +847 122 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 850 128 moveto +858 121 lineto +847 122 lineto +closepath +stroke +end grestore + +% Dhyp -> Tactics +newpath 644 219 moveto +684 220 756 217 810 191 curveto +844 175 855 163 872 137 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 875 138 moveto +877 128 lineto +869 135 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 875 138 moveto +877 128 lineto +869 135 lineto +closepath +stroke +end grestore + +% Dhyp -> Nbtermdn +newpath 642 225 moveto +662 230 689 238 712 244 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 712 247 moveto +722 246 lineto +713 241 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 712 247 moveto +722 246 lineto +713 241 lineto +closepath +stroke +end grestore + +% Contradiction +gsave 10 dict begin +758 18 51 18 ellipse_path +stroke +gsave 10 dict begin +719 13 moveto +(Contradiction) +[9.36 6.96 6.96 3.84 4.56 6.24 6.96 3.84 6.24 3.84 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Contradiction -> Tactics +newpath 784 34 moveto +793 39 802 44 810 50 curveto +827 62 845 76 859 88 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 857 91 moveto +867 95 lineto +862 86 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 857 91 moveto +867 95 lineto +862 86 lineto +closepath +stroke +end grestore + +% Autorewrite +gsave 10 dict begin +47 191 47 18 ellipse_path +stroke +gsave 10 dict begin +13 186 moveto +(Autorewrite) +[9.6 6.96 3.84 6.96 4.56 5.76 10.08 4.8 3.84 3.84 6.24] +xshow +end grestore +end grestore + +% Autorewrite -> Tacinterp +newpath 94 191 moveto +102 191 111 191 120 191 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 120 195 moveto +130 191 lineto +120 188 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 120 195 moveto +130 191 lineto +120 188 lineto +closepath +stroke +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/dev/doc/toplevel.dep.ps b/dev/doc/toplevel.dep.ps new file mode 100644 index 00000000..e0355aac --- /dev/null +++ b/dev/doc/toplevel.dep.ps @@ -0,0 +1,971 @@ +%!PS-Adobe-2.0 +%%Creator: dot version 2.2 (Wed Jan 19 21:09:25 UTC 2005) +%%For: (herbelin) Hugo Herbelin +%%Title: G +%%Pages: (atend) +%%BoundingBox: 35 35 577 166 +%%EndComments +save +%%BeginProlog +/DotDict 200 dict def +DotDict begin + +/setupLatin1 { +mark +/EncodingVector 256 array def + EncodingVector 0 + +ISOLatin1Encoding 0 255 getinterval putinterval + +EncodingVector + dup 306 /AE + dup 301 /Aacute + dup 302 /Acircumflex + dup 304 /Adieresis + dup 300 /Agrave + dup 305 /Aring + dup 303 /Atilde + dup 307 /Ccedilla + dup 311 /Eacute + dup 312 /Ecircumflex + dup 313 /Edieresis + dup 310 /Egrave + dup 315 /Iacute + dup 316 /Icircumflex + dup 317 /Idieresis + dup 314 /Igrave + dup 334 /Udieresis + dup 335 /Yacute + dup 376 /thorn + dup 337 /germandbls + dup 341 /aacute + dup 342 /acircumflex + dup 344 /adieresis + dup 346 /ae + dup 340 /agrave + dup 345 /aring + dup 347 /ccedilla + dup 351 /eacute + dup 352 /ecircumflex + dup 353 /edieresis + dup 350 /egrave + dup 355 /iacute + dup 356 /icircumflex + dup 357 /idieresis + dup 354 /igrave + dup 360 /dcroat + dup 361 /ntilde + dup 363 /oacute + dup 364 /ocircumflex + dup 366 /odieresis + dup 362 /ograve + dup 365 /otilde + dup 370 /oslash + dup 372 /uacute + dup 373 /ucircumflex + dup 374 /udieresis + dup 371 /ugrave + dup 375 /yacute + dup 377 /ydieresis + +% Set up ISO Latin 1 character encoding +/starnetISO { + dup dup findfont dup length dict begin + { 1 index /FID ne { def }{ pop pop } ifelse + } forall + /Encoding EncodingVector def + currentdict end definefont +} def +/Times-Roman starnetISO def +/Times-Italic starnetISO def +/Times-Bold starnetISO def +/Times-BoldItalic starnetISO def +/Helvetica starnetISO def +/Helvetica-Oblique starnetISO def +/Helvetica-Bold starnetISO def +/Helvetica-BoldOblique starnetISO def +/Courier starnetISO def +/Courier-Oblique starnetISO def +/Courier-Bold starnetISO def +/Courier-BoldOblique starnetISO def +cleartomark +} bind def + +%%BeginResource: procset graphviz 0 0 +/coord-font-family /Times-Roman def +/default-font-family /Times-Roman def +/coordfont coord-font-family findfont 8 scalefont def + +/InvScaleFactor 1.0 def +/set_scale { + dup 1 exch div /InvScaleFactor exch def + dup scale +} bind def + +% styles +/solid { [] 0 setdash } bind def +/dashed { [9 InvScaleFactor mul dup ] 0 setdash } bind def +/dotted { [1 InvScaleFactor mul 6 InvScaleFactor mul] 0 setdash } bind def +/invis {/fill {newpath} def /stroke {newpath} def /show {pop newpath} def} bind def +/bold { 2 setlinewidth } bind def +/filled { } bind def +/unfilled { } bind def +/rounded { } bind def +/diagonals { } bind def + +% hooks for setting color +/nodecolor { sethsbcolor } bind def +/edgecolor { sethsbcolor } bind def +/graphcolor { sethsbcolor } bind def +/nopcolor {pop pop pop} bind def + +/beginpage { % i j npages + /npages exch def + /j exch def + /i exch def + /str 10 string def + npages 1 gt { + gsave + coordfont setfont + 0 0 moveto + (\() show i str cvs show (,) show j str cvs show (\)) show + grestore + } if +} bind def + +/set_font { + findfont exch + scalefont setfont +} def + +% draw aligned label in bounding box aligned to current point +/alignedtext { % width adj text + /text exch def + /adj exch def + /width exch def + gsave + width 0 gt { + text stringwidth pop adj mul 0 rmoveto + } if + [] 0 setdash + text show + grestore +} def + +/boxprim { % xcorner ycorner xsize ysize + 4 2 roll + moveto + 2 copy + exch 0 rlineto + 0 exch rlineto + pop neg 0 rlineto + closepath +} bind def + +/ellipse_path { + /ry exch def + /rx exch def + /y exch def + /x exch def + matrix currentmatrix + newpath + x y translate + rx ry scale + 0 0 1 0 360 arc + setmatrix +} bind def + +/endpage { showpage } bind def +/showpage { } def + +/layercolorseq + [ % layer color sequence - darkest to lightest + [0 0 0] + [.2 .8 .8] + [.4 .8 .8] + [.6 .8 .8] + [.8 .8 .8] + ] +def + +/layerlen layercolorseq length def + +/setlayer {/maxlayer exch def /curlayer exch def + layercolorseq curlayer 1 sub layerlen mod get + aload pop sethsbcolor + /nodecolor {nopcolor} def + /edgecolor {nopcolor} def + /graphcolor {nopcolor} def +} bind def + +/onlayer { curlayer ne {invis} if } def + +/onlayers { + /myupper exch def + /mylower exch def + curlayer mylower lt + curlayer myupper gt + or + {invis} if +} def + +/curlayer 0 def + +%%EndResource +%%EndProlog +%%BeginSetup +14 default-font-family set_font +1 setmiterlimit +% /arrowlength 10 def +% /arrowwidth 5 def + +% make sure pdfmark is harmless for PS-interpreters other than Distiller +/pdfmark where {pop} {userdict /pdfmark /cleartomark load put} ifelse +% make '<<' and '>>' safe on PS Level 1 devices +/languagelevel where {pop languagelevel}{1} ifelse +2 lt { + userdict (<<) cvn ([) cvn load put + userdict (>>) cvn ([) cvn load put +} if + +%%EndSetup +%%Page: 1 1 +%%PageBoundingBox: 36 36 577 166 +%%PageOrientation: Portrait +gsave +35 35 542 131 boxprim clip newpath +36 36 translate +0 0 1 beginpage +0.4180 set_scale +0 0 translate 0 rotate +0.000 0.000 0.000 graphcolor +14.00 /Times-Roman set_font + +% Vernac +gsave 10 dict begin +562 145 33 18 ellipse_path +stroke +gsave 10 dict begin +541 140 moveto +(Vernac) +[8.88 6.24 4.8 6.96 6.24 6.24] +xshow +end grestore +end grestore + +% Vernacentries +gsave 10 dict begin +724 158 52 18 ellipse_path +stroke +gsave 10 dict begin +685 153 moveto +(Vernacentries) +[8.88 6.24 4.8 6.96 6.24 6.24 6.24 6.96 3.84 4.8 3.84 6.24 5.52] +xshow +end grestore +end grestore + +% Vernac -> Vernacentries +newpath 595 148 moveto +615 149 640 151 663 153 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 663 156 moveto +673 154 lineto +663 150 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 663 156 moveto +673 154 lineto +663 150 lineto +closepath +stroke +end grestore + +% Vernacinterp +gsave 10 dict begin +862 158 50 18 ellipse_path +stroke +gsave 10 dict begin +825 153 moveto +(Vernacinterp) +[8.88 6.24 4.8 6.96 6.24 6.24 3.84 6.96 3.84 6.24 4.8 6.96] +xshow +end grestore +end grestore + +% Vernacentries -> Vernacinterp +newpath 776 158 moveto +785 158 793 158 802 158 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 802 162 moveto +812 158 lineto +802 155 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 802 162 moveto +812 158 lineto +802 155 lineto +closepath +stroke +end grestore + +% Discharge +gsave 10 dict begin +862 212 42 18 ellipse_path +stroke +gsave 10 dict begin +833 207 moveto +(Discharge) +[10.08 3.84 5.52 6 6.96 6.24 4.32 6.72 6.24] +xshow +end grestore +end grestore + +% Vernacentries -> Discharge +newpath 758 171 moveto +777 179 801 188 822 196 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 820 199 moveto +831 200 lineto +823 193 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 820 199 moveto +831 200 lineto +823 193 lineto +closepath +stroke +end grestore + +% Mltop +gsave 10 dict begin +862 104 31 18 ellipse_path +stroke +gsave 10 dict begin +844 99 moveto +(Mltop) +[12.48 3.84 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Vernacentries -> Mltop +newpath 758 145 moveto +779 137 805 126 826 118 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 828 121 moveto +836 114 lineto +825 114 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 828 121 moveto +836 114 lineto +825 114 lineto +closepath +stroke +end grestore + +% Record +gsave 10 dict begin +862 281 33 18 ellipse_path +stroke +gsave 10 dict begin +842 276 moveto +(Record) +[9.12 6.24 6.24 6.96 4.32 6.96] +xshow +end grestore +end grestore + +% Vernacentries -> Record +newpath 742 175 moveto +760 192 788 217 812 239 curveto +819 246 828 253 835 259 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 833 262 moveto +843 266 lineto +838 257 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 833 262 moveto +843 266 lineto +838 257 lineto +closepath +stroke +end grestore + +% Himsg +gsave 10 dict begin +991 85 32 18 ellipse_path +stroke +gsave 10 dict begin +971 80 moveto +(Himsg) +[10.08 3.84 10.8 5.52 6.96] +xshow +end grestore +end grestore + +% Vernacinterp -> Himsg +newpath 890 143 moveto +897 139 905 135 912 131 curveto +929 123 946 112 960 103 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 962 106 moveto +969 98 lineto +959 100 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 962 106 moveto +969 98 lineto +959 100 lineto +closepath +stroke +end grestore + +% Vernacexpr +gsave 10 dict begin +1246 221 45 18 ellipse_path +stroke +gsave 10 dict begin +1213 216 moveto +(Vernacexpr) +[8.88 6.24 4.8 6.96 6.24 6.24 5.76 6.96 6.96 4.56] +xshow +end grestore +end grestore + +% Vernacinterp -> Vernacexpr +newpath 912 159 moveto +947 160 994 163 1034 169 curveto +1092 178 1158 195 1200 207 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1199 210 moveto +1210 210 lineto +1201 204 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1199 210 moveto +1210 210 lineto +1201 204 lineto +closepath +stroke +end grestore + +% Class +gsave 10 dict begin +1117 238 28 18 ellipse_path +stroke +gsave 10 dict begin +1101 233 moveto +(Class) +[9.36 3.84 6.24 5.52 5.52] +xshow +end grestore +end grestore + +% Discharge -> Class +newpath 902 217 moveto +917 219 933 221 948 223 curveto +992 228 1044 232 1079 235 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1079 238 moveto +1089 236 lineto +1079 232 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1079 238 moveto +1089 236 lineto +1079 232 lineto +closepath +stroke +end grestore + +% Recordobj +gsave 10 dict begin +991 196 42 18 ellipse_path +stroke +gsave 10 dict begin +962 191 moveto +(Recordobj) +[9.12 6.24 6.24 6.96 4.32 6.96 6.96 6.96 3.84] +xshow +end grestore +end grestore + +% Discharge -> Recordobj +newpath 902 207 moveto +914 205 927 204 940 202 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 940 205 moveto +950 201 lineto +940 199 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 940 205 moveto +950 201 lineto +940 199 lineto +closepath +stroke +end grestore + +% Command +gsave 10 dict begin +991 288 42 18 ellipse_path +stroke +gsave 10 dict begin +961 283 moveto +(Command) +[9.36 6.96 10.8 10.8 6.24 6.96 6.96] +xshow +end grestore +end grestore + +% Record -> Command +newpath 895 283 moveto +908 284 923 285 938 285 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 938 288 moveto +948 286 lineto +938 282 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 938 288 moveto +948 286 lineto +938 282 lineto +closepath +stroke +end grestore + +% Toplevel +gsave 10 dict begin +255 72 37 18 ellipse_path +stroke +gsave 10 dict begin +231 67 moveto +(Toplevel) +[7.2 6.96 6.96 3.84 5.76 6.48 6.24 3.84] +xshow +end grestore +end grestore + +% Protectedtoplevel +gsave 10 dict begin +390 72 61 18 ellipse_path +stroke +gsave 10 dict begin +341 67 moveto +(Protectedtoplevel) +[7.68 4.56 6.72 3.84 6.24 6.24 3.84 6.24 6.96 3.84 6.96 6.96 3.84 5.76 6.48 6.24 3.84] +xshow +end grestore +end grestore + +% Toplevel -> Protectedtoplevel +newpath 292 72 moveto +300 72 309 72 318 72 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 318 76 moveto +328 72 lineto +318 69 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 318 76 moveto +328 72 lineto +318 69 lineto +closepath +stroke +end grestore + +% Protectedtoplevel -> Vernac +newpath 425 87 moveto +455 100 497 117 527 130 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 525 133 moveto +536 134 lineto +528 127 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 525 133 moveto +536 134 lineto +528 127 lineto +closepath +stroke +end grestore + +% Cerrors +gsave 10 dict begin +724 65 34 18 ellipse_path +stroke +gsave 10 dict begin +702 60 moveto +(Cerrors) +[9.36 6.24 5.04 4.56 6.96 4.56 5.52] +xshow +end grestore +end grestore + +% Protectedtoplevel -> Cerrors +newpath 452 71 moveto +518 70 621 67 679 66 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 679 70 moveto +689 66 lineto +679 63 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 679 70 moveto +689 66 lineto +679 63 lineto +closepath +stroke +end grestore + +% Line_oriented_parser +gsave 10 dict begin +562 26 73 18 ellipse_path +stroke +gsave 10 dict begin +501 21 moveto +(Line_oriented_parser) +[8.4 3.84 6.96 6.24 6.96 6.96 4.8 3.84 6.24 6.96 3.84 6.24 6.96 6.96 6.96 6.24 4.56 5.52 6.24 4.56] +xshow +end grestore +end grestore + +% Protectedtoplevel -> Line_oriented_parser +newpath 436 60 moveto +457 55 481 48 502 42 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 503 45 moveto +512 39 lineto +501 39 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 503 45 moveto +512 39 lineto +501 39 lineto +closepath +stroke +end grestore + +% Metasyntax +gsave 10 dict begin +1117 292 46 18 ellipse_path +stroke +gsave 10 dict begin +1083 287 moveto +(Metasyntax) +[12.48 6 4.08 6.24 5.52 6.96 6.96 4.08 6.24 6.96] +xshow +end grestore +end grestore + +% Command -> Metasyntax +newpath 1034 289 moveto +1043 290 1052 290 1061 290 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1061 293 moveto +1071 291 lineto +1061 287 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1061 293 moveto +1071 291 lineto +1061 287 lineto +closepath +stroke +end grestore + +% Command -> Class +newpath 1022 276 moveto +1041 268 1065 259 1084 252 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1085 255 moveto +1093 248 lineto +1082 249 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1085 255 moveto +1093 248 lineto +1082 249 lineto +closepath +stroke +end grestore + +% Cerrors -> Himsg +newpath 758 67 moveto +796 69 859 73 912 77 curveto +924 78 937 79 949 80 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 949 83 moveto +959 81 lineto +949 77 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 949 83 moveto +959 81 lineto +949 77 lineto +closepath +stroke +end grestore + +% Minicoq +gsave 10 dict begin +38 126 37 18 ellipse_path +stroke +gsave 10 dict begin +13 121 moveto +(Minicoq) +[12.48 3.84 6.96 3.84 6.24 6.96 6.96] +xshow +end grestore +end grestore + +% Fhimsg +gsave 10 dict begin +147 126 34 18 ellipse_path +stroke +gsave 10 dict begin +125 121 moveto +(Fhimsg) +[7.68 6.96 3.84 10.8 5.52 6.96] +xshow +end grestore +end grestore + +% Minicoq -> Fhimsg +newpath 76 126 moveto +84 126 93 126 102 126 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 102 130 moveto +112 126 lineto +102 123 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 102 130 moveto +112 126 lineto +102 123 lineto +closepath +stroke +end grestore + +% Metasyntax -> Vernacexpr +newpath 1144 277 moveto +1163 267 1189 252 1210 241 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 1212 244 moveto +1219 236 lineto +1209 238 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 1212 244 moveto +1219 236 lineto +1209 238 lineto +closepath +stroke +end grestore + +% Coqtop +gsave 10 dict begin +38 45 34 18 ellipse_path +stroke +gsave 10 dict begin +17 40 moveto +(Coqtop) +[9.36 6.96 6.96 3.84 6.96 6.96] +xshow +end grestore +end grestore + +% Coqinit +gsave 10 dict begin +147 72 34 18 ellipse_path +stroke +gsave 10 dict begin +126 67 moveto +(Coqinit) +[9.36 6.96 6.96 3.84 6.96 3.84 3.84] +xshow +end grestore +end grestore + +% Coqtop -> Coqinit +newpath 69 53 moveto +81 56 94 59 106 62 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 105 65 moveto +116 65 lineto +107 59 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 105 65 moveto +116 65 lineto +107 59 lineto +closepath +stroke +end grestore + +% Usage +gsave 10 dict begin +147 18 31 18 ellipse_path +stroke +gsave 10 dict begin +129 13 moveto +(Usage) +[10.08 5.52 6.24 6.72 6.24] +xshow +end grestore +end grestore + +% Coqtop -> Usage +newpath 69 37 moveto +81 34 95 31 108 28 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 109 31 moveto +118 25 lineto +107 25 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 109 31 moveto +118 25 lineto +107 25 lineto +closepath +stroke +end grestore + +% Coqinit -> Toplevel +newpath 181 72 moveto +190 72 199 72 208 72 curveto +stroke +gsave 10 dict begin +solid +1 setlinewidth +0.000 0.000 0.000 edgecolor +newpath 208 76 moveto +218 72 lineto +208 69 lineto +closepath +fill +0.000 0.000 0.000 edgecolor +newpath 208 76 moveto +218 72 lineto +208 69 lineto +closepath +stroke +end grestore +endpage +showpage +grestore +%%PageTrailer +%%EndPage: 1 +%%Trailer +%%Pages: 1 +end +restore +%%EOF diff --git a/dev/include b/dev/include index eb370a5d..563edd04 100644 --- a/dev/include +++ b/dev/include @@ -4,32 +4,27 @@ #cd ".";; #use "base_include";; -#install_printer (* ast *) prast;; -#install_printer (* pat *) prastpat;; -#install_printer (* patlist *) prastpatl;; - #install_printer (* pattern *) pppattern;; -#install_printer (* rawconstr *) pprawterm;; +#install_printer (* rawconstr *) pprawconstr;; -#install_printer (* constr *) ppterm;; -#install_printer (* constr_substituted *) ppsterm;; -#install_printer (* universe *) print_uni;; -#install_printer (* universes *) pp_universes;; -#install_printer (* type_judgement*) pptype;; -#install_printer (* judgement*) prj;; +#install_printer (* constr *) ppconstr;; +#install_printer (* constr_substituted *) ppsconstr;; +#install_printer (* universe *) ppuni;; +#install_printer (* universes *) ppuniverses;; +#install_printer (* type_judgement *) pptype;; +#install_printer (* judgement *) ppj;; -#install_printer (* goal *) prgoal;; -#install_printer (* sigma goal *) prsigmagoal;; +#install_printer (* goal *) ppgoal;; +#install_printer (* sigma goal *) ppsigmagoal;; #install_printer (* proof *) pproof;; -#install_printer (* global_constraints *) prevd;; -#install_printer (* readable_constraints *) prevc;; -#install_printer (* walking_constraints *) prwc;; -#install_printer (* clenv *) prclenv;; +#install_printer (* evar_map *) ppevm;; +#install_printer (* evar_defs *) ppevd;; +#install_printer (* clenv *) ppclenv;; #install_printer (* env *) ppenv;; #install_printer (* tactic *) pptac;; -#install_printer (* object *) pr_obj;; -#install_printer (* global_reference *) prglobal;; +#install_printer (* object *) ppobj;; +#install_printer (* global_reference *) ppglobal;; #install_printer (* fconstr *) ppfconstr;; diff --git a/dev/ocamldebug-v7.template b/dev/ocamldebug-coq.template index 1dd625c8..30224216 100644 --- a/dev/ocamldebug-v7.template +++ b/dev/ocamldebug-coq.template @@ -2,10 +2,10 @@ # wrap around ocamldebug for Coq -export COQTOP='COQTOPDIRECTORY' -export COQLIB='COQLIBDIRECTORY' +export COQTOP=COQTOPDIRECTORY +export COQLIB=COQLIBDIRECTORY export COQTH=$COQLIB/theories -CAMLBIN='CAMLBINDIRECTORY' +CAMLBIN=CAMLBINDIRECTORY OCAMLDEBUG=$CAMLBIN/ocamldebug export CAMLP4LIB=`$CAMLBIN/camlp4 -where` @@ -36,6 +36,7 @@ case $coqdebug in -I $COQTOP/contrib/interface -I $COQTOP/contrib/jprover \ -I $COQTOP/contrib/omega -I $COQTOP/contrib/romega \ -I $COQTOP/contrib/ring -I $COQTOP/contrib/xml \ + -I $COQTOP/contrib/subtac \ $* $args;; *) exec $OCAMLDEBUG $*;; esac diff --git a/dev/perf-analysis b/dev/perf-analysis index 4295a573..23259156 100644 --- a/dev/perf-analysis +++ b/dev/perf-analysis @@ -1,51 +1,47 @@ -Performance analysis for V8-0-bugfix branch -------------------------------------------- +Performance analysis for V8-0 branch +------------------------------------ - Dec 27, 2005: contrib Karatsuba added (~ 24s) + Dec 29, 2005: new test and use of -vm in Stalmarck + + Dec 27, 2005: contrib Karatsuba added (~ 30s) + +Dec 28, 2005: size decrease + mainly due to Defined moved to Qed in FSets (reduction from 95M to 7Mo) Dec 1-14, 2005: benchmarking server down + between the two dates: Godel: -10%, CoRN: -10% + probably due to changes around vm (new informative Cast, + change of equality in named_context_val) -Nov 29 and Dec 16, 2005: size increase - due to new record flag in inductive for extraction + Oct 6, 2005: contribs IPC and Tait added (~ 22s and ~ 25s) - Oct 6, 2005: contribs IPC and Tait added (~ 22s and ~ 24s) - - Aug 1, 2005: contrib Kildall added (~ 64s) +Aug 19, 2005: time decrease after application of "Array.length x=0" Xavier's + suggestions for optimisation + (e.g. Nijmegen/QArith: -3%, Nijmegen/CoRN: -7%, Godel: -3%) + Aug 1, 2005: contrib Kildall added (~ 65s) + Jul 26-Aug 2, 2005: bench down Jul 14-15, 2005: 4 contribs failed including CoRN - Jul 7, 2005: adding contrib Fermat4: but not compabible and remove on Jul 8 +Jul 14, 2005: time increase after activation of "closure optimisation" + (e.g. Nijmegen/QArith: +8%, Nijmegen/CoRN: +3%, Godel: +13%) - Jun 17, 2005: contrib Goodstein extended and moved to CantorOrdinals (~ 28s) + Jul 7, 2005: adding contrib Fermat4 -Jun 4, 2005: significant time reduction - (e.g. Nijmegen/LinAlg: -15%, Nijmegen/QArith: stable; Nijmegen/CoRN: -1%) - only changes are the removal of an assert checking location and - the pre-definition of level 200 (could it be just a parsing improvement??) + Jun 17, 2005: contrib Goodstein extended and moved to CantorOrdinals (~ 30s) May 19, 2005: contrib Goodstein and prfx (~ 9s) added -Apr 30, 2005: evaluation order of atomic tactics changed - (e.g. Nijmegen/CoRN: stable, Nijmegen/QArith: -2%, Nijmegen/LinAlg: +20%) +Apr 21, 2005: strange time decrease + (could it be due to the change of Back and Reset mechanism) + (e.g. Nijmegen/CoRN: -2%, Nijmegen/QARITH: -4%, Godel: -11%) Mar 20, 2005: fixed Logic.with_check bug - improved whole V8-0-bugfix bench by 4 % - (e.g. Nijmegen/CoRN: - 7.5 %, Nijmegen/QARITH: - 1.5 %) - -Mar 7-10, 2005: unexplained time reduction - (on Mar 7, changed Ppconstrnew univ printer only) - (note also a server upgrade around Mar 10) - -Feb 17, 2005: fixed omega bug #922 (wrong STATE dependency): - improved whole V8-0-bugfix bench by 2 % - (e.g. Nijmegen/CoRN: - 6.5 %, Nijmegen/QARITH: - 3 %) - -Feb 2, 2005: fixed ltac var interpretation order - - Jan 13, 2005: contrib SumOfTwoSquare added (~ 37s) + global time decrease (e.g. Nijmegen/CoRN: -3%, Nijmegen/QARITH: -1.5%) -Dec 20-29, 2004: reduced whole V8-0-bugfix due to Berkeley/Godel failure +Jan 31-Feb 8, 2005: small instability + (e.g. CoRN: ~2015s -> ~1999s -> ~2032s, Godel: ~340s -> ~370s) -Nov 27 - Dec 10, 2004: strong instability + Jan 13, 2005: contrib SumOfTwoSquare added (~ 38s) diff --git a/dev/top_printers.ml b/dev/top_printers.ml index 1e314929..273f109c 100644 --- a/dev/top_printers.ml +++ b/dev/top_printers.ml @@ -9,8 +9,8 @@ (* Printers for the ocaml toplevel. *) open System +open Util open Pp -open Ast open Names open Libnames open Nameops @@ -19,104 +19,111 @@ open Univ open Proof_trees open Environ open Printer +open Tactic_printer open Refiner -open Tacmach open Term open Termops open Clenv open Cerrors -open Constrextern -open Constrintern +open Evd +open Goptions let _ = Constrextern.print_evar_arguments := true +let _ = set_bool_option_value (SecondaryTable ("Printing","Matching")) false + +(* name printers *) +let ppid id = pp (pr_id id) +let pplab l = pp (pr_lab l) +let ppmsid msid = pp (str (debug_string_of_msid msid)) +let ppmbid mbid = pp (str (debug_string_of_mbid mbid)) +let ppdir dir = pp (pr_dirpath dir) +let ppmp mp = pp(str (string_of_mp mp)) +let ppcon con = pp(pr_con con) +let ppkn kn = pp(pr_kn kn) +let ppsp sp = pp(pr_sp sp) +let ppqualid qid = pp(pr_qualid qid) + +(* term printers *) +let ppconstr x = pp(Termops.print_constr x) +let ppterm = ppconstr +let ppsconstr x = ppconstr (Declarations.force x) +let ppconstr_univ x = Constrextern.with_universes ppconstr x +let pprawconstr = (fun x -> pp(pr_lrawconstr x)) +let pppattern = (fun x -> pp(pr_constr_pattern x)) +let pptype = (fun x -> pp(pr_ltype x)) +let ppfconstr c = ppconstr (Closure.term_of_fconstr c) + +let ppbigint n = pp (Bigint.pr_bigint n);; + +let ppidset l = pp (prlist_with_sep spc pr_id (Idset.elements l)) let pP s = pp (hov 0 s) -let prast c = pp(print_ast c) - -let prastpat c = pp(print_astpat c) -let prastpatl c = pp(print_astlpat c) -let ppterm x = pp(prterm x) -let ppsterm x = ppterm (Declarations.force x) -let ppterm_univ x = Constrextern.with_universes ppterm x -let pprawterm = (fun x -> pp(pr_rawterm x)) -let pppattern = (fun x -> pp(pr_pattern x)) -let pptype = (fun x -> pp(prtype x)) - -let safe_prglobal = function - | ConstRef kn -> pp (str "CONSTREF(" ++ pr_kn kn ++ str ")") +let safe_pr_global = function + | ConstRef kn -> pp (str "CONSTREF(" ++ pr_con kn ++ str ")") | IndRef (kn,i) -> pp (str "INDREF(" ++ pr_kn kn ++ str "," ++ int i ++ str ")") | ConstructRef ((kn,i),j) -> pp (str "INDREF(" ++ pr_kn kn ++ str "," ++ int i ++ str "," ++ int j ++ str ")") | VarRef id -> pp (str "VARREF(" ++ pr_id id ++ str ")") -let prglobal x = try pp(pr_global x) with _ -> safe_prglobal x - -let prid id = pp (pr_id id) -let prlab l = pp (pr_lab l) - -let prmsid msid = pp (str (debug_string_of_msid msid)) -let prmbid mbid = pp (str (debug_string_of_mbid mbid)) - -let prdir dir = pp (pr_dirpath dir) +let ppglobal x = try pp(pr_global x) with _ -> safe_pr_global x -let prmp mp = pp(str (string_of_mp mp)) -let prkn kn = pp(pr_kn kn) +let ppconst (sp,j) = + pp (str"#" ++ pr_kn sp ++ str"=" ++ pr_lconstr j.uj_val) -let prsp sp = pp(pr_sp sp) +let ppvar ((id,a)) = + pp (str"#" ++ pr_id id ++ str":" ++ pr_lconstr a) -let prqualid qid = pp(pr_qualid qid) +let genppj f j = let (c,t) = f j in (c ++ str " : " ++ t) -let prconst (sp,j) = - pp (str"#" ++ pr_kn sp ++ str"=" ++ prterm j.uj_val) +let ppj j = pp (genppj pr_ljudge j) -let prvar ((id,a)) = - pp (str"#" ++ pr_id id ++ str":" ++ prterm a) +(* proof printers *) +let ppevm evd = pp(pr_evar_map evd) +let ppevd evd = pp(pr_evar_defs evd) +let ppclenv clenv = pp(pr_clenv clenv) +let ppgoal g = pp(db_pr_goal g) -let genprj f j = let (c,t) = f j in (c ++ str " : " ++ t) +let pr_gls gls = + hov 0 (pr_evar_map (sig_sig gls) ++ fnl () ++ db_pr_goal (sig_it gls)) -let prj j = pp (genprj prjudge j) - -let prgoal g = pp(prgl g) - -let prsigmagoal g = pp(prgl (sig_it g)) +let pr_glls glls = + hov 0 (pr_evar_map (sig_sig glls) ++ fnl () ++ + prlist_with_sep pr_fnl db_pr_goal (sig_it glls)) +let ppsigmagoal g = pp(pr_goal (sig_it g)) let prgls gls = pp(pr_gls gls) - let prglls glls = pp(pr_glls glls) - let pproof p = pp(print_proof Evd.empty empty_named_context p) -let prevd evd = pp(pr_decls evd) +let ppuni u = pp(pr_uni u) -let prevc evc = pp(pr_evc evc) - -let prwc wc = pp(pr_evc wc) - -let prclenv clenv = pp(pr_clenv clenv) - -let print_uni u = (pp (pr_uni u)) - -let pp_universes u = pp (str"[" ++ pr_universes u ++ str"]") +let ppuniverses u = pp (str"[" ++ pr_universes u ++ str"]") let ppenv e = pp (str "[" ++ pr_named_context_of e ++ str "]" ++ spc() ++ str "[" ++ pr_rel_context e (rel_context e) ++ str "]") -let pptac = (fun x -> pp(Pptactic.pr_glob_tactic x)) +let pptac = (fun x -> pp(Pptactic.pr_glob_tactic (Global.env()) x)) -let pr_obj obj = Format.print_string (Libobject.object_tag obj) +let ppobj obj = Format.print_string (Libobject.object_tag obj) let cnt = ref 0 +let cast_kind_display k = + match k with + | VMcast -> "VMcast" + | DEFAULTcast -> "DEFAULTcast" + let constr_display csr = let rec term_display c = match kind_of_term c with | Rel n -> "Rel("^(string_of_int n)^")" | Meta n -> "Meta("^(string_of_int n)^")" | Var id -> "Var("^(string_of_id id)^")" | Sort s -> "Sort("^(sort_display s)^")" - | Cast (c,t) -> "Cast("^(term_display c)^","^(term_display t)^")" + | Cast (c,k, t) -> + "Cast("^(term_display c)^","^(cast_kind_display k)^","^(term_display t)^")" | Prod (na,t,c) -> "Prod("^(name_display na)^","^(term_display t)^","^(term_display c)^")\n" | Lambda (na,t,c) -> @@ -126,7 +133,7 @@ let constr_display csr = ^(term_display t)^","^(term_display c)^")" | App (c,l) -> "App("^(term_display c)^","^(array_display l)^")\n" | Evar (e,l) -> "Evar("^(string_of_int e)^","^(array_display l)^")" - | Const c -> "Const("^(string_of_kn c)^")" + | Const c -> "Const("^(string_of_con c)^")" | Ind (sp,i) -> "MutInd("^(string_of_kn sp)^","^(string_of_int i)^")" | Construct ((sp,i),j) -> @@ -177,7 +184,7 @@ let print_pure_constr csr = | Meta n -> print_string "Meta("; print_int n; print_string ")" | Var id -> print_string (string_of_id id) | Sort s -> sort_display s - | Cast (c,t) -> open_hovbox 1; + | Cast (c,_, t) -> open_hovbox 1; print_string "("; (term_display c); print_cut(); print_string "::"; (term_display t); print_string ")"; close_box() | Prod (Name(id),t,c) -> @@ -207,7 +214,7 @@ let print_pure_constr csr = Array.iter (fun x -> print_space (); box_display x) l; print_string"}" | Const c -> print_string "Cons("; - sp_display c; + sp_con_display c; print_string ")" | Ind (sp,i) -> print_string "Ind("; @@ -231,11 +238,12 @@ let print_pure_constr csr = print_string "end"; close_box() | Fix ((t,i),(lna,tl,bl)) -> - print_string "Fix("; print_int i; print_string ")"; + print_string "Fix" +(* "("; print_int i; print_string ")"; print_cut(); open_vbox 0; let rec print_fix () = - for k = 0 to Array.length tl - 1 do + for k = 0 to (Array.length tl) - 1 do open_vbox 0; name_display lna.(k); print_string "/"; print_int t.(k); print_cut(); print_string ":"; @@ -243,13 +251,13 @@ let print_pure_constr csr = box_display bl.(k); close_box (); print_cut() done - in print_string"{"; print_fix(); print_string"}" + in print_string"{"; print_fix(); print_string"}" *) | CoFix(i,(lna,tl,bl)) -> print_string "CoFix("; print_int i; print_string ")"; print_cut(); open_vbox 0; let rec print_fix () = - for k = 0 to Array.length tl - 1 do + for k = 0 to (Array.length tl) - 1 do open_vbox 1; name_display lna.(k); print_cut(); print_string ":"; box_display tl.(k) ; print_cut(); print_string ":="; @@ -279,27 +287,85 @@ let print_pure_constr csr = | l -> l in List.iter (fun x -> print_string x; print_string ".") ls;*) print_string (string_of_kn sp) + and sp_con_display sp = +(* let dir,l = decode_kn sp in + let ls = + match List.rev (List.map string_of_id (repr_dirpath dir)) with + ("Top"::l)-> l + | ("Coq"::_::l) -> l + | l -> l + in List.iter (fun x -> print_string x; print_string ".") ls;*) + print_string (string_of_con sp) in + try box_display csr; print_flush() -(* -let _ = - Vernacentries.add "PrintConstr" - (function - | [VARG_CONSTR c] -> - (fun () -> - let (evmap,sign) = Command.get_current_context () in - constr_display (Constrintern.interp_constr evmap sign c)) - | _ -> bad_vernac_args "PrintConstr") + with e -> + print_string (Printexc.to_string e);print_flush (); + raise e -let _ = - Vernacentries.add "PrintPureConstr" - (function - | [VARG_CONSTR c] -> - (fun () -> - let (evmap,sign) = Command.get_current_context () in - print_pure_constr (Constrintern.interp_constr evmap sign c)) - | _ -> bad_vernac_args "PrintPureConstr") +let ppfconstr c = ppconstr (Closure.term_of_fconstr c) + +let pploc x = let (l,r) = unloc x in + print_string"(";print_int l;print_string",";print_int r;print_string")" + +(**********************************************************************) +(* Vernac-level debugging commands *) + +let in_current_context f c = + let (evmap,sign) = + try Pfedit.get_current_goal_context () + with e when Logic.catchable_exception e -> (Evd.empty, Global.env()) in + f (Constrintern.interp_constr evmap sign c) + +(* We expand the result of preprocessing to be independent of camlp4 + +VERNAC COMMAND EXTEND PrintPureConstr +| [ "PrintPureConstr" constr(c) ] -> [ in_current_context print_pure_constr c ] +END +VERNAC COMMAND EXTEND PrintConstr + [ "PrintConstr" constr(c) ] -> [ in_current_context constr_display c ] +END *) -let ppfconstr c = ppterm (Closure.term_of_fconstr c) +open Pcoq +open Genarg +open Egrammar + +let _ = + try + Vernacinterp.vinterp_add "PrintConstr" + (function + [c] when genarg_tag c = ConstrArgType && true -> + let c = out_gen rawwit_constr c in + (fun () -> in_current_context constr_display c) + | _ -> failwith "Vernac extension: cannot occur") + with + e -> Pp.pp (Cerrors.explain_exn e) +let _ = + extend_vernac_command_grammar "PrintConstr" + [[TacTerm "PrintConstr"; + TacNonTerm + (dummy_loc, + (Gramext.Snterm (Pcoq.Gram.Entry.obj Constr.constr), + ConstrArgType), + Some "c")]] + +let _ = + try + Vernacinterp.vinterp_add "PrintPureConstr" + (function + [c] when genarg_tag c = ConstrArgType && true -> + let c = out_gen rawwit_constr c in + (fun () -> in_current_context print_pure_constr c) + | _ -> failwith "Vernac extension: cannot occur") + with + e -> Pp.pp (Cerrors.explain_exn e) +let _ = + extend_vernac_command_grammar "PrintPureConstr" + [[TacTerm "PrintPureConstr"; + TacNonTerm + (dummy_loc, + (Gramext.Snterm (Pcoq.Gram.Entry.obj Constr.constr), + ConstrArgType), + Some "c")]] diff --git a/dev/vm_printers.ml b/dev/vm_printers.ml new file mode 100644 index 00000000..c037eca7 --- /dev/null +++ b/dev/vm_printers.ml @@ -0,0 +1,98 @@ +open Format +open Term +open Names +open Cbytecodes +open Cemitcodes +open Vm + +let ppripos (ri,pos) = + (match ri with + | Reloc_annot a -> + let sp,i = a.ci.ci_ind in + print_string + ("annot : MutInd("^(string_of_kn sp)^","^(string_of_int i)^")\n") + | Reloc_const _ -> + print_string "structured constant\n" + | Reloc_getglobal kn -> + print_string ("getglob "^(string_of_con kn)^"\n")); + print_flush () + +let print_vfix () = print_string "vfix" +let print_vfix_app () = print_string "vfix_app" +let print_vswith () = print_string "switch" + +let ppsort = function + | Prop(Pos) -> print_string "Set" + | Prop(Null) -> print_string "Prop" + | Type u -> print_string "Type" + + + +let print_idkey idk = + match idk with + | ConstKey sp -> + print_string "Cons("; + print_string (string_of_con sp); + print_string ")" + | VarKey id -> print_string (string_of_id id) + | RelKey i -> print_string "~";print_int i + +let rec ppzipper z = + match z with + | Zapp args -> + let n = nargs args in + open_hbox (); + for i = 0 to n-2 do + ppvalues (arg args i);print_string ";";print_space() + done; + if n-1 >= 0 then ppvalues (arg args (n-1)); + close_box() + | Zfix _ -> print_string "Zfix" + | Zswitch _ -> print_string "Zswitch" + +and ppstack s = + open_hovbox 0; + print_string "["; + List.iter (fun z -> ppzipper z;print_string " | ") s; + print_string "]"; + close_box() + +and ppatom a = + match a with + | Aid idk -> print_idkey idk + | Aiddef(idk,_) -> print_string "&";print_idkey idk + | Aind(sp,i) -> print_string "Ind("; + print_string (string_of_kn sp); + print_string ","; print_int i; + print_string ")" + | Afix_app _ -> print_vfix_app () + | Aswitch _ -> print_vswith() + +and ppwhd whd = + match whd with + | Vsort s -> ppsort s + | Vprod _ -> print_string "product" + | Vfun _ -> print_string "function" + | Vfix _ -> print_vfix() + | Vfix_app _ -> print_vfix_app() + | Vcofix _ -> print_string "cofix" + | Vcofix_app _ -> print_string "cofix_app" + | Vconstr_const i -> print_string "C(";print_int i;print_string")" + | Vconstr_block b -> ppvblock b + | Vatom_stk(a,s) -> + open_hbox();ppatom a;close_box(); + print_string"@";ppstack s + +and ppvblock b = + open_hbox(); + print_string "Cb(";print_int (btag b); + let n = bsize b in + for i = 0 to n -1 do + print_string ",";ppvalues (bfield b i) + done; + print_string")"; + close_box() + +and ppvalues v = + open_hovbox 0;ppwhd (whd_val v);close_box(); + print_flush() |