├── .gitignore ├── README.md └── code ├── delphin ├── Makefile ├── README ├── delphin.sml ├── examples │ ├── arith │ │ └── arith.d │ ├── bool │ │ └── bool.d │ ├── canonical │ │ └── sub.d │ ├── carsten │ │ ├── cps.d │ │ └── ex.d │ ├── church-rosser │ │ ├── lam.elf │ │ ├── meta.d │ │ ├── ord-red.elf │ │ └── par-red.elf │ ├── circuit │ │ └── circuit.d │ ├── combinator │ │ ├── combinator-detailed.d │ │ ├── combinator.d │ │ ├── simple-Payload.d │ │ └── simple.d │ ├── copy │ │ ├── copy.d │ │ └── copy.elf │ ├── cut-elim │ │ ├── formulas.elf │ │ ├── int-admit.d │ │ ├── int-elim.d │ │ └── int.elf │ ├── debruijn │ │ ├── debruijn-advanced.d │ │ └── debruijn-payload.d │ ├── dissertation │ │ ├── advancedEquiv.d │ │ ├── depDelphin.d │ │ └── simpleDelphin.d │ ├── esop08.d │ ├── handbook │ │ ├── README │ │ ├── fol.d │ │ ├── fol.elf │ │ ├── sources.cfg │ │ └── test.cfg │ ├── hereditary-sub │ │ ├── hsub.d │ │ └── hsub.elf │ ├── hol-nuprl │ │ ├── eval.elf │ │ ├── hol-nuprl-old.d │ │ ├── hol-nuprl.d │ │ ├── hol.elf │ │ ├── hol │ │ │ ├── axioms.elf │ │ │ ├── hol.d │ │ │ └── hol.elf │ │ ├── meta.elf │ │ ├── nuprl-axioms.elf │ │ ├── nuprl │ │ │ ├── classical.elf │ │ │ ├── examples.elf │ │ │ ├── nuprl-lemmas.elf │ │ │ └── nuprl.elf │ │ ├── sources.cfg │ │ └── trans.elf │ ├── lambda │ │ ├── cntvar-advanced.d │ │ ├── continuation.d │ │ ├── copy-advanced.d │ │ ├── copy.d │ │ ├── counting.d │ │ ├── domain.d │ │ ├── eval.d │ │ ├── par.d │ │ └── testing.d │ ├── list │ │ ├── README │ │ └── list.d │ ├── logic │ │ └── logic.d │ ├── mini-ml │ │ ├── eval.elf │ │ ├── meta.d │ │ ├── mini-ml.elf │ │ ├── new │ │ │ ├── eval.elf │ │ │ ├── meta.d │ │ │ ├── mini-ml.elf │ │ │ ├── tp.elf │ │ │ ├── tpinf.elf │ │ │ ├── typeInfer.d │ │ │ └── value.elf │ │ ├── tp.elf │ │ ├── tpinf.elf │ │ ├── typeInfer.d │ │ └── value.elf │ ├── paths │ │ └── paths.d │ └── string │ │ └── string.d └── src │ ├── elaboration │ ├── abstract.fun │ ├── abstract.sig │ ├── abstract.sml │ ├── abstract2.fun │ ├── approx.sml │ ├── convert.fun │ ├── convert.sig │ ├── coverage.fun │ ├── extSyntax.sml │ ├── intSyntax.sml │ ├── normalizeDelphin.sml │ ├── printDelphinExt.sml │ ├── printDelphinInt.sml │ ├── sources.cm │ ├── sources.syntax.cm │ ├── strict.sml │ ├── tempSyntax.sml │ ├── terminate.sml │ ├── unifyDelphin.fun │ ├── unifyDelphin.sml │ ├── world.fun │ └── worldChecker.fun │ ├── frontend │ ├── LFparsing.sml │ ├── delphin.fun │ ├── delphin.grm │ ├── delphin.lex │ ├── delphin.sig │ ├── delphin.sml │ ├── interface.fun │ ├── interface.sig │ ├── ml-yacc-lib-mod │ │ ├── base.sig │ │ ├── join.sml │ │ ├── lrtable.sml │ │ ├── parser2.sml │ │ ├── sources.cm │ │ └── stream.sml │ ├── parse-prg.fun │ ├── parse-prg.sig │ ├── polyUnsafe.sml │ ├── sources.cm │ └── sources.frontend.cm │ ├── opsem │ ├── opsem.fun │ └── opsem.sig │ ├── poly.sml │ ├── sources.cm │ ├── twelf │ ├── .cvsignore │ ├── DISTRIBUTE │ ├── DISTRIBUTE.build │ ├── DISTRIBUTE.sed │ ├── FILES │ ├── HISTORY │ ├── Makefile │ ├── README │ ├── TEST │ │ ├── all-nt.sml │ │ ├── all.sml │ │ ├── anonymous.elf │ │ ├── clause.elf │ │ ├── constr.elf │ │ ├── constr2.elf │ │ ├── cover.elf │ │ ├── cp.elf │ │ ├── cp2nd.sml │ │ ├── cp3rd.sml │ │ ├── cr.sml │ │ ├── evenodd.elf │ │ ├── kevin.elf │ │ ├── lexing.elf │ │ ├── location.elf │ │ ├── m.sml │ │ ├── meta.sml │ │ ├── misc.elf │ │ ├── modes.elf │ │ ├── multimode.elf │ │ ├── occurs.elf │ │ ├── parsing.elf │ │ ├── relfun.sml │ │ ├── skolem.sml │ │ ├── solving.elf │ │ ├── strict.elf │ │ ├── subord.elf │ │ ├── term.elf │ │ ├── test.cfg │ │ ├── total.elf │ │ ├── tprecon.elf │ │ ├── unique.elf │ │ ├── unsafe.sml │ │ ├── uscore.elf │ │ └── worlds.elf │ ├── TODO │ ├── bin │ │ ├── .cvsignore │ │ ├── .dbase │ │ │ ├── .cvsignore │ │ │ └── README │ │ ├── .heap │ │ │ ├── .cvsignore │ │ │ └── README │ │ ├── .mkexec │ │ ├── .twelf-server │ │ ├── .twelf-server.bat │ │ ├── .twelf-sml │ │ ├── .twelf-sml.bat │ │ ├── clean │ │ ├── clean-cm │ │ ├── create-tags │ │ ├── tag-examples │ │ └── tag-twelf │ ├── delphin.cm │ ├── delphin.sml │ ├── emacs │ │ ├── .cvsignore │ │ ├── README │ │ ├── auc-menu.el │ │ ├── twelf-font.el │ │ ├── twelf-hilit.el │ │ ├── twelf-init.el │ │ └── twelf.el │ ├── load.sml │ ├── mlton │ │ ├── Makefile │ │ ├── install.sh │ │ ├── twelf-server-20030716.cm │ │ ├── twelf-server-97.cm │ │ ├── twelf-server.cm │ │ └── twelf-server.sml │ ├── polyml │ │ ├── .mkexec │ │ ├── Makefile │ │ ├── install.sh │ │ ├── load-delphin.sml │ │ ├── load-twelf.sml │ │ ├── load.sml │ │ ├── twelf-server-dbase.sml │ │ ├── twelf-server.sml │ │ ├── twelf-sml-dbase.sml │ │ └── twelf-sml.sml │ ├── rpm │ │ ├── INSTALL │ │ ├── README │ │ ├── logo.gif │ │ ├── twelf-1.3.spec │ │ ├── twelf-1.4.spec │ │ ├── twelf-files │ │ ├── twelf-install │ │ └── twelf-uninstall │ ├── server.cm │ ├── smlnj │ │ ├── Makefile │ │ ├── README │ │ ├── delphin.sml │ │ ├── install.sh │ │ ├── twelf-server.sml │ │ └── twelf-sml.sml │ ├── sources.cm │ ├── src │ │ ├── WALK │ │ ├── compat │ │ │ ├── array-97.sml │ │ │ ├── array-slice.sig │ │ │ ├── array-slice.sml │ │ │ ├── array.sig │ │ │ ├── compat-97.sml │ │ │ ├── compat-mlton-20030716.sml │ │ │ ├── compat-poly02.sml │ │ │ ├── compat-smlnj03.sml │ │ │ ├── compat-smlnj98.sml │ │ │ ├── compat.fun │ │ │ ├── compat.sig │ │ │ ├── compat.sml │ │ │ ├── mono-array-slice.sig │ │ │ ├── path-97.sml │ │ │ ├── path.sig │ │ │ ├── sources.cm │ │ │ ├── substring-97.sml │ │ │ ├── substring.sig │ │ │ ├── text-io-97.sml │ │ │ ├── text-io.sig │ │ │ ├── timer-97.sml │ │ │ ├── timer.sig │ │ │ ├── vector-97.sml │ │ │ ├── vector-slice.sig │ │ │ ├── vector-slice.sml │ │ │ ├── vector.sig │ │ │ └── word8-array-slice.sml │ │ ├── compile │ │ │ ├── README │ │ │ ├── assign.fun │ │ │ ├── assign.sig │ │ │ ├── compile.fun │ │ │ ├── compile.sig │ │ │ ├── compile.sml │ │ │ ├── compsyn.fun │ │ │ ├── compsyn.sig │ │ │ ├── cprint.fun │ │ │ ├── cprint.sig │ │ │ └── sources.cm │ │ ├── cover │ │ │ ├── README │ │ │ ├── cover.fun │ │ │ ├── cover.sig │ │ │ ├── cover.sml │ │ │ ├── sources.cm │ │ │ ├── total.fun │ │ │ └── total.sig │ │ ├── delphin │ │ │ ├── delphin.fun │ │ │ ├── delphin.grm │ │ │ ├── delphin.lex │ │ │ ├── delphin.sig │ │ │ ├── delphin.sml │ │ │ ├── dextsyn.fun │ │ │ ├── dextsyn.sig │ │ │ ├── interface.fun │ │ │ ├── interface.sig │ │ │ ├── ml-yacc-lib-mod │ │ │ │ ├── base.sig │ │ │ │ ├── join.sml │ │ │ │ ├── lrtable.sml │ │ │ │ ├── parser2.sml │ │ │ │ ├── sources.cm │ │ │ │ └── stream.sml │ │ │ ├── parse-prg.fun │ │ │ ├── parse-prg.sig │ │ │ ├── sources.cm │ │ │ ├── trans.fun │ │ │ └── trans.sig │ │ ├── domains │ │ │ ├── README │ │ │ ├── domains.sml │ │ │ ├── field.sig │ │ │ ├── integers-mod.fun │ │ │ ├── integers.fun │ │ │ ├── integers.sig │ │ │ ├── ordered-field.sig │ │ │ ├── rationals.fun │ │ │ ├── rationals.sig │ │ │ └── sources.cm │ │ ├── flit │ │ │ ├── README │ │ │ ├── flit.fun │ │ │ ├── flit.sig │ │ │ ├── flit.sml │ │ │ └── sources.cm │ │ ├── formatter │ │ │ ├── README │ │ │ ├── formatter.fun │ │ │ ├── formatter.sig │ │ │ ├── formatter.sml │ │ │ └── sources.cm │ │ ├── frontend │ │ │ ├── WALK │ │ │ ├── fquery.fun │ │ │ ├── fquery.sig │ │ │ ├── frontend.sml │ │ │ ├── lexer.fun │ │ │ ├── lexer.sig │ │ │ ├── parse-condec.fun │ │ │ ├── parse-condec.sig │ │ │ ├── parse-fixity.fun │ │ │ ├── parse-fixity.sig │ │ │ ├── parse-mode.fun │ │ │ ├── parse-mode.sig │ │ │ ├── parse-module.fun │ │ │ ├── parse-module.sig │ │ │ ├── parse-query.fun │ │ │ ├── parse-query.sig │ │ │ ├── parse-term.fun │ │ │ ├── parse-term.sig │ │ │ ├── parse-thm.fun │ │ │ ├── parse-thm.sig │ │ │ ├── parser.fun │ │ │ ├── parser.sig │ │ │ ├── parsing.fun │ │ │ ├── parsing.sig │ │ │ ├── recon-condec.fun │ │ │ ├── recon-condec.sig │ │ │ ├── recon-mode.fun │ │ │ ├── recon-mode.sig │ │ │ ├── recon-module.fun │ │ │ ├── recon-module.sig │ │ │ ├── recon-query.fun │ │ │ ├── recon-query.sig │ │ │ ├── recon-term.fun │ │ │ ├── recon-term.sig │ │ │ ├── recon-thm.fun │ │ │ ├── recon-thm.sig │ │ │ ├── solve.fun │ │ │ ├── solve.sig │ │ │ ├── sources.cm │ │ │ ├── twelf.fun │ │ │ ├── twelf.sig │ │ │ ├── unknownexn-smlnj.sml │ │ │ ├── unknownexn-stub.sml │ │ │ ├── unknownexn.fun │ │ │ └── unknownexn.sig │ │ ├── global │ │ │ ├── README │ │ │ ├── WALK │ │ │ ├── global.sig │ │ │ ├── global.sml │ │ │ └── sources.cm │ │ ├── heuristic │ │ │ ├── heuristic.fun │ │ │ ├── heuristic.sig │ │ │ ├── heuristic.sum.fun │ │ │ └── sources.cm │ │ ├── index │ │ │ ├── README │ │ │ ├── WALK │ │ │ ├── index-skolem.fun │ │ │ ├── index.fun │ │ │ ├── index.sig │ │ │ ├── index.sml │ │ │ └── sources.cm │ │ ├── int-inf │ │ │ ├── README │ │ │ ├── int-inf-sig.sml │ │ │ ├── int-inf.sml │ │ │ └── sources.cm │ │ ├── lambda │ │ │ ├── README │ │ │ ├── WALK │ │ │ ├── abstract.fun │ │ │ ├── abstract.sig │ │ │ ├── approx.fun │ │ │ ├── approx.sig │ │ │ ├── constraints.fun │ │ │ ├── constraints.sig │ │ │ ├── conv.fun │ │ │ ├── conv.sig │ │ │ ├── fgnopn.sig │ │ │ ├── fgnopntable.fun │ │ │ ├── intsyn.fun │ │ │ ├── intsyn.sig │ │ │ ├── lambda.sml │ │ │ ├── normalize.fun │ │ │ ├── normalize.sig │ │ │ ├── sources.cm │ │ │ ├── tomega.fun │ │ │ ├── tomega.sig │ │ │ ├── tomega.sml │ │ │ ├── unify.fun │ │ │ ├── unify.sig │ │ │ ├── whnf.fun │ │ │ └── whnf.sig │ │ ├── m2 │ │ │ ├── README │ │ │ ├── WALK │ │ │ ├── filling.fun │ │ │ ├── filling.sig │ │ │ ├── init.fun │ │ │ ├── init.sig │ │ │ ├── lemma.fun │ │ │ ├── lemma.sig │ │ │ ├── m2.sml │ │ │ ├── meta-abstract.fun │ │ │ ├── meta-abstract.sig │ │ │ ├── meta-global.sig │ │ │ ├── meta-global.sml │ │ │ ├── meta-print.fun │ │ │ ├── meta-print.sig │ │ │ ├── metasyn.fun │ │ │ ├── metasyn.sig │ │ │ ├── mpi.fun │ │ │ ├── mpi.sig │ │ │ ├── prover.fun │ │ │ ├── prover.sig │ │ │ ├── qed.fun │ │ │ ├── qed.sig │ │ │ ├── recursion.fun │ │ │ ├── recursion.sig │ │ │ ├── search.fun │ │ │ ├── search.sig │ │ │ ├── skolem.fun │ │ │ ├── skolem.sig │ │ │ ├── sources.cm │ │ │ ├── splitting.fun │ │ │ ├── splitting.sig │ │ │ ├── strategy.fun │ │ │ └── strategy.sig │ │ ├── meta │ │ │ ├── NOTES │ │ │ ├── README │ │ │ ├── WALK │ │ │ ├── abstract.fun │ │ │ ├── abstract.sig │ │ │ ├── data.fun │ │ │ ├── data.sig │ │ │ ├── filling.fun │ │ │ ├── filling.sig │ │ │ ├── funnames.fun │ │ │ ├── funnames.sig │ │ │ ├── funprint.fun │ │ │ ├── funprint.sig │ │ │ ├── funsyn.fun │ │ │ ├── funsyn.sig │ │ │ ├── funtypecheck.fun │ │ │ ├── funtypecheck.sig │ │ │ ├── funweaken.fun │ │ │ ├── funweaken.sig │ │ │ ├── global.fun │ │ │ ├── global.sig │ │ │ ├── inference.fun │ │ │ ├── inference.sig │ │ │ ├── init.fun │ │ │ ├── init.sig │ │ │ ├── interpret.sig │ │ │ ├── meta.sml │ │ │ ├── mpi.fun │ │ │ ├── mpi.sig │ │ │ ├── print.fun │ │ │ ├── print.sig │ │ │ ├── prover.fun │ │ │ ├── prover.sig │ │ │ ├── recursion.fun │ │ │ ├── recursion.sig │ │ │ ├── relfun.fun │ │ │ ├── relfun.sig │ │ │ ├── search.fun │ │ │ ├── search.sig │ │ │ ├── sources.cm │ │ │ ├── splitting.fun │ │ │ ├── splitting.sig │ │ │ ├── statesyn.fun │ │ │ ├── statesyn.sig │ │ │ ├── strategy.fun │ │ │ ├── strategy.sig │ │ │ ├── uniquesearch.fun │ │ │ ├── uniquesearch.sig │ │ │ ├── weaken.fun │ │ │ └── weaken.sig │ │ ├── modes │ │ │ ├── README │ │ │ ├── WALK │ │ │ ├── modecheck.fun │ │ │ ├── modecheck.sig │ │ │ ├── modedec.fun │ │ │ ├── modedec.sig │ │ │ ├── modeprint.fun │ │ │ ├── modeprint.sig │ │ │ ├── modes.sml │ │ │ ├── modesyn.sml │ │ │ ├── modetable.fun │ │ │ ├── modetable.sig │ │ │ └── sources.cm │ │ ├── modules │ │ │ ├── modsyn.fun │ │ │ ├── modsyn.sig │ │ │ ├── modules.sml │ │ │ └── sources.cm │ │ ├── names │ │ │ ├── README │ │ │ ├── WALK │ │ │ ├── names.fun │ │ │ └── names.sig │ │ ├── opsem │ │ │ ├── README │ │ │ ├── WALK │ │ │ ├── absmachine.fun │ │ │ ├── absmachine.sig │ │ │ ├── abstract.fun │ │ │ ├── abstract.sig │ │ │ ├── index.fun │ │ │ ├── index.sig │ │ │ ├── opsem.sml │ │ │ ├── ptrecon.fun │ │ │ ├── ptrecon.sig │ │ │ ├── sources.cm │ │ │ ├── swmachine.fun │ │ │ ├── tabled.fun │ │ │ ├── tabled.sig │ │ │ ├── tmachine.fun │ │ │ ├── trace.fun │ │ │ └── trace.sig │ │ ├── order │ │ │ ├── README │ │ │ ├── WALK │ │ │ ├── order.fun │ │ │ ├── order.sig │ │ │ ├── order.sml │ │ │ └── sources.cm │ │ ├── paths │ │ │ ├── README │ │ │ ├── WALK │ │ │ ├── origins.fun │ │ │ ├── origins.sig │ │ │ ├── paths.fun │ │ │ ├── paths.sig │ │ │ ├── paths.sml │ │ │ └── sources.cm │ │ ├── print │ │ │ ├── README │ │ │ ├── WALK │ │ │ ├── clause-print.fun │ │ │ ├── clause-print.sig │ │ │ ├── print-omdoc.fun │ │ │ ├── print-twega.fun │ │ │ ├── print-twega.sig │ │ │ ├── print-xml.fun │ │ │ ├── print-xml.sig │ │ │ ├── print.fun │ │ │ ├── print.sig │ │ │ ├── print.sml │ │ │ ├── sources.cm │ │ │ ├── symbol.fun │ │ │ ├── symbol.sig │ │ │ ├── traverse.fun │ │ │ └── traverse.sig │ │ ├── prover │ │ │ ├── data.fun │ │ │ ├── data.sig │ │ │ ├── fill.fun │ │ │ ├── fill.sig │ │ │ ├── fixedpoint.fun │ │ │ ├── fixedpoint.sig │ │ │ ├── interactive.fun │ │ │ ├── interactive.sig │ │ │ ├── introduce.fun │ │ │ ├── introduce.sig │ │ │ ├── prover.sml │ │ │ ├── recurse.sig │ │ │ ├── search.fun │ │ │ ├── search.sig │ │ │ ├── sources.cm │ │ │ ├── split.fun │ │ │ ├── split.sig │ │ │ ├── state.fun │ │ │ ├── state.sig │ │ │ ├── stateprint.fun │ │ │ ├── stateprint.sig │ │ │ ├── weaken.fun │ │ │ └── weaken.sig │ │ ├── server │ │ │ ├── server.sml │ │ │ ├── sigint-mlton.sml │ │ │ ├── sigint-polyml.sml │ │ │ ├── sigint-smlnj.sml │ │ │ ├── sigint.sig │ │ │ └── sources.cm │ │ ├── solvers │ │ │ ├── cs-eq-bools.fun │ │ │ ├── cs-eq-field.fun │ │ │ ├── cs-eq-field.sig │ │ │ ├── cs-eq-integers.fun │ │ │ ├── cs-eq-integers.sig │ │ │ ├── cs-eq-strings.fun │ │ │ ├── cs-ineq-field.fun │ │ │ ├── cs-ineq-integers.fun │ │ │ ├── cs-integers-word.fun │ │ │ ├── cs-manager.fun │ │ │ ├── cs-manager.sig │ │ │ ├── cs.sig │ │ │ ├── solvers.sml │ │ │ └── sources.cm │ │ ├── stream │ │ │ ├── README │ │ │ ├── WALK │ │ │ ├── sources.cm │ │ │ └── stream.sml │ │ ├── style │ │ │ ├── sources.cm │ │ │ ├── style.fun │ │ │ ├── style.sig │ │ │ └── style.sml │ │ ├── subordinate │ │ │ ├── README │ │ │ ├── WALK │ │ │ ├── intset.sml │ │ │ ├── subordinate.fun │ │ │ └── subordinate.sig │ │ ├── table │ │ │ ├── README │ │ │ ├── WALK │ │ │ ├── hash-table.sml │ │ │ ├── hash.sml │ │ │ ├── queue.sig │ │ │ ├── queue.sml │ │ │ ├── red-black-tree.fun │ │ │ ├── redblack.sml │ │ │ ├── ring.sig │ │ │ ├── ring.sml │ │ │ ├── sources.cm │ │ │ ├── sparse-array.fun │ │ │ ├── sparse-array.sig │ │ │ ├── sparse-array2.fun │ │ │ ├── sparse-array2.sig │ │ │ ├── string-hash.sig │ │ │ ├── string-hash.sml │ │ │ ├── table.sig │ │ │ └── table.sml │ │ ├── tabling │ │ │ ├── sources.cm │ │ │ ├── tabled.sml │ │ │ ├── tabledsyn.fun │ │ │ └── tabledsyn.sig │ │ ├── terminate │ │ │ ├── README │ │ │ ├── WALK │ │ │ ├── checking.fun │ │ │ ├── checking.sig │ │ │ ├── reduces.fun │ │ │ ├── reduces.sig │ │ │ ├── sources.cm │ │ │ └── terminate.sml │ │ ├── thm │ │ │ ├── README │ │ │ ├── WALK │ │ │ ├── sources.cm │ │ │ ├── thm.fun │ │ │ ├── thm.sig │ │ │ ├── thm.sml │ │ │ ├── thmprint.fun │ │ │ ├── thmprint.sig │ │ │ ├── thmsyn.fun │ │ │ └── thmsyn.sig │ │ ├── timing │ │ │ ├── README │ │ │ ├── WALK │ │ │ ├── sources.cm │ │ │ ├── timers.fun │ │ │ ├── timers.sig │ │ │ ├── timers.sml │ │ │ └── timing.sml │ │ ├── tomega │ │ │ ├── abstract.fun │ │ │ ├── abstract.sig │ │ │ ├── converter.fun │ │ │ ├── converter.sig │ │ │ ├── coverage.fun │ │ │ ├── coverage.sig │ │ │ ├── normalize.fun │ │ │ ├── normalize.sig │ │ │ ├── opsem.fun │ │ │ ├── opsem.sig │ │ │ ├── redundant.fun │ │ │ ├── redundant.sig │ │ │ ├── sources.cm │ │ │ ├── tomega.sml │ │ │ ├── tomegaprint.fun │ │ │ ├── tomegaprint.sig │ │ │ ├── typecheck.fun │ │ │ ├── typecheck.sig │ │ │ ├── unify.fun │ │ │ └── unify.sig │ │ ├── trail │ │ │ ├── README │ │ │ ├── notrail.sml │ │ │ ├── sources.cm │ │ │ ├── trail.sig │ │ │ └── trail.sml │ │ ├── typecheck │ │ │ ├── README │ │ │ ├── WALK │ │ │ ├── sources.cm │ │ │ ├── strict.fun │ │ │ ├── strict.sig │ │ │ ├── typecheck.fun │ │ │ ├── typecheck.sig │ │ │ └── typecheck.sml │ │ ├── unique │ │ │ ├── sources.cm │ │ │ ├── unique.fun │ │ │ ├── unique.sig │ │ │ └── unique.sml │ │ └── worldcheck │ │ │ ├── README │ │ │ ├── TODO │ │ │ ├── sources.cm │ │ │ ├── worldcheck.sml │ │ │ ├── worldify.fun │ │ │ ├── worldify.sig │ │ │ ├── worldprint.fun │ │ │ ├── worldprint.sig │ │ │ ├── worldsyn.fun │ │ │ └── worldsyn.sig │ ├── tex │ │ ├── code.sty │ │ ├── example.tex │ │ └── twelf.sty │ ├── twelf-server.sml │ ├── twelf-sml.sml │ └── vim │ │ ├── README │ │ ├── filetype.vim │ │ └── syntax │ │ └── twelf.vim │ └── typecheck │ ├── typecheck.fun │ └── typecheck.sig └── elphin ├── examples ├── arith │ └── arith.d ├── bool │ └── bool.d ├── canonical │ └── sub.d ├── circuit │ └── circuit.d ├── combinator │ └── combinator.d ├── debruijn │ └── debruijn.d ├── lambda │ ├── continuation.d │ ├── continuation.old.d │ ├── copy.d │ ├── counting.d │ ├── domain.d │ ├── mini-ml.d │ ├── par.d │ └── testing.d ├── list │ ├── README │ └── list.d ├── logic │ └── logic.d └── string │ └── string.d └── src ├── Makefile ├── README ├── elaboration ├── abstract.fun ├── abstract.sig ├── abstract.sml ├── convert.fun ├── convert.sig ├── extSyntax.sml ├── intSyntax.sml ├── normalizeNabla.sml ├── printNablaExt.sml ├── printNablaInt.sml ├── sources.cm ├── sources.syntax.cm └── unifyNabla.sml ├── frontend ├── LFparsing.sml ├── interface.fun ├── interface.sig ├── ml-yacc-lib-mod │ ├── base.sig │ ├── join.sml │ ├── lrtable.sml │ ├── parser2.sml │ ├── sources.cm │ └── stream.sml ├── nabla.fun ├── nabla.grm ├── nabla.lex ├── nabla.sig ├── nabla.sml ├── parse-prg.fun ├── parse-prg.sig ├── sources.cm └── sources.frontend.cm ├── nabla.sml ├── opsem ├── opsem.fun ├── opsem.sig └── sources.cm ├── sources.cm ├── twelf ├── .cvsignore ├── DISTRIBUTE ├── DISTRIBUTE.build ├── DISTRIBUTE.sed ├── FILES ├── HISTORY ├── InstallShield │ ├── INSTALL.txt │ ├── README.TXT │ ├── README.final │ ├── twelf-init.el │ ├── twelf-server.bat │ └── twelf1-2.iwz ├── Makefile ├── OLD │ ├── Makefile.NT │ ├── NOTES │ ├── README-1.2 │ ├── README-1.2R9 │ └── README.NT ├── README ├── TEST │ ├── all-nt.sml │ ├── all.sml │ ├── anonymous.elf │ ├── clause.elf │ ├── constr.elf │ ├── constr2.elf │ ├── cover.elf │ ├── cp.elf │ ├── cp2nd.sml │ ├── cp3rd.sml │ ├── cr.sml │ ├── evenodd.elf │ ├── kevin.elf │ ├── lexing.elf │ ├── location.elf │ ├── m.sml │ ├── meta.sml │ ├── misc.elf │ ├── modes.elf │ ├── multimode.elf │ ├── occurs.elf │ ├── parsing.elf │ ├── relfun.sml │ ├── skolem.sml │ ├── solving.elf │ ├── strict.elf │ ├── subord.elf │ ├── term.elf │ ├── test.cfg │ ├── total.elf │ ├── tprecon.elf │ ├── unique.elf │ ├── unsafe.sml │ ├── uscore.elf │ └── worlds.elf ├── TODO ├── bin │ ├── .cvsignore │ ├── .dbase │ │ ├── .cvsignore │ │ └── README │ ├── .heap │ │ ├── .cvsignore │ │ └── README │ ├── .mkexec │ ├── .twelf-server │ ├── .twelf-server.bat │ ├── .twelf-sml │ ├── .twelf-sml.bat │ ├── clean │ ├── clean-cm │ ├── create-tags │ ├── tag-examples │ └── tag-twelf ├── delphin.cm ├── delphin.sml ├── doc │ ├── UPDATE │ ├── dvi │ │ └── .cvsignore │ ├── guide │ │ ├── .cvsignore │ │ ├── Makefile │ │ ├── README │ │ ├── config.embed │ │ └── twelf.texi │ ├── html │ │ ├── .cvsignore │ │ └── index.html │ ├── info │ │ └── .cvsignore │ ├── pdf │ │ └── .cvsignore │ └── ps │ │ └── .cvsignore ├── emacs │ ├── .cvsignore │ ├── README │ ├── auc-menu.el │ ├── twelf-font.el │ ├── twelf-hilit.el │ ├── twelf-init.el │ └── twelf.el ├── examples-clp │ ├── arith │ │ ├── eval.elf │ │ ├── examples.quy │ │ ├── parse.elf │ │ ├── sources.cfg │ │ └── test.cfg │ ├── base │ │ ├── base.elf │ │ ├── examples.quy │ │ ├── sources.cfg │ │ └── test.cfg │ ├── crypt │ │ ├── crypt.elf │ │ ├── examples.quy │ │ ├── sources.cfg │ │ └── test.cfg │ ├── integers │ │ ├── base.elf │ │ ├── cfract.elf │ │ ├── examples.quy │ │ ├── integers.elf │ │ ├── meta.elf │ │ ├── sources.cfg │ │ └── test.cfg │ ├── laplace │ │ ├── examples.quy │ │ ├── laplace.elf │ │ ├── sources.cfg │ │ └── test.cfg │ ├── lists │ │ ├── examples.quy │ │ ├── lists.elf │ │ ├── sources.cfg │ │ └── test.cfg │ ├── mortgage │ │ ├── examples.quy │ │ ├── mortgage.elf │ │ ├── sources.cfg │ │ └── test.cfg │ ├── pelletier │ │ ├── examples.quy │ │ ├── pelletier.elf │ │ ├── sources.cfg │ │ └── test.cfg │ └── sieve │ │ ├── examples.quy │ │ ├── sieve.elf │ │ ├── sieve2.elf │ │ ├── sources.cfg │ │ └── test.cfg ├── examples-delphin │ ├── carsten │ │ ├── mini-ml │ │ │ ├── add.delphin │ │ │ ├── bug1 │ │ │ ├── count.delphin │ │ │ ├── identity.delphin │ │ │ ├── mini-ml.elf │ │ │ ├── run.sml │ │ │ └── sources.cfg │ │ ├── nd │ │ │ ├── NOTES │ │ │ └── prover.delphin │ │ ├── prop-calc │ │ │ ├── equiv.delphin │ │ │ ├── prop-calc.elf │ │ │ └── run.sml │ │ └── prover │ │ │ ├── nd.elf │ │ │ ├── prop-calc.elf │ │ │ ├── prover.delphin │ │ │ ├── prover.elf │ │ │ ├── run.sml │ │ │ └── search.delphin │ └── mini-ml │ │ ├── count.delphin │ │ ├── mini-ml.elf │ │ └── sources.cfg ├── examples │ ├── README │ ├── arith │ │ ├── README │ │ ├── arith.elf │ │ ├── arith.thm │ │ ├── sources.cfg │ │ └── test.cfg │ ├── ccc │ │ ├── README │ │ ├── abs-env.elf │ │ ├── catlem.elf │ │ ├── ccc.elf │ │ ├── conc.elf │ │ ├── conc.thm │ │ ├── cong.elf │ │ ├── eqpres1.elf │ │ ├── eqpres2.elf │ │ ├── examples.quy │ │ ├── inv1.elf │ │ ├── inv2.elf │ │ ├── lambda.elf │ │ ├── pf.dvi │ │ ├── refl.elf │ │ ├── sources.cfg │ │ ├── spass.cfg │ │ ├── spass.elf │ │ ├── spass.sml │ │ ├── subext.elf │ │ └── test.cfg │ ├── church-rosser │ │ ├── README │ │ ├── church-rosser.thm │ │ ├── cr.thm │ │ ├── equiv.elf │ │ ├── examples.quy │ │ ├── lam.elf │ │ ├── ord-cr.elf │ │ ├── ord-lemmas.elf │ │ ├── ord-red.elf │ │ ├── par-cr.elf │ │ ├── par-lemmas.elf │ │ ├── par-red.elf │ │ ├── sources.cfg │ │ ├── test-unsafe.cfg │ │ ├── test.cfg │ │ └── test.tag │ ├── compile │ │ ├── README │ │ ├── cls │ │ │ ├── cls-complete.elf │ │ │ ├── cls-sound.elf │ │ │ ├── cls.elf │ │ │ ├── compute.elf │ │ │ ├── debruijn.elf │ │ │ ├── examples.quy │ │ │ ├── feval.elf │ │ │ ├── mini-ml.elf │ │ │ ├── slow.quy │ │ │ ├── sources.cfg │ │ │ ├── test.cfg │ │ │ ├── trans.elf │ │ │ └── trans2.elf │ │ ├── cpm │ │ │ ├── ceval-complete.elf │ │ │ ├── ceval-complete.thm │ │ │ ├── ceval-sound.elf │ │ │ ├── ceval.elf │ │ │ ├── cpm.elf │ │ │ ├── evalv.elf │ │ │ ├── examples.quy │ │ │ ├── mini-mlv.elf │ │ │ ├── proof-equiv.elf │ │ │ ├── proof-equiv.thm │ │ │ ├── slow.quy │ │ │ ├── sources.cfg │ │ │ ├── test.cfg │ │ │ ├── theorems.elf │ │ │ └── theorems.thm │ │ ├── cps │ │ │ ├── cps-eval.elf │ │ │ ├── cps.elf │ │ │ ├── examples.quy │ │ │ ├── mini-ml.elf │ │ │ ├── ml-cps.elf │ │ │ ├── sources.cfg │ │ │ └── test.cfg │ │ ├── cxm │ │ │ ├── evalv.elf │ │ │ ├── examples.quy │ │ │ ├── mini-mlv.elf │ │ │ ├── sources.cfg │ │ │ ├── test.cfg │ │ │ └── xeval.elf │ │ ├── debruijn │ │ │ ├── debruijn.elf │ │ │ ├── eval.elf │ │ │ ├── examples.quy │ │ │ ├── feval.elf │ │ │ ├── map-eval.elf │ │ │ ├── mini-ml.elf │ │ │ ├── sources.cfg │ │ │ ├── test.cfg │ │ │ ├── trans.elf │ │ │ ├── val-lemmas.elf │ │ │ └── value.elf │ │ └── debruijn1 │ │ │ ├── debruijn.elf │ │ │ ├── eval.elf │ │ │ ├── examples.quy │ │ │ ├── feval.elf │ │ │ ├── map-eval.elf │ │ │ ├── mini-ml.elf │ │ │ ├── sources.cfg │ │ │ ├── test.cfg │ │ │ └── trans.elf │ ├── cpsocc │ │ ├── NOTES │ │ ├── READ.ME │ │ ├── corr.elf │ │ ├── cpsBNF.elf │ │ ├── def1+5+fig4.elf │ │ ├── def13.elf │ │ ├── def16.elf │ │ ├── def3+6+fig5.elf │ │ ├── dsBNF.elf │ │ ├── examples.quy │ │ ├── examples.quy.orig │ │ ├── fig1.elf │ │ ├── fig10.elf │ │ ├── fig11.elf │ │ ├── fig12.elf │ │ ├── fig13.elf │ │ ├── fig7.elf │ │ ├── fig8.elf │ │ ├── fig9.elf │ │ ├── lemma14.elf │ │ ├── lemma17.elf │ │ ├── lemma7.elf │ │ ├── lemma9.elf │ │ ├── load.sml │ │ ├── sources.cfg │ │ ├── test.cfg │ │ ├── test.quy │ │ ├── test.quy.orig │ │ ├── th10.elf │ │ ├── th15.elf │ │ ├── th18.elf │ │ ├── th2.elf │ │ ├── th4.elf │ │ └── th8.elf │ ├── cut-elim │ │ ├── README │ │ ├── cl-admit.elf │ │ ├── cl-cut.elf │ │ ├── cl-elim.elf │ │ ├── cl.elf │ │ ├── cl.thm │ │ ├── examples.quy │ │ ├── formulas.elf │ │ ├── int-admit.elf │ │ ├── int-cut.elf │ │ ├── int-elim.elf │ │ ├── int.elf │ │ ├── int.thm │ │ ├── sources.cfg │ │ └── test.cfg │ ├── fol │ │ ├── README │ │ ├── fol.elf │ │ ├── fol.thm │ │ ├── sources.cfg │ │ └── test.cfg │ ├── guide │ │ ├── arith.elf │ │ ├── lam.elf │ │ ├── lists.elf │ │ ├── nd.elf │ │ ├── sources.cfg │ │ └── test.cfg │ ├── handbook │ │ ├── README │ │ ├── fol.elf │ │ ├── sources.cfg │ │ └── test.cfg │ ├── incll │ │ ├── README │ │ ├── bff-incll.elf │ │ ├── bff-incll.quy │ │ ├── cpm-incll.elf │ │ ├── cpm-incll.quy │ │ ├── incll.elf │ │ ├── iosequents.elf │ │ ├── lists-incll.elf │ │ ├── lists-incll.quy │ │ ├── lists.elf │ │ ├── parse-incll.elf │ │ ├── parse-incll.quy │ │ ├── parse-lolli.elf │ │ ├── parse-lolli.quy │ │ ├── pre-incll.elf │ │ ├── pre-incll.quy │ │ ├── search-incll.elf │ │ ├── search-incll.quy │ │ ├── sort-incll.elf │ │ ├── sort-incll.quy │ │ ├── sources.cfg │ │ └── test.cfg │ ├── kolm │ │ ├── README │ │ ├── complete.elf │ │ ├── examples.quy │ │ ├── fol.elf │ │ ├── kolmtrans.elf │ │ ├── nj.elf │ │ ├── nk.elf │ │ ├── report.ps │ │ ├── sound.elf │ │ ├── sources.cfg │ │ └── test.cfg │ ├── lp-horn │ │ ├── canon.elf │ │ ├── conv.elf │ │ ├── examples.quy │ │ ├── iscan.elf │ │ ├── natded.elf │ │ ├── sources.cfg │ │ ├── test.cfg │ │ ├── uni-can.elf │ │ ├── uni-can.thm │ │ ├── uni-complete.elf │ │ ├── uni-complete.thm │ │ ├── uni-sound.elf │ │ ├── uni-sound.thm │ │ └── uniform.elf │ ├── lp │ │ ├── canon.elf │ │ ├── cont.elf │ │ ├── conv.elf │ │ ├── examples.elf │ │ ├── examples.quy │ │ ├── fohh-formulas.elf │ │ ├── fohh.elf │ │ ├── iscan.elf │ │ ├── natded.elf │ │ ├── res-complete.elf │ │ ├── res-sound.elf │ │ ├── resolution.elf │ │ ├── sources.cfg │ │ ├── test.cfg │ │ ├── uni-complete.elf │ │ ├── uni-sound.elf │ │ └── uniform.elf │ ├── mini-ml │ │ ├── README │ │ ├── closed.elf │ │ ├── eval.elf │ │ ├── eval1.elf │ │ ├── eval2.elf │ │ ├── examples.quy │ │ ├── examples1.quy │ │ ├── mini-ml.elf │ │ ├── reduce.elf │ │ ├── reduce.thm │ │ ├── sources.cfg │ │ ├── sources1.cfg │ │ ├── test.cfg │ │ ├── tp-preserve.elf │ │ ├── tp-preserve.thm │ │ ├── tp.elf │ │ ├── tpinf.elf │ │ ├── val-sound.elf │ │ ├── val-sound.thm │ │ └── value.elf │ ├── polylam │ │ ├── examples.quy │ │ ├── polylam.elf │ │ ├── sources.cfg │ │ └── test.cfg │ ├── prop-calc │ │ ├── README │ │ ├── equiv.elf │ │ ├── equiv.thm │ │ ├── examples.quy │ │ ├── nd.elf │ │ ├── nd.tex │ │ ├── ndclass.elf │ │ ├── prop-calc-solution.elf │ │ ├── prop-calc.elf │ │ ├── sources.cfg │ │ ├── test.cfg │ │ ├── thm1.elf │ │ ├── thm2.elf │ │ └── thm3.elf │ └── tabled │ │ ├── README │ │ ├── all.sml │ │ ├── ccc │ │ ├── README │ │ ├── ccc.elf │ │ ├── tab-examples.quy │ │ └── tab.cfg │ │ ├── cr │ │ ├── lam.elf │ │ ├── ord-red.elf │ │ ├── par-red.elf │ │ ├── tab-examples.quy │ │ └── tab.cfg │ │ ├── mini-ml │ │ ├── examples.quy │ │ ├── mini-ml.elf │ │ ├── programs.elf │ │ ├── reduce.elf │ │ ├── tab.cfg │ │ └── value.elf │ │ ├── parsing │ │ ├── arithml.cfg │ │ ├── arithml.elf │ │ ├── arithml.quy │ │ ├── foll.cfg │ │ ├── foll.elf │ │ ├── foll.quy │ │ ├── tab.cfg │ │ └── warren.elf │ │ ├── poly │ │ ├── mini-ml.elf │ │ ├── tab-examples.quy │ │ ├── tab.cfg │ │ ├── tp.elf │ │ └── tpinf.elf │ │ ├── refine │ │ ├── norefex.quy │ │ ├── notab.quy │ │ ├── programs.elf │ │ ├── refex.elf │ │ ├── refex.quy │ │ └── tab.cfg │ │ ├── subtype │ │ ├── mini-ml.elf │ │ ├── subtype.elf │ │ ├── tab-examples.quy │ │ └── tab.cfg │ │ ├── subtype1 │ │ ├── basic.elf │ │ ├── mini-ml.elf │ │ ├── tab-examples.quy │ │ └── tab.cfg │ │ └── tests │ │ ├── tab.cfg │ │ ├── test1.elf │ │ ├── test2.elf │ │ ├── test3.elf │ │ ├── test4.elf │ │ ├── test5.elf │ │ ├── test6.elf │ │ └── test7.elf ├── exercises │ ├── README │ ├── opt-eval │ │ ├── README │ │ ├── eval.elf │ │ ├── examples.quy │ │ ├── mini-ml.elf │ │ ├── opt-equiv1.elf │ │ ├── opt-equiv1.thm │ │ ├── opt-equiv2.elf │ │ ├── opt-equiv2.thm │ │ ├── opt-eval.elf │ │ ├── opt-mini-ml.elf │ │ ├── opt-rep1.elf │ │ ├── opt-rep2.elf │ │ ├── sources.cfg │ │ └── test.cfg │ └── units │ │ ├── NOTES │ │ ├── README │ │ ├── constants.elf │ │ ├── eqtype-lemmas.elf │ │ ├── eqtypes.elf │ │ ├── equnits-alg.elf │ │ ├── equnits-sound.elf │ │ ├── equnits.elf │ │ ├── eval.elf │ │ ├── examples.quy │ │ ├── language.elf │ │ ├── number.elf │ │ ├── sources.cfg │ │ ├── test.cfg │ │ ├── tp-complete.elf │ │ ├── tp-inf.elf │ │ ├── tp-preserve.elf │ │ ├── tp-rules.elf │ │ ├── tp-sound.elf │ │ ├── types.elf │ │ ├── units.elf │ │ └── value.elf ├── load.sml ├── mlton │ ├── Makefile │ ├── install.sh │ ├── twelf-server-20030716.cm │ ├── twelf-server-97.cm │ ├── twelf-server.cm │ └── twelf-server.sml ├── polyml │ ├── .mkexec │ ├── Makefile │ ├── install.sh │ ├── load-delphin.sml │ ├── load-twelf.sml │ ├── load.sml │ ├── twelf-server-dbase.sml │ ├── twelf-server.sml │ ├── twelf-sml-dbase.sml │ └── twelf-sml.sml ├── rpm │ ├── INSTALL │ ├── README │ ├── logo.gif │ ├── twelf-1.3.spec │ ├── twelf-1.4.spec │ ├── twelf-files │ ├── twelf-install │ └── twelf-uninstall ├── server.cm ├── smlnj │ ├── Makefile │ ├── README │ ├── delphin.sml │ ├── install.sh │ ├── twelf-server.sml │ └── twelf-sml.sml ├── sources.cm ├── src │ ├── WALK │ ├── compat │ │ ├── array-97.sml │ │ ├── array-slice.sig │ │ ├── array-slice.sml │ │ ├── array.sig │ │ ├── compat-97.sml │ │ ├── compat-mlton-20030716.sml │ │ ├── compat-poly02.sml │ │ ├── compat-smlnj03.sml │ │ ├── compat-smlnj98.sml │ │ ├── compat.fun │ │ ├── compat.sig │ │ ├── compat.sml │ │ ├── mono-array-slice.sig │ │ ├── path-97.sml │ │ ├── path.sig │ │ ├── sources.cm │ │ ├── substring-97.sml │ │ ├── substring.sig │ │ ├── text-io-97.sml │ │ ├── text-io.sig │ │ ├── timer-97.sml │ │ ├── timer.sig │ │ ├── vector-97.sml │ │ ├── vector-slice.sig │ │ ├── vector-slice.sml │ │ ├── vector.sig │ │ └── word8-array-slice.sml │ ├── compile │ │ ├── README │ │ ├── assign.fun │ │ ├── assign.sig │ │ ├── compile.fun │ │ ├── compile.sig │ │ ├── compile.sml │ │ ├── compsyn.fun │ │ ├── compsyn.sig │ │ ├── cprint.fun │ │ ├── cprint.sig │ │ └── sources.cm │ ├── cover │ │ ├── README │ │ ├── cover.fun │ │ ├── cover.sig │ │ ├── cover.sml │ │ ├── sources.cm │ │ ├── total.fun │ │ └── total.sig │ ├── delphin │ │ ├── delphin.fun │ │ ├── delphin.grm │ │ ├── delphin.lex │ │ ├── delphin.sig │ │ ├── delphin.sml │ │ ├── dextsyn.fun │ │ ├── dextsyn.sig │ │ ├── interface.fun │ │ ├── interface.sig │ │ ├── ml-yacc-lib-mod │ │ │ ├── base.sig │ │ │ ├── join.sml │ │ │ ├── lrtable.sml │ │ │ ├── parser2.sml │ │ │ ├── sources.cm │ │ │ └── stream.sml │ │ ├── parse-prg.fun │ │ ├── parse-prg.sig │ │ ├── sources.cm │ │ ├── trans.fun │ │ └── trans.sig │ ├── domains │ │ ├── README │ │ ├── domains.sml │ │ ├── field.sig │ │ ├── integers-mod.fun │ │ ├── integers.fun │ │ ├── integers.sig │ │ ├── ordered-field.sig │ │ ├── rationals.fun │ │ ├── rationals.sig │ │ └── sources.cm │ ├── flit │ │ ├── README │ │ ├── flit.fun │ │ ├── flit.sig │ │ ├── flit.sml │ │ └── sources.cm │ ├── formatter │ │ ├── README │ │ ├── formatter.fun │ │ ├── formatter.sig │ │ ├── formatter.sml │ │ └── sources.cm │ ├── frontend │ │ ├── WALK │ │ ├── fquery.fun │ │ ├── fquery.sig │ │ ├── frontend.sml │ │ ├── lexer.fun │ │ ├── lexer.sig │ │ ├── parse-condec.fun │ │ ├── parse-condec.sig │ │ ├── parse-fixity.fun │ │ ├── parse-fixity.sig │ │ ├── parse-mode.fun │ │ ├── parse-mode.sig │ │ ├── parse-module.fun │ │ ├── parse-module.sig │ │ ├── parse-query.fun │ │ ├── parse-query.sig │ │ ├── parse-term.fun │ │ ├── parse-term.sig │ │ ├── parse-thm.fun │ │ ├── parse-thm.sig │ │ ├── parser.fun │ │ ├── parser.sig │ │ ├── parsing.fun │ │ ├── parsing.sig │ │ ├── recon-condec.fun │ │ ├── recon-condec.sig │ │ ├── recon-mode.fun │ │ ├── recon-mode.sig │ │ ├── recon-module.fun │ │ ├── recon-module.sig │ │ ├── recon-query.fun │ │ ├── recon-query.sig │ │ ├── recon-term.fun │ │ ├── recon-term.sig │ │ ├── recon-thm.fun │ │ ├── recon-thm.sig │ │ ├── solve.fun │ │ ├── solve.sig │ │ ├── sources.cm │ │ ├── twelf.fun │ │ ├── twelf.sig │ │ ├── unknownexn-smlnj.sml │ │ ├── unknownexn-stub.sml │ │ ├── unknownexn.fun │ │ └── unknownexn.sig │ ├── global │ │ ├── README │ │ ├── WALK │ │ ├── global.sig │ │ ├── global.sml │ │ └── sources.cm │ ├── heuristic │ │ ├── heuristic.fun │ │ ├── heuristic.sig │ │ ├── heuristic.sum.fun │ │ └── sources.cm │ ├── index │ │ ├── README │ │ ├── WALK │ │ ├── index-skolem.fun │ │ ├── index.fun │ │ ├── index.sig │ │ ├── index.sml │ │ └── sources.cm │ ├── int-inf │ │ ├── README │ │ ├── int-inf-sig.sml │ │ ├── int-inf.sml │ │ └── sources.cm │ ├── lambda │ │ ├── README │ │ ├── WALK │ │ ├── abstract.fun │ │ ├── abstract.sig │ │ ├── approx.fun │ │ ├── approx.sig │ │ ├── constraints.fun │ │ ├── constraints.sig │ │ ├── conv.fun │ │ ├── conv.sig │ │ ├── fgnopn.sig │ │ ├── fgnopntable.fun │ │ ├── intsyn.fun │ │ ├── intsyn.sig │ │ ├── lambda.sml │ │ ├── normalize.fun │ │ ├── normalize.sig │ │ ├── sources.cm │ │ ├── tomega.fun │ │ ├── tomega.sig │ │ ├── tomega.sml │ │ ├── unify.fun │ │ ├── unify.sig │ │ ├── whnf.fun │ │ └── whnf.sig │ ├── m2 │ │ ├── README │ │ ├── WALK │ │ ├── filling.fun │ │ ├── filling.sig │ │ ├── init.fun │ │ ├── init.sig │ │ ├── lemma.fun │ │ ├── lemma.sig │ │ ├── m2.sml │ │ ├── meta-abstract.fun │ │ ├── meta-abstract.sig │ │ ├── meta-global.sig │ │ ├── meta-global.sml │ │ ├── meta-print.fun │ │ ├── meta-print.sig │ │ ├── metasyn.fun │ │ ├── metasyn.sig │ │ ├── mpi.fun │ │ ├── mpi.sig │ │ ├── prover.fun │ │ ├── prover.sig │ │ ├── qed.fun │ │ ├── qed.sig │ │ ├── recursion.fun │ │ ├── recursion.sig │ │ ├── search.fun │ │ ├── search.sig │ │ ├── skolem.fun │ │ ├── skolem.sig │ │ ├── sources.cm │ │ ├── splitting.fun │ │ ├── splitting.sig │ │ ├── strategy.fun │ │ └── strategy.sig │ ├── meta │ │ ├── NOTES │ │ ├── README │ │ ├── WALK │ │ ├── abstract.fun │ │ ├── abstract.sig │ │ ├── data.fun │ │ ├── data.sig │ │ ├── filling.fun │ │ ├── filling.sig │ │ ├── funnames.fun │ │ ├── funnames.sig │ │ ├── funprint.fun │ │ ├── funprint.sig │ │ ├── funsyn.fun │ │ ├── funsyn.sig │ │ ├── funtypecheck.fun │ │ ├── funtypecheck.sig │ │ ├── funweaken.fun │ │ ├── funweaken.sig │ │ ├── global.fun │ │ ├── global.sig │ │ ├── inference.fun │ │ ├── inference.sig │ │ ├── init.fun │ │ ├── init.sig │ │ ├── interpret.sig │ │ ├── meta.sml │ │ ├── mpi.fun │ │ ├── mpi.sig │ │ ├── print.fun │ │ ├── print.sig │ │ ├── prover.fun │ │ ├── prover.sig │ │ ├── recursion.fun │ │ ├── recursion.sig │ │ ├── relfun.fun │ │ ├── relfun.sig │ │ ├── search.fun │ │ ├── search.sig │ │ ├── sources.cm │ │ ├── splitting.fun │ │ ├── splitting.sig │ │ ├── statesyn.fun │ │ ├── statesyn.sig │ │ ├── strategy.fun │ │ ├── strategy.sig │ │ ├── uniquesearch.fun │ │ ├── uniquesearch.sig │ │ ├── weaken.fun │ │ └── weaken.sig │ ├── modes │ │ ├── README │ │ ├── WALK │ │ ├── modecheck.fun │ │ ├── modecheck.sig │ │ ├── modedec.fun │ │ ├── modedec.sig │ │ ├── modeprint.fun │ │ ├── modeprint.sig │ │ ├── modes.sml │ │ ├── modesyn.sml │ │ ├── modetable.fun │ │ ├── modetable.sig │ │ └── sources.cm │ ├── modules │ │ ├── modsyn.fun │ │ ├── modsyn.sig │ │ ├── modules.sml │ │ └── sources.cm │ ├── names │ │ ├── README │ │ ├── WALK │ │ ├── names.fun │ │ ├── names.sig │ │ ├── names.sml │ │ └── sources.cm │ ├── opsem │ │ ├── README │ │ ├── WALK │ │ ├── absmachine.fun │ │ ├── absmachine.sig │ │ ├── abstract.fun │ │ ├── abstract.sig │ │ ├── index.fun │ │ ├── index.sig │ │ ├── opsem.sml │ │ ├── ptrecon.fun │ │ ├── ptrecon.sig │ │ ├── sources.cm │ │ ├── swmachine.fun │ │ ├── tabled.fun │ │ ├── tabled.sig │ │ ├── tmachine.fun │ │ ├── trace.fun │ │ └── trace.sig │ ├── order │ │ ├── README │ │ ├── WALK │ │ ├── order.fun │ │ ├── order.sig │ │ ├── order.sml │ │ └── sources.cm │ ├── paths │ │ ├── README │ │ ├── WALK │ │ ├── origins.fun │ │ ├── origins.sig │ │ ├── paths.fun │ │ ├── paths.sig │ │ ├── paths.sml │ │ └── sources.cm │ ├── print │ │ ├── README │ │ ├── WALK │ │ ├── clause-print.fun │ │ ├── clause-print.sig │ │ ├── print-omdoc.fun │ │ ├── print-twega.fun │ │ ├── print-twega.sig │ │ ├── print-xml.fun │ │ ├── print-xml.sig │ │ ├── print.fun │ │ ├── print.sig │ │ ├── print.sml │ │ ├── sources.cm │ │ ├── symbol.fun │ │ ├── symbol.sig │ │ ├── traverse.fun │ │ └── traverse.sig │ ├── prover │ │ ├── data.fun │ │ ├── data.sig │ │ ├── fill.fun │ │ ├── fill.sig │ │ ├── fixedpoint.fun │ │ ├── fixedpoint.sig │ │ ├── interactive.fun │ │ ├── interactive.sig │ │ ├── introduce.fun │ │ ├── introduce.sig │ │ ├── prover.sml │ │ ├── recurse.sig │ │ ├── search.fun │ │ ├── search.sig │ │ ├── sources.cm │ │ ├── split.fun │ │ ├── split.sig │ │ ├── state.fun │ │ ├── state.sig │ │ ├── stateprint.fun │ │ ├── stateprint.sig │ │ ├── weaken.fun │ │ └── weaken.sig │ ├── server │ │ ├── server.sml │ │ ├── sigint-mlton.sml │ │ ├── sigint-polyml.sml │ │ ├── sigint-smlnj.sml │ │ ├── sigint.sig │ │ └── sources.cm │ ├── solvers │ │ ├── cs-eq-bools.fun │ │ ├── cs-eq-field.fun │ │ ├── cs-eq-field.sig │ │ ├── cs-eq-integers.fun │ │ ├── cs-eq-integers.sig │ │ ├── cs-eq-strings.fun │ │ ├── cs-ineq-field.fun │ │ ├── cs-ineq-integers.fun │ │ ├── cs-integers-word.fun │ │ ├── cs-manager.fun │ │ ├── cs-manager.sig │ │ ├── cs.sig │ │ ├── solvers.sml │ │ └── sources.cm │ ├── stream │ │ ├── README │ │ ├── WALK │ │ ├── sources.cm │ │ └── stream.sml │ ├── style │ │ ├── sources.cm │ │ ├── style.fun │ │ ├── style.sig │ │ └── style.sml │ ├── subordinate │ │ ├── README │ │ ├── WALK │ │ ├── intset.sml │ │ ├── sources.cm │ │ ├── subordinate.fun │ │ ├── subordinate.sig │ │ └── subordinate.sml │ ├── table │ │ ├── README │ │ ├── WALK │ │ ├── hash-table.sml │ │ ├── hash.sml │ │ ├── queue.sig │ │ ├── queue.sml │ │ ├── red-black-tree.fun │ │ ├── redblack.sml │ │ ├── ring.sig │ │ ├── ring.sml │ │ ├── sources.cm │ │ ├── sparse-array.fun │ │ ├── sparse-array.sig │ │ ├── sparse-array2.fun │ │ ├── sparse-array2.sig │ │ ├── string-hash.sig │ │ ├── string-hash.sml │ │ ├── table.sig │ │ └── table.sml │ ├── tabling │ │ ├── sources.cm │ │ ├── tabled.sml │ │ ├── tabledsyn.fun │ │ └── tabledsyn.sig │ ├── terminate │ │ ├── README │ │ ├── WALK │ │ ├── checking.fun │ │ ├── checking.sig │ │ ├── reduces.fun │ │ ├── reduces.sig │ │ ├── sources.cm │ │ └── terminate.sml │ ├── thm │ │ ├── README │ │ ├── WALK │ │ ├── sources.cm │ │ ├── thm.fun │ │ ├── thm.sig │ │ ├── thm.sml │ │ ├── thmprint.fun │ │ ├── thmprint.sig │ │ ├── thmsyn.fun │ │ └── thmsyn.sig │ ├── timing │ │ ├── README │ │ ├── WALK │ │ ├── sources.cm │ │ ├── timers.fun │ │ ├── timers.sig │ │ ├── timers.sml │ │ └── timing.sml │ ├── tomega │ │ ├── abstract.fun │ │ ├── abstract.sig │ │ ├── converter.fun │ │ ├── converter.sig │ │ ├── coverage.fun │ │ ├── coverage.sig │ │ ├── normalize.fun │ │ ├── normalize.sig │ │ ├── opsem.fun │ │ ├── opsem.sig │ │ ├── redundant.fun │ │ ├── redundant.sig │ │ ├── sources.cm │ │ ├── tomega.sml │ │ ├── tomegaprint.fun │ │ ├── tomegaprint.sig │ │ ├── typecheck.fun │ │ ├── typecheck.sig │ │ ├── unify.fun │ │ └── unify.sig │ ├── trail │ │ ├── README │ │ ├── notrail.sml │ │ ├── sources.cm │ │ ├── trail.sig │ │ └── trail.sml │ ├── typecheck │ │ ├── README │ │ ├── WALK │ │ ├── sources.cm │ │ ├── strict.fun │ │ ├── strict.sig │ │ ├── typecheck.fun │ │ ├── typecheck.sig │ │ └── typecheck.sml │ ├── unique │ │ ├── sources.cm │ │ ├── unique.fun │ │ ├── unique.sig │ │ └── unique.sml │ └── worldcheck │ │ ├── README │ │ ├── TODO │ │ ├── sources.cm │ │ ├── worldcheck.sml │ │ ├── worldify.fun │ │ ├── worldify.sig │ │ ├── worldprint.fun │ │ ├── worldprint.sig │ │ ├── worldsyn.fun │ │ └── worldsyn.sig ├── tex │ ├── code.sty │ ├── example.tex │ └── twelf.sty ├── twelf-server.sml ├── twelf-sml.sml └── vim │ ├── README │ ├── filetype.vim │ └── syntax │ └── twelf.vim └── typecheck ├── sources.cm ├── twelf ├── sources.cm ├── typecheck.fun ├── typecheck.sig └── typecheck.sml ├── typecheck.fun └── typecheck.sig /.gitignore: -------------------------------------------------------------------------------- 1 | *.cm/ 2 | code/elphin/src/bin/ 3 | code/delphin/bin/ 4 | *.grm.desc 5 | *.grm.sig 6 | *.grm.sml 7 | *.lex.sml 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # The Delphin Project 2 | http://delphin.poswolsky.com 3 | -------------------------------------------------------------------------------- /code/delphin/README: -------------------------------------------------------------------------------- 1 | To Install just do "make". 2 | In order to compile under SML, you may also do: 3 | CM.make "src/sources.cm" . 4 | You can then access the frontend by doing "Delphin.top() " 5 | 6 | 7 | -------------------------------------------------------------------------------- /code/delphin/examples/church-rosser/lam.elf: -------------------------------------------------------------------------------- 1 | %%% Untyped lambda-calculus 2 | %%% Author: Frank Pfenning 3 | 4 | term : type. %name term M. 5 | 6 | lam : (term -> term) -> term. 7 | app : term -> term -> term. 8 | -------------------------------------------------------------------------------- /code/delphin/examples/handbook/sources.cfg: -------------------------------------------------------------------------------- 1 | fol.elf 2 | -------------------------------------------------------------------------------- /code/delphin/examples/handbook/test.cfg: -------------------------------------------------------------------------------- 1 | fol.elf 2 | -------------------------------------------------------------------------------- /code/delphin/examples/hol-nuprl/sources.cfg: -------------------------------------------------------------------------------- 1 | hol.elf 2 | nuprl/nuprl.elf 3 | nuprl/classical.elf 4 | nuprl/nuprl-lemmas.elf 5 | trans.elf 6 | nuprl-axioms.elf 7 | eval.elf -------------------------------------------------------------------------------- /code/delphin/examples/list/README: -------------------------------------------------------------------------------- 1 | (* Merge sort *) 2 | (* Author: Adam Poswolsky, Carsten Schuermann *) 3 | 4 | list.d implements the standard merge sort operation in Delphin. 5 | -------------------------------------------------------------------------------- /code/delphin/examples/mini-ml/new/tp.elf: -------------------------------------------------------------------------------- 1 | %%% Mini-ML types. 2 | %%% Author: Frank Pfenning, based on [Michaylov & Pfenning 92] 3 | 4 | tp : type. %name tp T. 5 | nat : tp. % Natural Numbers 6 | cross : tp -> tp -> tp. % Pairs 7 | arrow : tp -> tp -> tp. % Functions 8 | 9 | scheme : type. 10 | forall : (tp -> scheme) -> scheme. % Polymorphic 11 | ! : tp -> scheme. -------------------------------------------------------------------------------- /code/delphin/examples/mini-ml/new/value.elf: -------------------------------------------------------------------------------- 1 | %%% Definition of Values 2 | 3 | value : exp -> type. %name value P. 4 | 5 | val_z : value z. 6 | val_lam : value (lam E). 7 | val_s : value V 8 | -> value (s V). 9 | val_pair : value V1 10 | -> value V2 11 | -> value (pair V1 V2). 12 | 13 | -------------------------------------------------------------------------------- /code/delphin/examples/mini-ml/tp.elf: -------------------------------------------------------------------------------- 1 | %%% Mini-ML types. 2 | %%% Author: Frank Pfenning, based on [Michaylov & Pfenning 92] 3 | 4 | tp : type. %name tp T. 5 | 6 | nat : tp. % Natural Numbers 7 | cross : tp -> tp -> tp. % Pairs 8 | arrow : tp -> tp -> tp. % Functions 9 | forall : (tp -> tp) -> tp. % Polymorphic 10 | -------------------------------------------------------------------------------- /code/delphin/examples/mini-ml/value.elf: -------------------------------------------------------------------------------- 1 | %%% Definition of Values 2 | 3 | value : exp -> type. %name value P. 4 | 5 | val_z : value z. 6 | val_lam : value (lam E). 7 | val_s : value V 8 | -> value (s V). 9 | val_pair : value V1 10 | -> value V2 11 | -> value (pair V1 V2). 12 | 13 | -------------------------------------------------------------------------------- /code/delphin/src/elaboration/abstract.sml: -------------------------------------------------------------------------------- 1 | structure DelphinAbstract = 2 | DelphinAbstract (structure Whnf = Whnf 3 | structure Constraints = Constraints); 4 | -------------------------------------------------------------------------------- /code/delphin/src/elaboration/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature DELPHIN_ELABORATOR 3 | structure DelphinElab 4 | is 5 | #if defined(NEW_CM) 6 | $/basis.cm 7 | #endif 8 | ../twelf/src/table/sources.cm 9 | ../twelf/src/paths/sources.cm 10 | ../twelf/src/lambda/sources.cm 11 | 12 | ../frontend/sources.frontend.cm 13 | ../twelf/src/stream/sources.cm 14 | 15 | sources.syntax.cm 16 | convert.sig 17 | convert.fun -------------------------------------------------------------------------------- /code/delphin/src/elaboration/unifyDelphin.sml: -------------------------------------------------------------------------------- 1 | (* Delphin Unification *) 2 | (* Author: Adam Poswolsky *) 3 | 4 | structure UnifyDelphinNoTrail = 5 | UnifyDelphin (structure Trail = NoTrail 6 | structure U = UnifyNoTrail) 7 | 8 | structure UnifyDelphinTrail = 9 | UnifyDelphin (structure Trail = Trail 10 | structure U = UnifyTrail) 11 | -------------------------------------------------------------------------------- /code/delphin/src/frontend/parse-prg.sig: -------------------------------------------------------------------------------- 1 | (* The Parser *) 2 | 3 | signature PARSE = 4 | sig 5 | val fparse : string * string -> DelphinExtSyntax.DelphinProgram 6 | val sparse : unit -> DelphinExtSyntax.DelphinProgram 7 | 8 | 9 | end (* signature PARSE *) 10 | -------------------------------------------------------------------------------- /code/delphin/src/frontend/polyUnsafe.sml: -------------------------------------------------------------------------------- 1 | (* Dummy Unsafe Structure 2 | * For use in compiling output of ml-lex 3 | * using Poly/ML 4 | * (Only necessary for older versions of ml-lex it seems) 5 | *) 6 | 7 | structure Unsafe = 8 | struct 9 | structure Vector = Vector 10 | structure CharVector = CharVector 11 | end 12 | -------------------------------------------------------------------------------- /code/delphin/src/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature DELPHIN 3 | structure Delphin 4 | 5 | signature TWELF 6 | structure Twelf 7 | 8 | signature INTSYN 9 | structure IntSyn 10 | structure DelphinIntSyntax 11 | is 12 | #if defined(NEW_CM) 13 | $/basis.cm 14 | #endif 15 | frontend/sources.cm 16 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/.cvsignore: -------------------------------------------------------------------------------- 1 | CM 2 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/TEST/cr.sml: -------------------------------------------------------------------------------- 1 | fun test (file) = 2 | case Twelf.Config.load (Twelf.Config.read file) 3 | of Twelf.OK => Twelf.OK 4 | | Twelf.ABORT => raise Domain; 5 | 6 | Twelf.unsafe := true; 7 | test "examples/church-rosser/test-unsafe.cfg"; 8 | Twelf.unsafe := false; -------------------------------------------------------------------------------- /code/delphin/src/twelf/TEST/lexing.elf: -------------------------------------------------------------------------------- 1 | %%% Testing the lexer error messages. 2 | 3 | % Illegal character. 4 | % c : ". 5 | 6 | % Whitespace in quoted identifier. 7 | % 'exp ' : type. 8 | 'exp 9 | ' : type. 10 | 11 | % Unclosed delimited comment at end of file token (replace DOT by .) 12 | % %{ %DOT 13 | 14 | exp : type. 15 | z : exp. 16 | 17 | % Unclosed delimited comment at end of file 18 | % %{ 19 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/TEST/location.elf: -------------------------------------------------------------------------------- 1 | %%% Testing the lexer error messages. 2 | 3 | exp : type. 4 | z : exp. 5 | s : exp -> exp. 6 | 7 | value : exp -> type. 8 | val_z : value s. 9 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/TEST/modes.elf: -------------------------------------------------------------------------------- 1 | % Test mode redefinition. 2 | 3 | exp : type. 4 | z : exp. 5 | s : exp -> exp. 6 | 7 | eval : exp -> exp -> type. 8 | %mode eval +E -V. 9 | 10 | eval_z : eval (s E) (s E) 11 | <- eval (s E) (s E) 12 | <- eval (s E) (s E). 13 | 14 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/TEST/skolem.sml: -------------------------------------------------------------------------------- 1 | Twelf.reset (); 2 | Twelf.loadFile "TEST/cp.elf"; 3 | val SOME cpt = Names.nameLookup "cpt"; 4 | val _ = Skolem.install [cpt]; 5 | val SOME cpt1 = Names.nameLookup "cpt#1"; 6 | val SOME cpt2 = Names.nameLookup "cpt#2"; 7 | val _ = TextIO.print (Print.expToString (IntSyn.Null, IntSyn.constType cpt1) ^ "\n"); 8 | val _ = TextIO.print (Print.expToString (IntSyn.Null, IntSyn.constType cpt2) ^ "\n"); -------------------------------------------------------------------------------- /code/delphin/src/twelf/TEST/subord.elf: -------------------------------------------------------------------------------- 1 | % Testing subordination 2 | 3 | a : type. 4 | 5 | b : a -> type. 6 | c : a -> type. 7 | 8 | s1 : b X -> c X. 9 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/TEST/term.elf: -------------------------------------------------------------------------------- 1 | %terminates D (eval D _). -------------------------------------------------------------------------------- /code/delphin/src/twelf/TEST/test.cfg: -------------------------------------------------------------------------------- 1 | modes.elf 2 | term.elf -------------------------------------------------------------------------------- /code/delphin/src/twelf/TEST/uscore.elf: -------------------------------------------------------------------------------- 1 | exp: type. 2 | bug: exp -> type. 3 | %mode bug -E. 4 | oops: bug _ <- bug E. 5 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/bin/.cvsignore: -------------------------------------------------------------------------------- 1 | delphin 2 | delphin.bat 3 | twelf-server 4 | twelf-server.bat 5 | twelf-sml 6 | twelf-sml.bat 7 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/bin/.dbase/.cvsignore: -------------------------------------------------------------------------------- 1 | twelf* 2 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/bin/.dbase/README: -------------------------------------------------------------------------------- 1 | This directory will contain the databases loaded into 2 | the Poly/ML runtime system. 3 | 4 | Do not delete this file, so that this directory will be created 5 | when the distribution is unpacked. 6 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/bin/.heap/.cvsignore: -------------------------------------------------------------------------------- 1 | delphin* 2 | twelf* 3 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/bin/.heap/README: -------------------------------------------------------------------------------- 1 | This directory will contain the heaps which will be loaded into the 2 | SML of NJ runtime system. 3 | 4 | Do not delete this file, so that this directory will be created 5 | when the distribution is unpacked. 6 | 7 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/bin/.mkexec: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # Twelf Batch File Creator 4 | # 5 | # Arguments: 6 | # $1 = SMLNJ runtime 7 | # $2 = Twelf root directory 8 | # $3 = Type of executable (e.g. twelf-server, twelf-sml) 9 | # $4 = Name of executable (e.g. twelf-server, twelf-sml) 10 | cat > "$2/bin/$4" <> TAGS 6 | echo "$f,0" >> TAGS 7 | end 8 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/bin/tag-examples: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | # 3 | ../bin/create-tags {*/*,*/*/*}.{cfg,elf,quy,thm} 4 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/bin/tag-twelf: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | # 3 | ../bin/create-tags {*,*/*}.{cm,sig,fun,sml} 4 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/delphin.sml: -------------------------------------------------------------------------------- 1 | (* comment out first line if undefined in your version of SMLofNJ *) 2 | (* call sml-cm with @SMLdebug=/dev/null instead *) 3 | SMLofNJ.Internals.GC.messages false; 4 | CM.make ("delphin.cm"); 5 | if SMLofNJ.exportML ("bin/.heap/delphin") 6 | then (print (Delphin.version ^ "\n"); Delphin.top ()) else (); 7 | 8 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/emacs/.cvsignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aposwolsky/delphin/9b7a47f09374a64d0438f114dd90826d13b8edc2/code/delphin/src/twelf/emacs/.cvsignore -------------------------------------------------------------------------------- /code/delphin/src/twelf/mlton/twelf-server.sml: -------------------------------------------------------------------------------- 1 | val _ = OS.Process.exit 2 | (Server.server (CommandLine.name (), 3 | CommandLine.arguments ())) 4 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/polyml/.mkexec: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Twelf Batch File Creator 4 | # 5 | # Arguments: 6 | # $1 = PolyML executable 7 | # $2 = Twelf root directory 8 | # $3 = Name of executable and database (e.g. twelf-polyml, twelf-server-polyml) 9 | # $4 = Name of database (e.g. twelf-polyml, twelf-server-polyml) 10 | echo "(cd \"$2\" ; \"$1\" -r \"bin/.dbase/$3\")" > "$2/bin/$4" 11 | chmod a+x "$2/bin/$4" -------------------------------------------------------------------------------- /code/delphin/src/twelf/polyml/twelf-server-dbase.sml: -------------------------------------------------------------------------------- 1 | PolyML.make_database "bin/.dbase/twelf-server"; 2 | PolyML.exit 0; 3 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/polyml/twelf-server.sml: -------------------------------------------------------------------------------- 1 | (* Twelf Server in Poly/ML *) 2 | (* This is currently not a stand-alone program *) 3 | (* Interrupts do not work properly in Poly/ML *) 4 | (* Load this into "poly bin/twelf_dbase" *) 5 | use "src/server/sigint.sig"; 6 | use "src/server/sigint-polyml.sml"; 7 | use "src/server/server.sml"; 8 | PolyML.onEntry (fn () => OS.Process.exit (Server.server ("twelf-server", []))); 9 | PolyML.commit (); 10 | PolyML.exit (0); 11 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/polyml/twelf-sml-dbase.sml: -------------------------------------------------------------------------------- 1 | PolyML.make_database "bin/.dbase/twelf-sml"; 2 | PolyML.exit 0; 3 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/polyml/twelf-sml.sml: -------------------------------------------------------------------------------- 1 | use "polyml/load-twelf.sml"; 2 | PolyML.commit (); 3 | PolyML.exit 0; 4 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/rpm/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aposwolsky/delphin/9b7a47f09374a64d0438f114dd90826d13b8edc2/code/delphin/src/twelf/rpm/logo.gif -------------------------------------------------------------------------------- /code/delphin/src/twelf/rpm/twelf-files: -------------------------------------------------------------------------------- 1 | #!/bin/csh 2 | echo "%files" 3 | echo "/usr/bin/twelf-server" 4 | foreach f (`find /usr/share/twelf -type f -print`) 5 | echo $f 6 | end 7 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/rpm/twelf-uninstall: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | rm -rf /usr/share/twelf 3 | rm -f /usr/bin/twelf-server 4 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/server.cm: -------------------------------------------------------------------------------- 1 | Library 2 | structure Server 3 | is 4 | src/server/sources.cm 5 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/smlnj/README: -------------------------------------------------------------------------------- 1 | Directory with installation files for 2 | 3 | SML/NJ, Version 110.20 or greater 4 | 5 | In Twelf root directory, do 6 | 7 | % make -f smlnj/Makefile 8 | 9 | or 10 | 11 | % smlnj/install.sh 12 | 13 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/smlnj/delphin.sml: -------------------------------------------------------------------------------- 1 | (* comment out first line if undefined in your version of SMLofNJ *) 2 | (* call sml-cm with @SMLdebug=/dev/null instead *) 3 | (* This is for SML/NJ version >= 110.20 (using the new interface to CM) *) 4 | SMLofNJ.Internals.GC.messages false; 5 | CM.make "delphin.cm"; 6 | if SMLofNJ.exportML ("bin/.heap/delphin") 7 | then (print (Delphin.version ^ "\n"); Delphin.top ()) else (); 8 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/smlnj/twelf-server.sml: -------------------------------------------------------------------------------- 1 | (* comment out first line if undefined in your version of SMLofNJ *) 2 | (* call sml-cm with @SMLdebug=/dev/null instead *) 3 | (* This is for SML/NJ version >= 110.20 (using the new interface to CM) *) 4 | SMLofNJ.Internals.GC.messages false; 5 | CM.make "server.cm"; 6 | SMLofNJ.exportFn ("bin/.heap/twelf-server", Server.server); 7 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/smlnj/twelf-sml.sml: -------------------------------------------------------------------------------- 1 | (* comment out first line if undefined in your version of SMLofNJ *) 2 | (* call sml-cm with @SMLdebug=/dev/null instead *) 3 | SMLofNJ.Internals.GC.messages false; 4 | CM.make ("sources.cm"); 5 | if SMLofNJ.exportML ("bin/.heap/twelf-sml") 6 | then (print (Twelf.version ^ "\n"); Timing.init ()) else (); 7 | 8 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/array-97.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current Array to Basis-97 Array *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure CompatArray97 :> COMPAT_ARRAY = 5 | struct 6 | fun appi f arr = Array.appi f (arr, 0 , NONE) 7 | end; 8 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/array-slice.sig: -------------------------------------------------------------------------------- 1 | (* Compatibility shim to cope with Standard Basis version skew *) 2 | (* Author: Christopher Richards *) 3 | 4 | signature ARRAY_SLICE = 5 | sig 6 | type 'a slice 7 | val slice : 'a Array.array * int * int option -> 'a slice 8 | val appi : (int * 'a -> unit) -> 'a slice -> unit 9 | end; 10 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/array-slice.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current ArraySlice to Basis-97 Array *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure ArraySlice :> ARRAY_SLICE = 5 | struct 6 | type 'a slice = 'a Array.array * int * int option 7 | fun slice s = s 8 | val appi = Array.appi 9 | end; 10 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/array.sig: -------------------------------------------------------------------------------- 1 | (* Compatibility shim to cope with Standard Basis version skew *) 2 | (* Author: Christopher Richards *) 3 | 4 | signature COMPAT_ARRAY = 5 | sig 6 | val appi : (int * 'a -> unit) -> 'a Array.array -> unit 7 | end; 8 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/compat-97.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current to Basis-97 *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure Compat :> COMPAT = 5 | Compat (structure Array = CompatArray97 6 | structure Vector = CompatVector97 7 | structure Path = CompatPath97 8 | structure Substring = CompatSubstring97 9 | structure TextIO = CompatTextIO97 10 | structure Timer = CompatTimer97); 11 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/compat-mlton-20030716.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current to MLton Basis as of 20030716 *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure Compat :> COMPAT = 5 | Compat (structure Array = Array 6 | structure Vector = Vector 7 | structure Path = OS.Path 8 | structure Substring = Substring 9 | structure TextIO = CompatTextIO97 10 | structure Timer = Timer); 11 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/compat-poly02.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current to Poly/ML Basis as of 4.1.3 *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure Compat :> COMPAT = 5 | Compat (structure Array = CompatArray97 6 | structure Vector = CompatVector97 7 | structure Path = OS.Path 8 | structure Substring = CompatSubstring97 9 | structure TextIO = CompatTextIO97 10 | structure Timer = Timer); 11 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/compat-smlnj03.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current to SML/NJ Basis as of 110.43 *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure Compat :> COMPAT = 5 | Compat (structure Array = Array 6 | structure Vector = Vector 7 | structure Path = OS.Path 8 | structure Substring = Substring 9 | structure TextIO = TextIO 10 | structure Timer = CompatTimer97); 11 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/compat-smlnj98.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current to SML/NJ Basis as of 110.9.1 *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure Compat :> COMPAT = 5 | Compat (structure Array = CompatArray97 6 | structure Vector = CompatVector97 7 | structure Path = OS.Path 8 | structure Substring = CompatSubstring97 9 | structure TextIO = CompatTextIO97 10 | structure Timer = CompatTimer97); 11 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/compat.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current to itself *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure Compat :> COMPAT = 5 | Compat (structure Array = Array 6 | structure Vector = Vector 7 | structure Path = OS.Path 8 | structure Substring = Substring 9 | structure TextIO = TextIO 10 | structure Timer = Timer); 11 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/mono-array-slice.sig: -------------------------------------------------------------------------------- 1 | (* Compatibility shim to cope with Standard Basis version skew *) 2 | (* Author: Christopher Richards *) 3 | 4 | signature MONO_ARRAY_SLICE = 5 | sig 6 | type array 7 | type slice 8 | type vector 9 | val slice : array * int * int option -> slice 10 | val vector : slice -> vector 11 | end; 12 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/path-97.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current OS.Path to Basis-97 OS.Path *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure CompatPath97 :> COMPAT_PATH = 5 | struct 6 | fun mkAbsolute {path=path, relativeTo=relativeTo} = 7 | OS.Path.mkAbsolute (path, relativeTo) 8 | end; 9 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/path.sig: -------------------------------------------------------------------------------- 1 | (* Compatibility shim to cope with Standard Basis version skew *) 2 | (* Author: Christopher Richards *) 3 | 4 | signature COMPAT_PATH = 5 | sig 6 | val mkAbsolute : {path:string, relativeTo:string} -> string 7 | end; 8 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/substring-97.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current Substring to Basis-97 Substring *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure CompatSubstring97 :> COMPAT_SUBSTRING = 5 | struct 6 | val full = Substring.all 7 | end; 8 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/substring.sig: -------------------------------------------------------------------------------- 1 | (* Compatibility shim to cope with Standard Basis version skew *) 2 | (* Author: Christopher Richards *) 3 | 4 | signature COMPAT_SUBSTRING = 5 | sig 6 | val full : string -> Substring.substring 7 | end; 8 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/text-io-97.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current TextIO to Basis-97 TextIO *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure CompatTextIO97 :> COMPAT_TEXT_IO = 5 | struct 6 | fun inputLine instream = 7 | let 8 | val line = TextIO.inputLine instream 9 | in 10 | case line of 11 | "" => NONE 12 | | str => SOME str 13 | end 14 | end; 15 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/text-io.sig: -------------------------------------------------------------------------------- 1 | (* Compatibility shim to cope with Standard Basis version skew *) 2 | (* Author: Christopher Richards *) 3 | 4 | signature COMPAT_TEXT_IO = 5 | sig 6 | val inputLine : TextIO.instream -> string option 7 | end; 8 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/timer.sig: -------------------------------------------------------------------------------- 1 | (* Compatibility shim to cope with Standard Basis version skew *) 2 | (* Author: Christopher Richards *) 3 | 4 | signature COMPAT_TIMER = 5 | sig 6 | val checkCPUTimer : Timer.cpu_timer -> { usr : Time.time, sys : Time.time } 7 | val checkGCTime : Timer.cpu_timer -> Time.time 8 | end; 9 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/vector-97.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current Vector to Basis-97 Vector *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure CompatVector97 :> COMPAT_VECTOR = 5 | struct 6 | fun appi f vec = Vector.appi f (vec, 0, NONE) 7 | fun mapi f vec = Vector.mapi f (vec, 0, NONE) 8 | end; 9 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/vector-slice.sig: -------------------------------------------------------------------------------- 1 | (* Compatibility shim to cope with Standard Basis version skew *) 2 | (* Author: Christopher Richards *) 3 | 4 | signature VECTOR_SLICE = 5 | sig 6 | type 'a slice 7 | val slice : 'a Vector.vector * int * int option -> 'a slice 8 | val appi : (int * 'a -> unit) -> 'a slice -> unit 9 | val mapi : (int * 'a -> 'b) -> 'a slice -> 'b Vector.vector 10 | end; 11 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/vector-slice.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current VectorSlice to Basis-97 Vector *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure VectorSlice :> VECTOR_SLICE = 5 | struct 6 | type 'a slice = 'a Vector.vector * int * int option 7 | fun slice s = s 8 | val appi = Vector.appi 9 | val mapi = Vector.mapi 10 | end; 11 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compat/vector.sig: -------------------------------------------------------------------------------- 1 | (* Compatibility shim to cope with Standard Basis version skew *) 2 | (* Author: Christopher Richards *) 3 | 4 | signature COMPAT_VECTOR = 5 | sig 6 | val appi : (int * 'a -> unit) -> 'a Vector.vector -> unit 7 | val mapi : (int * 'a -> 'b) -> 'a Vector.vector -> 'b Vector.vector 8 | end; 9 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/compile/README: -------------------------------------------------------------------------------- 1 | Description of optimzing compilation? 2 | 3 | Tue Apr 2 11:42:20 2002 4 | 5 | compile.fun 6 | 7 | Probably should compile A1 in {x:A1} A2 in order 8 | to avoid incompleteness. 9 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/cover/total.sig: -------------------------------------------------------------------------------- 1 | (* Total Declarations *) 2 | (* Author: Frank Pfenning *) 3 | 4 | signature TOTAL = 5 | sig 6 | 7 | (*! structure IntSyn : INTSYN !*) 8 | 9 | exception Error of string 10 | 11 | val reset : unit -> unit 12 | val install : IntSyn.cid -> unit (* install(a) --- a is total in its input arguments *) 13 | 14 | val checkFam : IntSyn.cid -> unit (* may raise Error(msg) *) 15 | 16 | end; (* signature TOTAL *) 17 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/delphin/delphin.sig: -------------------------------------------------------------------------------- 1 | (* Delphin Frontend *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature DELPHIN = 5 | sig 6 | val version : string 7 | val loadFile : string * string -> unit 8 | 9 | val top : unit -> unit 10 | 11 | val runSimpleTest : string -> (string list) -> string list -> unit 12 | val eval : Tomega.Prg -> Tomega.Prg 13 | end 14 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/delphin/interface.sig: -------------------------------------------------------------------------------- 1 | (* Interface for error reporting syntax *) 2 | (* Author: Richard Fontana *) 3 | 4 | (* compare to Paths *) 5 | 6 | signature INTERFACE = 7 | sig 8 | 9 | type pos 10 | val line : pos ref 11 | 12 | val init_line : unit -> unit 13 | val next_line : unit -> unit 14 | val error : string * pos * pos -> unit 15 | 16 | type arg 17 | val nothing : arg 18 | end (* signature INTERFACE *) 19 | 20 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/delphin/parse-prg.sig: -------------------------------------------------------------------------------- 1 | (* The Parser *) 2 | (* Author: Richard Fontana *) 3 | 4 | signature PARSE = 5 | sig 6 | 7 | structure DextSyn : DEXTSYN 8 | 9 | val fparse : string -> unit 10 | val gparse : string -> DextSyn.Ast 11 | val sparse : unit -> DextSyn.Ast 12 | 13 | end (* signature PARSE *) 14 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/domains/README: -------------------------------------------------------------------------------- 1 | Domains for arithmetical expressions 2 | Author: Roberto Virga 3 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/domains/domains.sml: -------------------------------------------------------------------------------- 1 | structure Integers = Integers(IntInf); 2 | 3 | structure Rationals = Rationals(Integers); 4 | 5 | structure IntegersMod7 = IntegersMod(val p = 7); 6 | 7 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/domains/integers.sig: -------------------------------------------------------------------------------- 1 | (* Integers *) 2 | (* Author: Roberto Virga *) 3 | 4 | signature INTEGERS = 5 | sig 6 | include INTEGER 7 | 8 | val gcd : int * int -> int 9 | val lcm : int * int -> int 10 | val solve_gcd : int * int -> int * int 11 | end; (* signature INTEGERS *) 12 | 13 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/flit/flit.sml: -------------------------------------------------------------------------------- 1 | structure Flit = 2 | Flit (structure Global = Global 3 | structure Word = Word32 4 | structure Pack = Pack32Little 5 | structure IntSyn = IntSyn 6 | structure Whnf = Whnf 7 | structure Print = Print 8 | structure Names = Names 9 | structure Index = Index 10 | structure Table = IntRedBlackTree) 11 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/flit/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature FLIT 3 | structure Flit 4 | is 5 | #if defined(NEW_CM) 6 | $/basis.cm 7 | #endif 8 | ../compat/sources.cm 9 | ../global/sources.cm 10 | ../table/sources.cm 11 | ../lambda/sources.cm 12 | ../index/sources.cm 13 | ../paths/sources.cm 14 | ../print/sources.cm 15 | flit.sig 16 | flit.fun 17 | flit.sml 18 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/formatter/formatter.sml: -------------------------------------------------------------------------------- 1 | structure Formatter : FORMATTER = Formatter() 2 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/formatter/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature FORMATTER 3 | structure Formatter 4 | is 5 | #if defined(NEW_CM) 6 | $/basis.cm 7 | #endif 8 | formatter.sig 9 | formatter.fun 10 | formatter.sml 11 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/frontend/fquery.sig: -------------------------------------------------------------------------------- 1 | (* fquery: Executing logic programs via functional interpretation *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature FQUERY = 5 | sig 6 | structure ExtQuery : EXTQUERY 7 | 8 | exception AbortQuery of string 9 | 10 | val run : ExtQuery.query * Paths.location -> unit 11 | (* may raise AbortQuery(msg) *) 12 | 13 | end; (* signature SOLVE *) 14 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/frontend/parse-condec.sig: -------------------------------------------------------------------------------- 1 | (* Parsing Signature Entries *) 2 | (* Author: Frank Pfenning *) 3 | 4 | signature PARSE_CONDEC = 5 | sig 6 | 7 | (*! structure Parsing : PARSING !*) 8 | structure ExtConDec : EXTCONDEC 9 | 10 | val parseConDec' : ExtConDec.condec Parsing.parser 11 | val parseAbbrev' : ExtConDec.condec Parsing.parser 12 | val parseClause' : ExtConDec.condec Parsing.parser 13 | 14 | end; (* signature PARSE_CONDEC *) 15 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/frontend/parse-mode.sig: -------------------------------------------------------------------------------- 1 | (* Parsing Mode Declarations *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature PARSE_MODE = 5 | sig 6 | 7 | (*! structure Parsing : PARSING !*) 8 | structure ExtModes: EXTMODES 9 | 10 | val parseMode' : (ExtModes.modedec list) Parsing.parser 11 | 12 | end; (* signature PARSE_MODE *) 13 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/frontend/parse-query.sig: -------------------------------------------------------------------------------- 1 | (* Parsing Queries *) 2 | (* Author: Frank Pfenning *) 3 | 4 | signature PARSE_QUERY = 5 | sig 6 | 7 | (*! structure Parsing : PARSING !*) 8 | structure ExtQuery : EXTQUERY 9 | 10 | val parseQuery' : ExtQuery.query Parsing.parser 11 | val parseSolve' : (ExtQuery.define list * ExtQuery.solve) Parsing.parser 12 | 13 | end; (* signature PARSE_QUERY *) 14 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/frontend/unknownexn-smlnj.sml: -------------------------------------------------------------------------------- 1 | (* Print exception trace in unknownExn. Both SML/NJ and MLton have 2 | SMLofNJ.exnHistory. 3 | *) 4 | 5 | structure UnknownExn = 6 | UnknownExn (val exnHistory = SMLofNJ.exnHistory); 7 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/frontend/unknownexn-stub.sml: -------------------------------------------------------------------------------- 1 | (* A do-nothing stub for SML implementations without an SML/NJ-like 2 | exnHistory function. 3 | *) 4 | 5 | structure UnknownExn = 6 | UnknownExn (val exnHistory = fn exn => nil); 7 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/frontend/unknownexn.sig: -------------------------------------------------------------------------------- 1 | signature UNKNOWN_EXN = 2 | sig 3 | val unknownExn : exn -> string 4 | end; 5 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/global/README: -------------------------------------------------------------------------------- 1 | Global parameters 2 | Author: Frank Pfenning 3 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/global/WALK: -------------------------------------------------------------------------------- 1 | Main current issues 2 | 3 | Main future issues 4 | 5 | CM/ 6 | README OK -fp 7 | WALK 8 | global.sig OK -fp 9 | Q: add SEPARATE flag for external vs internal printing? A: DONE (see Print.implicit) 10 | OK -cs 11 | global.sml OK -fp 12 | OK -cs 13 | sources.cm OK -fp 14 | OK -cs 15 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/global/global.sig: -------------------------------------------------------------------------------- 1 | (* Global parameters *) 2 | (* Author: Frank Pfenning *) 3 | 4 | signature GLOBAL = 5 | sig 6 | val chatter : int ref 7 | val maxCid : int 8 | val maxMid : int 9 | val maxCSid : int 10 | val doubleCheck : bool ref 11 | val unsafe : bool ref 12 | val chPrint : int -> (unit -> string) -> unit 13 | end; (* signature GLOBAL *) 14 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/global/global.sml: -------------------------------------------------------------------------------- 1 | (* Global parameters *) 2 | (* Author: Frank Pfenning *) 3 | 4 | structure Global :> GLOBAL = 5 | struct 6 | 7 | val chatter = ref 3 8 | val maxCid = 19999 9 | val maxMid = 999 10 | val maxCSid = 49 11 | val doubleCheck = ref false 12 | val unsafe = ref false 13 | 14 | fun chPrint n s = if !chatter >= n then print (s ()) else () 15 | end; (* structure Global *) 16 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/global/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature GLOBAL 3 | structure Global 4 | is 5 | global.sig 6 | global.sml 7 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/heuristic/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature HEURISTIC 3 | structure Heuristic 4 | is 5 | #if defined(NEW_CM) 6 | $/basis.cm 7 | #endif 8 | heuristic.sig 9 | heuristic.sum.fun 10 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/index/README: -------------------------------------------------------------------------------- 1 | Indexing 2 | 3 | This mainains a global mapping from type families to their constructors. 4 | 5 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/index/WALK: -------------------------------------------------------------------------------- 1 | Future Issues: 2 | 3 | - replace array by tree based on type family, but 4 | frequent access may require it too be fast? 5 | 6 | CM/ 7 | NOTES DELETED -fp 8 | README OK -fp 9 | WALK 10 | index.fun OK -fp 11 | OK -cs 12 | index.sig OK -fp 13 | OK -cs 14 | index.sml OK -fp 15 | sources.cm OK -fp 16 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/index/index.sml: -------------------------------------------------------------------------------- 1 | structure Index = 2 | Index (structure Global = Global 3 | structure Queue = Queue 4 | (*! structure IntSyn' = IntSyn !*)); 5 | 6 | structure IndexSkolem = 7 | IndexSkolem (structure Global = Global 8 | structure Queue = Queue 9 | (*! structure IntSyn' = IntSyn !*)); 10 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/index/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature INDEX 3 | structure Index 4 | structure IndexSkolem 5 | is 6 | #if defined(NEW_CM) 7 | $/basis.cm 8 | #endif 9 | ../lambda/sources.cm 10 | ../table/sources.cm 11 | ../global/sources.cm 12 | index.sig 13 | index.fun 14 | index-skolem.fun 15 | index.sml 16 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/int-inf/README: -------------------------------------------------------------------------------- 1 | Copied from the Standard ML of New Jersey Library 2 | Version 110.0.3 3 | 4 | This was copied in order to make the implementation completely 5 | portable, and independent of SML/NJ. 6 | 7 | Perpetrator: Frank Pfenning 8 | Sun Sep 24 2000 9 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/int-inf/sources.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | int-inf-sig.sml 3 | int-inf.sml 4 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/lambda/README: -------------------------------------------------------------------------------- 1 | Core Lambda Calculus 2 | Author: Frank Pfenning, Carsten Schuermann 3 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/lambda/constraints.sig: -------------------------------------------------------------------------------- 1 | (* Manipulating Constraints *) 2 | (* Author: Jeff Polakow, Frank Pfenning *) 3 | (* Modified: Roberto Virga *) 4 | 5 | signature CONSTRAINTS = 6 | sig 7 | 8 | (*! structure IntSyn : INTSYN !*) 9 | 10 | exception Error of IntSyn.cnstr list 11 | 12 | val simplify : IntSyn.cnstr list -> IntSyn.cnstr list 13 | val warnConstraints : string list -> unit 14 | 15 | end; (* signature CONSTRAINTS *) 16 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/lambda/fgnopn.sig: -------------------------------------------------------------------------------- 1 | (* Extensible operation on foreign matter *) 2 | (* Author: Aleksey Kliger *) 3 | 4 | signature FGN_OPN = sig 5 | type csid = int 6 | type rep = exn 7 | type arg 8 | type result 9 | 10 | type func = rep -> arg -> result 11 | 12 | val install : csid * func -> unit 13 | 14 | val apply : csid * rep -> arg -> result 15 | end 16 | 17 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/lambda/tomega.sml: -------------------------------------------------------------------------------- 1 | structure Whnf = 2 | Whnf ((*! structure IntSyn' = IntSyn !*)); 3 | 4 | structure Conv = 5 | Conv ((*! structure IntSyn' = IntSyn !*) 6 | structure Whnf = Whnf); 7 | 8 | structure Tomega : TOMEGA = 9 | Tomega ((*! structure IntSyn' = IntSyn !*) 10 | structure Whnf = Whnf 11 | structure Conv = Conv); 12 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/m2/init.sig: -------------------------------------------------------------------------------- 1 | (* Initialization *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature INIT = 5 | sig 6 | structure MetaSyn : METASYN 7 | 8 | exception Error of string 9 | 10 | val init : IntSyn.cid list -> MetaSyn.State list 11 | end; (* signature INIT *) 12 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/m2/lemma.sig: -------------------------------------------------------------------------------- 1 | (* Lemma *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature LEMMA = 5 | sig 6 | structure MetaSyn : METASYN 7 | 8 | exception Error of string 9 | 10 | val apply : MetaSyn.State * IntSyn.cid -> MetaSyn.State 11 | end; (* signature LEMMA *) 12 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/m2/meta-abstract.sig: -------------------------------------------------------------------------------- 1 | (* Meta Abstraction *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature METAABSTRACT = 5 | sig 6 | structure MetaSyn : METASYN 7 | 8 | exception Error of string 9 | 10 | val abstract : MetaSyn.State -> MetaSyn.State 11 | end; (* signature METAABSTRACT *) 12 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/m2/meta-global.sig: -------------------------------------------------------------------------------- 1 | (* Global parameters *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature METAGLOBAL = 5 | sig 6 | datatype Strategy = RFS | FRS 7 | 8 | val strategy : Strategy ref 9 | val maxFill : int ref 10 | val maxSplit : int ref 11 | val maxRecurse : int ref 12 | end; (* signature METAGLOBAL *) 13 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/m2/meta-global.sml: -------------------------------------------------------------------------------- 1 | (* Global parameters *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | structure MetaGlobal : METAGLOBAL = 5 | struct 6 | datatype Strategy = RFS | FRS 7 | 8 | val strategy = ref FRS 9 | val maxFill = ref 6 10 | val maxSplit = ref 2 11 | val maxRecurse = ref 10 12 | end; (* structure MetaGlobal *) 13 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/m2/meta-print.sig: -------------------------------------------------------------------------------- 1 | (* Meta printer for proof states *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature METAPRINT = 5 | sig 6 | structure MetaSyn : METASYN 7 | 8 | val stateToString : MetaSyn.State -> string 9 | val sgnToString : MetaSyn.Sgn -> string 10 | val modeToString : MetaSyn.Mode -> string 11 | val conDecToString : IntSyn.ConDec -> string 12 | 13 | end; (* signature METAPRINT *) 14 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/m2/prover.sig: -------------------------------------------------------------------------------- 1 | (* Meta Prover *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature PROVER = 5 | sig 6 | (*! structure IntSyn : INTSYN !*) 7 | 8 | exception Error of string 9 | 10 | val init : (int * IntSyn.cid list) -> unit 11 | val auto : unit -> unit 12 | val print : unit -> unit 13 | val install: (IntSyn.ConDec -> IntSyn.cid) -> unit 14 | end; (* signature PROVER *) 15 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/m2/qed.sig: -------------------------------------------------------------------------------- 1 | (* Qed *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature QED = 5 | sig 6 | structure MetaSyn : METASYN 7 | 8 | exception Error of string 9 | 10 | val subgoal : MetaSyn.State -> bool 11 | end; (* signature QED *) 12 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/m2/skolem.sig: -------------------------------------------------------------------------------- 1 | (* Skolem administration *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature SKOLEM = 5 | sig 6 | (*! structure IntSyn : INTSYN !*) 7 | 8 | val install: IntSyn.cid list -> unit 9 | end; (* signature SKOLEM *) 10 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/m2/strategy.sig: -------------------------------------------------------------------------------- 1 | (* Strategy *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature STRATEGY = 5 | sig 6 | structure MetaSyn : METASYN 7 | 8 | val run : MetaSyn.State list -> MetaSyn.State list * MetaSyn.State list 9 | (* open cases -> remaining cases * solved cases *) 10 | end; (* signature STRATEGY *) 11 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/meta/NOTES: -------------------------------------------------------------------------------- 1 | Fri Sep 3 13:28:29 EDT 1999 -cs 2 | 3 | There is a problem with Skolem constants. They cannot be applied to 4 | local parameters, otherwise the LF/meta level distinction is violated. 5 | In filling.fun I am lowering EVars (in createEVars), and there it is 6 | possible that local parameters get into the context G, which can 7 | be used (in search.fun) as arguments via unfications. This is a bug. 8 | 9 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/meta/data.fun: -------------------------------------------------------------------------------- 1 | (* Meta Global parameters *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | functor MTPData (structure MTPGlobal : MTPGLOBAL) : MTPDATA = 5 | struct 6 | val maxFill = ref 0 7 | end; (* structure MTPData*) 8 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/meta/data.sig: -------------------------------------------------------------------------------- 1 | (* Data aquired during proof search *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature MTPDATA = 5 | sig 6 | val maxFill : int ref 7 | end; (* signature MTPDATA *) 8 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/meta/filling.sig: -------------------------------------------------------------------------------- 1 | (* Filling: Version 1.3 *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature MTPFILLING = 5 | sig 6 | (*! structure FunSyn : FUNSYN !*) 7 | structure StateSyn : STATESYN 8 | 9 | exception Error of string 10 | 11 | type operator 12 | 13 | val expand : StateSyn.State -> operator 14 | val apply : operator -> (int * FunSyn.Pro) 15 | val menu : operator -> string 16 | end; (* signature MTPFILLING *) 17 | 18 | 19 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/meta/funweaken.sig: -------------------------------------------------------------------------------- 1 | (* Weakening substitutions for meta substitutions *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature FUNWEAKEN = 5 | sig 6 | (*! structure FunSyn : FUNSYN !*) 7 | 8 | val strengthenPsi : (FunSyn.lfctx * IntSyn.Sub) 9 | -> (FunSyn.lfctx * IntSyn.Sub) 10 | val strengthenPsi': (FunSyn.LFDec list * IntSyn.Sub) 11 | -> (FunSyn.LFDec list * IntSyn.Sub) 12 | end (* signature FUNWEAKEN *) -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/meta/global.fun: -------------------------------------------------------------------------------- 1 | (* Meta Global parameters *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | functor MTPGlobal 5 | (structure MetaGlobal : METAGLOBAL): MTPGLOBAL = 6 | struct 7 | datatype ProverType = New | Old 8 | 9 | val prover = ref New 10 | val maxFill = MetaGlobal.maxFill 11 | val maxSplit = MetaGlobal.maxSplit 12 | val maxRecurse = MetaGlobal.maxRecurse 13 | end; (* structure MTPGlobal *) 14 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/meta/global.sig: -------------------------------------------------------------------------------- 1 | (* Global parameters *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature MTPGLOBAL = 5 | sig 6 | datatype ProverType = New | Old 7 | 8 | val prover : ProverType ref 9 | val maxFill : int ref 10 | val maxSplit : int ref 11 | val maxRecurse : int ref 12 | end; (* signature MTPGLOBAL *) 13 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/meta/inference.sig: -------------------------------------------------------------------------------- 1 | (* Inference: Version 1.3 *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature INFERENCE = 5 | sig 6 | (*! structure FunSyn : FUNSYN !*) 7 | structure StateSyn : STATESYN 8 | 9 | exception Error of string 10 | 11 | type operator 12 | 13 | val expand : StateSyn.State -> operator 14 | val apply : operator -> StateSyn.State 15 | val menu : operator -> string 16 | end; (* signature Inference *) 17 | 18 | 19 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/meta/init.sig: -------------------------------------------------------------------------------- 1 | (* Initialization *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature MTPINIT = 5 | sig 6 | (*! structure FunSyn : FUNSYN !*) 7 | structure StateSyn : STATESYN 8 | 9 | exception Error of string 10 | 11 | (* Current restriction to non-mutual inductive theorems ! *) 12 | 13 | val init : (FunSyn.For * StateSyn.Order) -> StateSyn.State list 14 | 15 | end; (* signature MTPINIT *) 16 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/meta/interpret.sig: -------------------------------------------------------------------------------- 1 | (* Operational semantics *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature Interpreter = 5 | sig 6 | (*! structure FunSyn : FUNSYN !*) 7 | 8 | val run : FunSyn.Pro -> FunSyn.Pro 9 | end (* Signature Interpreter *) 10 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/meta/print.sig: -------------------------------------------------------------------------------- 1 | (* Meta Printer Version 1.3 *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature MTPRINT = 5 | sig 6 | structure Formatter : FORMATTER 7 | structure StateSyn : STATESYN 8 | 9 | exception Error of string 10 | 11 | val nameState : StateSyn.State -> StateSyn.State 12 | val formatState : StateSyn.State -> Formatter.format 13 | val stateToString : StateSyn.State -> string 14 | end; (* signature MTPRINT *) 15 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/meta/prover.sig: -------------------------------------------------------------------------------- 1 | (* Meta Prover Version 1.3 *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | 5 | signature MTPROVER = 6 | sig 7 | (*! structure FunSyn : FUNSYN !*) 8 | structure StateSyn : STATESYN 9 | 10 | exception Error of string 11 | 12 | val init : FunSyn.For * StateSyn.Order -> unit 13 | end; (* signature MTPROVER *) 14 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/meta/recursion.sig: -------------------------------------------------------------------------------- 1 | (* Recursion: Version 1.3 *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature MTPRECURSION = 5 | sig 6 | structure StateSyn : STATESYN 7 | 8 | exception Error of string 9 | 10 | type operator 11 | 12 | val expand : StateSyn.State -> operator 13 | val apply : operator -> StateSyn.State 14 | val menu : operator -> string 15 | end; (* signature MTPRECURSION *) 16 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/meta/relfun.sig: -------------------------------------------------------------------------------- 1 | (* Converter from relational representation to a functional 2 | representation of proof terms *) 3 | (* Author: Carsten Schuermann *) 4 | 5 | signature RELFUN = 6 | sig 7 | (*! structure FunSyn : FUNSYN !*) 8 | 9 | exception Error of string 10 | 11 | val convertFor : IntSyn.cid list -> FunSyn.For 12 | val convertPro : IntSyn.cid list -> FunSyn.Pro 13 | end (* Signature RELFUN *) 14 | 15 | 16 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/meta/search.sig: -------------------------------------------------------------------------------- 1 | (* Basic search engine: Version 1.3*) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature MTPSEARCH = 5 | sig 6 | structure StateSyn : STATESYN 7 | 8 | exception Error of string 9 | 10 | val searchEx : int * IntSyn.Exp list 11 | (* * (IntSyn.Exp * IntSyn.Sub) *) 12 | * (int -> unit) -> unit 13 | end; (* signature SEARCH *) 14 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/meta/strategy.sig: -------------------------------------------------------------------------------- 1 | (* MTPStrategy : Version 1.3 *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature MTPSTRATEGY = 5 | sig 6 | structure StateSyn : STATESYN 7 | 8 | val run : StateSyn.State list -> StateSyn.State list * StateSyn.State list 9 | (* open cases -> remaining cases * solved cases *) 10 | end; (* signature MTPSTRATEGY *) 11 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/modes/modeprint.sig: -------------------------------------------------------------------------------- 1 | (* Printing Mode Declarations *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature MODEPRINT = 5 | sig 6 | (*! structure ModeSyn : MODESYN !*) 7 | 8 | val modeToString : IntSyn.cid * ModeSyn.ModeSpine -> string 9 | val modesToString : (IntSyn.cid * ModeSyn.ModeSpine) list -> string 10 | end; (* signature MODEPRINT *) 11 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/modules/modules.sml: -------------------------------------------------------------------------------- 1 | structure ModSyn = 2 | ModSyn (structure Global = Global 3 | (*! structure IntSyn' = IntSyn !*) 4 | structure Names' = Names 5 | (*! structure Paths' = Paths !*) 6 | structure Origins = Origins 7 | structure Whnf = Whnf 8 | structure Strict = Strict 9 | structure IntTree = IntRedBlackTree 10 | structure HashTable = StringHashTable); 11 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/modules/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature MODSYN 3 | structure ModSyn 4 | is 5 | ../global/sources.cm 6 | ../table/sources.cm 7 | ../lambda/sources.cm 8 | ../paths/sources.cm 9 | ../typecheck/sources.cm 10 | modsyn.sig 11 | modsyn.fun 12 | modules.sml 13 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/names/README: -------------------------------------------------------------------------------- 1 | Naming of constants, parameters, and variables 2 | Author: Frank Pfenning 3 | Modified: Jeff Polakow 4 | 5 | This maintains mappings in two directions: from variable to 6 | name and from names to variables. It is a critical invariant 7 | that these mapping remains consistent. 8 | 9 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/opsem/absmachine.sig: -------------------------------------------------------------------------------- 1 | (* Abstract Machine *) 2 | (* Author: Iliano Cervesato *) 3 | (* Modified: Jeff Polakow *) 4 | (* Modified: Frank Pfenning *) 5 | 6 | signature ABSMACHINE = 7 | sig 8 | 9 | (*! structure IntSyn : INTSYN !*) 10 | (*! structure CompSyn : COMPSYN !*) 11 | 12 | val solve : (CompSyn.Goal * IntSyn.Sub) * CompSyn.DProg 13 | * (IntSyn.Exp -> unit) -> unit 14 | 15 | end; (* signature ABSMACHINE *) 16 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/order/README: -------------------------------------------------------------------------------- 1 | Termination orders for type families 2 | Author: Carsten Schuermann 3 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/order/WALK: -------------------------------------------------------------------------------- 1 | Current issues 2 | Renamed TermDec to TDec or TDecl? -fp DONE -cs 3 | 4 | Future issues 5 | 6 | CM/ 7 | README 8 | WALK 9 | order.fun OK -fp 10 | OK -cs 11 | order.sig OK -cs 12 | OK -fp 13 | order.sml OK -fp 14 | OK -cs 15 | sources.cm OK -fp 16 | OK -cs 17 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/order/order.sml: -------------------------------------------------------------------------------- 1 | structure Order = 2 | Order ((*! structure IntSyn' = IntSyn !*) 3 | structure Table = IntRedBlackTree); 4 | (* -bp *) 5 | (* 6 | structure RedOrder = 7 | RedOrder ((*! structure IntSyn' = IntSyn !*) 8 | structure Table = IntRedBlackTree); 9 | *) -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/order/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature ORDER 3 | structure Order 4 | is 5 | #if defined(NEW_CM) 6 | $/basis.cm 7 | #endif 8 | ../table/sources.cm 9 | ../lambda/sources.cm 10 | order.sig 11 | order.fun 12 | order.sml 13 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/paths/README: -------------------------------------------------------------------------------- 1 | Paths, occurrences, and error locations 2 | Author: Frank Pfenning 3 | 4 | This is used for error messages. 5 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/paths/paths.sml: -------------------------------------------------------------------------------- 1 | (* Now in paths.fun *) 2 | (* 3 | structure Paths = Paths (); 4 | *) 5 | 6 | structure Origins = 7 | Origins (structure Global = Global 8 | structure Table = StringHashTable 9 | (*! structure IntSyn' = IntSyn !*) 10 | (*! structure Paths' = Paths !*) 11 | ); 12 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/paths/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature PATHS 3 | structure Paths 4 | signature ORIGINS 5 | structure Origins 6 | is 7 | #if defined(NEW_CM) 8 | $/basis.cm 9 | #endif 10 | ../lambda/sources.cm 11 | ../global/sources.cm 12 | ../table/sources.cm 13 | paths.sig 14 | paths.fun 15 | origins.sig 16 | origins.fun 17 | paths.sml 18 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/print/README: -------------------------------------------------------------------------------- 1 | Printing of terms 2 | Author: Frank Pfenning 3 | 4 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/print/print-twega.sig: -------------------------------------------------------------------------------- 1 | (* Printing Signatures *) 2 | (* Author: Frank Pfenning *) 3 | 4 | signature PRINT_TWEGA = 5 | sig 6 | 7 | val printSgn : unit -> unit 8 | val printSgnToFile : string -> unit 9 | 10 | end; (* signature PRINT_TWEGA *) 11 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/print/print-xml.sig: -------------------------------------------------------------------------------- 1 | (* Printing Signatures *) 2 | (* Author: Frank Pfenning *) 3 | (* modified: Carsten Schuermann *) 4 | 5 | signature PRINT_XML = 6 | sig 7 | val printSgn : unit -> unit 8 | val printSgnToFile : string -> string -> unit 9 | end; (* signature PRINT_XML *) 10 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/prover/data.fun: -------------------------------------------------------------------------------- 1 | (* Meta data parameters *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | structure Data : DATA = 5 | struct 6 | val maxFill = ref 5 7 | val maxSplit = ref 5 8 | val maxRecurse = ref 2 9 | end; (* structure Data *) 10 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/prover/data.sig: -------------------------------------------------------------------------------- 1 | (* Data Global parameters *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature DATA = 5 | sig 6 | val maxFill : int ref 7 | val maxSplit : int ref 8 | val maxRecurse : int ref 9 | end; (* signature DATA *) 10 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/prover/recurse.sig: -------------------------------------------------------------------------------- 1 | (* Recurse: Version 1.4 *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature RECURSE = 5 | sig 6 | structure State : STATE 7 | 8 | exception Error of string 9 | 10 | type operator 11 | 12 | val expand : State.State -> operator 13 | val apply : operator -> State.State 14 | val menu : operator -> string 15 | end; (* signature RECURSE *) 16 | 17 | 18 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/server/sigint-mlton.sml: -------------------------------------------------------------------------------- 1 | structure SigINT :> SIGINT = 2 | struct 3 | 4 | fun interruptLoop (loop:unit -> unit) = 5 | let 6 | (* open MLton *) 7 | val _ = 8 | MLton.Cont.callcc 9 | (fn k => 10 | MLton.Signal.setHandler 11 | (Posix.Signal.int, 12 | MLton.Signal.Handler.handler 13 | (fn _ => 14 | MLton.Thread.new (fn () => MLton.Cont.throw (k, ()))))) 15 | in 16 | loop () 17 | end 18 | 19 | end; 20 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/server/sigint-smlnj.sml: -------------------------------------------------------------------------------- 1 | structure SigINT :> SIGINT = 2 | struct 3 | 4 | fun interruptLoop (loop:unit -> unit) = 5 | (SMLofNJ.Cont.callcc 6 | (fn k => (Signals.setHandler (Signals.sigINT, 7 | Signals.HANDLER (fn _ => (print "\ninterrupt\n"; k))); 8 | ())); 9 | loop ()) 10 | 11 | end; (* structure SigINT *) 12 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/server/sigint.sig: -------------------------------------------------------------------------------- 1 | signature SIGINT = 2 | sig 3 | 4 | val interruptLoop : (unit -> unit) -> unit 5 | 6 | end; (* signature SIGINT *) 7 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/server/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | structure Server 3 | is 4 | #if defined(NEW_CM) 5 | $/basis.cm 6 | #endif 7 | ../compat/sources.cm 8 | ../timing/sources.cm 9 | ../frontend/sources.cm 10 | sigint.sig 11 | #if defined(MLton) 12 | sigint-mlton.sml 13 | #else 14 | sigint-smlnj.sml 15 | #endif 16 | server.sml 17 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/solvers/cs.sig: -------------------------------------------------------------------------------- 1 | (* Constraint Solver *) 2 | signature CS = 3 | sig 4 | (*! structure CSManager : CS_MANAGER !*) 5 | 6 | (* all a constraint solver must define is a structure 7 | suitable for the constraint solver manager to install. 8 | *) 9 | val solver : CSManager.solver 10 | 11 | end (* signature CS *) 12 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/stream/README: -------------------------------------------------------------------------------- 1 | Stream Library 2 | Author: Frank Pfenning 3 | 4 | Streams are potentially infinite lists generate on demand. 5 | There are memoizing and non-memoizing versions. 6 | 7 | Used for lexing and parsing. 8 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/stream/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature STREAM 3 | structure Stream 4 | is 5 | stream.sml 6 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/style/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature STYLECHECK 3 | structure StyleCheck 4 | is 5 | #if defined(NEW_CM) 6 | $/basis.cm 7 | #endif 8 | ../global/sources.cm 9 | ../table/sources.cm 10 | ../lambda/sources.cm 11 | ../formatter/sources.cm 12 | ../print/sources.cm 13 | ../paths/sources.cm 14 | ../index/sources.cm 15 | style.sig 16 | style.fun 17 | style.sml -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/style/style.sig: -------------------------------------------------------------------------------- 1 | (* Style Checking *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature STYLECHECK = 5 | sig 6 | exception Error of string 7 | 8 | val check : unit -> unit (* raises Error (msg) *) 9 | end; (* signature STYLECHECK *) 10 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/style/style.sml: -------------------------------------------------------------------------------- 1 | structure StyleCheck = 2 | StyleCheck (structure Whnf = Whnf 3 | structure Index = Index 4 | structure Origins = Origins); 5 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/table/README: -------------------------------------------------------------------------------- 1 | Hash tables and red/black trees. 2 | Author: Frank Pfenning 3 | 4 | Red/black trees is based on an early version of code by Chris Okasaki. 5 | This should be updated some time (see version 15-212, Fall 1997 and 6 | Chris Okasaki's JFP paper on red/black trees). 7 | 8 | Updated the hash-table implementation to fix a bug in HashTable.app, 9 | Dec 23 1997. -fp 10 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/table/string-hash.sig: -------------------------------------------------------------------------------- 1 | (* String Hash Table *) 2 | (* Author: Frank Pfenning *) 3 | 4 | signature STRING_HASH = 5 | sig 6 | val stringHash : string -> int 7 | end; 8 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/tabling/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature TABLEDSYN 3 | structure TabledSyn 4 | is 5 | ../table/sources.cm 6 | ../lambda/sources.cm 7 | ../print/sources.cm 8 | ../paths/sources.cm 9 | ../index/sources.cm 10 | tabledsyn.sig 11 | tabledsyn.fun 12 | tabled.sml 13 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/tabling/tabled.sml: -------------------------------------------------------------------------------- 1 | structure TabledSyn = 2 | TabledSyn ((*! structure IntSyn' = IntSyn !*) 3 | structure Names = Names 4 | structure Table = IntRedBlackTree 5 | structure Index = Index); 6 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/tabling/tabledsyn.sig: -------------------------------------------------------------------------------- 1 | (* Tabled Syntax *) 2 | (* Author: Brigitte Pientka *) 3 | 4 | signature TABLEDSYN = 5 | sig 6 | 7 | (*! structure IntSyn : INTSYN !*) 8 | 9 | exception Error of string 10 | 11 | val reset : unit -> unit 12 | val installTabled : IntSyn.cid -> unit 13 | val tabledLookup : IntSyn.cid -> bool 14 | 15 | end; (* signature TABLEDSYN *) 16 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/terminate/README: -------------------------------------------------------------------------------- 1 | Termination checker 2 | Author: Carsten Schuermann 3 | 4 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/terminate/WALK: -------------------------------------------------------------------------------- 1 | Current issues 2 | 3 | Future issues: 4 | terminology: Order?? 5 | introduce a datatype for comparisons (EQUAL, LESS, NOTLE)? 6 | more complex termination orders -fp 7 | "complete" induction -fp 8 | 9 | CM/ 10 | README 11 | WALK 12 | sources.cm Q: move order into terminate? -fp 13 | terminate.fun OK -fp 14 | terminate.sig Q: check used? removed -fp 15 | OK -fp 16 | terminate.sml OK -fp 17 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/terminate/reduces.sig: -------------------------------------------------------------------------------- 1 | (* Reduction and Termination checker *) 2 | (* Author: Brigitte Pientka *) 3 | 4 | signature REDUCES = 5 | sig 6 | (*! structure IntSyn : INTSYN !*) 7 | 8 | exception Error of string 9 | 10 | val reset : unit -> unit 11 | val checkFamReduction : IntSyn.cid -> unit 12 | val checkFam : IntSyn.cid -> unit 13 | 14 | end; (* signature REDUCES *) 15 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/thm/README: -------------------------------------------------------------------------------- 1 | Theorem and related declarations 2 | Author: Carsten Schuermann 3 | 4 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/timing/README: -------------------------------------------------------------------------------- 1 | Utility code and definitions for timing SML code 2 | Author: Frank Pfenning 3 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/timing/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature TIMERS 3 | structure Timers 4 | signature TIMING 5 | structure Timing 6 | is 7 | #if defined(NEW_CM) 8 | $/basis.cm 9 | #endif 10 | ../compat/sources.cm 11 | timers.sig 12 | timers.fun 13 | timers.sml 14 | timing.sml 15 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/timing/timers.sml: -------------------------------------------------------------------------------- 1 | (* Timers *) 2 | (* Author: Frank Pfenning *) 3 | 4 | 5 | (* 6 | structure Timers = 7 | Timers (structure Timing' = Timing); 8 | *) 9 | 10 | (* alternative not using actual timers *) 11 | structure Timers = 12 | Timers (structure Timing' = Counting); 13 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/tomega/coverage.sig: -------------------------------------------------------------------------------- 1 | (* Unification on Formulas *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature TOMEGACOVERAGE = 5 | sig 6 | (*! structure IntSyn : INTSYN !*) 7 | (*! structure Tomega : TOMEGA !*) 8 | 9 | exception Error of string 10 | 11 | val coverageCheckPrg : Tomega.Worlds * Tomega.Dec IntSyn.Ctx * Tomega.Prg -> unit 12 | end (* Signature TOMEGACOVERAGE *) 13 | 14 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/tomega/redundant.sig: -------------------------------------------------------------------------------- 1 | signature REDUNDANT = 2 | sig 3 | exception Error of string 4 | 5 | val convert : Tomega.Prg -> Tomega.Prg 6 | end -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/tomega/unify.sig: -------------------------------------------------------------------------------- 1 | (* Unification on Formulas *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature TOMEGAUNIFY = 5 | sig 6 | (*! structure IntSyn : INTSYN !*) 7 | (*! structure Tomega : TOMEGA !*) 8 | 9 | exception Unify of string 10 | 11 | val unifyFor : Tomega.Dec IntSyn.Ctx * Tomega.For * Tomega.For -> unit 12 | end (* Signature TOMEGATYPECHECK *) 13 | 14 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/trail/README: -------------------------------------------------------------------------------- 1 | Generic Trailing 2 | Author: Roberto Virga 3 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/trail/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature TRAIL 3 | structure Trail 4 | structure NoTrail 5 | is 6 | trail.sig 7 | trail.sml 8 | notrail.sml 9 | 10 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/typecheck/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature TYPECHECK 3 | structure TypeCheck 4 | signature STRICT 5 | structure Strict 6 | is 7 | #if defined(NEW_CM) 8 | $/basis.cm 9 | #endif 10 | ../lambda/sources.cm 11 | ../print/sources.cm 12 | ../paths/sources.cm 13 | typecheck.sig 14 | typecheck.fun 15 | typecheck.sml 16 | strict.sig 17 | strict.fun 18 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/typecheck/strict.sig: -------------------------------------------------------------------------------- 1 | (* Checking Definitions for Strictness *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature STRICT = 5 | sig 6 | (*! structure IntSyn : INTSYN !*) 7 | (*! structure Paths : PATHS !*) 8 | 9 | exception Error of string 10 | 11 | val check : (IntSyn.Exp * IntSyn.Exp) * Paths.occConDec option -> unit 12 | val checkType : (int * IntSyn.Exp) * Paths.occConDec option -> unit 13 | end; (* signature STRICT *) 14 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/typecheck/typecheck.sml: -------------------------------------------------------------------------------- 1 | structure TypeCheck = 2 | TypeCheck ((*! structure IntSyn' = IntSyn !*) 3 | structure Conv = Conv 4 | structure Whnf = Whnf 5 | structure Names = Names 6 | structure Print = Print); 7 | 8 | structure Strict = 9 | Strict ((*! structure IntSyn' = IntSyn !*) 10 | structure Whnf = Whnf 11 | structure Paths' = Paths); 12 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/unique/unique.sig: -------------------------------------------------------------------------------- 1 | (* Uniqueness Checking *) 2 | (* Author: Frank Pfenning *) 3 | 4 | signature UNIQUE = 5 | sig 6 | 7 | exception Error of string 8 | 9 | val checkUnique : (IntSyn.cid * ModeSyn.ModeSpine) -> unit (* raises Error(msg) *) 10 | 11 | end; (* signature UNIQUE *) 12 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/worldcheck/worldify.sig: -------------------------------------------------------------------------------- 1 | (* Worldify *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | 5 | signature WORLDIFY = 6 | sig 7 | (*! structure IntSyn : INTSYN !*) 8 | (*! structure Tomega : TOMEGA !*) 9 | 10 | exception Error of string 11 | 12 | val worldify : IntSyn.cid -> IntSyn.ConDec list 13 | val worldifyGoal : IntSyn.Dec IntSyn.Ctx * IntSyn.Exp -> IntSyn.Exp 14 | end; (* signature WORLDIFY *) 15 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/src/worldcheck/worldprint.sig: -------------------------------------------------------------------------------- 1 | (* World Printer *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature WORLDPRINT = 5 | sig 6 | structure Formatter : FORMATTER 7 | (*! structure Tomega : TOMEGA !*) 8 | 9 | exception Error of string 10 | 11 | val formatWorlds : Tomega.Worlds -> Formatter.format 12 | val worldsToString : Tomega.Worlds -> string 13 | 14 | end; (* signature WORLDPRINT *) 15 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/tex/twelf.sty: -------------------------------------------------------------------------------- 1 | \def\EVar#1{\mbox{\bf #1}} 2 | \def\BVar#1{\mbox{\it #1}} 3 | \def\Const#1{\mbox{\rm #1}} 4 | \def\Skonst#1{\mbox{\bf #1}} 5 | \def\Def#1{\mbox{\rm #1}} 6 | \def\FVar#1{\mbox{\bf #1}} 7 | 8 | \def\Type{\mbox{\rm type}} 9 | \def\Kind{\mbox{\rm kind}} 10 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/twelf-server.sml: -------------------------------------------------------------------------------- 1 | (* comment out first line if undefined in your version of SMLofNJ *) 2 | (* call sml-cm with @SMLdebug=/dev/null instead *) 3 | SMLofNJ.Internals.GC.messages false; 4 | CM.make "server.cm"; 5 | SMLofNJ.exportFn ("bin/.heap/twelf-server", Server.server); 6 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/twelf-sml.sml: -------------------------------------------------------------------------------- 1 | (* comment out first line if undefined in your version of SMLofNJ *) 2 | (* call sml-cm with @SMLdebug=/dev/null instead *) 3 | SMLofNJ.Internals.GC.messages false; 4 | CM.make ("sources.cm"); 5 | if SMLofNJ.exportML ("bin/.heap/twelf-sml") 6 | then (print (Twelf.version ^ "\n"); Timing.init ()) else (); 7 | 8 | -------------------------------------------------------------------------------- /code/delphin/src/twelf/vim/filetype.vim: -------------------------------------------------------------------------------- 1 | " my filetype file 2 | if exists("did_load_filetypes") 3 | finish 4 | endif 5 | augroup filetypedetect 6 | autocmd! BufRead,BufNewFile *.elf,sources.cfg setfiletype twelf 7 | augroup END 8 | -------------------------------------------------------------------------------- /code/elphin/examples/list/README: -------------------------------------------------------------------------------- 1 | (* Merge sort *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | merge.d implements the standard merge sort operation in Elphin. 5 | -------------------------------------------------------------------------------- /code/elphin/src/Makefile: -------------------------------------------------------------------------------- 1 | all: ; 2 | @echo "*************************************************" 3 | @echo "Creating Executable: bin/elphin" 4 | @echo "*************************************************" 5 | mkdir -p bin/.heap 6 | sml < nabla.sml ; 7 | @echo "#! /bin/sh" > bin/elphin 8 | @echo "exec sml @SMLload=`pwd`/bin/.heap/elphin @SMLdebug=/dev/null" >> bin/elphin 9 | @chmod +x bin/elphin 10 | 11 | 12 | clean: ; 13 | rm -rf bin/.heap/elphin* bin/elphin */CM 14 | -------------------------------------------------------------------------------- /code/elphin/src/README: -------------------------------------------------------------------------------- 1 | To build Elphin, simply do "make". 2 | This will create an executable "bin/elphin" that you can run. 3 | 4 | OR Alternatively, 5 | you can start SML and then do: 6 | - CM.make "sources.cm"; 7 | - Nabla.top(); 8 | and this will also get you to Elphin 9 | 10 | Once inside Elphin, to load a file simply do: 11 | use "../example/example.elphin"; 12 | -------------------------------------------------------------------------------- /code/elphin/src/elaboration/abstract.sml: -------------------------------------------------------------------------------- 1 | structure NablaAbstract = 2 | NablaAbstract (structure Whnf = Whnf 3 | structure Constraints = Constraints); 4 | -------------------------------------------------------------------------------- /code/elphin/src/elaboration/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature NABLA_ELABORATOR 3 | structure NablaElab 4 | is 5 | #if defined(NEW_CM) 6 | $/basis.cm 7 | #endif 8 | ../twelf/src/paths/sources.cm 9 | ../twelf/src/lambda/sources.cm 10 | 11 | ../typecheck/sources.cm 12 | 13 | ../frontend/sources.frontend.cm 14 | ../twelf/src/stream/sources.cm 15 | 16 | sources.syntax.cm 17 | convert.sig 18 | convert.fun 19 | -------------------------------------------------------------------------------- /code/elphin/src/frontend/nabla.sig: -------------------------------------------------------------------------------- 1 | (* Nabla Frontend *) 2 | 3 | signature NABLA = 4 | sig 5 | val version : string 6 | val debug : bool ref 7 | val loadFile : string -> unit 8 | val top : unit -> unit 9 | 10 | val top' : (NablaIntSyntax.Dec IntSyn.Ctx) ref * 11 | (NablaIntSyntax.Sub) ref 12 | -> unit 13 | end 14 | -------------------------------------------------------------------------------- /code/elphin/src/frontend/parse-prg.sig: -------------------------------------------------------------------------------- 1 | (* The Parser *) 2 | 3 | signature PARSE = 4 | sig 5 | val fparse : string -> NablaExtSyntax.NablaProgram 6 | val sparse : unit -> NablaExtSyntax.NablaProgram 7 | 8 | 9 | end (* signature PARSE *) 10 | -------------------------------------------------------------------------------- /code/elphin/src/opsem/opsem.sig: -------------------------------------------------------------------------------- 1 | (* The nabla programming language operational semantics *) 2 | (* Author: Adam Poswolsky and Carsten Schuermann *) 3 | 4 | signature NABLA_OPSEM = 5 | sig 6 | exception NoSolution 7 | val eval0 : NablaIntSyntax.Exp -> NablaIntSyntax.Exp 8 | 9 | end 10 | -------------------------------------------------------------------------------- /code/elphin/src/opsem/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature NABLA_OPSEM 3 | structure NablaOpsem 4 | is 5 | #if defined(NEW_CM) 6 | $/basis.cm 7 | #endif 8 | ../twelf/src/lambda/sources.cm 9 | ../elaboration/sources.syntax.cm 10 | opsem.sig 11 | opsem.fun 12 | -------------------------------------------------------------------------------- /code/elphin/src/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature NABLA 3 | structure Nabla 4 | 5 | signature INTSYN 6 | structure IntSyn 7 | structure NablaIntSyntax 8 | is 9 | #if defined(NEW_CM) 10 | $/basis.cm 11 | #endif 12 | frontend/sources.cm 13 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/.cvsignore: -------------------------------------------------------------------------------- 1 | CM 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/InstallShield/README.final: -------------------------------------------------------------------------------- 1 | Twelf 1.2 has been successfully installed. 2 | To use the Twelf server from NT Emacs, add 3 | 4 | (load "C:/Twelf/emacs/twelf-init.el") 5 | 6 | to your _emacs file. 7 | 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/InstallShield/twelf-server.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | C:\Twelf\bin\run.x86-win32 @SMLload=C:/Twelf/bin/_heap/twelf-server -------------------------------------------------------------------------------- /code/elphin/src/twelf/TEST/cr.sml: -------------------------------------------------------------------------------- 1 | fun test (file) = 2 | case Twelf.Config.load (Twelf.Config.read file) 3 | of Twelf.OK => Twelf.OK 4 | | Twelf.ABORT => raise Domain; 5 | 6 | Twelf.unsafe := true; 7 | test "examples/church-rosser/test-unsafe.cfg"; 8 | Twelf.unsafe := false; -------------------------------------------------------------------------------- /code/elphin/src/twelf/TEST/lexing.elf: -------------------------------------------------------------------------------- 1 | %%% Testing the lexer error messages. 2 | 3 | % Illegal character. 4 | % c : ". 5 | 6 | % Whitespace in quoted identifier. 7 | % 'exp ' : type. 8 | 'exp 9 | ' : type. 10 | 11 | % Unclosed delimited comment at end of file token (replace DOT by .) 12 | % %{ %DOT 13 | 14 | exp : type. 15 | z : exp. 16 | 17 | % Unclosed delimited comment at end of file 18 | % %{ 19 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/TEST/location.elf: -------------------------------------------------------------------------------- 1 | %%% Testing the lexer error messages. 2 | 3 | exp : type. 4 | z : exp. 5 | s : exp -> exp. 6 | 7 | value : exp -> type. 8 | val_z : value s. 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/TEST/modes.elf: -------------------------------------------------------------------------------- 1 | % Test mode redefinition. 2 | 3 | exp : type. 4 | z : exp. 5 | s : exp -> exp. 6 | 7 | eval : exp -> exp -> type. 8 | %mode eval +E -V. 9 | 10 | eval_z : eval (s E) (s E) 11 | <- eval (s E) (s E) 12 | <- eval (s E) (s E). 13 | 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/TEST/skolem.sml: -------------------------------------------------------------------------------- 1 | Twelf.reset (); 2 | Twelf.loadFile "TEST/cp.elf"; 3 | val SOME cpt = Names.nameLookup "cpt"; 4 | val _ = Skolem.install [cpt]; 5 | val SOME cpt1 = Names.nameLookup "cpt#1"; 6 | val SOME cpt2 = Names.nameLookup "cpt#2"; 7 | val _ = TextIO.print (Print.expToString (IntSyn.Null, IntSyn.constType cpt1) ^ "\n"); 8 | val _ = TextIO.print (Print.expToString (IntSyn.Null, IntSyn.constType cpt2) ^ "\n"); -------------------------------------------------------------------------------- /code/elphin/src/twelf/TEST/subord.elf: -------------------------------------------------------------------------------- 1 | % Testing subordination 2 | 3 | a : type. 4 | 5 | b : a -> type. 6 | c : a -> type. 7 | 8 | s1 : b X -> c X. 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/TEST/term.elf: -------------------------------------------------------------------------------- 1 | %terminates D (eval D _). -------------------------------------------------------------------------------- /code/elphin/src/twelf/TEST/test.cfg: -------------------------------------------------------------------------------- 1 | modes.elf 2 | term.elf -------------------------------------------------------------------------------- /code/elphin/src/twelf/TEST/uscore.elf: -------------------------------------------------------------------------------- 1 | exp: type. 2 | bug: exp -> type. 3 | %mode bug -E. 4 | oops: bug _ <- bug E. 5 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/bin/.cvsignore: -------------------------------------------------------------------------------- 1 | delphin 2 | delphin.bat 3 | twelf-server 4 | twelf-server.bat 5 | twelf-sml 6 | twelf-sml.bat 7 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/bin/.dbase/.cvsignore: -------------------------------------------------------------------------------- 1 | twelf* 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/bin/.dbase/README: -------------------------------------------------------------------------------- 1 | This directory will contain the databases loaded into 2 | the Poly/ML runtime system. 3 | 4 | Do not delete this file, so that this directory will be created 5 | when the distribution is unpacked. 6 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/bin/.heap/.cvsignore: -------------------------------------------------------------------------------- 1 | delphin* 2 | twelf* 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/bin/.heap/README: -------------------------------------------------------------------------------- 1 | This directory will contain the heaps which will be loaded into the 2 | SML of NJ runtime system. 3 | 4 | Do not delete this file, so that this directory will be created 5 | when the distribution is unpacked. 6 | 7 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/bin/.mkexec: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | # 3 | # Twelf Batch File Creator 4 | # 5 | # Arguments: 6 | # $1 = SMLNJ runtime 7 | # $2 = Twelf root directory 8 | # $3 = Type of executable (e.g. twelf-server, twelf-sml) 9 | # $4 = Name of executable (e.g. twelf-server, twelf-sml) 10 | cat > "$2/bin/$4" <> TAGS 6 | echo "$f,0" >> TAGS 7 | end 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/bin/tag-examples: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | # 3 | ../bin/create-tags {*/*,*/*/*}.{cfg,elf,quy,thm} 4 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/bin/tag-twelf: -------------------------------------------------------------------------------- 1 | #! /bin/csh -f 2 | # 3 | ../bin/create-tags {*,*/*}.{cm,sig,fun,sml} 4 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/delphin.sml: -------------------------------------------------------------------------------- 1 | (* comment out first line if undefined in your version of SMLofNJ *) 2 | (* call sml-cm with @SMLdebug=/dev/null instead *) 3 | SMLofNJ.Internals.GC.messages false; 4 | CM.make' ("delphin.cm"); 5 | if SMLofNJ.exportML ("bin/.heap/delphin") 6 | then (print (Delphin.version ^ "\n"); Delphin.top ()) else (); 7 | 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/doc/dvi/.cvsignore: -------------------------------------------------------------------------------- 1 | twelf.dvi 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/doc/guide/.cvsignore: -------------------------------------------------------------------------------- 1 | twelf.dvi 2 | twelf.ps 3 | twelf.ps.gz 4 | twelf.pdf 5 | twelf*.html 6 | twelf.info* 7 | twelf.aux 8 | twelf.log 9 | twelf.cp 10 | twelf.cps 11 | twelf.fn 12 | twelf.fns 13 | twelf.ky 14 | twelf.pg 15 | twelf.toc 16 | twelf.tp 17 | twelf.vr 18 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/doc/guide/config.embed: -------------------------------------------------------------------------------- 1 | p +/afs/cs/project/twelf/misc/ps-type1/embed.map 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/doc/html/.cvsignore: -------------------------------------------------------------------------------- 1 | twelf_*.html 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/doc/html/index.html: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aposwolsky/delphin/9b7a47f09374a64d0438f114dd90826d13b8edc2/code/elphin/src/twelf/doc/html/index.html -------------------------------------------------------------------------------- /code/elphin/src/twelf/doc/info/.cvsignore: -------------------------------------------------------------------------------- 1 | twelf.info* 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/doc/pdf/.cvsignore: -------------------------------------------------------------------------------- 1 | twelf.pdf 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/doc/ps/.cvsignore: -------------------------------------------------------------------------------- 1 | twelf.ps 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/emacs/.cvsignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aposwolsky/delphin/9b7a47f09374a64d0438f114dd90826d13b8edc2/code/elphin/src/twelf/emacs/.cvsignore -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/arith/examples.quy: -------------------------------------------------------------------------------- 1 | %%% Sample queries. 2 | %%% Author: Roberto Virga. 3 | 4 | %solve 5 | exp : expression "(10*9)+35". 6 | 7 | %query 1 * 8 | eval exp Q. 9 | 10 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/arith/sources.cfg: -------------------------------------------------------------------------------- 1 | parse.elf 2 | eval.elf 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/arith/test.cfg: -------------------------------------------------------------------------------- 1 | parse.elf 2 | eval.elf 3 | 4 | examples.quy 5 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/base/examples.quy: -------------------------------------------------------------------------------- 1 | %%% A sample query. 2 | %%% Author: Roberto Virga. 3 | 4 | %query 1 * 5 | 6 | represent 32767 8 L. 7 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/base/sources.cfg: -------------------------------------------------------------------------------- 1 | base.elf 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/base/test.cfg: -------------------------------------------------------------------------------- 1 | base.elf 2 | 3 | examples.quy 4 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/crypt/examples.quy: -------------------------------------------------------------------------------- 1 | %%% A sample query. 2 | %%% Author: Roberto Virga. 3 | 4 | %query 1 * 5 | solve (S , E , N , D , M , O , R , Y , nil). 6 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/crypt/sources.cfg: -------------------------------------------------------------------------------- 1 | crypt.elf 2 | examples.quy 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/crypt/test.cfg: -------------------------------------------------------------------------------- 1 | crypt.elf 2 | examples.quy 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/integers/sources.cfg: -------------------------------------------------------------------------------- 1 | base.elf 2 | integers.elf 3 | meta.elf 4 | cfract.elf -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/integers/test.cfg: -------------------------------------------------------------------------------- 1 | base.elf 2 | integers.elf 3 | meta.elf 4 | cfract.elf 5 | 6 | examples.quy 7 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/laplace/examples.quy: -------------------------------------------------------------------------------- 1 | %%% A sample query. 2 | %%% Author: Roberto Virga. 3 | 4 | %query 1 * 5 | P : laplace ( 6 | ( 0 , 0 , 0 , 0 , 0 , nil) ; 7 | (100 , R , S , T , 100 , nil) ; 8 | (100 , U , V , W , 100 , nil) ; 9 | (100 , X , Y , Z , 100 , nil) ; 10 | (100 , 100 , 100 , 100 , 100 , nil) ; 11 | lnil 12 | ). 13 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/laplace/sources.cfg: -------------------------------------------------------------------------------- 1 | laplace.elf -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/laplace/test.cfg: -------------------------------------------------------------------------------- 1 | laplace.elf 2 | 3 | examples.quy 4 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/lists/examples.quy: -------------------------------------------------------------------------------- 1 | %%% A sample query. 2 | %%% Author: Roberto Virga. 3 | 4 | %query 10 10 5 | Z : list 3. 6 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/lists/sources.cfg: -------------------------------------------------------------------------------- 1 | lists.elf -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/lists/test.cfg: -------------------------------------------------------------------------------- 1 | lists.elf 2 | 3 | examples.quy 4 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/mortgage/examples.quy: -------------------------------------------------------------------------------- 1 | %%% Sample queries. 2 | %%% Author: Roberto Virga. 3 | 4 | %query 1 * 5 | mortgage 80000 36 19/2 MP 0. 6 | 7 | %query 1 * 8 | mortgage P 36 15 MP 0. 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/mortgage/sources.cfg: -------------------------------------------------------------------------------- 1 | mortgage.elf -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/mortgage/test.cfg: -------------------------------------------------------------------------------- 1 | mortgage.elf 2 | 3 | examples.quy 4 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/pelletier/pelletier.elf: -------------------------------------------------------------------------------- 1 | %%% A straightforward way to prove propositional logic theorems 2 | %%% by using uniqueness of canonical form of polynomial in Z(2). 3 | %%% Author: Roberto Virga 4 | 5 | %use equality/booleans. 6 | 7 | %% theorem 8 | theorem : bool -> type. 9 | 10 | tt : theorem true. 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/pelletier/sources.cfg: -------------------------------------------------------------------------------- 1 | pelletier.elf 2 | examples.quy 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/pelletier/test.cfg: -------------------------------------------------------------------------------- 1 | pelletier.elf 2 | examples.quy 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/sieve/examples.quy: -------------------------------------------------------------------------------- 1 | %%% Sample queries. 2 | %%% Author: Roberto Virga. 3 | 4 | %query 1 * 5 | sieve 500 L. 6 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/sieve/sources.cfg: -------------------------------------------------------------------------------- 1 | sieve2.elf 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-clp/sieve/test.cfg: -------------------------------------------------------------------------------- 1 | sieve2.elf 2 | 3 | examples.quy 4 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-delphin/carsten/mini-ml/bug1: -------------------------------------------------------------------------------- 1 | Root (Var 2,AppExp (Root (Proj (Bidx 1,3),Nil),Nil)) 2 | 3 | Root (Var 3,AppExp (Root (Proj (Bidx 2,4),App (Root (Const -,App (Root (BVar 2,Nil),Nil)), 4 | Nil)),Nil)), -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-delphin/carsten/mini-ml/run.sml: -------------------------------------------------------------------------------- 1 | Delphin.loadFile ("examples-delphin/carsten/mini-ml/mini-ml.elf", "examples-delphin/carsten/mini-ml/identity.delphin"); 2 | Delphin.loadFile ("examples-delphin/carsten/mini-ml/mini-ml.elf", "examples-delphin/carsten/mini-ml/add.delphin"); 3 | Delphin.loadFile ("examples-delphin/carsten/mini-ml/mini-ml.elf", "examples-delphin/carsten/mini-ml/count.delphin"); -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-delphin/carsten/mini-ml/sources.cfg: -------------------------------------------------------------------------------- 1 | mini-ml.elf -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-delphin/carsten/prop-calc/run.sml: -------------------------------------------------------------------------------- 1 | Delphin.loadFile ("examples-delphin/carsten/prop-calc/prop-calc.elf", "examples-delphin/carsten/prop-calc/equiv.delphin"); 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-delphin/carsten/prover/prover.elf: -------------------------------------------------------------------------------- 1 | % Carsten Schuermann 2 | % The first mature Delphin program 3 | 4 | n : type. 5 | o : type. 6 | nd: o -> type. 7 | l1: (imp : o -> o -> o) 8 | (atm : n -> o) 9 | (impi : (nd A -> nd B) -> nd (A imp B)) 10 | (impe : nd (A imp B) -> (nd A -> nd B)). 11 | l2: (p: n). 12 | l3: [A:o] (u : nd A). 13 | 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-delphin/carsten/prover/run.sml: -------------------------------------------------------------------------------- 1 | Delphin.loadFile ("examples-delphin/carsten/prover/nd.elf", "examples-delphin/carsten/prover/prover.delphin"); 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples-delphin/mini-ml/sources.cfg: -------------------------------------------------------------------------------- 1 | mini-ml.elf -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/arith/README: -------------------------------------------------------------------------------- 1 | Simple unary arithmetic to test inductive theorem prover. 2 | 3 | Authors: Frank Pfenning and Carsten Schuermann 4 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/arith/sources.cfg: -------------------------------------------------------------------------------- 1 | % Trivial Unary Arithmetic 2 | arith.elf 3 | 4 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/arith/test.cfg: -------------------------------------------------------------------------------- 1 | arith.elf 2 | arith.thm 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/ccc/conc.thm: -------------------------------------------------------------------------------- 1 | % Translation CCC combinators -> lambda-terms 2 | 3 | % Partial check of hand-coded proof 4 | %terminates F (conc F _). 5 | 6 | % Automatic proof generation 7 | %theorem concom : forall* {A:obj} {B:obj} 8 | forall {F: mor A B} 9 | exists {M: term A -> term B} true. 10 | %prove 4 F (concom F _). 11 | 12 | % Partial verification of generated proof 13 | %terminates F (concom F _). 14 | 15 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/ccc/pf.dvi: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aposwolsky/delphin/9b7a47f09374a64d0438f114dd90826d13b8edc2/code/elphin/src/twelf/examples/ccc/pf.dvi -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/ccc/sources.cfg: -------------------------------------------------------------------------------- 1 | ccc.elf 2 | lambda.elf 3 | catlem.elf 4 | cong.elf 5 | abs-env.elf 6 | % subext.elf 7 | % eqpres1.elf 8 | conc.elf 9 | eqpres2.elf 10 | inv1.elf 11 | % inv2.elf 12 | % refl.elf 13 | 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/ccc/spass.cfg: -------------------------------------------------------------------------------- 1 | spass.elf 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/ccc/test.cfg: -------------------------------------------------------------------------------- 1 | ccc.elf 2 | lambda.elf 3 | catlem.elf 4 | cong.elf 5 | abs-env.elf 6 | % subext.elf 7 | % eqpres1.elf 8 | conc.elf 9 | conc.thm 10 | eqpres2.elf 11 | inv1.elf 12 | % inv2.elf 13 | % refl.elf 14 | examples.quy 15 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/church-rosser/lam.elf: -------------------------------------------------------------------------------- 1 | %%% Untyped lambda-calculus 2 | %%% Author: Frank Pfenning 3 | 4 | term : type. %name term M. 5 | 6 | lam : (term -> term) -> term. 7 | app : term -> term -> term. 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/church-rosser/sources.cfg: -------------------------------------------------------------------------------- 1 | lam.elf 2 | ord-red.elf 3 | par-red.elf 4 | par-lemmas.elf 5 | par-cr.elf 6 | ord-lemmas.elf 7 | equiv.elf 8 | ord-cr.elf 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/church-rosser/test-unsafe.cfg: -------------------------------------------------------------------------------- 1 | lam.elf 2 | ord-red.elf 3 | par-red.elf 4 | par-lemmas.elf 5 | % par-cr.elf 6 | % ord-lemmas.elf 7 | % equiv.elf 8 | % ord-cr.elf 9 | % examples.quy 10 | church-rosser.thm 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/church-rosser/test.cfg: -------------------------------------------------------------------------------- 1 | lam.elf 2 | ord-red.elf 3 | par-red.elf 4 | par-lemmas.elf 5 | par-cr.elf 6 | ord-lemmas.elf 7 | equiv.elf 8 | ord-cr.elf 9 | examples.quy 10 | 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/compile/README: -------------------------------------------------------------------------------- 1 | Directory with source material for compiler 2 | Copyright (c) 1992,1994 by Frank Pfenning 3 | 4 | debruijn1/ --- from expressions to de Bruijn expressions, fragment 5 | debruijn/ --- from expressions to expressions with de Bruijn indices 6 | cls/ --- CLS machine 7 | cpm/ --- continuation-passing machine 8 | cxm/ --- contextual abstract machine 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/compile/cls/sources.cfg: -------------------------------------------------------------------------------- 1 | mini-ml.elf 2 | debruijn.elf 3 | trans.elf 4 | feval.elf 5 | cls.elf 6 | compute.elf 7 | cls-complete.elf 8 | cls-sound.elf 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/compile/cls/test.cfg: -------------------------------------------------------------------------------- 1 | mini-ml.elf 2 | debruijn.elf 3 | trans.elf 4 | feval.elf 5 | cls.elf 6 | compute.elf 7 | cls-complete.elf 8 | cls-sound.elf 9 | examples.quy 10 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/compile/cpm/sources.cfg: -------------------------------------------------------------------------------- 1 | mini-mlv.elf 2 | evalv.elf 3 | cpm.elf 4 | ceval.elf 5 | ceval-sound.elf 6 | ceval-complete.elf 7 | proof-equiv.elf 8 | 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/compile/cpm/test.cfg: -------------------------------------------------------------------------------- 1 | mini-mlv.elf 2 | evalv.elf 3 | cpm.elf 4 | ceval.elf 5 | ceval-sound.elf 6 | ceval-complete.elf 7 | ceval-complete.thm 8 | proof-equiv.elf 9 | proof-equiv.thm 10 | examples.quy 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/compile/cps/sources.cfg: -------------------------------------------------------------------------------- 1 | mini-ml.elf 2 | cps.elf 3 | ml-cps.elf 4 | cps-eval.elf 5 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/compile/cps/test.cfg: -------------------------------------------------------------------------------- 1 | mini-ml.elf 2 | cps.elf 3 | ml-cps.elf 4 | cps-eval.elf 5 | examples.quy 6 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/compile/cxm/examples.quy: -------------------------------------------------------------------------------- 1 | %query 1 * 2 | xeval (app (lam [x] (vl x)) z) V. 3 | 4 | %query 1 * 5 | xeval (app (fix [double] lam [x] 6 | case (vl x) z 7 | [x'] s (s (app double (vl x')))) (s (s (s z)))) 8 | V. 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/compile/cxm/sources.cfg: -------------------------------------------------------------------------------- 1 | mini-mlv.elf 2 | evalv.elf 3 | xeval.elf 4 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/compile/cxm/test.cfg: -------------------------------------------------------------------------------- 1 | mini-mlv.elf 2 | evalv.elf 3 | xeval.elf 4 | examples.quy 5 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/compile/debruijn/sources.cfg: -------------------------------------------------------------------------------- 1 | mini-ml.elf 2 | value.elf 3 | debruijn.elf 4 | trans.elf 5 | feval.elf 6 | eval.elf 7 | val-lemmas.elf 8 | map-eval.elf 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/compile/debruijn/test.cfg: -------------------------------------------------------------------------------- 1 | mini-ml.elf 2 | value.elf 3 | debruijn.elf 4 | trans.elf 5 | feval.elf 6 | eval.elf 7 | val-lemmas.elf 8 | map-eval.elf 9 | examples.quy 10 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/compile/debruijn/value.elf: -------------------------------------------------------------------------------- 1 | %%% Definition of Values 2 | %%% Author: Frank Pfenning, based on [Michaylov & Pfenning 92] 3 | 4 | value : exp -> type. %name value P. 5 | 6 | val_z : value z. 7 | val_s : value (s E) <- value E. 8 | val_pair : value (pair E1 E2) <- value E1 <- value E2. 9 | val_lam : value (lam E). 10 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/compile/debruijn1/eval.elf: -------------------------------------------------------------------------------- 1 | %%% Mini-ML Natural Semantics 2 | %%% Version restricted to pure lambda-calculus 3 | %%% Author: Frank Pfenning, based on [Michaylov & Pfenning 92] 4 | 5 | eval : exp -> exp -> type. %name eval D. 6 | 7 | % Functions 8 | ev_lam : eval (lam E) (lam E). 9 | ev_app : eval (app E1 E2) V 10 | <- eval E1 (lam E1') 11 | <- eval E2 V2 12 | <- eval (E1' V2) V. 13 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/compile/debruijn1/examples.quy: -------------------------------------------------------------------------------- 1 | %query 1 * 2 | trans empty F (app (lam [x] lam [y] x) (lam [z] z)). 3 | 4 | %query 1 * 5 | feval empty (app' (lam' (lam' (1 ^))) (lam' 1)) W. 6 | 7 | %query 1 * 8 | vtrans (clo (empty ; clo empty (lam' 1)) (lam' (1 ^))) V. 9 | 10 | %query 2 * 11 | trans empty F (lam [x] lam [y] app x x). 12 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/compile/debruijn1/mini-ml.elf: -------------------------------------------------------------------------------- 1 | %%% The Mini-ML Language 2 | %%% Version restricted to pure lambda-calculus 3 | %%% Author: Frank Pfenning, based on [Michaylov & Pfenning 92] 4 | 5 | exp : type. %name exp E. 6 | 7 | lam : (exp -> exp) -> exp. 8 | app : exp -> exp -> exp. 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/compile/debruijn1/sources.cfg: -------------------------------------------------------------------------------- 1 | mini-ml.elf 2 | debruijn.elf 3 | trans.elf 4 | feval.elf 5 | eval.elf 6 | map-eval.elf 7 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/compile/debruijn1/test.cfg: -------------------------------------------------------------------------------- 1 | mini-ml.elf 2 | debruijn.elf 3 | trans.elf 4 | feval.elf 5 | eval.elf 6 | map-eval.elf 7 | examples.quy 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/cpsocc/NOTES: -------------------------------------------------------------------------------- 1 | Notes made during the conversion from Elf to Twelf 1.2 2 | Frank Pfenning 3 | 4 | . missing at end of declarations 5 | [x:_] illegal => replace by [x] 6 | {y:A} is not operational => replace by A -> in queries 7 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/cpsocc/dsBNF.elf: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | %%%%% BNF of direct-style terms 3 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4 | 5 | droot : type. %name droot DROOT. 6 | dexp : type. %name dexp DEXP. 7 | dtriv : type. %name dtriv DTRIV. 8 | 9 | dexp->droot : dexp -> droot. 10 | 11 | dapp : dexp -> dexp -> dexp. 12 | dtriv->dexp : dtriv -> dexp. 13 | 14 | dlam : (dtriv -> droot) -> dtriv. -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/cpsocc/fig11.elf: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | %%%%% Figure 11 : Var-valid data stacks 3 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4 | 5 | vvalDS : stack -> stack -> type. 6 | 7 | vvalDS_init : vvalDS dot dot. 8 | 9 | vvalDS_stack : vvalDS (XXi , V) (Xi , T) 10 | <- ({xi:stack}vvalT xi T xi) 11 | <- vvalDS XXi Xi. -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/cpsocc/fig13.elf: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | %%%%% Figure 13 : Cont-valid data stacks 3 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 4 | 5 | cvalDS : stack -> type. 6 | 7 | cvalDS_init : cvalDS dot. 8 | 9 | cvalDS_stack : cvalDS (Xi , T) 10 | <- cvalT T 11 | <- cvalDS Xi. 12 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/cpsocc/sources.cfg: -------------------------------------------------------------------------------- 1 | dsBNF.elf 2 | cpsBNF.elf 3 | fig1.elf 4 | def1+5+fig4.elf 5 | th2.elf 6 | def3+6+fig5.elf 7 | th4.elf 8 | fig7.elf 9 | fig8.elf 10 | fig10.elf 11 | fig12.elf 12 | lemma7.elf 13 | th8.elf 14 | fig9.elf 15 | lemma9.elf 16 | %----- 17 | th10.elf 18 | %----- 19 | def13.elf 20 | lemma14.elf 21 | th15.elf 22 | def16.elf 23 | fig11.elf 24 | fig13.elf 25 | corr.elf 26 | lemma17.elf 27 | th18.elf 28 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/cpsocc/test.cfg: -------------------------------------------------------------------------------- 1 | dsBNF.elf 2 | cpsBNF.elf 3 | fig1.elf 4 | def1+5+fig4.elf 5 | th2.elf 6 | def3+6+fig5.elf 7 | th4.elf 8 | fig7.elf 9 | fig8.elf 10 | fig10.elf 11 | fig12.elf 12 | lemma7.elf 13 | th8.elf 14 | fig9.elf 15 | lemma9.elf 16 | th10.elf 17 | def13.elf 18 | lemma14.elf 19 | th15.elf 20 | def16.elf 21 | fig11.elf 22 | fig13.elf 23 | corr.elf 24 | lemma17.elf 25 | th18.elf 26 | test.quy 27 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/cut-elim/cl.thm: -------------------------------------------------------------------------------- 1 | %%% Termination of cut-elimination 2 | 3 | %terminates {A [D E]} 4 | (ca' A D E _). 5 | 6 | %terminates D (ce' D _). 7 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/cut-elim/int.thm: -------------------------------------------------------------------------------- 1 | %%% Termination of cut-elimination 2 | 3 | %terminates {A [D E]} 4 | (ca A D E _). 5 | 6 | %terminates D (ce D _). 7 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/cut-elim/sources.cfg: -------------------------------------------------------------------------------- 1 | formulas.elf 2 | int.elf 3 | cl.elf 4 | int-admit.elf 5 | cl-admit.elf 6 | int-cut.elf 7 | cl-cut.elf 8 | int-elim.elf 9 | cl-elim.elf 10 | examples.quy 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/cut-elim/test.cfg: -------------------------------------------------------------------------------- 1 | formulas.elf 2 | int.elf 3 | cl.elf 4 | int-admit.elf 5 | cl-admit.elf 6 | int-cut.elf 7 | cl-cut.elf 8 | int-elim.elf 9 | cl-elim.elf 10 | examples.quy 11 | cl.thm 12 | int.thm 13 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/fol/README: -------------------------------------------------------------------------------- 1 | A few experiments in direct proof search. 2 | 3 | Can we prove uncurry? 4 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/fol/sources.cfg: -------------------------------------------------------------------------------- 1 | fol.elf 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/fol/test.cfg: -------------------------------------------------------------------------------- 1 | fol.elf 2 | fol.thm 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/guide/sources.cfg: -------------------------------------------------------------------------------- 1 | % Examples from Twelf User's Guide 2 | nd.elf 3 | lists.elf 4 | lam.elf 5 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/guide/test.cfg: -------------------------------------------------------------------------------- 1 | % Examples from Twelf User's Guide 2 | nd.elf 3 | lists.elf 4 | lam.elf 5 | arith.elf 6 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/handbook/sources.cfg: -------------------------------------------------------------------------------- 1 | fol.elf 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/handbook/test.cfg: -------------------------------------------------------------------------------- 1 | fol.elf 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/incll/bff-incll.quy: -------------------------------------------------------------------------------- 1 | t1 : trm tree = t z (t z e (t z e e)) (t z (t z e e) e). 2 | 3 | % It works now!! 4 | 5 | %query 1 * (sqnt rnil rnil rnil rnil (^ (bf e T))). 6 | %query 1 * (sqnt rnil rnil rnil rnil (^ (bf (t z e e) T))). 7 | %query 1 * (sqnt rnil rnil rnil rnil (^ (bf t1 T))). 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/incll/lists-incll.quy: -------------------------------------------------------------------------------- 1 | %query 24 * (sqnt rnil rnil rnil rnil (^ (perm l4 L))). 2 | %query 6 * (sqnt rnil rnil rnil rnil (^ (perm l3 L))). 3 | 4 | %query 1 * (sqnt rnil rnil rnil rnil (^ (rev l4 L))). 5 | 6 | %query 1 * (sqnt rnil rnil rnil rnil (^ (id l4 L))). 7 | 8 | %query 1 * (sqnt rnil rnil rnil rnil (^ (idl l4 L))). 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/incll/pre-incll.quy: -------------------------------------------------------------------------------- 1 | % 2 | % 3 + 2 * 1 3 | % 4 | o1i = rnil ,r # ^ fun end 5 | ,r # ^ con 1 ,r # ^ fun * ,r # ^ con 2 ,r # ^ fun + ,r # ^ con 3. 6 | o1o = rnil ,r del ,r del ,r del ,r del ,r del ,r del. 7 | 8 | o2 = rnil ,r # ^ fun end ,r # ^ con 1. 9 | 10 | %query 1 * (sqnt rnil rnil o2 OO (^ (evc end 1))). 11 | %query 1 * (sqnt rnil rnil o2 OO (^ (evc end A))). 12 | %query 1 * (sqnt rnil rnil o1i o1o (^ (evc end A))). 13 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/incll/sort-incll.quy: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%%%%%%%%%%% 2 | 3 | % l1 = (cons (s s s z) (cons (s z) (cons (s s z) nil))). 4 | % l2 = (cons (s s s z) (cons (s s z) (cons (s z) (cons (s s z) nil)))). 5 | 6 | l1 = (s s s z) | (s z) | (s s z) | nil. 7 | l2 = (s s s z) | (s s z) | (s z) | (s s z) | nil. 8 | 9 | %query 1 * (sqnt rnil rnil rnil rnil (^ (mergeSort l1 L))). 10 | %query 1 * (sqnt rnil rnil rnil rnil (^ (mergeSort l2 L))). 11 | 12 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/incll/sources.cfg: -------------------------------------------------------------------------------- 1 | % Meta-interpreter 2 | incll.elf 3 | lists.elf 4 | iosequents.elf 5 | % Sample INCLL programs 6 | parse-lolli.elf 7 | parse-incll.elf 8 | search-incll.elf 9 | lists-incll.elf 10 | sort-incll.elf 11 | cpm-incll.elf 12 | bff-incll.elf 13 | % pre-incll.elf 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/kolm/fol.elf: -------------------------------------------------------------------------------- 1 | % File: fol.elf 2 | 3 | % First Order Logic Signature. 4 | 5 | i : type. %name i T. 6 | o : type. %name o A. 7 | 8 | and : o -> o -> o. %infix right 11 and. 9 | imp : o -> o -> o. %infix right 10 imp. 10 | or : o -> o -> o. %infix right 11 or. 11 | not : o -> o. %prefix 12 not. 12 | true : o. 13 | false : o. 14 | forall : (i -> o) -> o. 15 | exists : (i -> o) -> o. 16 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/kolm/sources.cfg: -------------------------------------------------------------------------------- 1 | fol.elf 2 | nk.elf 3 | nj.elf 4 | kolmtrans.elf 5 | sound.elf 6 | complete.elf 7 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/kolm/test.cfg: -------------------------------------------------------------------------------- 1 | fol.elf 2 | nk.elf 3 | nj.elf 4 | kolmtrans.elf 5 | sound.elf 6 | complete.elf 7 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/lp-horn/examples.quy: -------------------------------------------------------------------------------- 1 | % see ../lp/examples.quy---there are no specific queries here. 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/lp-horn/sources.cfg: -------------------------------------------------------------------------------- 1 | natded.elf 2 | canon.elf 3 | conv.elf 4 | iscan.elf 5 | uniform.elf 6 | uni-sound.elf 7 | uni-can.elf 8 | uni-complete.elf 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/lp-horn/test.cfg: -------------------------------------------------------------------------------- 1 | natded.elf 2 | canon.elf 3 | conv.elf 4 | iscan.elf 5 | uniform.elf 6 | uni-sound.elf 7 | uni-sound.thm 8 | uni-can.elf 9 | uni-can.thm 10 | uni-complete.elf 11 | uni-complete.thm 12 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/lp-horn/uni-complete.thm: -------------------------------------------------------------------------------- 1 | % Completeness 2 | 3 | %theorem compcs : forall* {A:o} {D:pf A} 4 | forall {CN : can A D} 5 | exists {S : solve A} true. 6 | %theorem compai : forall* {A:o} 7 | forall {D : pf A} {AT : atm D} 8 | exists {CN : {P:p} A >> P -> solve (atom P)} true. 9 | %prove 4 (CN AT) 10 | (compcs CN _) 11 | (compai _ AT _). 12 | 13 | %terminates (CN AT) 14 | (compcs CN _) 15 | (compai _ AT _). 16 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/lp/sources.cfg: -------------------------------------------------------------------------------- 1 | natded.elf 2 | canon.elf 3 | conv.elf 4 | iscan.elf 5 | uniform.elf 6 | uni-sound.elf 7 | uni-complete.elf 8 | fohh.elf 9 | fohh-formulas.elf 10 | resolution.elf 11 | res-sound.elf 12 | res-complete.elf 13 | examples.elf 14 | cont.elf 15 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/lp/test.cfg: -------------------------------------------------------------------------------- 1 | natded.elf 2 | canon.elf 3 | conv.elf 4 | iscan.elf 5 | uniform.elf 6 | uni-sound.elf 7 | uni-complete.elf 8 | fohh.elf 9 | fohh-formulas.elf 10 | resolution.elf 11 | res-sound.elf 12 | res-complete.elf 13 | examples.elf 14 | cont.elf 15 | examples.quy 16 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/mini-ml/examples1.quy: -------------------------------------------------------------------------------- 1 | % These can be executed in configuration sources1.cfg 2 | 3 | _ = ev_case_z z (s z) ([x:exp] z) (s z) ev_z (ev_s z z ev_z) 4 | : eval (case z (s z) ([x:exp] z)) (s z). 5 | 6 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/mini-ml/reduce.thm: -------------------------------------------------------------------------------- 1 | % Evaluation is a strategy for reduction 2 | 3 | %theorem evalRed : 4 | forall* {E:exp} {V:exp} 5 | forall {D:eval E V} 6 | exists {R* : E ==>* V} true. 7 | 8 | %prove 4 D (evalRed D _). 9 | 10 | % Partial check if proof 11 | %terminates D (evalRed D _). 12 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/mini-ml/sources.cfg: -------------------------------------------------------------------------------- 1 | %%% Mini-ML language and natural semantics 2 | mini-ml.elf 3 | eval.elf 4 | value.elf 5 | val-sound.elf 6 | closed.elf 7 | tp.elf 8 | tpinf.elf 9 | tp-preserve.elf 10 | % examples.quy 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/mini-ml/sources1.cfg: -------------------------------------------------------------------------------- 1 | %%% Mini-ML in natural argument order and explicit arguments 2 | mini-ml.elf 3 | eval1.elf 4 | examples1.quy 5 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/mini-ml/test.cfg: -------------------------------------------------------------------------------- 1 | mini-ml.elf 2 | tp.elf 3 | eval.elf 4 | value.elf 5 | val-sound.elf 6 | val-sound.thm 7 | closed.elf 8 | tpinf.elf 9 | tp-preserve.elf 10 | tp-preserve.thm 11 | reduce.elf 12 | reduce.thm 13 | examples.quy 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/mini-ml/tp-preserve.thm: -------------------------------------------------------------------------------- 1 | % Type preservation 2 | 3 | % Partial check of hand-coded proof 4 | %terminates D (tps D _ _). 5 | 6 | %theorem 7 | tpp : forall* {E: exp} {V: exp} {T: tp} 8 | forall {D: eval E V} {P: of E T} 9 | exists {Q: of V T} true. 10 | 11 | %prove 6 D (tpp D _ _). 12 | 13 | % Partial verification of generated proof 14 | %terminates D (tpp D _ _). 15 | 16 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/mini-ml/tp.elf: -------------------------------------------------------------------------------- 1 | %%% Mini-ML types. 2 | %%% Author: Frank Pfenning, based on [Michaylov & Pfenning 92] 3 | 4 | tp : type. %name tp T. 5 | 6 | nat : tp. % Natural Numbers 7 | cross : tp -> tp -> tp. % Pairs 8 | arrow : tp -> tp -> tp. % Functions 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/mini-ml/val-sound.thm: -------------------------------------------------------------------------------- 1 | % Value soundness 2 | 3 | % Partial check of hand-coded proof 4 | %terminates D (vs D _). 5 | 6 | % Automatic proof generation 7 | %theorem vls : forall* {E : exp} {V : exp} 8 | forall {D : eval E V} 9 | exists {P : value V} true. 10 | %prove 3 D (vls D _). 11 | 12 | % Partial verification of generated proof 13 | %terminates D (vls D _). 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/mini-ml/value.elf: -------------------------------------------------------------------------------- 1 | %%% Definition of Values 2 | %%% Author: Frank Pfenning, based on [Michaylov & Pfenning 92] 3 | 4 | value : exp -> type. %name value P. 5 | %mode value +V. 6 | 7 | val_z : value z. 8 | val_lam : value (lam E). 9 | val_s : value (s V) 10 | <- value V. 11 | val_pair : value (pair V1 V2) 12 | <- value V1 13 | <- value V2. 14 | 15 | % terminates D (value D). 16 | %worlds () (value D). 17 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/polylam/examples.quy: -------------------------------------------------------------------------------- 1 | % Currently, these is no program to run---just testing definitions. 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/polylam/sources.cfg: -------------------------------------------------------------------------------- 1 | polylam.elf 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/polylam/test.cfg: -------------------------------------------------------------------------------- 1 | polylam.elf 2 | examples.quy 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/prop-calc/README: -------------------------------------------------------------------------------- 1 | Various formulations of the intuitionistic propositional calculus 2 | and their equivalence. Currently missing is the elegant 3 | formulation by Roy Dyckhoff. 4 | 5 | Author: Frank Pfenning 6 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/prop-calc/nd.tex: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aposwolsky/delphin/9b7a47f09374a64d0438f114dd90826d13b8edc2/code/elphin/src/twelf/examples/prop-calc/nd.tex -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/prop-calc/sources.cfg: -------------------------------------------------------------------------------- 1 | prop-calc.elf 2 | equiv.elf 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/prop-calc/test.cfg: -------------------------------------------------------------------------------- 1 | prop-calc.elf 2 | equiv.elf 3 | equiv.thm 4 | examples.quy 5 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/prop-calc/thm1.elf: -------------------------------------------------------------------------------- 1 | %%% into a proof in the Hilbert-style system and vice versa. 2 | %%% Expresses the equivalence of the two systems. 3 | %%% Author: Frank Pfenning 4 | 5 | abs : (|- A -> |- B) -> |- A => B -> type. 6 | 7 | aID : abs ([x] x) (MP (MP S K) K). 8 | aK : abs ([x] K) (MP K K). 9 | aS : abs ([x] S) (MP K S). 10 | aMP : abs ([x] MP (P x) (Q x)) (MP (MP S P') Q') 11 | <- abs P P' <- abs Q Q'. 12 | 13 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/ccc/README: -------------------------------------------------------------------------------- 1 | 2 | Prove lemmas: 3 | 4 | 5 | needs subsumption strategy 6 | 7 | Problem: 8 | 9 | - what is the right formulation of 10 | the lemma ? 11 | 12 | need universal quantification ? 13 | 14 | {f}{g}{h} .... 15 | 16 | - needs term-depth abstraction 17 | otherwise it will loop 18 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/ccc/tab-examples.quy: -------------------------------------------------------------------------------- 1 | 2 | % A few test examples 3 | %{ 4 | %querytabled * 10 10 5 | D : fst @ (pair f g @ h) == (f @ h). 6 | D : {f}{g}{h}pair f g @ h == pair (f @ h) (g @ h). 7 | }% 8 | % at least : termDepth 35 required 9 | %querytabled * 2 D : pair f g @ h == pair (f @ h) (g @ h). 10 | 11 | 12 | %{ 13 | %querytabled * 10 10 14 | D : pair F G @ H == pair (F @ H) (G @ H). 15 | }% -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/ccc/tab.cfg: -------------------------------------------------------------------------------- 1 | ccc.elf 2 | tab-examples.quy 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/cr/lam.elf: -------------------------------------------------------------------------------- 1 | 2 | %%% Untyped lambda-calculus 3 | %%% Author: Frank Pfenning 4 | 5 | term : type. %name term M. 6 | 7 | lam : (term -> term) -> term. 8 | app : term -> term -> term. 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/cr/tab.cfg: -------------------------------------------------------------------------------- 1 | lam.elf 2 | ord-red.elf 3 | par-red.elf 4 | tab-examples.quy 5 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/mini-ml/programs.elf: -------------------------------------------------------------------------------- 1 | 2 | 3 | plus = fix [plus] lam [x] lam [y] 4 | case x y ([x] s (app (app plus x) y)). 5 | 6 | minus = fix [minus] lam [x] lam [y] 7 | case x z ([x] case y x ([y] (app (app minus x) y))). 8 | 9 | mult = fix [mult] lam [x] lam [y] 10 | case x z ([x] (app (app plus y) (app (app mult x) y))). 11 | 12 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/mini-ml/tab.cfg: -------------------------------------------------------------------------------- 1 | mini-ml.elf 2 | value.elf 3 | reduce.elf 4 | programs.elf 5 | examples.quy 6 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/mini-ml/value.elf: -------------------------------------------------------------------------------- 1 | %%% Definition of Values 2 | %%% Author: Frank Pfenning, based on [Michaylov & Pfenning 92] 3 | 4 | value : exp -> type. %name value P. 5 | %mode value +V. 6 | 7 | val_z : value z. 8 | val_s : value (s E) <- value E. 9 | 10 | 11 | val_pair : value (pair E1 E2) <- value E1 <- value E2. 12 | val_lam : value (lam E). 13 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/parsing/arithml.cfg: -------------------------------------------------------------------------------- 1 | arithml.elf 2 | arithml.quy -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/parsing/foll.cfg: -------------------------------------------------------------------------------- 1 | foll.elf 2 | foll.quy -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/parsing/tab.cfg: -------------------------------------------------------------------------------- 1 | warren.elf -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/poly/tab.cfg: -------------------------------------------------------------------------------- 1 | % extended from mini-ml 2 | mini-ml.elf 3 | tp.elf 4 | tpinf.elf 5 | tab-examples.quy -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/refine/norefex.quy: -------------------------------------------------------------------------------- 1 | % not provable 2 | %%%%%%%%%%%%%%%%%%%%%% 3 | % not provable 4 | 5 | %querytabled * * 6 | D : check inc (nat => nat). 7 | 8 | %querytabled * 5 check test2 nat. 9 | 10 | %querytabled * * 11 | check sub' (nat => nat => nat). 12 | 13 | %querytabled * 16 14 | check mult (nat => pos => nat). 15 | 16 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/refine/tab.cfg: -------------------------------------------------------------------------------- 1 | refex.elf 2 | programs.elf 3 | refex.quy 4 | norefex.quy -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/subtype/tab.cfg: -------------------------------------------------------------------------------- 1 | % copied from mini-ml 2 | mini-ml.elf 3 | % subtyping 4 | subtype.elf 5 | tab-examples.quy 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/subtype1/tab-examples.quy: -------------------------------------------------------------------------------- 1 | 2 | % terminates after 3 stages (variant) 3 | % terminates after 3 stages (subsumption) 4 | 5 | %querytabled * 6 (of z T). 6 | 7 | %querytabled * 7 (of (case z z ([x] x)) T). 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/subtype1/tab.cfg: -------------------------------------------------------------------------------- 1 | mini-ml.elf 2 | basic.elf 3 | tab-examples.quy -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/tests/tab.cfg: -------------------------------------------------------------------------------- 1 | test1.elf 2 | test2.elf 3 | test3.elf 4 | test4.elf 5 | test5.elf 6 | test6.elf 7 | test7.elf 8 | 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/tests/test1.elf: -------------------------------------------------------------------------------- 1 | node:type. 2 | 3 | a:node. 4 | b:node. 5 | c:node. 6 | d:node. 7 | 8 | edge: node -> node -> type. 9 | 10 | e_ab: edge a b. 11 | e_ac: edge a c. 12 | e_ba: edge b a. 13 | e_bd: edge b d. 14 | 15 | reach: node -> node -> type. 16 | %tabled reach. 17 | 18 | r_refl: reach X X. 19 | 20 | r_cl : reach X Y 21 | <- edge X Z 22 | <- reach Z Y. 23 | 24 | %querytabled * 3 (reach a X). 25 | 26 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/tests/test2.elf: -------------------------------------------------------------------------------- 1 | node:type. 2 | 3 | a:node. 4 | b:node. 5 | c:node. 6 | d:node. 7 | 8 | edge: node -> node -> type. 9 | 10 | e_ab: edge a b. 11 | e_ac: edge a c. 12 | e_ba: edge b a. 13 | e_bd: edge b d. 14 | 15 | reach': node -> node -> type. 16 | %tabled reach'. 17 | 18 | r_cl' : reach' X Y 19 | <- reach' X Z 20 | <- edge Z Y. 21 | 22 | r_refl': reach' X X. 23 | 24 | 25 | %querytabled * 5 (reach' a X). 26 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/tests/test3.elf: -------------------------------------------------------------------------------- 1 | node : type. 2 | a: node. 3 | b: node. 4 | 5 | p: node -> type. 6 | %tabled p. 7 | 8 | p1: p a. 9 | p2: p a 10 | <- p b. 11 | p3: p b 12 | <- p a. 13 | 14 | 15 | %querytabled * 5 A:(p a). 16 | 17 | 18 | q: node -> type. 19 | %tabled q. 20 | 21 | q2: q a 22 | <- q b. 23 | q3: q b 24 | <- q a. 25 | 26 | q1: q a. 27 | 28 | %querytabled * 5 A:(q a). 29 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/tests/test4.elf: -------------------------------------------------------------------------------- 1 | node:type. 2 | a:node. 3 | b:node. 4 | 5 | 6 | 7 | r: node -> type. 8 | s: node -> type. 9 | %tabled s. 10 | 11 | r2: r a 12 | <- s b. 13 | s3: s b 14 | <- s a. 15 | 16 | q1: s a. 17 | 18 | %querytabled * 2 A:(r a). 19 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/examples/tabled/tests/test6.elf: -------------------------------------------------------------------------------- 1 | %%%%%%%%%%%%%%%%%% 2 | %%% Tamaki, Sato 3 | %%% 4 | 5 | nat: type. 6 | 7 | 0: nat. 8 | suc: nat -> nat. 9 | 10 | pts: nat -> type. 11 | qts: nat -> type. 12 | rts: type. 13 | %tabled qts. 14 | 15 | c1: pts X 16 | <- qts X 17 | <- rts. 18 | 19 | c2: qts (suc X) 20 | <- qts X. 21 | 22 | c3: qts 0. 23 | 24 | c4: rts. 25 | 26 | %querytabled * 10 (pts X). 27 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/exercises/README: -------------------------------------------------------------------------------- 1 | opt-eval Optimized evaluation for Mini-ML [Exercise ??] 2 | units Mini-ML extended with units [incomplete] 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/exercises/opt-eval/README: -------------------------------------------------------------------------------- 1 | Optimized evaluation based on a distinction between 2 | values and expression, plus the correctness with 3 | respect to the formulation in the notes. 4 | 5 | Author: David Swasey, March 1999 6 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/exercises/opt-eval/opt-equiv1.thm: -------------------------------------------------------------------------------- 1 | %theorem vlem : 2 | forall* {E:exp} {V:exp} {V*:val*} 3 | forall {D:eval E V} {RE*:repv* E V*} 4 | exists {RV*:repv* V V*} 5 | true. 6 | 7 | %prove 5 RE* (vlem _ RE* _). 8 | 9 | %theorem eq* : 10 | forall* {E:exp} {V:exp} {E*:exp*} 11 | forall {D:eval E V} {R*:rep* E E*} 12 | exists {V*:val*} {RV*:repv* V V*} {D*:eval* E* V*} 13 | true. 14 | 15 | %prove 5 D (eq* D R* V* RV* D*). 16 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/exercises/opt-eval/opt-equiv2.thm: -------------------------------------------------------------------------------- 1 | %theorem vev : 2 | forall* {V*:val*} {V:exp} 3 | forall {RV:repv V* V} 4 | exists {D:eval V V} 5 | true. 6 | 7 | %prove 3 RV (vev RV D). 8 | 9 | %theorem eq : 10 | forall* {E*:exp*} {V*:val*} {E:exp} 11 | forall {D*:eval* E* V*} {R:rep E* E} 12 | exists {V:exp} {RV:repv V* V} {D:eval E V} 13 | true. 14 | 15 | %prove 3 D* (eq D* R V RV D). 16 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/exercises/opt-eval/sources.cfg: -------------------------------------------------------------------------------- 1 | mini-ml.elf 2 | eval.elf 3 | opt-mini-ml.elf 4 | opt-eval.elf 5 | opt-rep1.elf 6 | opt-equiv1.elf 7 | opt-rep2.elf 8 | opt-equiv2.elf 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/exercises/opt-eval/test.cfg: -------------------------------------------------------------------------------- 1 | mini-ml.elf 2 | eval.elf 3 | opt-mini-ml.elf 4 | opt-eval.elf 5 | opt-rep1.elf 6 | opt-equiv1.elf 7 | opt-rep2.elf 8 | opt-equiv2.elf 9 | examples.quy 10 | % below will shadow names 11 | opt-equiv1.thm 12 | opt-equiv2.thm 13 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/exercises/units/constants.elf: -------------------------------------------------------------------------------- 1 | %%% constants--mostly numbers and units. 2 | %%% by Ralph Melton 3 | 4 | 0 : exp. 5 | number_0 : number 0. 6 | 7 | 1 : exp. 8 | number_1 : number 1. 9 | 10 | % 11 | m : unit. 12 | kg : unit. 13 | s : unit. -------------------------------------------------------------------------------- /code/elphin/src/twelf/exercises/units/sources.cfg: -------------------------------------------------------------------------------- 1 | units.elf 2 | types.elf 3 | language.elf 4 | number.elf 5 | constants.elf 6 | value.elf 7 | eval.elf 8 | equnits.elf 9 | equnits-alg.elf 10 | eqtypes.elf 11 | equnits-sound.elf 12 | eqtype-lemmas.elf 13 | tp-rules.elf 14 | tp-inf.elf 15 | tp-sound.elf 16 | tp-complete.elf 17 | tp-preserve.elf 18 | 19 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/exercises/units/test.cfg: -------------------------------------------------------------------------------- 1 | units.elf 2 | types.elf 3 | language.elf 4 | number.elf 5 | constants.elf 6 | value.elf 7 | eval.elf 8 | equnits.elf 9 | equnits-alg.elf 10 | eqtypes.elf 11 | equnits-sound.elf 12 | eqtype-lemmas.elf 13 | tp-rules.elf 14 | tp-inf.elf 15 | tp-sound.elf 16 | tp-complete.elf 17 | tp-preserve.elf 18 | examples.quy 19 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/exercises/units/tp-sound.elf: -------------------------------------------------------------------------------- 1 | %%% Proof of soundness of tp-inf.elf with regard to tp-rules.elf 2 | %%% by Ralph Melton 3 | 4 | 5 | %%% I expect this to be straightforward and easy, so I'll leave it to later. 6 | 7 | tp_sound: of! E T -> of E T -> type. 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/exercises/units/types.elf: -------------------------------------------------------------------------------- 1 | %%% types for language with units of measure 2 | %%% By Ralph Melton (based on Kennedy97) 3 | 4 | tp: type. %name tp T. 5 | 6 | %%% type syntax. 7 | 8 | bool : tp. 9 | 10 | num : unit -> tp. 11 | 12 | => : tp -> tp -> tp. %infix left 8 =>. 13 | 14 | forall : (unit -> tp) -> tp. 15 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/exercises/units/units.elf: -------------------------------------------------------------------------------- 1 | %%% units for language with units of measure 2 | %%% By Ralph Melton (based on Kennedy97) 3 | 4 | unit: type. %name unit U. 5 | 6 | %%% units syntax. 7 | % unit variables correspond to Elf variables. 8 | 9 | u1 : unit. 10 | 11 | u* : unit -> unit -> unit. %infix right 10 u*. 12 | 13 | u-1 : unit -> unit. %postfix 15 u-1. 14 | 15 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/mlton/twelf-server.sml: -------------------------------------------------------------------------------- 1 | val _ = OS.Process.exit 2 | (Server.server (CommandLine.name (), 3 | CommandLine.arguments ())) 4 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/polyml/.mkexec: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Twelf Batch File Creator 4 | # 5 | # Arguments: 6 | # $1 = PolyML executable 7 | # $2 = Twelf root directory 8 | # $3 = Name of executable and database (e.g. twelf-polyml, twelf-server-polyml) 9 | # $4 = Name of database (e.g. twelf-polyml, twelf-server-polyml) 10 | echo "(cd \"$2\" ; \"$1\" -r \"bin/.dbase/$3\")" > "$2/bin/$4" 11 | chmod a+x "$2/bin/$4" -------------------------------------------------------------------------------- /code/elphin/src/twelf/polyml/twelf-server-dbase.sml: -------------------------------------------------------------------------------- 1 | PolyML.make_database "bin/.dbase/twelf-server"; 2 | PolyML.exit 0; 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/polyml/twelf-server.sml: -------------------------------------------------------------------------------- 1 | (* Twelf Server in Poly/ML *) 2 | (* This is currently not a stand-alone program *) 3 | (* Interrupts do not work properly in Poly/ML *) 4 | (* Load this into "poly bin/twelf_dbase" *) 5 | use "src/server/sigint.sig"; 6 | use "src/server/sigint-polyml.sml"; 7 | use "src/server/server.sml"; 8 | PolyML.onEntry (fn () => OS.Process.exit (Server.server ("twelf-server", []))); 9 | PolyML.commit (); 10 | PolyML.exit (0); 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/polyml/twelf-sml-dbase.sml: -------------------------------------------------------------------------------- 1 | PolyML.make_database "bin/.dbase/twelf-sml"; 2 | PolyML.exit 0; 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/polyml/twelf-sml.sml: -------------------------------------------------------------------------------- 1 | use "polyml/load-twelf.sml"; 2 | PolyML.commit (); 3 | PolyML.exit 0; 4 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/rpm/logo.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aposwolsky/delphin/9b7a47f09374a64d0438f114dd90826d13b8edc2/code/elphin/src/twelf/rpm/logo.gif -------------------------------------------------------------------------------- /code/elphin/src/twelf/rpm/twelf-files: -------------------------------------------------------------------------------- 1 | #!/bin/csh 2 | echo "%files" 3 | echo "/usr/bin/twelf-server" 4 | foreach f (`find /usr/share/twelf -type f -print`) 5 | echo $f 6 | end 7 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/rpm/twelf-uninstall: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | rm -rf /usr/share/twelf 3 | rm -f /usr/bin/twelf-server 4 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/server.cm: -------------------------------------------------------------------------------- 1 | Library 2 | structure Server 3 | is 4 | src/server/sources.cm 5 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/smlnj/README: -------------------------------------------------------------------------------- 1 | Directory with installation files for 2 | 3 | SML/NJ, Version 110.20 or greater 4 | 5 | In Twelf root directory, do 6 | 7 | % make -f smlnj/Makefile 8 | 9 | or 10 | 11 | % smlnj/install.sh 12 | 13 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/smlnj/delphin.sml: -------------------------------------------------------------------------------- 1 | (* comment out first line if undefined in your version of SMLofNJ *) 2 | (* call sml-cm with @SMLdebug=/dev/null instead *) 3 | (* This is for SML/NJ version >= 110.20 (using the new interface to CM) *) 4 | SMLofNJ.Internals.GC.messages false; 5 | CM.make "delphin.cm"; 6 | if SMLofNJ.exportML ("bin/.heap/delphin") 7 | then (print (Delphin.version ^ "\n"); Delphin.top ()) else (); 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/smlnj/twelf-server.sml: -------------------------------------------------------------------------------- 1 | (* comment out first line if undefined in your version of SMLofNJ *) 2 | (* call sml-cm with @SMLdebug=/dev/null instead *) 3 | (* This is for SML/NJ version >= 110.20 (using the new interface to CM) *) 4 | SMLofNJ.Internals.GC.messages false; 5 | CM.make "server.cm"; 6 | SMLofNJ.exportFn ("bin/.heap/twelf-server", Server.server); 7 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/smlnj/twelf-sml.sml: -------------------------------------------------------------------------------- 1 | (* comment out first line if undefined in your version of SMLofNJ *) 2 | (* call sml-cm with @SMLdebug=/dev/null instead *) 3 | SMLofNJ.Internals.GC.messages false; 4 | CM.make ("sources.cm"); 5 | if SMLofNJ.exportML ("bin/.heap/twelf-sml") 6 | then (print (Twelf.version ^ "\n"); Timing.init ()) else (); 7 | 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/array-97.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current Array to Basis-97 Array *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure CompatArray97 :> COMPAT_ARRAY = 5 | struct 6 | fun appi f arr = Array.appi f (arr, 0 , NONE) 7 | end; 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/array-slice.sig: -------------------------------------------------------------------------------- 1 | (* Compatibility shim to cope with Standard Basis version skew *) 2 | (* Author: Christopher Richards *) 3 | 4 | signature ARRAY_SLICE = 5 | sig 6 | type 'a slice 7 | val slice : 'a Array.array * int * int option -> 'a slice 8 | val appi : (int * 'a -> unit) -> 'a slice -> unit 9 | end; 10 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/array-slice.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current ArraySlice to Basis-97 Array *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure ArraySlice :> ARRAY_SLICE = 5 | struct 6 | type 'a slice = 'a Array.array * int * int option 7 | fun slice s = s 8 | val appi = Array.appi 9 | end; 10 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/array.sig: -------------------------------------------------------------------------------- 1 | (* Compatibility shim to cope with Standard Basis version skew *) 2 | (* Author: Christopher Richards *) 3 | 4 | signature COMPAT_ARRAY = 5 | sig 6 | val appi : (int * 'a -> unit) -> 'a Array.array -> unit 7 | end; 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/compat-97.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current to Basis-97 *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure Compat :> COMPAT = 5 | Compat (structure Array = CompatArray97 6 | structure Vector = CompatVector97 7 | structure Path = CompatPath97 8 | structure Substring = CompatSubstring97 9 | structure TextIO = CompatTextIO97 10 | structure Timer = CompatTimer97); 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/compat-mlton-20030716.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current to MLton Basis as of 20030716 *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure Compat :> COMPAT = 5 | Compat (structure Array = Array 6 | structure Vector = Vector 7 | structure Path = OS.Path 8 | structure Substring = Substring 9 | structure TextIO = CompatTextIO97 10 | structure Timer = Timer); 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/compat-poly02.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current to Poly/ML Basis as of 4.1.3 *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure Compat :> COMPAT = 5 | Compat (structure Array = CompatArray97 6 | structure Vector = CompatVector97 7 | structure Path = OS.Path 8 | structure Substring = CompatSubstring97 9 | structure TextIO = CompatTextIO97 10 | structure Timer = Timer); 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/compat-smlnj03.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current to SML/NJ Basis as of 110.43 *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure Compat :> COMPAT = 5 | Compat (structure Array = Array 6 | structure Vector = Vector 7 | structure Path = OS.Path 8 | structure Substring = Substring 9 | structure TextIO = TextIO 10 | structure Timer = CompatTimer97); 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/compat-smlnj98.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current to SML/NJ Basis as of 110.9.1 *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure Compat :> COMPAT = 5 | Compat (structure Array = CompatArray97 6 | structure Vector = CompatVector97 7 | structure Path = OS.Path 8 | structure Substring = CompatSubstring97 9 | structure TextIO = CompatTextIO97 10 | structure Timer = CompatTimer97); 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/compat.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current to itself *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure Compat :> COMPAT = 5 | Compat (structure Array = Array 6 | structure Vector = Vector 7 | structure Path = OS.Path 8 | structure Substring = Substring 9 | structure TextIO = TextIO 10 | structure Timer = Timer); 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/mono-array-slice.sig: -------------------------------------------------------------------------------- 1 | (* Compatibility shim to cope with Standard Basis version skew *) 2 | (* Author: Christopher Richards *) 3 | 4 | signature MONO_ARRAY_SLICE = 5 | sig 6 | type array 7 | type slice 8 | type vector 9 | val slice : array * int * int option -> slice 10 | val vector : slice -> vector 11 | end; 12 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/path-97.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current OS.Path to Basis-97 OS.Path *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure CompatPath97 :> COMPAT_PATH = 5 | struct 6 | fun mkAbsolute {path=path, relativeTo=relativeTo} = 7 | OS.Path.mkAbsolute (path, relativeTo) 8 | end; 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/path.sig: -------------------------------------------------------------------------------- 1 | (* Compatibility shim to cope with Standard Basis version skew *) 2 | (* Author: Christopher Richards *) 3 | 4 | signature COMPAT_PATH = 5 | sig 6 | val mkAbsolute : {path:string, relativeTo:string} -> string 7 | end; 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/substring-97.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current Substring to Basis-97 Substring *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure CompatSubstring97 :> COMPAT_SUBSTRING = 5 | struct 6 | val full = Substring.all 7 | end; 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/substring.sig: -------------------------------------------------------------------------------- 1 | (* Compatibility shim to cope with Standard Basis version skew *) 2 | (* Author: Christopher Richards *) 3 | 4 | signature COMPAT_SUBSTRING = 5 | sig 6 | val full : string -> Substring.substring 7 | end; 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/text-io-97.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current TextIO to Basis-97 TextIO *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure CompatTextIO97 :> COMPAT_TEXT_IO = 5 | struct 6 | fun inputLine instream = 7 | let 8 | val line = TextIO.inputLine instream 9 | in 10 | case line of 11 | "" => NONE 12 | | str => SOME str 13 | end 14 | end; 15 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/text-io.sig: -------------------------------------------------------------------------------- 1 | (* Compatibility shim to cope with Standard Basis version skew *) 2 | (* Author: Christopher Richards *) 3 | 4 | signature COMPAT_TEXT_IO = 5 | sig 6 | val inputLine : TextIO.instream -> string option 7 | end; 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/timer.sig: -------------------------------------------------------------------------------- 1 | (* Compatibility shim to cope with Standard Basis version skew *) 2 | (* Author: Christopher Richards *) 3 | 4 | signature COMPAT_TIMER = 5 | sig 6 | val checkCPUTimer : Timer.cpu_timer -> { usr : Time.time, sys : Time.time } 7 | val checkGCTime : Timer.cpu_timer -> Time.time 8 | end; 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/vector-97.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current Vector to Basis-97 Vector *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure CompatVector97 :> COMPAT_VECTOR = 5 | struct 6 | fun appi f vec = Vector.appi f (vec, 0, NONE) 7 | fun mapi f vec = Vector.mapi f (vec, 0, NONE) 8 | end; 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/vector-slice.sig: -------------------------------------------------------------------------------- 1 | (* Compatibility shim to cope with Standard Basis version skew *) 2 | (* Author: Christopher Richards *) 3 | 4 | signature VECTOR_SLICE = 5 | sig 6 | type 'a slice 7 | val slice : 'a Vector.vector * int * int option -> 'a slice 8 | val appi : (int * 'a -> unit) -> 'a slice -> unit 9 | val mapi : (int * 'a -> 'b) -> 'a slice -> 'b Vector.vector 10 | end; 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/vector-slice.sml: -------------------------------------------------------------------------------- 1 | (* Compatibility shim from Basis-current VectorSlice to Basis-97 Vector *) 2 | (* Author: Christopher Richards *) 3 | 4 | structure VectorSlice :> VECTOR_SLICE = 5 | struct 6 | type 'a slice = 'a Vector.vector * int * int option 7 | fun slice s = s 8 | val appi = Vector.appi 9 | val mapi = Vector.mapi 10 | end; 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compat/vector.sig: -------------------------------------------------------------------------------- 1 | (* Compatibility shim to cope with Standard Basis version skew *) 2 | (* Author: Christopher Richards *) 3 | 4 | signature COMPAT_VECTOR = 5 | sig 6 | val appi : (int * 'a -> unit) -> 'a Vector.vector -> unit 7 | val mapi : (int * 'a -> 'b) -> 'a Vector.vector -> 'b Vector.vector 8 | end; 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/compile/README: -------------------------------------------------------------------------------- 1 | Description of optimzing compilation? 2 | 3 | Tue Apr 2 11:42:20 2002 4 | 5 | compile.fun 6 | 7 | Probably should compile A1 in {x:A1} A2 in order 8 | to avoid incompleteness. 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/cover/total.sig: -------------------------------------------------------------------------------- 1 | (* Total Declarations *) 2 | (* Author: Frank Pfenning *) 3 | 4 | signature TOTAL = 5 | sig 6 | 7 | (*! structure IntSyn : INTSYN !*) 8 | 9 | exception Error of string 10 | 11 | val reset : unit -> unit 12 | val install : IntSyn.cid -> unit (* install(a) --- a is total in its input arguments *) 13 | 14 | val checkFam : IntSyn.cid -> unit (* may raise Error(msg) *) 15 | 16 | end; (* signature TOTAL *) 17 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/delphin/delphin.sig: -------------------------------------------------------------------------------- 1 | (* Delphin Frontend *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature DELPHIN = 5 | sig 6 | val version : string 7 | val loadFile : string * string -> unit 8 | 9 | val top : unit -> unit 10 | 11 | val runSimpleTest : string -> (string list) -> string list -> unit 12 | val eval : Tomega.Prg -> Tomega.Prg 13 | end 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/delphin/interface.sig: -------------------------------------------------------------------------------- 1 | (* Interface for error reporting syntax *) 2 | (* Author: Richard Fontana *) 3 | 4 | (* compare to Paths *) 5 | 6 | signature INTERFACE = 7 | sig 8 | 9 | type pos 10 | val line : pos ref 11 | 12 | val init_line : unit -> unit 13 | val next_line : unit -> unit 14 | val error : string * pos * pos -> unit 15 | 16 | type arg 17 | val nothing : arg 18 | end (* signature INTERFACE *) 19 | 20 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/delphin/parse-prg.sig: -------------------------------------------------------------------------------- 1 | (* The Parser *) 2 | (* Author: Richard Fontana *) 3 | 4 | signature PARSE = 5 | sig 6 | 7 | structure DextSyn : DEXTSYN 8 | 9 | val fparse : string -> unit 10 | val gparse : string -> DextSyn.Ast 11 | val sparse : unit -> DextSyn.Ast 12 | 13 | end (* signature PARSE *) 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/domains/README: -------------------------------------------------------------------------------- 1 | Domains for arithmetical expressions 2 | Author: Roberto Virga 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/domains/domains.sml: -------------------------------------------------------------------------------- 1 | structure Integers = Integers(IntInf); 2 | 3 | structure Rationals = Rationals(Integers); 4 | 5 | structure IntegersMod7 = IntegersMod(val p = 7); 6 | 7 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/domains/integers.sig: -------------------------------------------------------------------------------- 1 | (* Integers *) 2 | (* Author: Roberto Virga *) 3 | 4 | signature INTEGERS = 5 | sig 6 | include INTEGER 7 | 8 | val gcd : int * int -> int 9 | val lcm : int * int -> int 10 | val solve_gcd : int * int -> int * int 11 | end; (* signature INTEGERS *) 12 | 13 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/flit/flit.sml: -------------------------------------------------------------------------------- 1 | structure Flit = 2 | Flit (structure Global = Global 3 | structure Word = Word32 4 | structure Pack = Pack32Little 5 | structure IntSyn = IntSyn 6 | structure Whnf = Whnf 7 | structure Print = Print 8 | structure Names = Names 9 | structure Index = Index 10 | structure Table = IntRedBlackTree) 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/flit/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature FLIT 3 | structure Flit 4 | is 5 | #if defined(NEW_CM) 6 | $/basis.cm 7 | #endif 8 | ../compat/sources.cm 9 | ../global/sources.cm 10 | ../table/sources.cm 11 | ../lambda/sources.cm 12 | ../names/sources.cm 13 | ../index/sources.cm 14 | ../paths/sources.cm 15 | ../print/sources.cm 16 | flit.sig 17 | flit.fun 18 | flit.sml 19 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/formatter/formatter.sml: -------------------------------------------------------------------------------- 1 | structure Formatter : FORMATTER = Formatter() 2 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/formatter/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature FORMATTER 3 | structure Formatter 4 | is 5 | #if defined(NEW_CM) 6 | $/basis.cm 7 | #endif 8 | formatter.sig 9 | formatter.fun 10 | formatter.sml 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/frontend/fquery.sig: -------------------------------------------------------------------------------- 1 | (* fquery: Executing logic programs via functional interpretation *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature FQUERY = 5 | sig 6 | structure ExtQuery : EXTQUERY 7 | 8 | exception AbortQuery of string 9 | 10 | val run : ExtQuery.query * Paths.location -> unit 11 | (* may raise AbortQuery(msg) *) 12 | 13 | end; (* signature SOLVE *) 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/frontend/parse-condec.sig: -------------------------------------------------------------------------------- 1 | (* Parsing Signature Entries *) 2 | (* Author: Frank Pfenning *) 3 | 4 | signature PARSE_CONDEC = 5 | sig 6 | 7 | (*! structure Parsing : PARSING !*) 8 | structure ExtConDec : EXTCONDEC 9 | 10 | val parseConDec' : ExtConDec.condec Parsing.parser 11 | val parseAbbrev' : ExtConDec.condec Parsing.parser 12 | val parseClause' : ExtConDec.condec Parsing.parser 13 | 14 | end; (* signature PARSE_CONDEC *) 15 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/frontend/parse-mode.sig: -------------------------------------------------------------------------------- 1 | (* Parsing Mode Declarations *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature PARSE_MODE = 5 | sig 6 | 7 | (*! structure Parsing : PARSING !*) 8 | structure ExtModes: EXTMODES 9 | 10 | val parseMode' : (ExtModes.modedec list) Parsing.parser 11 | 12 | end; (* signature PARSE_MODE *) 13 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/frontend/parse-query.sig: -------------------------------------------------------------------------------- 1 | (* Parsing Queries *) 2 | (* Author: Frank Pfenning *) 3 | 4 | signature PARSE_QUERY = 5 | sig 6 | 7 | (*! structure Parsing : PARSING !*) 8 | structure ExtQuery : EXTQUERY 9 | 10 | val parseQuery' : ExtQuery.query Parsing.parser 11 | val parseSolve' : (ExtQuery.define list * ExtQuery.solve) Parsing.parser 12 | 13 | end; (* signature PARSE_QUERY *) 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/frontend/unknownexn-smlnj.sml: -------------------------------------------------------------------------------- 1 | (* Print exception trace in unknownExn. Both SML/NJ and MLton have 2 | SMLofNJ.exnHistory. 3 | *) 4 | 5 | structure UnknownExn = 6 | UnknownExn (val exnHistory = SMLofNJ.exnHistory); 7 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/frontend/unknownexn-stub.sml: -------------------------------------------------------------------------------- 1 | (* A do-nothing stub for SML implementations without an SML/NJ-like 2 | exnHistory function. 3 | *) 4 | 5 | structure UnknownExn = 6 | UnknownExn (val exnHistory = fn exn => nil); 7 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/frontend/unknownexn.sig: -------------------------------------------------------------------------------- 1 | signature UNKNOWN_EXN = 2 | sig 3 | val unknownExn : exn -> string 4 | end; 5 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/global/README: -------------------------------------------------------------------------------- 1 | Global parameters 2 | Author: Frank Pfenning 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/global/WALK: -------------------------------------------------------------------------------- 1 | Main current issues 2 | 3 | Main future issues 4 | 5 | CM/ 6 | README OK -fp 7 | WALK 8 | global.sig OK -fp 9 | Q: add SEPARATE flag for external vs internal printing? A: DONE (see Print.implicit) 10 | OK -cs 11 | global.sml OK -fp 12 | OK -cs 13 | sources.cm OK -fp 14 | OK -cs 15 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/global/global.sig: -------------------------------------------------------------------------------- 1 | (* Global parameters *) 2 | (* Author: Frank Pfenning *) 3 | 4 | signature GLOBAL = 5 | sig 6 | val chatter : int ref 7 | val maxCid : int 8 | val maxMid : int 9 | val maxCSid : int 10 | val doubleCheck : bool ref 11 | val unsafe : bool ref 12 | val chPrint : int -> (unit -> string) -> unit 13 | end; (* signature GLOBAL *) 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/global/global.sml: -------------------------------------------------------------------------------- 1 | (* Global parameters *) 2 | (* Author: Frank Pfenning *) 3 | 4 | structure Global :> GLOBAL = 5 | struct 6 | 7 | val chatter = ref 3 8 | val maxCid = 19999 9 | val maxMid = 999 10 | val maxCSid = 49 11 | val doubleCheck = ref false 12 | val unsafe = ref false 13 | 14 | fun chPrint n s = if !chatter >= n then print (s ()) else () 15 | end; (* structure Global *) 16 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/global/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature GLOBAL 3 | structure Global 4 | is 5 | global.sig 6 | global.sml 7 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/heuristic/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature HEURISTIC 3 | structure Heuristic 4 | is 5 | #if defined(NEW_CM) 6 | $/basis.cm 7 | #endif 8 | heuristic.sig 9 | heuristic.sum.fun 10 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/index/README: -------------------------------------------------------------------------------- 1 | Indexing 2 | 3 | This mainains a global mapping from type families to their constructors. 4 | 5 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/index/WALK: -------------------------------------------------------------------------------- 1 | Future Issues: 2 | 3 | - replace array by tree based on type family, but 4 | frequent access may require it too be fast? 5 | 6 | CM/ 7 | NOTES DELETED -fp 8 | README OK -fp 9 | WALK 10 | index.fun OK -fp 11 | OK -cs 12 | index.sig OK -fp 13 | OK -cs 14 | index.sml OK -fp 15 | sources.cm OK -fp 16 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/index/index.sml: -------------------------------------------------------------------------------- 1 | structure Index = 2 | Index (structure Global = Global 3 | structure Queue = Queue 4 | (*! structure IntSyn' = IntSyn !*)); 5 | 6 | structure IndexSkolem = 7 | IndexSkolem (structure Global = Global 8 | structure Queue = Queue 9 | (*! structure IntSyn' = IntSyn !*)); 10 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/index/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature INDEX 3 | structure Index 4 | structure IndexSkolem 5 | is 6 | #if defined(NEW_CM) 7 | $/basis.cm 8 | #endif 9 | ../lambda/sources.cm 10 | ../table/sources.cm 11 | ../global/sources.cm 12 | index.sig 13 | index.fun 14 | index-skolem.fun 15 | index.sml 16 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/int-inf/README: -------------------------------------------------------------------------------- 1 | Copied from the Standard ML of New Jersey Library 2 | Version 110.0.3 3 | 4 | This was copied in order to make the implementation completely 5 | portable, and independent of SML/NJ. 6 | 7 | Perpetrator: Frank Pfenning 8 | Sun Sep 24 2000 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/int-inf/sources.cm: -------------------------------------------------------------------------------- 1 | Group is 2 | int-inf-sig.sml 3 | int-inf.sml 4 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/lambda/README: -------------------------------------------------------------------------------- 1 | Core Lambda Calculus 2 | Author: Frank Pfenning, Carsten Schuermann 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/lambda/constraints.sig: -------------------------------------------------------------------------------- 1 | (* Manipulating Constraints *) 2 | (* Author: Jeff Polakow, Frank Pfenning *) 3 | (* Modified: Roberto Virga *) 4 | 5 | signature CONSTRAINTS = 6 | sig 7 | 8 | (*! structure IntSyn : INTSYN !*) 9 | 10 | exception Error of IntSyn.cnstr list 11 | 12 | val simplify : IntSyn.cnstr list -> IntSyn.cnstr list 13 | val warnConstraints : string list -> unit 14 | 15 | end; (* signature CONSTRAINTS *) 16 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/lambda/conv.sig: -------------------------------------------------------------------------------- 1 | (* Convertibility Modulo Beta and Eta *) 2 | (* Author: Frank Pfenning, Carsten Schuermann *) 3 | 4 | signature CONV = 5 | sig 6 | (*! structure IntSyn : INTSYN !*) 7 | 8 | val conv : IntSyn.eclo * IntSyn.eclo -> bool 9 | val convDec : (IntSyn.Dec * IntSyn.Sub) * (IntSyn.Dec * IntSyn.Sub)-> bool 10 | val convSub : IntSyn.Sub * IntSyn.Sub -> bool 11 | end; (* signature CONV *) 12 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/lambda/fgnopn.sig: -------------------------------------------------------------------------------- 1 | (* Extensible operation on foreign matter *) 2 | (* Author: Aleksey Kliger *) 3 | 4 | signature FGN_OPN = sig 5 | type csid = int 6 | type rep = exn 7 | type arg 8 | type result 9 | 10 | type func = rep -> arg -> result 11 | 12 | val install : csid * func -> unit 13 | 14 | val apply : csid * rep -> arg -> result 15 | end 16 | 17 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/lambda/tomega.sml: -------------------------------------------------------------------------------- 1 | structure Whnf = 2 | Whnf ((*! structure IntSyn' = IntSyn !*)); 3 | 4 | structure Conv = 5 | Conv ((*! structure IntSyn' = IntSyn !*) 6 | structure Whnf = Whnf); 7 | 8 | structure Tomega : TOMEGA = 9 | Tomega ((*! structure IntSyn' = IntSyn !*) 10 | structure Whnf = Whnf 11 | structure Conv = Conv); 12 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/m2/init.sig: -------------------------------------------------------------------------------- 1 | (* Initialization *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature INIT = 5 | sig 6 | structure MetaSyn : METASYN 7 | 8 | exception Error of string 9 | 10 | val init : IntSyn.cid list -> MetaSyn.State list 11 | end; (* signature INIT *) 12 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/m2/lemma.sig: -------------------------------------------------------------------------------- 1 | (* Lemma *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature LEMMA = 5 | sig 6 | structure MetaSyn : METASYN 7 | 8 | exception Error of string 9 | 10 | val apply : MetaSyn.State * IntSyn.cid -> MetaSyn.State 11 | end; (* signature LEMMA *) 12 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/m2/meta-abstract.sig: -------------------------------------------------------------------------------- 1 | (* Meta Abstraction *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature METAABSTRACT = 5 | sig 6 | structure MetaSyn : METASYN 7 | 8 | exception Error of string 9 | 10 | val abstract : MetaSyn.State -> MetaSyn.State 11 | end; (* signature METAABSTRACT *) 12 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/m2/meta-global.sig: -------------------------------------------------------------------------------- 1 | (* Global parameters *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature METAGLOBAL = 5 | sig 6 | datatype Strategy = RFS | FRS 7 | 8 | val strategy : Strategy ref 9 | val maxFill : int ref 10 | val maxSplit : int ref 11 | val maxRecurse : int ref 12 | end; (* signature METAGLOBAL *) 13 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/m2/meta-global.sml: -------------------------------------------------------------------------------- 1 | (* Global parameters *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | structure MetaGlobal : METAGLOBAL = 5 | struct 6 | datatype Strategy = RFS | FRS 7 | 8 | val strategy = ref FRS 9 | val maxFill = ref 6 10 | val maxSplit = ref 2 11 | val maxRecurse = ref 10 12 | end; (* structure MetaGlobal *) 13 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/m2/meta-print.sig: -------------------------------------------------------------------------------- 1 | (* Meta printer for proof states *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature METAPRINT = 5 | sig 6 | structure MetaSyn : METASYN 7 | 8 | val stateToString : MetaSyn.State -> string 9 | val sgnToString : MetaSyn.Sgn -> string 10 | val modeToString : MetaSyn.Mode -> string 11 | val conDecToString : IntSyn.ConDec -> string 12 | 13 | end; (* signature METAPRINT *) 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/m2/prover.sig: -------------------------------------------------------------------------------- 1 | (* Meta Prover *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature PROVER = 5 | sig 6 | (*! structure IntSyn : INTSYN !*) 7 | 8 | exception Error of string 9 | 10 | val init : (int * IntSyn.cid list) -> unit 11 | val auto : unit -> unit 12 | val print : unit -> unit 13 | val install: (IntSyn.ConDec -> IntSyn.cid) -> unit 14 | end; (* signature PROVER *) 15 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/m2/qed.sig: -------------------------------------------------------------------------------- 1 | (* Qed *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature QED = 5 | sig 6 | structure MetaSyn : METASYN 7 | 8 | exception Error of string 9 | 10 | val subgoal : MetaSyn.State -> bool 11 | end; (* signature QED *) 12 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/m2/skolem.sig: -------------------------------------------------------------------------------- 1 | (* Skolem administration *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature SKOLEM = 5 | sig 6 | (*! structure IntSyn : INTSYN !*) 7 | 8 | val install: IntSyn.cid list -> unit 9 | end; (* signature SKOLEM *) 10 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/m2/strategy.sig: -------------------------------------------------------------------------------- 1 | (* Strategy *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature STRATEGY = 5 | sig 6 | structure MetaSyn : METASYN 7 | 8 | val run : MetaSyn.State list -> MetaSyn.State list * MetaSyn.State list 9 | (* open cases -> remaining cases * solved cases *) 10 | end; (* signature STRATEGY *) 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/meta/NOTES: -------------------------------------------------------------------------------- 1 | Fri Sep 3 13:28:29 EDT 1999 -cs 2 | 3 | There is a problem with Skolem constants. They cannot be applied to 4 | local parameters, otherwise the LF/meta level distinction is violated. 5 | In filling.fun I am lowering EVars (in createEVars), and there it is 6 | possible that local parameters get into the context G, which can 7 | be used (in search.fun) as arguments via unfications. This is a bug. 8 | 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/meta/data.fun: -------------------------------------------------------------------------------- 1 | (* Meta Global parameters *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | functor MTPData (structure MTPGlobal : MTPGLOBAL) : MTPDATA = 5 | struct 6 | val maxFill = ref 0 7 | end; (* structure MTPData*) 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/meta/data.sig: -------------------------------------------------------------------------------- 1 | (* Data aquired during proof search *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature MTPDATA = 5 | sig 6 | val maxFill : int ref 7 | end; (* signature MTPDATA *) 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/meta/filling.sig: -------------------------------------------------------------------------------- 1 | (* Filling: Version 1.3 *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature MTPFILLING = 5 | sig 6 | (*! structure FunSyn : FUNSYN !*) 7 | structure StateSyn : STATESYN 8 | 9 | exception Error of string 10 | 11 | type operator 12 | 13 | val expand : StateSyn.State -> operator 14 | val apply : operator -> (int * FunSyn.Pro) 15 | val menu : operator -> string 16 | end; (* signature MTPFILLING *) 17 | 18 | 19 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/meta/funweaken.sig: -------------------------------------------------------------------------------- 1 | (* Weakening substitutions for meta substitutions *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature FUNWEAKEN = 5 | sig 6 | (*! structure FunSyn : FUNSYN !*) 7 | 8 | val strengthenPsi : (FunSyn.lfctx * IntSyn.Sub) 9 | -> (FunSyn.lfctx * IntSyn.Sub) 10 | val strengthenPsi': (FunSyn.LFDec list * IntSyn.Sub) 11 | -> (FunSyn.LFDec list * IntSyn.Sub) 12 | end (* signature FUNWEAKEN *) -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/meta/global.fun: -------------------------------------------------------------------------------- 1 | (* Meta Global parameters *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | functor MTPGlobal 5 | (structure MetaGlobal : METAGLOBAL): MTPGLOBAL = 6 | struct 7 | datatype ProverType = New | Old 8 | 9 | val prover = ref New 10 | val maxFill = MetaGlobal.maxFill 11 | val maxSplit = MetaGlobal.maxSplit 12 | val maxRecurse = MetaGlobal.maxRecurse 13 | end; (* structure MTPGlobal *) 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/meta/global.sig: -------------------------------------------------------------------------------- 1 | (* Global parameters *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature MTPGLOBAL = 5 | sig 6 | datatype ProverType = New | Old 7 | 8 | val prover : ProverType ref 9 | val maxFill : int ref 10 | val maxSplit : int ref 11 | val maxRecurse : int ref 12 | end; (* signature MTPGLOBAL *) 13 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/meta/inference.sig: -------------------------------------------------------------------------------- 1 | (* Inference: Version 1.3 *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature INFERENCE = 5 | sig 6 | (*! structure FunSyn : FUNSYN !*) 7 | structure StateSyn : STATESYN 8 | 9 | exception Error of string 10 | 11 | type operator 12 | 13 | val expand : StateSyn.State -> operator 14 | val apply : operator -> StateSyn.State 15 | val menu : operator -> string 16 | end; (* signature Inference *) 17 | 18 | 19 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/meta/init.sig: -------------------------------------------------------------------------------- 1 | (* Initialization *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature MTPINIT = 5 | sig 6 | (*! structure FunSyn : FUNSYN !*) 7 | structure StateSyn : STATESYN 8 | 9 | exception Error of string 10 | 11 | (* Current restriction to non-mutual inductive theorems ! *) 12 | 13 | val init : (FunSyn.For * StateSyn.Order) -> StateSyn.State list 14 | 15 | end; (* signature MTPINIT *) 16 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/meta/interpret.sig: -------------------------------------------------------------------------------- 1 | (* Operational semantics *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature Interpreter = 5 | sig 6 | (*! structure FunSyn : FUNSYN !*) 7 | 8 | val run : FunSyn.Pro -> FunSyn.Pro 9 | end (* Signature Interpreter *) 10 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/meta/print.sig: -------------------------------------------------------------------------------- 1 | (* Meta Printer Version 1.3 *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature MTPRINT = 5 | sig 6 | structure Formatter : FORMATTER 7 | structure StateSyn : STATESYN 8 | 9 | exception Error of string 10 | 11 | val nameState : StateSyn.State -> StateSyn.State 12 | val formatState : StateSyn.State -> Formatter.format 13 | val stateToString : StateSyn.State -> string 14 | end; (* signature MTPRINT *) 15 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/meta/prover.sig: -------------------------------------------------------------------------------- 1 | (* Meta Prover Version 1.3 *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | 5 | signature MTPROVER = 6 | sig 7 | (*! structure FunSyn : FUNSYN !*) 8 | structure StateSyn : STATESYN 9 | 10 | exception Error of string 11 | 12 | val init : FunSyn.For * StateSyn.Order -> unit 13 | end; (* signature MTPROVER *) 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/meta/recursion.sig: -------------------------------------------------------------------------------- 1 | (* Recursion: Version 1.3 *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature MTPRECURSION = 5 | sig 6 | structure StateSyn : STATESYN 7 | 8 | exception Error of string 9 | 10 | type operator 11 | 12 | val expand : StateSyn.State -> operator 13 | val apply : operator -> StateSyn.State 14 | val menu : operator -> string 15 | end; (* signature MTPRECURSION *) 16 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/meta/relfun.sig: -------------------------------------------------------------------------------- 1 | (* Converter from relational representation to a functional 2 | representation of proof terms *) 3 | (* Author: Carsten Schuermann *) 4 | 5 | signature RELFUN = 6 | sig 7 | (*! structure FunSyn : FUNSYN !*) 8 | 9 | exception Error of string 10 | 11 | val convertFor : IntSyn.cid list -> FunSyn.For 12 | val convertPro : IntSyn.cid list -> FunSyn.Pro 13 | end (* Signature RELFUN *) 14 | 15 | 16 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/meta/search.sig: -------------------------------------------------------------------------------- 1 | (* Basic search engine: Version 1.3*) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature MTPSEARCH = 5 | sig 6 | structure StateSyn : STATESYN 7 | 8 | exception Error of string 9 | 10 | val searchEx : int * IntSyn.Exp list 11 | (* * (IntSyn.Exp * IntSyn.Sub) *) 12 | * (int -> unit) -> unit 13 | end; (* signature SEARCH *) 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/meta/strategy.sig: -------------------------------------------------------------------------------- 1 | (* MTPStrategy : Version 1.3 *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature MTPSTRATEGY = 5 | sig 6 | structure StateSyn : STATESYN 7 | 8 | val run : StateSyn.State list -> StateSyn.State list * StateSyn.State list 9 | (* open cases -> remaining cases * solved cases *) 10 | end; (* signature MTPSTRATEGY *) 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/modes/modeprint.sig: -------------------------------------------------------------------------------- 1 | (* Printing Mode Declarations *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature MODEPRINT = 5 | sig 6 | (*! structure ModeSyn : MODESYN !*) 7 | 8 | val modeToString : IntSyn.cid * ModeSyn.ModeSpine -> string 9 | val modesToString : (IntSyn.cid * ModeSyn.ModeSpine) list -> string 10 | end; (* signature MODEPRINT *) 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/modules/modules.sml: -------------------------------------------------------------------------------- 1 | structure ModSyn = 2 | ModSyn (structure Global = Global 3 | (*! structure IntSyn' = IntSyn !*) 4 | structure Names' = Names 5 | (*! structure Paths' = Paths !*) 6 | structure Origins = Origins 7 | structure Whnf = Whnf 8 | structure Strict = Strict 9 | structure IntTree = IntRedBlackTree 10 | structure HashTable = StringHashTable); 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/modules/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature MODSYN 3 | structure ModSyn 4 | is 5 | ../global/sources.cm 6 | ../table/sources.cm 7 | ../lambda/sources.cm 8 | ../names/sources.cm 9 | ../paths/sources.cm 10 | ../typecheck/sources.cm 11 | modsyn.sig 12 | modsyn.fun 13 | modules.sml 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/names/README: -------------------------------------------------------------------------------- 1 | Naming of constants, parameters, and variables 2 | Author: Frank Pfenning 3 | Modified: Jeff Polakow 4 | 5 | This maintains mappings in two directions: from variable to 6 | name and from names to variables. It is a critical invariant 7 | that these mapping remains consistent. 8 | 9 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/names/names.sml: -------------------------------------------------------------------------------- 1 | structure Names = 2 | Names (structure Global = Global 3 | (*! structure IntSyn' = IntSyn !*) 4 | structure Constraints = Constraints 5 | structure HashTable = StringHashTable 6 | structure StringTree = StringRedBlackTree); 7 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/names/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature FIXITY 3 | signature NAMES 4 | structure Names 5 | is 6 | #if defined(NEW_CM) 7 | $/basis.cm 8 | #endif 9 | ../compat/sources.cm 10 | ../table/sources.cm 11 | ../global/sources.cm 12 | ../lambda/sources.cm 13 | names.sig 14 | names.fun 15 | names.sml 16 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/opsem/absmachine.sig: -------------------------------------------------------------------------------- 1 | (* Abstract Machine *) 2 | (* Author: Iliano Cervesato *) 3 | (* Modified: Jeff Polakow *) 4 | (* Modified: Frank Pfenning *) 5 | 6 | signature ABSMACHINE = 7 | sig 8 | 9 | (*! structure IntSyn : INTSYN !*) 10 | (*! structure CompSyn : COMPSYN !*) 11 | 12 | val solve : (CompSyn.Goal * IntSyn.Sub) * CompSyn.DProg 13 | * (IntSyn.Exp -> unit) -> unit 14 | 15 | end; (* signature ABSMACHINE *) 16 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/order/README: -------------------------------------------------------------------------------- 1 | Termination orders for type families 2 | Author: Carsten Schuermann 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/order/WALK: -------------------------------------------------------------------------------- 1 | Current issues 2 | Renamed TermDec to TDec or TDecl? -fp DONE -cs 3 | 4 | Future issues 5 | 6 | CM/ 7 | README 8 | WALK 9 | order.fun OK -fp 10 | OK -cs 11 | order.sig OK -cs 12 | OK -fp 13 | order.sml OK -fp 14 | OK -cs 15 | sources.cm OK -fp 16 | OK -cs 17 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/order/order.sml: -------------------------------------------------------------------------------- 1 | structure Order = 2 | Order ((*! structure IntSyn' = IntSyn !*) 3 | structure Table = IntRedBlackTree); 4 | (* -bp *) 5 | (* 6 | structure RedOrder = 7 | RedOrder ((*! structure IntSyn' = IntSyn !*) 8 | structure Table = IntRedBlackTree); 9 | *) -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/order/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature ORDER 3 | structure Order 4 | is 5 | #if defined(NEW_CM) 6 | $/basis.cm 7 | #endif 8 | ../table/sources.cm 9 | ../lambda/sources.cm 10 | order.sig 11 | order.fun 12 | order.sml 13 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/paths/README: -------------------------------------------------------------------------------- 1 | Paths, occurrences, and error locations 2 | Author: Frank Pfenning 3 | 4 | This is used for error messages. 5 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/paths/paths.sml: -------------------------------------------------------------------------------- 1 | (* Now in paths.fun *) 2 | (* 3 | structure Paths = Paths (); 4 | *) 5 | 6 | structure Origins = 7 | Origins (structure Global = Global 8 | structure Table = StringHashTable 9 | (*! structure IntSyn' = IntSyn !*) 10 | (*! structure Paths' = Paths !*) 11 | ); 12 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/paths/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature PATHS 3 | structure Paths 4 | signature ORIGINS 5 | structure Origins 6 | is 7 | #if defined(NEW_CM) 8 | $/basis.cm 9 | #endif 10 | ../lambda/sources.cm 11 | ../global/sources.cm 12 | ../table/sources.cm 13 | paths.sig 14 | paths.fun 15 | origins.sig 16 | origins.fun 17 | paths.sml 18 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/print/README: -------------------------------------------------------------------------------- 1 | Printing of terms 2 | Author: Frank Pfenning 3 | 4 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/print/print-twega.sig: -------------------------------------------------------------------------------- 1 | (* Printing Signatures *) 2 | (* Author: Frank Pfenning *) 3 | 4 | signature PRINT_TWEGA = 5 | sig 6 | 7 | val printSgn : unit -> unit 8 | val printSgnToFile : string -> unit 9 | 10 | end; (* signature PRINT_TWEGA *) 11 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/print/print-xml.sig: -------------------------------------------------------------------------------- 1 | (* Printing Signatures *) 2 | (* Author: Frank Pfenning *) 3 | (* modified: Carsten Schuermann *) 4 | 5 | signature PRINT_XML = 6 | sig 7 | val printSgn : unit -> unit 8 | val printSgnToFile : string -> string -> unit 9 | end; (* signature PRINT_XML *) 10 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/print/symbol.sig: -------------------------------------------------------------------------------- 1 | signature SYMBOL = 2 | sig 3 | 4 | val str : string -> string * int 5 | val evar : string -> string * int 6 | val bvar : string -> string * int 7 | val const : string -> string * int 8 | val label : string -> string * int 9 | val skonst : string -> string * int 10 | val def : string -> string * int 11 | val fvar : string -> string * int 12 | 13 | val sym : string -> string * int 14 | 15 | end; (* signature SYMBOL *) 16 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/prover/data.fun: -------------------------------------------------------------------------------- 1 | (* Meta data parameters *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | structure Data : DATA = 5 | struct 6 | val maxFill = ref 5 7 | val maxSplit = ref 5 8 | val maxRecurse = ref 2 9 | end; (* structure Data *) 10 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/prover/data.sig: -------------------------------------------------------------------------------- 1 | (* Data Global parameters *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature DATA = 5 | sig 6 | val maxFill : int ref 7 | val maxSplit : int ref 8 | val maxRecurse : int ref 9 | end; (* signature DATA *) 10 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/prover/recurse.sig: -------------------------------------------------------------------------------- 1 | (* Recurse: Version 1.4 *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature RECURSE = 5 | sig 6 | structure State : STATE 7 | 8 | exception Error of string 9 | 10 | type operator 11 | 12 | val expand : State.State -> operator 13 | val apply : operator -> State.State 14 | val menu : operator -> string 15 | end; (* signature RECURSE *) 16 | 17 | 18 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/server/sigint-mlton.sml: -------------------------------------------------------------------------------- 1 | structure SigINT :> SIGINT = 2 | struct 3 | 4 | fun interruptLoop (loop:unit -> unit) = 5 | let 6 | (* open MLton *) 7 | val _ = 8 | MLton.Cont.callcc 9 | (fn k => 10 | MLton.Signal.setHandler 11 | (Posix.Signal.int, 12 | MLton.Signal.Handler.handler 13 | (fn _ => 14 | MLton.Thread.new (fn () => MLton.Cont.throw (k, ()))))) 15 | in 16 | loop () 17 | end 18 | 19 | end; 20 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/server/sigint-smlnj.sml: -------------------------------------------------------------------------------- 1 | structure SigINT :> SIGINT = 2 | struct 3 | 4 | fun interruptLoop (loop:unit -> unit) = 5 | (SMLofNJ.Cont.callcc 6 | (fn k => (Signals.setHandler (Signals.sigINT, 7 | Signals.HANDLER (fn _ => (print "\ninterrupt\n"; k))); 8 | ())); 9 | loop ()) 10 | 11 | end; (* structure SigINT *) 12 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/server/sigint.sig: -------------------------------------------------------------------------------- 1 | signature SIGINT = 2 | sig 3 | 4 | val interruptLoop : (unit -> unit) -> unit 5 | 6 | end; (* signature SIGINT *) 7 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/server/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | structure Server 3 | is 4 | #if defined(NEW_CM) 5 | $/basis.cm 6 | #endif 7 | ../compat/sources.cm 8 | ../timing/sources.cm 9 | ../frontend/sources.cm 10 | sigint.sig 11 | #if defined(MLton) 12 | sigint-mlton.sml 13 | #else 14 | sigint-smlnj.sml 15 | #endif 16 | server.sml 17 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/solvers/cs.sig: -------------------------------------------------------------------------------- 1 | (* Constraint Solver *) 2 | signature CS = 3 | sig 4 | (*! structure CSManager : CS_MANAGER !*) 5 | 6 | (* all a constraint solver must define is a structure 7 | suitable for the constraint solver manager to install. 8 | *) 9 | val solver : CSManager.solver 10 | 11 | end (* signature CS *) 12 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/stream/README: -------------------------------------------------------------------------------- 1 | Stream Library 2 | Author: Frank Pfenning 3 | 4 | Streams are potentially infinite lists generate on demand. 5 | There are memoizing and non-memoizing versions. 6 | 7 | Used for lexing and parsing. 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/stream/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature STREAM 3 | structure Stream 4 | is 5 | stream.sml 6 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/style/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature STYLECHECK 3 | structure StyleCheck 4 | is 5 | #if defined(NEW_CM) 6 | $/basis.cm 7 | #endif 8 | ../global/sources.cm 9 | ../table/sources.cm 10 | ../lambda/sources.cm 11 | ../formatter/sources.cm 12 | ../print/sources.cm 13 | ../names/sources.cm 14 | ../paths/sources.cm 15 | ../index/sources.cm 16 | style.sig 17 | style.fun 18 | style.sml -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/style/style.sig: -------------------------------------------------------------------------------- 1 | (* Style Checking *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature STYLECHECK = 5 | sig 6 | exception Error of string 7 | 8 | val check : unit -> unit (* raises Error (msg) *) 9 | end; (* signature STYLECHECK *) 10 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/style/style.sml: -------------------------------------------------------------------------------- 1 | structure StyleCheck = 2 | StyleCheck (structure Whnf = Whnf 3 | structure Index = Index 4 | structure Origins = Origins); 5 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/subordinate/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature SUBORDINATE 3 | structure Subordinate 4 | is 5 | #if defined(NEW_CM) 6 | $/basis.cm 7 | #endif 8 | ../compat/sources.cm 9 | ../global/sources.cm 10 | ../table/sources.cm 11 | ../lambda/sources.cm 12 | ../names/sources.cm 13 | intset.sml 14 | subordinate.sig 15 | subordinate.fun 16 | subordinate.sml 17 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/table/README: -------------------------------------------------------------------------------- 1 | Hash tables and red/black trees. 2 | Author: Frank Pfenning 3 | 4 | Red/black trees is based on an early version of code by Chris Okasaki. 5 | This should be updated some time (see version 15-212, Fall 1997 and 6 | Chris Okasaki's JFP paper on red/black trees). 7 | 8 | Updated the hash-table implementation to fix a bug in HashTable.app, 9 | Dec 23 1997. -fp 10 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/table/string-hash.sig: -------------------------------------------------------------------------------- 1 | (* String Hash Table *) 2 | (* Author: Frank Pfenning *) 3 | 4 | signature STRING_HASH = 5 | sig 6 | val stringHash : string -> int 7 | end; 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/tabling/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature TABLEDSYN 3 | structure TabledSyn 4 | is 5 | ../table/sources.cm 6 | ../lambda/sources.cm 7 | ../print/sources.cm 8 | ../names/sources.cm 9 | ../paths/sources.cm 10 | ../index/sources.cm 11 | tabledsyn.sig 12 | tabledsyn.fun 13 | tabled.sml 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/tabling/tabled.sml: -------------------------------------------------------------------------------- 1 | structure TabledSyn = 2 | TabledSyn ((*! structure IntSyn' = IntSyn !*) 3 | structure Names = Names 4 | structure Table = IntRedBlackTree 5 | structure Index = Index); 6 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/tabling/tabledsyn.sig: -------------------------------------------------------------------------------- 1 | (* Tabled Syntax *) 2 | (* Author: Brigitte Pientka *) 3 | 4 | signature TABLEDSYN = 5 | sig 6 | 7 | (*! structure IntSyn : INTSYN !*) 8 | 9 | exception Error of string 10 | 11 | val reset : unit -> unit 12 | val installTabled : IntSyn.cid -> unit 13 | val tabledLookup : IntSyn.cid -> bool 14 | 15 | end; (* signature TABLEDSYN *) 16 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/terminate/README: -------------------------------------------------------------------------------- 1 | Termination checker 2 | Author: Carsten Schuermann 3 | 4 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/terminate/WALK: -------------------------------------------------------------------------------- 1 | Current issues 2 | 3 | Future issues: 4 | terminology: Order?? 5 | introduce a datatype for comparisons (EQUAL, LESS, NOTLE)? 6 | more complex termination orders -fp 7 | "complete" induction -fp 8 | 9 | CM/ 10 | README 11 | WALK 12 | sources.cm Q: move order into terminate? -fp 13 | terminate.fun OK -fp 14 | terminate.sig Q: check used? removed -fp 15 | OK -fp 16 | terminate.sml OK -fp 17 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/terminate/reduces.sig: -------------------------------------------------------------------------------- 1 | (* Reduction and Termination checker *) 2 | (* Author: Brigitte Pientka *) 3 | 4 | signature REDUCES = 5 | sig 6 | (*! structure IntSyn : INTSYN !*) 7 | 8 | exception Error of string 9 | 10 | val reset : unit -> unit 11 | val checkFamReduction : IntSyn.cid -> unit 12 | val checkFam : IntSyn.cid -> unit 13 | 14 | end; (* signature REDUCES *) 15 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/thm/README: -------------------------------------------------------------------------------- 1 | Theorem and related declarations 2 | Author: Carsten Schuermann 3 | 4 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/timing/README: -------------------------------------------------------------------------------- 1 | Utility code and definitions for timing SML code 2 | Author: Frank Pfenning 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/timing/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature TIMERS 3 | structure Timers 4 | signature TIMING 5 | structure Timing 6 | is 7 | #if defined(NEW_CM) 8 | $/basis.cm 9 | #endif 10 | ../compat/sources.cm 11 | timers.sig 12 | timers.fun 13 | timers.sml 14 | timing.sml 15 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/timing/timers.sml: -------------------------------------------------------------------------------- 1 | (* Timers *) 2 | (* Author: Frank Pfenning *) 3 | 4 | 5 | (* 6 | structure Timers = 7 | Timers (structure Timing' = Timing); 8 | *) 9 | 10 | (* alternative not using actual timers *) 11 | structure Timers = 12 | Timers (structure Timing' = Counting); 13 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/tomega/coverage.sig: -------------------------------------------------------------------------------- 1 | (* Unification on Formulas *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature TOMEGACOVERAGE = 5 | sig 6 | (*! structure IntSyn : INTSYN !*) 7 | (*! structure Tomega : TOMEGA !*) 8 | 9 | exception Error of string 10 | 11 | val coverageCheckPrg : Tomega.Worlds * Tomega.Dec IntSyn.Ctx * Tomega.Prg -> unit 12 | end (* Signature TOMEGACOVERAGE *) 13 | 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/tomega/redundant.sig: -------------------------------------------------------------------------------- 1 | signature REDUNDANT = 2 | sig 3 | exception Error of string 4 | 5 | val convert : Tomega.Prg -> Tomega.Prg 6 | end -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/tomega/unify.sig: -------------------------------------------------------------------------------- 1 | (* Unification on Formulas *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature TOMEGAUNIFY = 5 | sig 6 | (*! structure IntSyn : INTSYN !*) 7 | (*! structure Tomega : TOMEGA !*) 8 | 9 | exception Unify of string 10 | 11 | val unifyFor : Tomega.Dec IntSyn.Ctx * Tomega.For * Tomega.For -> unit 12 | end (* Signature TOMEGATYPECHECK *) 13 | 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/trail/README: -------------------------------------------------------------------------------- 1 | Generic Trailing 2 | Author: Roberto Virga 3 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/trail/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature TRAIL 3 | structure Trail 4 | structure NoTrail 5 | is 6 | trail.sig 7 | trail.sml 8 | notrail.sml 9 | 10 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/typecheck/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature TYPECHECK 3 | structure TypeCheck 4 | signature STRICT 5 | structure Strict 6 | is 7 | #if defined(NEW_CM) 8 | $/basis.cm 9 | #endif 10 | ../lambda/sources.cm 11 | ../print/sources.cm 12 | ../paths/sources.cm 13 | ../names/sources.cm 14 | typecheck.sig 15 | typecheck.fun 16 | typecheck.sml 17 | strict.sig 18 | strict.fun 19 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/typecheck/strict.sig: -------------------------------------------------------------------------------- 1 | (* Checking Definitions for Strictness *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature STRICT = 5 | sig 6 | (*! structure IntSyn : INTSYN !*) 7 | (*! structure Paths : PATHS !*) 8 | 9 | exception Error of string 10 | 11 | val check : (IntSyn.Exp * IntSyn.Exp) * Paths.occConDec option -> unit 12 | val checkType : (int * IntSyn.Exp) * Paths.occConDec option -> unit 13 | end; (* signature STRICT *) 14 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/typecheck/typecheck.sml: -------------------------------------------------------------------------------- 1 | structure TypeCheck = 2 | TypeCheck ((*! structure IntSyn' = IntSyn !*) 3 | structure Conv = Conv 4 | structure Whnf = Whnf 5 | structure Names = Names 6 | structure Print = Print); 7 | 8 | structure Strict = 9 | Strict ((*! structure IntSyn' = IntSyn !*) 10 | structure Whnf = Whnf 11 | structure Paths' = Paths); 12 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/unique/unique.sig: -------------------------------------------------------------------------------- 1 | (* Uniqueness Checking *) 2 | (* Author: Frank Pfenning *) 3 | 4 | signature UNIQUE = 5 | sig 6 | 7 | exception Error of string 8 | 9 | val checkUnique : (IntSyn.cid * ModeSyn.ModeSpine) -> unit (* raises Error(msg) *) 10 | 11 | end; (* signature UNIQUE *) 12 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/worldcheck/worldify.sig: -------------------------------------------------------------------------------- 1 | (* Worldify *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | 5 | signature WORLDIFY = 6 | sig 7 | (*! structure IntSyn : INTSYN !*) 8 | (*! structure Tomega : TOMEGA !*) 9 | 10 | exception Error of string 11 | 12 | val worldify : IntSyn.cid -> IntSyn.ConDec list 13 | val worldifyGoal : IntSyn.Dec IntSyn.Ctx * IntSyn.Exp -> IntSyn.Exp 14 | end; (* signature WORLDIFY *) 15 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/src/worldcheck/worldprint.sig: -------------------------------------------------------------------------------- 1 | (* World Printer *) 2 | (* Author: Carsten Schuermann *) 3 | 4 | signature WORLDPRINT = 5 | sig 6 | structure Formatter : FORMATTER 7 | (*! structure Tomega : TOMEGA !*) 8 | 9 | exception Error of string 10 | 11 | val formatWorlds : Tomega.Worlds -> Formatter.format 12 | val worldsToString : Tomega.Worlds -> string 13 | 14 | end; (* signature WORLDPRINT *) 15 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/tex/twelf.sty: -------------------------------------------------------------------------------- 1 | \def\EVar#1{\mbox{\bf #1}} 2 | \def\BVar#1{\mbox{\it #1}} 3 | \def\Const#1{\mbox{\rm #1}} 4 | \def\Skonst#1{\mbox{\bf #1}} 5 | \def\Def#1{\mbox{\rm #1}} 6 | \def\FVar#1{\mbox{\bf #1}} 7 | 8 | \def\Type{\mbox{\rm type}} 9 | \def\Kind{\mbox{\rm kind}} 10 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/twelf-server.sml: -------------------------------------------------------------------------------- 1 | (* comment out first line if undefined in your version of SMLofNJ *) 2 | (* call sml-cm with @SMLdebug=/dev/null instead *) 3 | SMLofNJ.Internals.GC.messages false; 4 | CM.make' "server.cm"; 5 | SMLofNJ.exportFn ("bin/.heap/twelf-server", Server.server); 6 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/twelf-sml.sml: -------------------------------------------------------------------------------- 1 | (* comment out first line if undefined in your version of SMLofNJ *) 2 | (* call sml-cm with @SMLdebug=/dev/null instead *) 3 | SMLofNJ.Internals.GC.messages false; 4 | CM.make' ("sources.cm"); 5 | if SMLofNJ.exportML ("bin/.heap/twelf-sml") 6 | then (print (Twelf.version ^ "\n"); Timing.init ()) else (); 7 | 8 | -------------------------------------------------------------------------------- /code/elphin/src/twelf/vim/filetype.vim: -------------------------------------------------------------------------------- 1 | " my filetype file 2 | if exists("did_load_filetypes") 3 | finish 4 | endif 5 | augroup filetypedetect 6 | autocmd! BufRead,BufNewFile *.elf,sources.cfg setfiletype twelf 7 | augroup END 8 | -------------------------------------------------------------------------------- /code/elphin/src/typecheck/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature NABLA_TYPECHECK 3 | structure NablaTypeCheck 4 | is 5 | #if defined(NEW_CM) 6 | $/basis.cm 7 | #endif 8 | twelf/sources.cm 9 | ../twelf/src/lambda/sources.cm 10 | ../elaboration/sources.syntax.cm 11 | 12 | typecheck.sig 13 | typecheck.fun 14 | 15 | 16 | -------------------------------------------------------------------------------- /code/elphin/src/typecheck/twelf/sources.cm: -------------------------------------------------------------------------------- 1 | Library 2 | signature TYPECHECKLF 3 | structure TypeCheckLF 4 | is 5 | #if defined(NEW_CM) 6 | $/basis.cm 7 | #endif 8 | ../../twelf/src/lambda/sources.cm 9 | ../../twelf/src/print/sources.cm 10 | ../../twelf/src/paths/sources.cm 11 | ../../twelf/src/names/sources.cm 12 | typecheck.sig 13 | typecheck.fun 14 | typecheck.sml 15 | -------------------------------------------------------------------------------- /code/elphin/src/typecheck/twelf/typecheck.sml: -------------------------------------------------------------------------------- 1 | structure TypeCheckLF = 2 | TypeCheckLF ((*! structure IntSyn' = IntSyn !*) 3 | structure Conv = Conv 4 | structure Whnf = Whnf 5 | structure Names = Names 6 | structure Print = Print); 7 | -------------------------------------------------------------------------------- /code/elphin/src/typecheck/typecheck.sig: -------------------------------------------------------------------------------- 1 | (* Nabla Type Checker *) 2 | (* Author: Adam Poswolsky *) 3 | 4 | signature NABLA_TYPECHECK = 5 | sig 6 | exception Error of string 7 | val inferType : (NablaIntSyntax.Dec IntSyn.Ctx) list * NablaIntSyntax.Exp -> NablaIntSyntax.Formula 8 | 9 | end 10 | --------------------------------------------------------------------------------