From 3cd82ba195cdc71d9f4d6d89522c4033e4c105cb Mon Sep 17 00:00:00 2001 From: MartyO256 Date: Tue, 24 Oct 2023 20:39:47 +0000 Subject: [PATCH] =?UTF-8?q?Deploying=20to=20gh-pages=20from=20@=20Beluga-l?= =?UTF-8?q?ang/Beluga@a36785b2f6cb484ab36cc544443a1968165d9bbe=20?= =?UTF-8?q?=F0=9F=9A=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- beluga/Beluga/Abstract/index.html | 70 ---- beluga/Beluga/Apxnorm/index.html | 255 ------------ beluga/Beluga/Chatter/index.html | 2 - beluga/Beluga/Check/Comp/index.html | 124 ------ beluga/Beluga/Check/LF/index.html | 93 ----- beluga/Beluga/Check/index.html | 2 - beluga/Beluga/Command/index.html | 5 - beluga/Beluga/Context/index.html | 114 ------ beluga/Beluga/ConvSigma/index.html | 26 -- beluga/Beluga/Coverage/index.html | 48 --- beluga/Beluga/Ctxsub/index.html | 10 - beluga/Beluga/Erase/index.html | 5 - beluga/Beluga/Holes/index.html | 5 - beluga/Beluga/Index/Indexer/index.html | 334 --------------- .../argument-1-Indexing_state/index.html | 302 -------------- beluga/Beluga/Index/Make_indexer/index.html | 104 ----- beluga/Beluga/Index/index.html | 4 - .../Index/module-type-INDEXER/index.html | 103 ----- .../Index_state/Indexing_state/index.html | 302 -------------- beluga/Beluga/Index_state/index.html | 2 - .../module-type-INDEXING_STATE/index.html | 302 -------------- beluga/Beluga/Interactive/index.html | 29 -- beluga/Beluga/Lfcheck/index.html | 194 --------- beluga/Beluga/Lfrecon/index.html | 265 ------------ .../argument-1-Load_state/index.html | 81 ---- beluga/Beluga/Load/Make_load/index.html | 76 ---- .../Entry/index.html | 2 - .../index.html | 284 ------------- .../Entry/index.html | 2 - .../argument-2-Disambiguation/index.html | 382 ------------------ .../index.html | 214 ---------- .../index.html | 79 ---- beluga/Beluga/Load/Make_load_state/index.html | 86 ---- beluga/Beluga/Load/index.html | 17 - .../Beluga/Load/module-type-LOAD/index.html | 75 ---- .../Load/module-type-LOAD_STATE/index.html | 81 ---- beluga/Beluga/Logic/CSolver/index.html | 12 - beluga/Beluga/Logic/Convert/index.html | 14 - beluga/Beluga/Logic/Frontend/index.html | 14 - beluga/Beluga/Logic/Index/index.html | 2 - beluga/Beluga/Logic/Options/index.html | 2 - beluga/Beluga/Logic/Solver/index.html | 8 - beluga/Beluga/Logic/index.html | 14 - beluga/Beluga/Monitor/index.html | 2 - beluga/Beluga/NameGen/index.html | 5 - beluga/Beluga/Opsem/index.html | 2 - beluga/Beluga/Options/Debug/index.html | 2 - beluga/Beluga/Options/Html/index.html | 2 - beluga/Beluga/Options/Subord/index.html | 2 - beluga/Beluga/Options/index.html | 2 - beluga/Beluga/Order/index.html | 2 - .../Prettyint/DefaultPrinter/index.html | 293 -------------- .../Prettyint/Make/argument-1-R/index.html | 14 - beluga/Beluga/Prettyint/Make/index.html | 293 -------------- beluga/Beluga/Prettyint/index.html | 2 - beluga/Beluga/Printer/Control/index.html | 2 - beluga/Beluga/Printer/Int/index.html | 2 - .../Printer/Int/module-type-T/index.html | 293 -------------- beluga/Beluga/Printer/index.html | 12 - beluga/Beluga/Reconstruct/index.html | 52 --- .../index.html | 214 ---------- beluga/Beluga/Recsgn/Make/index.html | 79 ---- .../Signature_reconstruction/index.html | 78 ---- beluga/Beluga/Recsgn/index.html | 9 - .../index.html | 78 ---- .../argument-1-Index_state/index.html | 302 -------------- .../argument-2-Index/index.html | 104 ----- .../index.html | 217 ---------- .../Signature_reconstruction_state/index.html | 218 ---------- beluga/Beluga/Recsgn_state/index.html | 5 - .../index.html | 214 ---------- beluga/Beluga/Sigma/index.html | 2 - beluga/Beluga/Store/Cid/Comp/Entry/index.html | 2 - beluga/Beluga/Store/Cid/Comp/index.html | 22 - .../Store/Cid/CompConst/Entry/index.html | 2 - beluga/Beluga/Store/Cid/CompConst/index.html | 9 - .../Store/Cid/CompCotyp/Entry/index.html | 2 - beluga/Beluga/Store/Cid/CompCotyp/index.html | 11 - .../Store/Cid/CompDest/Entry/index.html | 2 - beluga/Beluga/Store/Cid/CompDest/index.html | 11 - .../Beluga/Store/Cid/CompTyp/Entry/index.html | 2 - beluga/Beluga/Store/Cid/CompTyp/index.html | 12 - .../Store/Cid/CompTypDef/Entry/index.html | 2 - beluga/Beluga/Store/Cid/CompTypDef/index.html | 9 - .../Store/Cid/DefaultRenderer/index.html | 14 - .../Beluga/Store/Cid/NamedRenderer/index.html | 14 - .../Beluga/Store/Cid/Schema/Entry/index.html | 2 - beluga/Beluga/Store/Cid/Schema/index.html | 2 - beluga/Beluga/Store/Cid/Term/Entry/index.html | 2 - beluga/Beluga/Store/Cid/Term/index.html | 10 - beluga/Beluga/Store/Cid/Typ/Entry/index.html | 2 - beluga/Beluga/Store/Cid/Typ/index.html | 21 - beluga/Beluga/Store/Cid/index.html | 2 - .../Store/Cid/module-type-RENDERER/index.html | 14 - beluga/Beluga/Store/FCVar/index.html | 7 - beluga/Beluga/Store/FVar/index.html | 2 - beluga/Beluga/Store/OpPragmas/index.html | 7 - beluga/Beluga/Store/index.html | 2 - .../Beluga/Store/module-type-ENTRY/index.html | 2 - beluga/Beluga/Subord/index.html | 9 - beluga/Beluga/Substitution/LF/index.html | 20 - beluga/Beluga/Substitution/index.html | 2 - beluga/Beluga/Total/index.html | 204 ---------- beluga/Beluga/Trail/EmptyTrail/index.html | 2 - beluga/Beluga/Trail/StdTrail/index.html | 2 - beluga/Beluga/Trail/index.html | 2 - .../Beluga/Trail/module-type-TRAIL/index.html | 2 - beluga/Beluga/Typeinfo/Annot/index.html | 2 - beluga/Beluga/Typeinfo/Comp/index.html | 5 - beluga/Beluga/Typeinfo/LF/index.html | 6 - beluga/Beluga/Typeinfo/Sgn/index.html | 2 - beluga/Beluga/Typeinfo/index.html | 2 - beluga/Beluga/Unify/EmptyTrail/index.html | 92 ----- .../Beluga/Unify/Make/argument-1-T/index.html | 2 - beluga/Beluga/Unify/Make/index.html | 92 ----- beluga/Beluga/Unify/StdTrail/index.html | 92 ----- beluga/Beluga/Unify/index.html | 2 - .../Beluga/Unify/module-type-UNIFY/index.html | 92 ----- beluga/Beluga/Whnf/index.html | 258 ------------ .../Synext_html_pp/Html_printer/index.html | 229 ----------- .../argument-1-Html_printing_state/index.html | 220 ---------- .../Make_html_printer/index.html | 73 ---- beluga/Beluga_html/Synext_html_pp/index.html | 4 - .../module-type-HTML_PRINTER/index.html | 72 ---- .../Html_printing_state/index.html | 223 ---------- .../Synext_html_pp_state/index.html | 2 - .../index.html | 220 ---------- .../argument-1-Expression/index.html | 2 - .../index.html | 8 - .../Application_disambiguation/index.html | 4 - .../index.html | 8 - .../module-type-EXPRESSION/index.html | 2 - .../Entry/index.html | 2 - .../index.html | 284 ------------- .../Clf_disambiguation/Make/index.html | 93 ----- .../Clf_disambiguation/index.html | 4 - .../module-type-CLF_DISAMBIGUATION/index.html | 92 ----- .../Make/argument-1-Parser/index.html | 31 -- .../Beluga_parser/Clf_parser/Make/index.html | 38 -- beluga/Beluga_parser/Clf_parser/index.html | 10 - .../module-type-CLF_PARSER/index.html | 29 -- .../Make/argument-1-Parser/index.html | 24 -- .../Common_parser/Make/index.html | 35 -- beluga/Beluga_parser/Common_parser/index.html | 10 - .../module-type-COMMON_PARSER/index.html | 29 -- .../Entry/index.html | 2 - .../index.html | 284 ------------- .../argument-2-Meta_disambiguator/index.html | 84 ---- .../Comp_disambiguation/Make/index.html | 91 ----- .../Comp_disambiguation/index.html | 7 - .../index.html | 88 ---- .../Make/argument-1-Parser/index.html | 31 -- .../Make/argument-2-Meta_parser/index.html | 35 -- .../Beluga_parser/Comp_parser/Make/index.html | 42 -- beluga/Beluga_parser/Comp_parser/index.html | 15 - .../module-type-COMP_PARSER/index.html | 29 -- beluga/Beluga_parser/Config_parser/index.html | 14 - .../Disambiguation_state/Entry/index.html | 2 - .../Disambiguation_state/index.html | 284 ------------- .../Disambiguation_state/index.html | 2 - .../Entry/index.html | 2 - .../index.html | 284 ------------- .../module-type-ENTRY/index.html | 2 - .../Entry/index.html | 2 - .../index.html | 284 ------------- .../argument-2-Meta_disambiguation/index.html | 84 ---- .../argument-3-Comp_disambiguation/index.html | 89 ---- .../Harpoon_disambiguation/Make/index.html | 99 ----- .../Harpoon_disambiguation/index.html | 10 - .../index.html | 94 ----- .../Make/argument-1-Parser/index.html | 31 -- .../Make/argument-2-Meta_parser/index.html | 35 -- .../Make/argument-3-Comp_parser/index.html | 35 -- .../Harpoon_parser/Make/index.html | 46 --- .../Beluga_parser/Harpoon_parser/index.html | 20 - .../module-type-HARPOON_PARSER/index.html | 29 -- beluga/Beluga_parser/Lexer/index.html | 8 - .../Entry/index.html | 2 - .../index.html | 284 ------------- .../Lf_disambiguation/Make/index.html | 73 ---- .../Lf_disambiguation/index.html | 4 - .../module-type-LF_DISAMBIGUATION/index.html | 72 ---- .../Make/argument-1-Parser/index.html | 31 -- .../Beluga_parser/Lf_parser/Make/index.html | 38 -- beluga/Beluga_parser/Lf_parser/index.html | 10 - .../module-type-LF_PARSER/index.html | 29 -- beluga/Beluga_parser/Located_token/index.html | 2 - .../Make/Disambiguation/Entry/index.html | 2 - .../Make/Disambiguation/index.html | 374 ----------------- beluga/Beluga_parser/Make/Parsing/index.html | 125 ------ .../Make/argument-1-Parser_state/index.html | 58 --- .../Entry/index.html | 2 - .../index.html | 284 ------------- beluga/Beluga_parser/Make/index.html | 63 --- .../Make_disambiguation/Entry/index.html | 2 - .../Entry/index.html | 2 - .../index.html | 284 ------------- .../Make_disambiguation/index.html | 376 ----------------- .../argument-1-Parser_state/index.html | 58 --- beluga/Beluga_parser/Make_parsing/index.html | 152 ------- .../Entry/index.html | 2 - .../index.html | 284 ------------- .../argument-2-Lf_disambiguation/index.html | 73 ---- .../argument-3-Clf_disambiguator/index.html | 93 ----- .../Meta_disambiguation/Make/index.html | 88 ---- .../Meta_disambiguation/index.html | 10 - .../index.html | 83 ---- .../Make/argument-1-Parser/index.html | 31 -- .../Make/argument-2-Lf_parser/index.html | 35 -- .../Make/argument-3-Clf_parser/index.html | 35 -- .../Beluga_parser/Meta_parser/Make/index.html | 46 --- beluga/Beluga_parser/Meta_parser/index.html | 20 - .../module-type-META_PARSER/index.html | 29 -- .../Parser/Disambiguation/Entry/index.html | 2 - .../Parser/Disambiguation/index.html | 374 ----------------- .../Parser/Parser_state/index.html | 58 --- .../Beluga_parser/Parser/Parsing/index.html | 125 ------ beluga/Beluga_parser/Parser/index.html | 74 ---- .../Make/argument-1-State/index.html | 58 --- .../Parser_combinator/Make/index.html | 24 -- .../argument-1-Token/index.html | 2 - .../Make_persistent_state/index.html | 60 --- .../Parser_combinator/index.html | 7 - .../module-type-LOCATED/index.html | 2 - .../module-type-PARSER/index.html | 24 -- .../module-type-PARSER_STATE/index.html | 58 --- .../Entry/index.html | 2 - .../index.html | 284 ------------- .../argument-2-Lf_disambiguation/index.html | 73 ---- .../argument-3-Clf_disambiguation/index.html | 93 ----- .../argument-4-Meta_disambiguation/index.html | 84 ---- .../argument-5-Comp_disambiguation/index.html | 89 ---- .../index.html | 95 ----- .../Signature_disambiguation/Make/index.html | 104 ----- .../Signature_disambiguation/index.html | 19 - .../index.html | 93 ----- .../Make/argument-1-Parser/index.html | 31 -- .../Make/argument-2-Lf_parser/index.html | 35 -- .../Make/argument-3-Clf_parser/index.html | 35 -- .../Make/argument-4-Meta_parser/index.html | 35 -- .../Make/argument-5-Comp_parser/index.html | 35 -- .../Make/argument-6-Harpoon_parser/index.html | 35 -- .../Signature_parser/Make/index.html | 58 --- .../Beluga_parser/Signature_parser/index.html | 35 -- .../module-type-SIGNATURE_PARSER/index.html | 29 -- beluga/Beluga_parser/Token/index.html | 2 - .../Entry/index.html | 2 - .../module-type-DISAMBIGUATION/index.html | 375 ----------------- .../module-type-PARSING/index.html | 139 ------- beluga/Harpoon/Automation/State/index.html | 2 - beluga/Harpoon/Automation/index.html | 6 - beluga/Harpoon/CidProgRewrite/index.html | 5 - beluga/Harpoon/HarpoonState/index.html | 13 - beluga/Harpoon/InputPrompt/index.html | 6 - beluga/Harpoon/Io/index.html | 13 - beluga/Harpoon/Options/index.html | 2 - beluga/Harpoon/Prover/index.html | 9 - beluga/Harpoon/Repl/index.html | 13 - beluga/Harpoon/Revisit/index.html | 9 - beluga/Harpoon/Serialization/index.html | 2 - beluga/Harpoon/Session/index.html | 13 - beluga/Harpoon/Tactic/index.html | 33 -- beluga/Harpoon/Theorem/Action/index.html | 7 - beluga/Harpoon/Theorem/Conf/index.html | 7 - beluga/Harpoon/Theorem/index.html | 29 -- beluga/Harpoon/Translate/index.html | 2 - beluga/Optparser/Error/Argument/index.html | 2 - beluga/Optparser/Error/Option/index.html | 2 - beluga/Optparser/Error/index.html | 2 - beluga/Support/Alternative/index.html | 2 - .../module-type-ALTERNATIVE/index.html | 2 - .../Apply/Make/argument-1-M/index.html | 2 - beluga/Support/Apply/Make/index.html | 21 - beluga/Support/Apply/index.html | 2 - .../Apply/module-type-APPLY/index.html | 21 - beluga/Support/Debug/Fmt/index.html | 6 - beluga/Support/Debug/index.html | 4 - beluga/Support/DynArray/index.html | 2 - beluga/Support/Either/index.html | 20 - .../Support/Eq/Make/argument-1-T/index.html | 2 - beluga/Support/Eq/Make/index.html | 2 - beluga/Support/Eq/index.html | 12 - beluga/Support/Eq/module-type-EQ/index.html | 2 - beluga/Support/Equality/index.html | 2 - beluga/Support/Files/index.html | 6 - beluga/Support/Format/index.html | 119 ------ .../Make/argument-1-State/index.html | 2 - beluga/Support/Format_state/Make/index.html | 93 ----- beluga/Support/Format_state/index.html | 2 - .../Format_state/module-type-S/index.html | 93 ----- beluga/Support/Fun/index.html | 2 - .../Functor/Make/argument-1-M/index.html | 2 - beluga/Support/Functor/Make/index.html | 2 - beluga/Support/Functor/index.html | 2 - .../Functor/module-type-FUNCTOR/index.html | 2 - beluga/Support/Gen/IO/index.html | 28 -- beluga/Support/Gen/Infix/index.html | 2 - beluga/Support/Gen/Restart/Infix/index.html | 2 - beluga/Support/Gen/Restart/index.html | 45 --- beluga/Support/Gen/index.html | 18 - .../Support/Hash/Make/argument-1-T/index.html | 2 - beluga/Support/Hash/Make/index.html | 2 - beluga/Support/Hash/index.html | 6 - .../Support/Hash/module-type-HASH/index.html | 2 - .../Hashtbl/Make/argument-1-H/index.html | 2 - beluga/Support/Hashtbl/Make/index.html | 2 - .../MakeSeeded/argument-1-H/index.html | 2 - beluga/Support/Hashtbl/MakeSeeded/index.html | 2 - beluga/Support/Hashtbl/index.html | 2 - .../Hashtbl/module-type-HashedType/index.html | 2 - .../Support/Hashtbl/module-type-S/index.html | 2 - .../module-type-SeededHashedType/index.html | 2 - .../Hashtbl/module-type-SeededS/index.html | 2 - beluga/Support/History/index.html | 2 - .../Make/argument-1-State/index.html | 2 - .../Support/Imperative_state/Make/index.html | 57 --- beluga/Support/Imperative_state/index.html | 4 - .../module-type-IMPERATIVE_STATE/index.html | 57 --- beluga/Support/Int/Hashtbl/index.html | 2 - beluga/Support/Int/index.html | 2 - .../List/MakeEq/argument-1-E/index.html | 2 - beluga/Support/List/MakeEq/index.html | 2 - .../List/MakeOrd/argument-1-O/index.html | 2 - beluga/Support/List/MakeOrd/index.html | 2 - .../List/MakeShow/argument-1-S/index.html | 2 - beluga/Support/List/MakeShow/index.html | 2 - beluga/Support/List/index.html | 27 -- .../List1/MakeEq/argument-1-E/index.html | 2 - beluga/Support/List1/MakeEq/index.html | 2 - .../List1/MakeOrd/argument-1-O/index.html | 2 - beluga/Support/List1/MakeOrd/index.html | 2 - .../List1/MakeShow/argument-1-S/index.html | 2 - beluga/Support/List1/MakeShow/index.html | 2 - beluga/Support/List1/index.html | 14 - .../List2/MakeEq/argument-1-E/index.html | 2 - beluga/Support/List2/MakeEq/index.html | 2 - .../List2/MakeOrd/argument-1-O/index.html | 2 - beluga/Support/List2/MakeOrd/index.html | 2 - .../List2/MakeShow/argument-1-S/index.html | 2 - beluga/Support/List2/MakeShow/index.html | 2 - beluga/Support/List2/index.html | 42 -- beluga/Support/Misc/index.html | 2 - .../Monad/Make/argument-1-Monad/index.html | 2 - beluga/Support/Monad/Make/index.html | 2 - beluga/Support/Monad/index.html | 2 - .../Monad/module-type-MONAD/index.html | 2 - .../Option/MakeEq/argument-1-E/index.html | 2 - beluga/Support/Option/MakeEq/index.html | 2 - .../Option/MakeOrd/argument-1-O/index.html | 2 - beluga/Support/Option/MakeOrd/index.html | 2 - .../Option/MakeShow/argument-1-S/index.html | 2 - beluga/Support/Option/MakeShow/index.html | 2 - beluga/Support/Option/index.html | 25 -- .../Support/Ord/Make/argument-1-T/index.html | 2 - beluga/Support/Ord/Make/index.html | 2 - .../Ord/Reverse/argument-1-Ord/index.html | 2 - beluga/Support/Ord/Reverse/index.html | 2 - beluga/Support/Ord/index.html | 20 - beluga/Support/Ord/module-type-ORD/index.html | 2 - .../Pair/MakeEq/argument-1-E1/index.html | 2 - .../Pair/MakeEq/argument-2-E2/index.html | 2 - beluga/Support/Pair/MakeEq/index.html | 2 - .../Pair/MakeOrd/argument-1-O1/index.html | 2 - .../Pair/MakeOrd/argument-2-O2/index.html | 2 - beluga/Support/Pair/MakeOrd/index.html | 2 - .../Pair/MakeShow/argument-1-S1/index.html | 2 - .../Pair/MakeShow/argument-2-S2/index.html | 2 - beluga/Support/Pair/MakeShow/index.html | 2 - beluga/Support/Pair/index.html | 27 -- beluga/Support/PureStack/index.html | 19 - beluga/Support/Seq/index.html | 2 - .../Support/Show/Make/argument-1-T/index.html | 2 - beluga/Support/Show/Make/index.html | 2 - beluga/Support/Show/index.html | 6 - .../Support/Show/module-type-SHOW/index.html | 2 - beluga/Support/Stack/index.html | 2 - .../State/Make/argument-1-State/index.html | 2 - beluga/Support/State/Make/index.html | 30 -- beluga/Support/State/index.html | 37 -- .../State/module-type-STATE/index.html | 30 -- beluga/Support/String/Hashtbl/index.html | 2 - beluga/Support/String/index.html | 2 - beluga/Synapx/Comp/index.html | 5 - beluga/Synapx/LF/index.html | 2 - beluga/Syncom/Associativity/index.html | 2 - beluga/Syncom/Binding_tree/index.html | 17 - beluga/Syncom/Depend/index.html | 2 - beluga/Syncom/Error/index.html | 21 - beluga/Syncom/Fixity/index.html | 2 - beluga/Syncom/Gensym/MVarData/index.html | 2 - beluga/Syncom/Gensym/VarData/index.html | 2 - beluga/Syncom/Gensym/index.html | 2 - .../Gensym/module-type-GENSYM/index.html | 2 - beluga/Syncom/HoleId/Make/index.html | 2 - beluga/Syncom/HoleId/index.html | 2 - beluga/Syncom/Id/CompConst/Hashtbl/index.html | 2 - beluga/Syncom/Id/CompConst/index.html | 2 - beluga/Syncom/Id/CompCotyp/Hashtbl/index.html | 2 - beluga/Syncom/Id/CompCotyp/index.html | 2 - beluga/Syncom/Id/CompDest/Hashtbl/index.html | 2 - beluga/Syncom/Id/CompDest/index.html | 2 - beluga/Syncom/Id/CompTyp/Hashtbl/index.html | 2 - beluga/Syncom/Id/CompTyp/index.html | 2 - .../Syncom/Id/CompTypdef/Hashtbl/index.html | 2 - beluga/Syncom/Id/CompTypdef/index.html | 2 - beluga/Syncom/Id/Module/Hashtbl/index.html | 2 - beluga/Syncom/Id/Module/index.html | 2 - .../Syncom/Id/MutualGroup/Hashtbl/index.html | 2 - beluga/Syncom/Id/MutualGroup/index.html | 2 - beluga/Syncom/Id/Prog/Hashtbl/index.html | 2 - beluga/Syncom/Id/Prog/index.html | 2 - beluga/Syncom/Id/Schema/Hashtbl/index.html | 2 - beluga/Syncom/Id/Schema/index.html | 2 - beluga/Syncom/Id/Term/Hashtbl/index.html | 2 - beluga/Syncom/Id/Term/index.html | 2 - beluga/Syncom/Id/Typ/Hashtbl/index.html | 2 - beluga/Syncom/Id/Typ/index.html | 2 - beluga/Syncom/Id/index.html | 2 - .../Id/module-type-ID/Hashtbl/index.html | 2 - beluga/Syncom/Id/module-type-ID/index.html | 2 - beluga/Syncom/Identifier/Hashtbl/index.html | 2 - beluga/Syncom/Identifier/index.html | 4 - beluga/Syncom/Inductivity/index.html | 2 - .../Syncom/Location/Ord_by_start/index.html | 2 - beluga/Syncom/Location/Ord_by_stop/index.html | 2 - beluga/Syncom/Location/index.html | 10 - beluga/Syncom/Name/index.html | 2 - beluga/Syncom/Operator/index.html | 2 - .../Make/argument-1-Format_state/index.html | 108 ----- .../Make/argument-2-Precedence/index.html | 2 - beluga/Syncom/Parenthesizer/Make/index.html | 148 ------- beluga/Syncom/Parenthesizer/index.html | 7 - .../module-type-PARENTHESIZER/index.html | 147 ------- beluga/Syncom/Plicity/index.html | 2 - beluga/Syncom/Position/index.html | 2 - beluga/Syncom/Qualified_identifier/index.html | 6 - beluga/Synext/CLF/Context/Head/index.html | 2 - .../CLF/Context/Pattern/Head/index.html | 2 - beluga/Synext/CLF/Context/Pattern/index.html | 2 - beluga/Synext/CLF/Context/index.html | 2 - .../Synext/CLF/Substitution/Head/index.html | 2 - .../CLF/Substitution/Pattern/Head/index.html | 2 - .../CLF/Substitution/Pattern/index.html | 2 - beluga/Synext/CLF/Substitution/index.html | 2 - beluga/Synext/CLF/Term/Pattern/index.html | 3 - beluga/Synext/CLF/Term/index.html | 3 - beluga/Synext/CLF/Typ/index.html | 3 - beluga/Synext/CLF/index.html | 2 - beluga/Synext/Comp/Case_branch/index.html | 2 - .../Synext/Comp/Cofunction_branch/index.html | 2 - beluga/Synext/Comp/Context/index.html | 2 - beluga/Synext/Comp/Copattern/index.html | 3 - beluga/Synext/Comp/Expression/index.html | 6 - beluga/Synext/Comp/Kind/index.html | 2 - beluga/Synext/Comp/Pattern/index.html | 2 - beluga/Synext/Comp/Typ/index.html | 2 - beluga/Synext/Comp/index.html | 2 - beluga/Synext/Harpoon/Command/index.html | 2 - beluga/Synext/Harpoon/Directive/index.html | 2 - beluga/Synext/Harpoon/Hypothetical/index.html | 2 - beluga/Synext/Harpoon/Proof/index.html | 2 - beluga/Synext/Harpoon/Repl/Command/index.html | 6 - beluga/Synext/Harpoon/Repl/index.html | 2 - .../Harpoon/Split_branch/Label/index.html | 2 - beluga/Synext/Harpoon/Split_branch/index.html | 2 - .../Synext/Harpoon/Suffices_branch/index.html | 2 - beluga/Synext/Harpoon/index.html | 2 - beluga/Synext/LF/Kind/index.html | 2 - beluga/Synext/LF/Term/index.html | 2 - beluga/Synext/LF/Typ/index.html | 2 - beluga/Synext/LF/index.html | 2 - .../Clf_precedence/Ord/index.html | 2 - .../Clf_precedence/index.html | 2 - .../Comp_expression_precedence/Ord/index.html | 2 - .../Comp_expression_precedence/index.html | 2 - .../Comp_pattern_precedence/Ord/index.html | 2 - .../Comp_pattern_precedence/index.html | 2 - .../Comp_sort_precedence/Ord/index.html | 2 - .../Comp_sort_precedence/index.html | 2 - .../Lf_precedence/Ord/index.html | 2 - .../Make_precedences/Lf_precedence/index.html | 2 - .../Schema_precedence/Ord/index.html | 2 - .../Schema_precedence/index.html | 2 - .../Make_precedences/argument-1-S/index.html | 75 ---- beluga/Synext/Make_precedences/index.html | 87 ---- .../argument-1-Printing_state/index.html | 192 --------- beluga/Synext/Make_printer/index.html | 73 ---- beluga/Synext/Meta/Context/index.html | 2 - beluga/Synext/Meta/Object/index.html | 2 - beluga/Synext/Meta/Pattern/index.html | 2 - beluga/Synext/Meta/Schema/index.html | 2 - beluga/Synext/Meta/Typ/index.html | 2 - beluga/Synext/Meta/index.html | 2 - beluga/Synext/Printer/index.html | 198 --------- beluga/Synext/Printing_state/index.html | 192 --------- .../Synext/Signature/Declaration/index.html | 2 - beluga/Synext/Signature/Entry/index.html | 2 - .../Synext/Signature/Global_pragma/index.html | 2 - beluga/Synext/Signature/Pragma/index.html | 2 - .../Signature/Totality/Declaration/index.html | 2 - .../Signature/Totality/Order/index.html | 2 - beluga/Synext/Signature/Totality/index.html | 2 - beluga/Synext/Signature/index.html | 2 - .../Ord/index.html | 2 - .../module-type-BASE_PRECEDENCE/index.html | 2 - .../module-type-PRECEDENCE_STATE/index.html | 75 ---- beluga/Synext/module-type-PRINTER/index.html | 72 ---- .../module-type-PRINTING_STATE/index.html | 192 --------- beluga/Synint/Comp/SubgoalPath/index.html | 2 - beluga/Synint/Comp/index.html | 38 -- beluga/Synint/LF/index.html | 9 - beluga/Synint/Sgn/index.html | 2 - .../Synprs/CLF/Context_object/Head/index.html | 2 - beluga/Synprs/CLF/Context_object/index.html | 3 - beluga/Synprs/CLF/Object/index.html | 6 - beluga/Synprs/CLF/index.html | 2 - beluga/Synprs/Comp/Context_object/index.html | 3 - .../Synprs/Comp/Copattern_object/index.html | 2 - .../Synprs/Comp/Expression_object/index.html | 7 - beluga/Synprs/Comp/Pattern_object/index.html | 2 - beluga/Synprs/Comp/Sort_object/index.html | 2 - beluga/Synprs/Comp/index.html | 2 - beluga/Synprs/Harpoon/Command/index.html | 2 - beluga/Synprs/Harpoon/Directive/index.html | 2 - beluga/Synprs/Harpoon/Hypothetical/index.html | 2 - beluga/Synprs/Harpoon/Proof/index.html | 2 - beluga/Synprs/Harpoon/Repl/Command/index.html | 7 - beluga/Synprs/Harpoon/Repl/index.html | 2 - .../Harpoon/Split_branch/Label/index.html | 2 - beluga/Synprs/Harpoon/Split_branch/index.html | 2 - .../Synprs/Harpoon/Suffices_branch/index.html | 2 - beluga/Synprs/Harpoon/index.html | 2 - beluga/Synprs/LF/Object/index.html | 2 - beluga/Synprs/LF/index.html | 2 - beluga/Synprs/Meta/Context_object/index.html | 4 - beluga/Synprs/Meta/Schema_object/index.html | 2 - beluga/Synprs/Meta/Thing/index.html | 2 - beluga/Synprs/Meta/index.html | 2 - .../Synprs/Signature/Declaration/index.html | 2 - beluga/Synprs/Signature/Entry/index.html | 2 - .../Synprs/Signature/Global_pragma/index.html | 2 - beluga/Synprs/Signature/Pragma/index.html | 2 - .../Signature/Totality/Declaration/index.html | 3 - .../Signature/Totality/Order/index.html | 2 - beluga/Synprs/Signature/Totality/index.html | 2 - beluga/Synprs/Signature/index.html | 2 - 546 files changed, 20671 deletions(-) delete mode 100644 beluga/Beluga/Abstract/index.html delete mode 100644 beluga/Beluga/Apxnorm/index.html delete mode 100644 beluga/Beluga/Chatter/index.html delete mode 100644 beluga/Beluga/Check/Comp/index.html delete mode 100644 beluga/Beluga/Check/LF/index.html delete mode 100644 beluga/Beluga/Check/index.html delete mode 100644 beluga/Beluga/Command/index.html delete mode 100644 beluga/Beluga/Context/index.html delete mode 100644 beluga/Beluga/ConvSigma/index.html delete mode 100644 beluga/Beluga/Coverage/index.html delete mode 100644 beluga/Beluga/Ctxsub/index.html delete mode 100644 beluga/Beluga/Erase/index.html delete mode 100644 beluga/Beluga/Holes/index.html delete mode 100644 beluga/Beluga/Index/Indexer/index.html delete mode 100644 beluga/Beluga/Index/Make_indexer/argument-1-Indexing_state/index.html delete mode 100644 beluga/Beluga/Index/Make_indexer/index.html delete mode 100644 beluga/Beluga/Index/index.html delete mode 100644 beluga/Beluga/Index/module-type-INDEXER/index.html delete mode 100644 beluga/Beluga/Index_state/Indexing_state/index.html delete mode 100644 beluga/Beluga/Index_state/index.html delete mode 100644 beluga/Beluga/Index_state/module-type-INDEXING_STATE/index.html delete mode 100644 beluga/Beluga/Interactive/index.html delete mode 100644 beluga/Beluga/Lfcheck/index.html delete mode 100644 beluga/Beluga/Lfrecon/index.html delete mode 100644 beluga/Beluga/Load/Make_load/argument-1-Load_state/index.html delete mode 100644 beluga/Beluga/Load/Make_load/index.html delete mode 100644 beluga/Beluga/Load/Make_load_state/argument-1-Disambiguation_state/Entry/index.html delete mode 100644 beluga/Beluga/Load/Make_load_state/argument-1-Disambiguation_state/index.html delete mode 100644 beluga/Beluga/Load/Make_load_state/argument-2-Disambiguation/Entry/index.html delete mode 100644 beluga/Beluga/Load/Make_load_state/argument-2-Disambiguation/index.html delete mode 100644 beluga/Beluga/Load/Make_load_state/argument-3-Signature_reconstruction_state/index.html delete mode 100644 beluga/Beluga/Load/Make_load_state/argument-4-Signature_reconstruction/index.html delete mode 100644 beluga/Beluga/Load/Make_load_state/index.html delete mode 100644 beluga/Beluga/Load/index.html delete mode 100644 beluga/Beluga/Load/module-type-LOAD/index.html delete mode 100644 beluga/Beluga/Load/module-type-LOAD_STATE/index.html delete mode 100644 beluga/Beluga/Logic/CSolver/index.html delete mode 100644 beluga/Beluga/Logic/Convert/index.html delete mode 100644 beluga/Beluga/Logic/Frontend/index.html delete mode 100644 beluga/Beluga/Logic/Index/index.html delete mode 100644 beluga/Beluga/Logic/Options/index.html delete mode 100644 beluga/Beluga/Logic/Solver/index.html delete mode 100644 beluga/Beluga/Logic/index.html delete mode 100644 beluga/Beluga/Monitor/index.html delete mode 100644 beluga/Beluga/NameGen/index.html delete mode 100644 beluga/Beluga/Opsem/index.html delete mode 100644 beluga/Beluga/Options/Debug/index.html delete mode 100644 beluga/Beluga/Options/Html/index.html delete mode 100644 beluga/Beluga/Options/Subord/index.html delete mode 100644 beluga/Beluga/Options/index.html delete mode 100644 beluga/Beluga/Order/index.html delete mode 100644 beluga/Beluga/Prettyint/DefaultPrinter/index.html delete mode 100644 beluga/Beluga/Prettyint/Make/argument-1-R/index.html delete mode 100644 beluga/Beluga/Prettyint/Make/index.html delete mode 100644 beluga/Beluga/Prettyint/index.html delete mode 100644 beluga/Beluga/Printer/Control/index.html delete mode 100644 beluga/Beluga/Printer/Int/index.html delete mode 100644 beluga/Beluga/Printer/Int/module-type-T/index.html delete mode 100644 beluga/Beluga/Printer/index.html delete mode 100644 beluga/Beluga/Reconstruct/index.html delete mode 100644 beluga/Beluga/Recsgn/Make/argument-1-Signature_reconstruction_state/index.html delete mode 100644 beluga/Beluga/Recsgn/Make/index.html delete mode 100644 beluga/Beluga/Recsgn/Signature_reconstruction/index.html delete mode 100644 beluga/Beluga/Recsgn/index.html delete mode 100644 beluga/Beluga/Recsgn/module-type-SIGNATURE_RECONSTRUCTION/index.html delete mode 100644 beluga/Beluga/Recsgn_state/Make_signature_reconstruction_state/argument-1-Index_state/index.html delete mode 100644 beluga/Beluga/Recsgn_state/Make_signature_reconstruction_state/argument-2-Index/index.html delete mode 100644 beluga/Beluga/Recsgn_state/Make_signature_reconstruction_state/index.html delete mode 100644 beluga/Beluga/Recsgn_state/Signature_reconstruction_state/index.html delete mode 100644 beluga/Beluga/Recsgn_state/index.html delete mode 100644 beluga/Beluga/Recsgn_state/module-type-SIGNATURE_RECONSTRUCTION_STATE/index.html delete mode 100644 beluga/Beluga/Sigma/index.html delete mode 100644 beluga/Beluga/Store/Cid/Comp/Entry/index.html delete mode 100644 beluga/Beluga/Store/Cid/Comp/index.html delete mode 100644 beluga/Beluga/Store/Cid/CompConst/Entry/index.html delete mode 100644 beluga/Beluga/Store/Cid/CompConst/index.html delete mode 100644 beluga/Beluga/Store/Cid/CompCotyp/Entry/index.html delete mode 100644 beluga/Beluga/Store/Cid/CompCotyp/index.html delete mode 100644 beluga/Beluga/Store/Cid/CompDest/Entry/index.html delete mode 100644 beluga/Beluga/Store/Cid/CompDest/index.html delete mode 100644 beluga/Beluga/Store/Cid/CompTyp/Entry/index.html delete mode 100644 beluga/Beluga/Store/Cid/CompTyp/index.html delete mode 100644 beluga/Beluga/Store/Cid/CompTypDef/Entry/index.html delete mode 100644 beluga/Beluga/Store/Cid/CompTypDef/index.html delete mode 100644 beluga/Beluga/Store/Cid/DefaultRenderer/index.html delete mode 100644 beluga/Beluga/Store/Cid/NamedRenderer/index.html delete mode 100644 beluga/Beluga/Store/Cid/Schema/Entry/index.html delete mode 100644 beluga/Beluga/Store/Cid/Schema/index.html delete mode 100644 beluga/Beluga/Store/Cid/Term/Entry/index.html delete mode 100644 beluga/Beluga/Store/Cid/Term/index.html delete mode 100644 beluga/Beluga/Store/Cid/Typ/Entry/index.html delete mode 100644 beluga/Beluga/Store/Cid/Typ/index.html delete mode 100644 beluga/Beluga/Store/Cid/index.html delete mode 100644 beluga/Beluga/Store/Cid/module-type-RENDERER/index.html delete mode 100644 beluga/Beluga/Store/FCVar/index.html delete mode 100644 beluga/Beluga/Store/FVar/index.html delete mode 100644 beluga/Beluga/Store/OpPragmas/index.html delete mode 100644 beluga/Beluga/Store/index.html delete mode 100644 beluga/Beluga/Store/module-type-ENTRY/index.html delete mode 100644 beluga/Beluga/Subord/index.html delete mode 100644 beluga/Beluga/Substitution/LF/index.html delete mode 100644 beluga/Beluga/Substitution/index.html delete mode 100644 beluga/Beluga/Total/index.html delete mode 100644 beluga/Beluga/Trail/EmptyTrail/index.html delete mode 100644 beluga/Beluga/Trail/StdTrail/index.html delete mode 100644 beluga/Beluga/Trail/index.html delete mode 100644 beluga/Beluga/Trail/module-type-TRAIL/index.html delete mode 100644 beluga/Beluga/Typeinfo/Annot/index.html delete mode 100644 beluga/Beluga/Typeinfo/Comp/index.html delete mode 100644 beluga/Beluga/Typeinfo/LF/index.html delete mode 100644 beluga/Beluga/Typeinfo/Sgn/index.html delete mode 100644 beluga/Beluga/Typeinfo/index.html delete mode 100644 beluga/Beluga/Unify/EmptyTrail/index.html delete mode 100644 beluga/Beluga/Unify/Make/argument-1-T/index.html delete mode 100644 beluga/Beluga/Unify/Make/index.html delete mode 100644 beluga/Beluga/Unify/StdTrail/index.html delete mode 100644 beluga/Beluga/Unify/index.html delete mode 100644 beluga/Beluga/Unify/module-type-UNIFY/index.html delete mode 100644 beluga/Beluga/Whnf/index.html delete mode 100644 beluga/Beluga_html/Synext_html_pp/Html_printer/index.html delete mode 100644 beluga/Beluga_html/Synext_html_pp/Make_html_printer/argument-1-Html_printing_state/index.html delete mode 100644 beluga/Beluga_html/Synext_html_pp/Make_html_printer/index.html delete mode 100644 beluga/Beluga_html/Synext_html_pp/index.html delete mode 100644 beluga/Beluga_html/Synext_html_pp/module-type-HTML_PRINTER/index.html delete mode 100644 beluga/Beluga_html/Synext_html_pp_state/Html_printing_state/index.html delete mode 100644 beluga/Beluga_html/Synext_html_pp_state/index.html delete mode 100644 beluga/Beluga_html/Synext_html_pp_state/module-type-HTML_PRINTING_STATE/index.html delete mode 100644 beluga/Beluga_parser/Application_disambiguation/Make_application_disambiguation/argument-1-Expression/index.html delete mode 100644 beluga/Beluga_parser/Application_disambiguation/Make_application_disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Application_disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Application_disambiguation/module-type-APPLICATION_DISAMBIGUATION/index.html delete mode 100644 beluga/Beluga_parser/Application_disambiguation/module-type-EXPRESSION/index.html delete mode 100644 beluga/Beluga_parser/Clf_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html delete mode 100644 beluga/Beluga_parser/Clf_disambiguation/Make/argument-1-Disambiguation_state/index.html delete mode 100644 beluga/Beluga_parser/Clf_disambiguation/Make/index.html delete mode 100644 beluga/Beluga_parser/Clf_disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Clf_disambiguation/module-type-CLF_DISAMBIGUATION/index.html delete mode 100644 beluga/Beluga_parser/Clf_parser/Make/argument-1-Parser/index.html delete mode 100644 beluga/Beluga_parser/Clf_parser/Make/index.html delete mode 100644 beluga/Beluga_parser/Clf_parser/index.html delete mode 100644 beluga/Beluga_parser/Clf_parser/module-type-CLF_PARSER/index.html delete mode 100644 beluga/Beluga_parser/Common_parser/Make/argument-1-Parser/index.html delete mode 100644 beluga/Beluga_parser/Common_parser/Make/index.html delete mode 100644 beluga/Beluga_parser/Common_parser/index.html delete mode 100644 beluga/Beluga_parser/Common_parser/module-type-COMMON_PARSER/index.html delete mode 100644 beluga/Beluga_parser/Comp_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html delete mode 100644 beluga/Beluga_parser/Comp_disambiguation/Make/argument-1-Disambiguation_state/index.html delete mode 100644 beluga/Beluga_parser/Comp_disambiguation/Make/argument-2-Meta_disambiguator/index.html delete mode 100644 beluga/Beluga_parser/Comp_disambiguation/Make/index.html delete mode 100644 beluga/Beluga_parser/Comp_disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Comp_disambiguation/module-type-COMP_DISAMBIGUATION/index.html delete mode 100644 beluga/Beluga_parser/Comp_parser/Make/argument-1-Parser/index.html delete mode 100644 beluga/Beluga_parser/Comp_parser/Make/argument-2-Meta_parser/index.html delete mode 100644 beluga/Beluga_parser/Comp_parser/Make/index.html delete mode 100644 beluga/Beluga_parser/Comp_parser/index.html delete mode 100644 beluga/Beluga_parser/Comp_parser/module-type-COMP_PARSER/index.html delete mode 100644 beluga/Beluga_parser/Config_parser/index.html delete mode 100644 beluga/Beluga_parser/Disambiguation_state/Disambiguation_state/Entry/index.html delete mode 100644 beluga/Beluga_parser/Disambiguation_state/Disambiguation_state/index.html delete mode 100644 beluga/Beluga_parser/Disambiguation_state/index.html delete mode 100644 beluga/Beluga_parser/Disambiguation_state/module-type-DISAMBIGUATION_STATE/Entry/index.html delete mode 100644 beluga/Beluga_parser/Disambiguation_state/module-type-DISAMBIGUATION_STATE/index.html delete mode 100644 beluga/Beluga_parser/Disambiguation_state/module-type-ENTRY/index.html delete mode 100644 beluga/Beluga_parser/Harpoon_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html delete mode 100644 beluga/Beluga_parser/Harpoon_disambiguation/Make/argument-1-Disambiguation_state/index.html delete mode 100644 beluga/Beluga_parser/Harpoon_disambiguation/Make/argument-2-Meta_disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Harpoon_disambiguation/Make/argument-3-Comp_disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Harpoon_disambiguation/Make/index.html delete mode 100644 beluga/Beluga_parser/Harpoon_disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Harpoon_disambiguation/module-type-HARPOON_DISAMBIGUATION/index.html delete mode 100644 beluga/Beluga_parser/Harpoon_parser/Make/argument-1-Parser/index.html delete mode 100644 beluga/Beluga_parser/Harpoon_parser/Make/argument-2-Meta_parser/index.html delete mode 100644 beluga/Beluga_parser/Harpoon_parser/Make/argument-3-Comp_parser/index.html delete mode 100644 beluga/Beluga_parser/Harpoon_parser/Make/index.html delete mode 100644 beluga/Beluga_parser/Harpoon_parser/index.html delete mode 100644 beluga/Beluga_parser/Harpoon_parser/module-type-HARPOON_PARSER/index.html delete mode 100644 beluga/Beluga_parser/Lexer/index.html delete mode 100644 beluga/Beluga_parser/Lf_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html delete mode 100644 beluga/Beluga_parser/Lf_disambiguation/Make/argument-1-Disambiguation_state/index.html delete mode 100644 beluga/Beluga_parser/Lf_disambiguation/Make/index.html delete mode 100644 beluga/Beluga_parser/Lf_disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Lf_disambiguation/module-type-LF_DISAMBIGUATION/index.html delete mode 100644 beluga/Beluga_parser/Lf_parser/Make/argument-1-Parser/index.html delete mode 100644 beluga/Beluga_parser/Lf_parser/Make/index.html delete mode 100644 beluga/Beluga_parser/Lf_parser/index.html delete mode 100644 beluga/Beluga_parser/Lf_parser/module-type-LF_PARSER/index.html delete mode 100644 beluga/Beluga_parser/Located_token/index.html delete mode 100644 beluga/Beluga_parser/Make/Disambiguation/Entry/index.html delete mode 100644 beluga/Beluga_parser/Make/Disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Make/Parsing/index.html delete mode 100644 beluga/Beluga_parser/Make/argument-1-Parser_state/index.html delete mode 100644 beluga/Beluga_parser/Make/argument-2-Disambiguation_state/Entry/index.html delete mode 100644 beluga/Beluga_parser/Make/argument-2-Disambiguation_state/index.html delete mode 100644 beluga/Beluga_parser/Make/index.html delete mode 100644 beluga/Beluga_parser/Make_disambiguation/Entry/index.html delete mode 100644 beluga/Beluga_parser/Make_disambiguation/argument-1-Disambiguation_state/Entry/index.html delete mode 100644 beluga/Beluga_parser/Make_disambiguation/argument-1-Disambiguation_state/index.html delete mode 100644 beluga/Beluga_parser/Make_disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Make_parsing/argument-1-Parser_state/index.html delete mode 100644 beluga/Beluga_parser/Make_parsing/index.html delete mode 100644 beluga/Beluga_parser/Meta_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html delete mode 100644 beluga/Beluga_parser/Meta_disambiguation/Make/argument-1-Disambiguation_state/index.html delete mode 100644 beluga/Beluga_parser/Meta_disambiguation/Make/argument-2-Lf_disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Meta_disambiguation/Make/argument-3-Clf_disambiguator/index.html delete mode 100644 beluga/Beluga_parser/Meta_disambiguation/Make/index.html delete mode 100644 beluga/Beluga_parser/Meta_disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Meta_disambiguation/module-type-META_DISAMBIGUATION/index.html delete mode 100644 beluga/Beluga_parser/Meta_parser/Make/argument-1-Parser/index.html delete mode 100644 beluga/Beluga_parser/Meta_parser/Make/argument-2-Lf_parser/index.html delete mode 100644 beluga/Beluga_parser/Meta_parser/Make/argument-3-Clf_parser/index.html delete mode 100644 beluga/Beluga_parser/Meta_parser/Make/index.html delete mode 100644 beluga/Beluga_parser/Meta_parser/index.html delete mode 100644 beluga/Beluga_parser/Meta_parser/module-type-META_PARSER/index.html delete mode 100644 beluga/Beluga_parser/Parser/Disambiguation/Entry/index.html delete mode 100644 beluga/Beluga_parser/Parser/Disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Parser/Parser_state/index.html delete mode 100644 beluga/Beluga_parser/Parser/Parsing/index.html delete mode 100644 beluga/Beluga_parser/Parser/index.html delete mode 100644 beluga/Beluga_parser/Parser_combinator/Make/argument-1-State/index.html delete mode 100644 beluga/Beluga_parser/Parser_combinator/Make/index.html delete mode 100644 beluga/Beluga_parser/Parser_combinator/Make_persistent_state/argument-1-Token/index.html delete mode 100644 beluga/Beluga_parser/Parser_combinator/Make_persistent_state/index.html delete mode 100644 beluga/Beluga_parser/Parser_combinator/index.html delete mode 100644 beluga/Beluga_parser/Parser_combinator/module-type-LOCATED/index.html delete mode 100644 beluga/Beluga_parser/Parser_combinator/module-type-PARSER/index.html delete mode 100644 beluga/Beluga_parser/Parser_combinator/module-type-PARSER_STATE/index.html delete mode 100644 beluga/Beluga_parser/Signature_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html delete mode 100644 beluga/Beluga_parser/Signature_disambiguation/Make/argument-1-Disambiguation_state/index.html delete mode 100644 beluga/Beluga_parser/Signature_disambiguation/Make/argument-2-Lf_disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Signature_disambiguation/Make/argument-3-Clf_disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Signature_disambiguation/Make/argument-4-Meta_disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Signature_disambiguation/Make/argument-5-Comp_disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Signature_disambiguation/Make/argument-6-Harpoon_disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Signature_disambiguation/Make/index.html delete mode 100644 beluga/Beluga_parser/Signature_disambiguation/index.html delete mode 100644 beluga/Beluga_parser/Signature_disambiguation/module-type-SIGNATURE_DISAMBIGUATION/index.html delete mode 100644 beluga/Beluga_parser/Signature_parser/Make/argument-1-Parser/index.html delete mode 100644 beluga/Beluga_parser/Signature_parser/Make/argument-2-Lf_parser/index.html delete mode 100644 beluga/Beluga_parser/Signature_parser/Make/argument-3-Clf_parser/index.html delete mode 100644 beluga/Beluga_parser/Signature_parser/Make/argument-4-Meta_parser/index.html delete mode 100644 beluga/Beluga_parser/Signature_parser/Make/argument-5-Comp_parser/index.html delete mode 100644 beluga/Beluga_parser/Signature_parser/Make/argument-6-Harpoon_parser/index.html delete mode 100644 beluga/Beluga_parser/Signature_parser/Make/index.html delete mode 100644 beluga/Beluga_parser/Signature_parser/index.html delete mode 100644 beluga/Beluga_parser/Signature_parser/module-type-SIGNATURE_PARSER/index.html delete mode 100644 beluga/Beluga_parser/Token/index.html delete mode 100644 beluga/Beluga_parser/module-type-DISAMBIGUATION/Entry/index.html delete mode 100644 beluga/Beluga_parser/module-type-DISAMBIGUATION/index.html delete mode 100644 beluga/Beluga_parser/module-type-PARSING/index.html delete mode 100644 beluga/Harpoon/Automation/State/index.html delete mode 100644 beluga/Harpoon/Automation/index.html delete mode 100644 beluga/Harpoon/CidProgRewrite/index.html delete mode 100644 beluga/Harpoon/HarpoonState/index.html delete mode 100644 beluga/Harpoon/InputPrompt/index.html delete mode 100644 beluga/Harpoon/Io/index.html delete mode 100644 beluga/Harpoon/Options/index.html delete mode 100644 beluga/Harpoon/Prover/index.html delete mode 100644 beluga/Harpoon/Repl/index.html delete mode 100644 beluga/Harpoon/Revisit/index.html delete mode 100644 beluga/Harpoon/Serialization/index.html delete mode 100644 beluga/Harpoon/Session/index.html delete mode 100644 beluga/Harpoon/Tactic/index.html delete mode 100644 beluga/Harpoon/Theorem/Action/index.html delete mode 100644 beluga/Harpoon/Theorem/Conf/index.html delete mode 100644 beluga/Harpoon/Theorem/index.html delete mode 100644 beluga/Harpoon/Translate/index.html delete mode 100644 beluga/Optparser/Error/Argument/index.html delete mode 100644 beluga/Optparser/Error/Option/index.html delete mode 100644 beluga/Optparser/Error/index.html delete mode 100644 beluga/Support/Alternative/index.html delete mode 100644 beluga/Support/Alternative/module-type-ALTERNATIVE/index.html delete mode 100644 beluga/Support/Apply/Make/argument-1-M/index.html delete mode 100644 beluga/Support/Apply/Make/index.html delete mode 100644 beluga/Support/Apply/index.html delete mode 100644 beluga/Support/Apply/module-type-APPLY/index.html delete mode 100644 beluga/Support/Debug/Fmt/index.html delete mode 100644 beluga/Support/Debug/index.html delete mode 100644 beluga/Support/DynArray/index.html delete mode 100644 beluga/Support/Either/index.html delete mode 100644 beluga/Support/Eq/Make/argument-1-T/index.html delete mode 100644 beluga/Support/Eq/Make/index.html delete mode 100644 beluga/Support/Eq/index.html delete mode 100644 beluga/Support/Eq/module-type-EQ/index.html delete mode 100644 beluga/Support/Equality/index.html delete mode 100644 beluga/Support/Files/index.html delete mode 100644 beluga/Support/Format/index.html delete mode 100644 beluga/Support/Format_state/Make/argument-1-State/index.html delete mode 100644 beluga/Support/Format_state/Make/index.html delete mode 100644 beluga/Support/Format_state/index.html delete mode 100644 beluga/Support/Format_state/module-type-S/index.html delete mode 100644 beluga/Support/Fun/index.html delete mode 100644 beluga/Support/Functor/Make/argument-1-M/index.html delete mode 100644 beluga/Support/Functor/Make/index.html delete mode 100644 beluga/Support/Functor/index.html delete mode 100644 beluga/Support/Functor/module-type-FUNCTOR/index.html delete mode 100644 beluga/Support/Gen/IO/index.html delete mode 100644 beluga/Support/Gen/Infix/index.html delete mode 100644 beluga/Support/Gen/Restart/Infix/index.html delete mode 100644 beluga/Support/Gen/Restart/index.html delete mode 100644 beluga/Support/Gen/index.html delete mode 100644 beluga/Support/Hash/Make/argument-1-T/index.html delete mode 100644 beluga/Support/Hash/Make/index.html delete mode 100644 beluga/Support/Hash/index.html delete mode 100644 beluga/Support/Hash/module-type-HASH/index.html delete mode 100644 beluga/Support/Hashtbl/Make/argument-1-H/index.html delete mode 100644 beluga/Support/Hashtbl/Make/index.html delete mode 100644 beluga/Support/Hashtbl/MakeSeeded/argument-1-H/index.html delete mode 100644 beluga/Support/Hashtbl/MakeSeeded/index.html delete mode 100644 beluga/Support/Hashtbl/index.html delete mode 100644 beluga/Support/Hashtbl/module-type-HashedType/index.html delete mode 100644 beluga/Support/Hashtbl/module-type-S/index.html delete mode 100644 beluga/Support/Hashtbl/module-type-SeededHashedType/index.html delete mode 100644 beluga/Support/Hashtbl/module-type-SeededS/index.html delete mode 100644 beluga/Support/History/index.html delete mode 100644 beluga/Support/Imperative_state/Make/argument-1-State/index.html delete mode 100644 beluga/Support/Imperative_state/Make/index.html delete mode 100644 beluga/Support/Imperative_state/index.html delete mode 100644 beluga/Support/Imperative_state/module-type-IMPERATIVE_STATE/index.html delete mode 100644 beluga/Support/Int/Hashtbl/index.html delete mode 100644 beluga/Support/Int/index.html delete mode 100644 beluga/Support/List/MakeEq/argument-1-E/index.html delete mode 100644 beluga/Support/List/MakeEq/index.html delete mode 100644 beluga/Support/List/MakeOrd/argument-1-O/index.html delete mode 100644 beluga/Support/List/MakeOrd/index.html delete mode 100644 beluga/Support/List/MakeShow/argument-1-S/index.html delete mode 100644 beluga/Support/List/MakeShow/index.html delete mode 100644 beluga/Support/List/index.html delete mode 100644 beluga/Support/List1/MakeEq/argument-1-E/index.html delete mode 100644 beluga/Support/List1/MakeEq/index.html delete mode 100644 beluga/Support/List1/MakeOrd/argument-1-O/index.html delete mode 100644 beluga/Support/List1/MakeOrd/index.html delete mode 100644 beluga/Support/List1/MakeShow/argument-1-S/index.html delete mode 100644 beluga/Support/List1/MakeShow/index.html delete mode 100644 beluga/Support/List1/index.html delete mode 100644 beluga/Support/List2/MakeEq/argument-1-E/index.html delete mode 100644 beluga/Support/List2/MakeEq/index.html delete mode 100644 beluga/Support/List2/MakeOrd/argument-1-O/index.html delete mode 100644 beluga/Support/List2/MakeOrd/index.html delete mode 100644 beluga/Support/List2/MakeShow/argument-1-S/index.html delete mode 100644 beluga/Support/List2/MakeShow/index.html delete mode 100644 beluga/Support/List2/index.html delete mode 100644 beluga/Support/Misc/index.html delete mode 100644 beluga/Support/Monad/Make/argument-1-Monad/index.html delete mode 100644 beluga/Support/Monad/Make/index.html delete mode 100644 beluga/Support/Monad/index.html delete mode 100644 beluga/Support/Monad/module-type-MONAD/index.html delete mode 100644 beluga/Support/Option/MakeEq/argument-1-E/index.html delete mode 100644 beluga/Support/Option/MakeEq/index.html delete mode 100644 beluga/Support/Option/MakeOrd/argument-1-O/index.html delete mode 100644 beluga/Support/Option/MakeOrd/index.html delete mode 100644 beluga/Support/Option/MakeShow/argument-1-S/index.html delete mode 100644 beluga/Support/Option/MakeShow/index.html delete mode 100644 beluga/Support/Option/index.html delete mode 100644 beluga/Support/Ord/Make/argument-1-T/index.html delete mode 100644 beluga/Support/Ord/Make/index.html delete mode 100644 beluga/Support/Ord/Reverse/argument-1-Ord/index.html delete mode 100644 beluga/Support/Ord/Reverse/index.html delete mode 100644 beluga/Support/Ord/index.html delete mode 100644 beluga/Support/Ord/module-type-ORD/index.html delete mode 100644 beluga/Support/Pair/MakeEq/argument-1-E1/index.html delete mode 100644 beluga/Support/Pair/MakeEq/argument-2-E2/index.html delete mode 100644 beluga/Support/Pair/MakeEq/index.html delete mode 100644 beluga/Support/Pair/MakeOrd/argument-1-O1/index.html delete mode 100644 beluga/Support/Pair/MakeOrd/argument-2-O2/index.html delete mode 100644 beluga/Support/Pair/MakeOrd/index.html delete mode 100644 beluga/Support/Pair/MakeShow/argument-1-S1/index.html delete mode 100644 beluga/Support/Pair/MakeShow/argument-2-S2/index.html delete mode 100644 beluga/Support/Pair/MakeShow/index.html delete mode 100644 beluga/Support/Pair/index.html delete mode 100644 beluga/Support/PureStack/index.html delete mode 100644 beluga/Support/Seq/index.html delete mode 100644 beluga/Support/Show/Make/argument-1-T/index.html delete mode 100644 beluga/Support/Show/Make/index.html delete mode 100644 beluga/Support/Show/index.html delete mode 100644 beluga/Support/Show/module-type-SHOW/index.html delete mode 100644 beluga/Support/Stack/index.html delete mode 100644 beluga/Support/State/Make/argument-1-State/index.html delete mode 100644 beluga/Support/State/Make/index.html delete mode 100644 beluga/Support/State/index.html delete mode 100644 beluga/Support/State/module-type-STATE/index.html delete mode 100644 beluga/Support/String/Hashtbl/index.html delete mode 100644 beluga/Support/String/index.html delete mode 100644 beluga/Synapx/Comp/index.html delete mode 100644 beluga/Synapx/LF/index.html delete mode 100644 beluga/Syncom/Associativity/index.html delete mode 100644 beluga/Syncom/Binding_tree/index.html delete mode 100644 beluga/Syncom/Depend/index.html delete mode 100644 beluga/Syncom/Error/index.html delete mode 100644 beluga/Syncom/Fixity/index.html delete mode 100644 beluga/Syncom/Gensym/MVarData/index.html delete mode 100644 beluga/Syncom/Gensym/VarData/index.html delete mode 100644 beluga/Syncom/Gensym/index.html delete mode 100644 beluga/Syncom/Gensym/module-type-GENSYM/index.html delete mode 100644 beluga/Syncom/HoleId/Make/index.html delete mode 100644 beluga/Syncom/HoleId/index.html delete mode 100644 beluga/Syncom/Id/CompConst/Hashtbl/index.html delete mode 100644 beluga/Syncom/Id/CompConst/index.html delete mode 100644 beluga/Syncom/Id/CompCotyp/Hashtbl/index.html delete mode 100644 beluga/Syncom/Id/CompCotyp/index.html delete mode 100644 beluga/Syncom/Id/CompDest/Hashtbl/index.html delete mode 100644 beluga/Syncom/Id/CompDest/index.html delete mode 100644 beluga/Syncom/Id/CompTyp/Hashtbl/index.html delete mode 100644 beluga/Syncom/Id/CompTyp/index.html delete mode 100644 beluga/Syncom/Id/CompTypdef/Hashtbl/index.html delete mode 100644 beluga/Syncom/Id/CompTypdef/index.html delete mode 100644 beluga/Syncom/Id/Module/Hashtbl/index.html delete mode 100644 beluga/Syncom/Id/Module/index.html delete mode 100644 beluga/Syncom/Id/MutualGroup/Hashtbl/index.html delete mode 100644 beluga/Syncom/Id/MutualGroup/index.html delete mode 100644 beluga/Syncom/Id/Prog/Hashtbl/index.html delete mode 100644 beluga/Syncom/Id/Prog/index.html delete mode 100644 beluga/Syncom/Id/Schema/Hashtbl/index.html delete mode 100644 beluga/Syncom/Id/Schema/index.html delete mode 100644 beluga/Syncom/Id/Term/Hashtbl/index.html delete mode 100644 beluga/Syncom/Id/Term/index.html delete mode 100644 beluga/Syncom/Id/Typ/Hashtbl/index.html delete mode 100644 beluga/Syncom/Id/Typ/index.html delete mode 100644 beluga/Syncom/Id/index.html delete mode 100644 beluga/Syncom/Id/module-type-ID/Hashtbl/index.html delete mode 100644 beluga/Syncom/Id/module-type-ID/index.html delete mode 100644 beluga/Syncom/Identifier/Hashtbl/index.html delete mode 100644 beluga/Syncom/Identifier/index.html delete mode 100644 beluga/Syncom/Inductivity/index.html delete mode 100644 beluga/Syncom/Location/Ord_by_start/index.html delete mode 100644 beluga/Syncom/Location/Ord_by_stop/index.html delete mode 100644 beluga/Syncom/Location/index.html delete mode 100644 beluga/Syncom/Name/index.html delete mode 100644 beluga/Syncom/Operator/index.html delete mode 100644 beluga/Syncom/Parenthesizer/Make/argument-1-Format_state/index.html delete mode 100644 beluga/Syncom/Parenthesizer/Make/argument-2-Precedence/index.html delete mode 100644 beluga/Syncom/Parenthesizer/Make/index.html delete mode 100644 beluga/Syncom/Parenthesizer/index.html delete mode 100644 beluga/Syncom/Parenthesizer/module-type-PARENTHESIZER/index.html delete mode 100644 beluga/Syncom/Plicity/index.html delete mode 100644 beluga/Syncom/Position/index.html delete mode 100644 beluga/Syncom/Qualified_identifier/index.html delete mode 100644 beluga/Synext/CLF/Context/Head/index.html delete mode 100644 beluga/Synext/CLF/Context/Pattern/Head/index.html delete mode 100644 beluga/Synext/CLF/Context/Pattern/index.html delete mode 100644 beluga/Synext/CLF/Context/index.html delete mode 100644 beluga/Synext/CLF/Substitution/Head/index.html delete mode 100644 beluga/Synext/CLF/Substitution/Pattern/Head/index.html delete mode 100644 beluga/Synext/CLF/Substitution/Pattern/index.html delete mode 100644 beluga/Synext/CLF/Substitution/index.html delete mode 100644 beluga/Synext/CLF/Term/Pattern/index.html delete mode 100644 beluga/Synext/CLF/Term/index.html delete mode 100644 beluga/Synext/CLF/Typ/index.html delete mode 100644 beluga/Synext/CLF/index.html delete mode 100644 beluga/Synext/Comp/Case_branch/index.html delete mode 100644 beluga/Synext/Comp/Cofunction_branch/index.html delete mode 100644 beluga/Synext/Comp/Context/index.html delete mode 100644 beluga/Synext/Comp/Copattern/index.html delete mode 100644 beluga/Synext/Comp/Expression/index.html delete mode 100644 beluga/Synext/Comp/Kind/index.html delete mode 100644 beluga/Synext/Comp/Pattern/index.html delete mode 100644 beluga/Synext/Comp/Typ/index.html delete mode 100644 beluga/Synext/Comp/index.html delete mode 100644 beluga/Synext/Harpoon/Command/index.html delete mode 100644 beluga/Synext/Harpoon/Directive/index.html delete mode 100644 beluga/Synext/Harpoon/Hypothetical/index.html delete mode 100644 beluga/Synext/Harpoon/Proof/index.html delete mode 100644 beluga/Synext/Harpoon/Repl/Command/index.html delete mode 100644 beluga/Synext/Harpoon/Repl/index.html delete mode 100644 beluga/Synext/Harpoon/Split_branch/Label/index.html delete mode 100644 beluga/Synext/Harpoon/Split_branch/index.html delete mode 100644 beluga/Synext/Harpoon/Suffices_branch/index.html delete mode 100644 beluga/Synext/Harpoon/index.html delete mode 100644 beluga/Synext/LF/Kind/index.html delete mode 100644 beluga/Synext/LF/Term/index.html delete mode 100644 beluga/Synext/LF/Typ/index.html delete mode 100644 beluga/Synext/LF/index.html delete mode 100644 beluga/Synext/Make_precedences/Clf_precedence/Ord/index.html delete mode 100644 beluga/Synext/Make_precedences/Clf_precedence/index.html delete mode 100644 beluga/Synext/Make_precedences/Comp_expression_precedence/Ord/index.html delete mode 100644 beluga/Synext/Make_precedences/Comp_expression_precedence/index.html delete mode 100644 beluga/Synext/Make_precedences/Comp_pattern_precedence/Ord/index.html delete mode 100644 beluga/Synext/Make_precedences/Comp_pattern_precedence/index.html delete mode 100644 beluga/Synext/Make_precedences/Comp_sort_precedence/Ord/index.html delete mode 100644 beluga/Synext/Make_precedences/Comp_sort_precedence/index.html delete mode 100644 beluga/Synext/Make_precedences/Lf_precedence/Ord/index.html delete mode 100644 beluga/Synext/Make_precedences/Lf_precedence/index.html delete mode 100644 beluga/Synext/Make_precedences/Schema_precedence/Ord/index.html delete mode 100644 beluga/Synext/Make_precedences/Schema_precedence/index.html delete mode 100644 beluga/Synext/Make_precedences/argument-1-S/index.html delete mode 100644 beluga/Synext/Make_precedences/index.html delete mode 100644 beluga/Synext/Make_printer/argument-1-Printing_state/index.html delete mode 100644 beluga/Synext/Make_printer/index.html delete mode 100644 beluga/Synext/Meta/Context/index.html delete mode 100644 beluga/Synext/Meta/Object/index.html delete mode 100644 beluga/Synext/Meta/Pattern/index.html delete mode 100644 beluga/Synext/Meta/Schema/index.html delete mode 100644 beluga/Synext/Meta/Typ/index.html delete mode 100644 beluga/Synext/Meta/index.html delete mode 100644 beluga/Synext/Printer/index.html delete mode 100644 beluga/Synext/Printing_state/index.html delete mode 100644 beluga/Synext/Signature/Declaration/index.html delete mode 100644 beluga/Synext/Signature/Entry/index.html delete mode 100644 beluga/Synext/Signature/Global_pragma/index.html delete mode 100644 beluga/Synext/Signature/Pragma/index.html delete mode 100644 beluga/Synext/Signature/Totality/Declaration/index.html delete mode 100644 beluga/Synext/Signature/Totality/Order/index.html delete mode 100644 beluga/Synext/Signature/Totality/index.html delete mode 100644 beluga/Synext/Signature/index.html delete mode 100644 beluga/Synext/module-type-BASE_PRECEDENCE/Ord/index.html delete mode 100644 beluga/Synext/module-type-BASE_PRECEDENCE/index.html delete mode 100644 beluga/Synext/module-type-PRECEDENCE_STATE/index.html delete mode 100644 beluga/Synext/module-type-PRINTER/index.html delete mode 100644 beluga/Synext/module-type-PRINTING_STATE/index.html delete mode 100644 beluga/Synint/Comp/SubgoalPath/index.html delete mode 100644 beluga/Synint/Comp/index.html delete mode 100644 beluga/Synint/LF/index.html delete mode 100644 beluga/Synint/Sgn/index.html delete mode 100644 beluga/Synprs/CLF/Context_object/Head/index.html delete mode 100644 beluga/Synprs/CLF/Context_object/index.html delete mode 100644 beluga/Synprs/CLF/Object/index.html delete mode 100644 beluga/Synprs/CLF/index.html delete mode 100644 beluga/Synprs/Comp/Context_object/index.html delete mode 100644 beluga/Synprs/Comp/Copattern_object/index.html delete mode 100644 beluga/Synprs/Comp/Expression_object/index.html delete mode 100644 beluga/Synprs/Comp/Pattern_object/index.html delete mode 100644 beluga/Synprs/Comp/Sort_object/index.html delete mode 100644 beluga/Synprs/Comp/index.html delete mode 100644 beluga/Synprs/Harpoon/Command/index.html delete mode 100644 beluga/Synprs/Harpoon/Directive/index.html delete mode 100644 beluga/Synprs/Harpoon/Hypothetical/index.html delete mode 100644 beluga/Synprs/Harpoon/Proof/index.html delete mode 100644 beluga/Synprs/Harpoon/Repl/Command/index.html delete mode 100644 beluga/Synprs/Harpoon/Repl/index.html delete mode 100644 beluga/Synprs/Harpoon/Split_branch/Label/index.html delete mode 100644 beluga/Synprs/Harpoon/Split_branch/index.html delete mode 100644 beluga/Synprs/Harpoon/Suffices_branch/index.html delete mode 100644 beluga/Synprs/Harpoon/index.html delete mode 100644 beluga/Synprs/LF/Object/index.html delete mode 100644 beluga/Synprs/LF/index.html delete mode 100644 beluga/Synprs/Meta/Context_object/index.html delete mode 100644 beluga/Synprs/Meta/Schema_object/index.html delete mode 100644 beluga/Synprs/Meta/Thing/index.html delete mode 100644 beluga/Synprs/Meta/index.html delete mode 100644 beluga/Synprs/Signature/Declaration/index.html delete mode 100644 beluga/Synprs/Signature/Entry/index.html delete mode 100644 beluga/Synprs/Signature/Global_pragma/index.html delete mode 100644 beluga/Synprs/Signature/Pragma/index.html delete mode 100644 beluga/Synprs/Signature/Totality/Declaration/index.html delete mode 100644 beluga/Synprs/Signature/Totality/Order/index.html delete mode 100644 beluga/Synprs/Signature/Totality/index.html delete mode 100644 beluga/Synprs/Signature/index.html diff --git a/beluga/Beluga/Abstract/index.html b/beluga/Beluga/Abstract/index.html deleted file mode 100644 index 5ec0a261d..000000000 --- a/beluga/Beluga/Abstract/index.html +++ /dev/null @@ -1,70 +0,0 @@ - -Abstract (beluga.Beluga.Abstract)

Module Beluga.Abstract

modified: Joshua Dunfield

type kind =
  1. | MMV of Beluga_syntax.Name.t * Beluga_syntax.Synint.LF.iterm option Stdlib.ref
  2. | FV of Beluga_syntax.Name.t
type error =
  1. | LeftoverVars
  2. | LeftoverConstraints
  3. | CyclicDependency of kind
  4. | UnknownIdentifier
  5. | UnknownMTyp of Beluga_syntax.Name.t
type marker =
  1. | Pure of sort
  2. | Impure
exception Error of Beluga_syntax.Location.t * error
val fmt_ppr_collection : Support.Format.formatter -> fctx -> unit
diff --git a/beluga/Beluga/Apxnorm/index.html b/beluga/Beluga/Apxnorm/index.html deleted file mode 100644 index 6290f43a9..000000000 --- a/beluga/Beluga/Apxnorm/index.html +++ /dev/null @@ -1,255 +0,0 @@ - -Apxnorm (beluga.Beluga.Apxnorm)

Module Beluga.Apxnorm

val dprint : (unit -> string) Support.Debug.io
type error =
  1. | CtxOverGeneral
  2. | IndexInvariantFailed of Support.Format.formatter -> unit -> unit
exception Error of Beluga_syntax.Location.t * error
val throw : Beluga_syntax.Location.t -> error -> 'a
val lengthApxMCtx : 'a Beluga_syntax.Synint.LF.ctx -> int
val shiftApxTerm : - int -> - Beluga_syntax.Apx.LF.normal -> - Beluga_syntax.Apx.LF.normal
val shiftApxHead : - int -> - Beluga_syntax.Apx.LF.head -> - Beluga_syntax.Apx.LF.head
val shiftApxSpine : - int -> - Beluga_syntax.Apx.LF.spine -> - Beluga_syntax.Apx.LF.spine
val collectApxTerm : - Syncom.Name.t list -> - Beluga_syntax.Apx.LF.normal -> - Syncom.Name.t list
val collectApxTuple : - Syncom.Name.t list -> - Beluga_syntax.Apx.LF.tuple -> - Syncom.Name.t list
val collectApxHead : - Syncom.Name.t list -> - Beluga_syntax.Apx.LF.head -> - Syncom.Name.t list
val collectApxSubOpt : - Syncom.Name.t list -> - Beluga_syntax.Apx.LF.sub option -> - Syncom.Name.t list
val collectApxSub : - Syncom.Name.t list -> - Beluga_syntax.Apx.LF.sub -> - Syncom.Name.t list
val collectApxSpine : - Syncom.Name.t list -> - Beluga_syntax.Apx.LF.spine -> - Syncom.Name.t list
val collectApxTypDecl : - Syncom.Name.t list -> - Beluga_syntax.Apx.LF.typ_decl -> - Syncom.Name.t list
val collectApxDCtx : - Syncom.Name.t list -> - Beluga_syntax.Apx.LF.dctx -> - Syncom.Name.t list
val collectApxHat : - Syncom.Name.t list -> - (Beluga_syntax.Int.LF.ctx_var option * 'a) -> - Syncom.Name.t list
val collectApxCTypDecl : - Syncom.Name.t list -> - Beluga_syntax.Apx.LF.ctyp_decl -> - Syncom.Name.t list
val collectApxMetaObj : - Syncom.Name.t list -> - Beluga_syntax.Apx.Comp.meta_obj -> - Syncom.Name.t list
val collectApxMetaSpine : - Syncom.Name.t list -> - Beluga_syntax.Apx.Comp.meta_spine -> - Syncom.Name.t list
val collectApxTyp : - Syncom.Name.t list -> - Beluga_syntax.Apx.LF.typ -> - Syncom.Name.t list
val collectApxTypRec : - Syncom.Name.t list -> - Beluga_syntax.Apx.LF.typ_rec -> - Syncom.Name.t list
val collectApxCDecl : - Syncom.Name.t list -> - Beluga_syntax.Apx.LF.ctyp_decl -> - Syncom.Name.t list
val collectApxCompTyp : - Syncom.Name.t list -> - Beluga_syntax.Apx.Comp.typ -> - Syncom.Name.t list
val collectApxPattern : - Syncom.Name.t list -> - Beluga_syntax.Apx.Comp.pattern -> - Syncom.Name.t list
val collectApxPatSpine : - Syncom.Name.t list -> - Beluga_syntax.Apx.Comp.pattern_spine -> - Syncom.Name.t list
val fmvApxSub : - Beluga_syntax.Name.t list -> - Beluga_syntax.Synint.LF.mctx -> - (int * int * int) -> - Beluga_syntax.Apx.LF.sub -> - Beluga_syntax.Apx.LF.sub
val fmvApxTyp : - Beluga_syntax.Name.t list -> - Beluga_syntax.Synint.LF.mctx -> - (int * int * int) -> - Beluga_syntax.Apx.LF.typ -> - Beluga_syntax.Apx.LF.typ
val fmvApxHat : - Beluga_syntax.Location.t -> - Beluga_syntax.Name.t list -> - Beluga_syntax.Synint.LF.mctx -> - (int * int * int) -> - (Beluga_syntax.Int.LF.ctx_var option * 'a) -> - Beluga_syntax.Int.LF.ctx_var option * 'a
val fmvApxExp : - Syncom.Name.t list -> - Beluga_syntax.Synint.LF.mctx -> - (int * int * int) -> - Beluga_syntax.Apx.Comp.exp -> - Beluga_syntax.Apx.Comp.exp
val fmvApxBranches : - Syncom.Name.t list -> - Beluga_syntax.Synint.LF.mctx -> - (int * int * int) -> - Beluga_syntax.Apx.Comp.branch list -> - Beluga_syntax.Apx.Comp.branch list
val fmvApxBranch : - Syncom.Name.t list -> - Beluga_syntax.Synint.LF.mctx -> - (int * int * int) -> - Beluga_syntax.Apx.Comp.branch -> - Beluga_syntax.Apx.Comp.branch
diff --git a/beluga/Beluga/Chatter/index.html b/beluga/Beluga/Chatter/index.html deleted file mode 100644 index ce57b6042..000000000 --- a/beluga/Beluga/Chatter/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Chatter (beluga.Beluga.Chatter)

Module Beluga.Chatter

val level : int Stdlib.ref
val print : int -> (Support.Format.formatter -> unit) -> unit
diff --git a/beluga/Beluga/Check/Comp/index.html b/beluga/Beluga/Check/Comp/index.html deleted file mode 100644 index 9cbdf2cc9..000000000 --- a/beluga/Beluga/Check/Comp/index.html +++ /dev/null @@ -1,124 +0,0 @@ - -Comp (beluga.Beluga.Check.Comp)

Module Check.Comp

type typeVariant =
  1. | VariantCross
  2. | VariantArrow
  3. | VariantCtxPi
  4. | VariantPiBox
  5. | VariantBox
type mismatch_kind = [
  1. | `fn
  2. | `mlam
  3. | `box
  4. | `ctxfun
  5. | `tuple
]
type error =
  1. | IllegalParamTyp of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.typ
  2. | MismatchChk of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.Comp.gctx - * Beluga_syntax.Synint.Comp.exp - * Beluga_syntax.Synint.Comp.tclo - * Beluga_syntax.Synint.Comp.tclo
  3. | MismatchSyn of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.Comp.gctx - * Beluga_syntax.Synint.Comp.exp - * typeVariant - * Beluga_syntax.Synint.Comp.tclo
  4. | PatIllTyped of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.Comp.gctx - * Beluga_syntax.Synint.Comp.pattern - * Beluga_syntax.Synint.Comp.tclo - * Beluga_syntax.Synint.Comp.tclo
  5. | BasicMismatch of mismatch_kind - * Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.Comp.gctx - * Beluga_syntax.Synint.Comp.tclo
  6. | SBoxMismatch of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.Comp.gctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.dctx
  7. | SynMismatch of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.Comp.tclo - * Beluga_syntax.Synint.Comp.tclo
  8. | TypMismatch of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.Comp.tclo - * Beluga_syntax.Synint.Comp.tclo
  9. | UnsolvableConstraints of Beluga_syntax.Name.t option * string
  10. | InvalidRecCall
  11. | NotRecursiveSrc of Beluga_syntax.Name.t
  12. | NotRecursiveDst of Beluga_syntax.Name.t
  13. | MissingTotal of Beluga_syntax.Id.cid_prog
  14. | NotImpossible of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.Comp.gctx - * Beluga_syntax.Synint.Comp.typ - * Beluga_syntax.Synint.Comp.exp
  15. | InvalidHypotheses of Beluga_syntax.Synint.Comp.hypotheses - * Beluga_syntax.Synint.Comp.hypotheses
  16. | SufficesDecompositionFailed of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.Comp.typ
  17. | SufficesLengthsMismatch of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.Comp.typ - * int - * int
  18. | SufficesBadAnnotation of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.Comp.typ - * int - * Beluga_syntax.Synint.Comp.typ
  19. | SufficesBadGoal of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.Comp.typ - * Beluga_syntax.Synint.Comp.typ
  20. | SufficesPremiseNotClosed of Beluga_syntax.Synint.LF.mctx - * int - * Beluga_syntax.Synint.Comp.suffices_typ
exception Error of Beluga_syntax.Location.t * error
val throw : Beluga_syntax.Location.t -> error -> 'a

Raises an error from this module.

Appends two sets of hypotheses. Appropriately MShifts the left contexts and applies an appropriate totality shift.

Transforms the given contextual type according the an unboxing modifier. The returned substitution witnesses the transformation of the type. It should be applied to the metavariable of the computed type in order for it to make sense in the original context. For example, suppose apply_unbox_modifier cD `Strengthen cU = cU', s If we want X : cU' to make sense in its original LF context, then it suffices to apply Xs. This substitution is used by the translation from proofs into programs.

Variant of apply_unbox_modifier that is the identity when no modifier is specified.

Verifies that the pairs of contexts are convertible. It is a user error InvalidHypotheses if they are not. If the contexts are convertible, then they are merged, using plicity and type information from the context on the left, but the entry name from the context on the right.

Checks a theorem in the given contexts against the given type. The given list of total declarations is used for totality checking. The cid_comp_const parameter is used for registering Harpoon subgoals. For ordinary Beluga programs or for complete Harpoon proofs, this argument can be None.

val wf_mctx : Beluga_syntax.Synint.LF.mctx -> unit

Transforms the given meta-context by marking all meta-variables appearing in the pattern as Inductive.

This function relies on numerous (non-exported; 87 lines total) helpers to traverse the syntax tree. I believe that there is an opportunity to refactor this and move it to a different module. -je

Analyzes a contextual object to decide whether it's a (contextual) variable and rewrites its type from MTyp to PTyp if necessary. This is crucial for coverage checking of a case analysis on a parameter variable. Also returns the index of the variable (so we can later decide if it's a variable we're doing induction on) as well what projection, if any, is applied to the parameter variable.

Transfers inductivity annotations from a source context to a target context related by a meta-substitution.

id_map_ind cD' t cD = cD'* where cD' |- t : cD

unroll cD cG cIH tau = (cD', cG', cIH', tau', t) where cD |- cG <= ctx and cD |- tau <= type s.t. cD' extends cD and cG' extends cG and tau' is a subterm of tau and tau' is not an arrow nor a PiBox type and cD' |- t : cD is a weakening meta-substitution. and cD' |- cIH' ihctx and cIH' is appropriately shifted

Requires that the given type be a box-type. require_syn_typbox cD cG loc i (tau, t) = (cU, t) if tau = cU; else, raises a synthesis mismatch error for the expression i saying that the type of i is expected to be a box-type.

Processes all leading PiBoxes to replace them with unification variables in the following type, and returns a further decomposition of the type remaining after all these PiBoxes, which must consist only of simple function types (or a base type).

Given cD |- tau <= type and tau = Pi X_1:U_1. ... Pi X_n:U_n. tau' and tau' = tau_1 -> tau_2 -> ... -> tau_k (so cD, X_1:U_1, ..., X_n:U_n |- tau' <= type) `decompose_function_type cD tau` calculates an msub t such that cD |- t : cD, X_1:U_1, ..., X_n:U_n that replaces each X_i with a fresh unification variable ?X_i. The msub t is applied to tau' and tau' is further decomposed into a list l = [t]tau_1; [t]tau_2; ...; [t]tau_(k-1). This list is returned together with the type ttau_k. If the decomposition fails due to an interleaving of PiBox-types and arrow-types, None is returned.

Checks that the given type annotations are compatible with a given function type.

unify_suffices cD tau_i tau_anns tau_g requires 1. cD |- tau_i <= type 2. for each stau in tau_anns, if stau = `exact tau, then cD |- tau <= type (for each type in the list) 3. cD |- tau_g <= type It decomposes the function type tau_i (see decompose_function_type) and appropriately unifies the decomposition with the given type annotations so as to pin down all instantiations of universally quantified variables. Some type annotations may be omitted. The interpretation of an omitted annotation is that that annotation is not necessary (the type of that argument is already determined by unification of the goal, or other annotations).

Returns the list of elaborated premise types, which are guaranteed to be closed (no MMVars).

The provided location is used when raising errors.

Generates a meta-application spine consisting of unification variables to eliminate leading PiBox types. Returns the number of generated unification variables as well as the type (together with a delayed meta-substitution) of the produced expression.

diff --git a/beluga/Beluga/Check/LF/index.html b/beluga/Beluga/Check/LF/index.html deleted file mode 100644 index a826134c3..000000000 --- a/beluga/Beluga/Check/LF/index.html +++ /dev/null @@ -1,93 +0,0 @@ - -LF (beluga.Beluga.Check.LF)

Module Check.LF

type error =
  1. | CtxVarMisCheck of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.tclo - * Beluga_syntax.Name.t - * Beluga_syntax.Int.LF.schema
  2. | CtxVarMismatch of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.ctx_var - * Beluga_syntax.Name.t - * Beluga_syntax.Int.LF.schema
  3. | CtxVarDiffer of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.ctx_var - * Beluga_syntax.Int.LF.ctx_var
  4. | CheckError of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.nclo - * Beluga_syntax.Int.LF.tclo
  5. | TupleArity of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.nclo - * Beluga_syntax.Int.LF.trec_clo
  6. | SigmaMismatch of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.trec_clo - * Beluga_syntax.Int.LF.trec_clo
  7. | KindMismatch of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.sclo - * Beluga_syntax.Int.LF.kind * Beluga_syntax.Int.LF.sub
  8. | TypMismatch of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.nclo - * Beluga_syntax.Int.LF.tclo - * Beluga_syntax.Int.LF.tclo
  9. | IllTypedSub of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.sub - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.normal option
  10. | SpineIllTyped of int * int
  11. | LeftoverFV of Beluga_syntax.Name.t
  12. | ParamVarInst of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.tclo
  13. | CtxHatMismatch of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.dctx_hat - * Beluga_syntax.Location.t * Beluga_syntax.Int.LF.mfront
  14. | IllTypedMetaObj of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.clobj - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.cltyp
  15. | TermWhenVar of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.normal
  16. | SubWhenRen of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.sub
  17. | MissingType of string
exception Error of Beluga_syntax.Location.t * error
val throw : Beluga_syntax.Location.t -> error -> 'a
val checkSchemaWf : Beluga_syntax.Int.LF.schema -> unit

Checks that a type exists within a given schema. checkTypeAgainstSchema loc cD cPsi tA name es = (tR, s) if cD; cPsi |- tA <== type and tA is an instance of one of the schema elements es. If not, an error will the raised with the given location. The input name will be a part of the error message, and should be the declared name of the schema.

diff --git a/beluga/Beluga/Check/index.html b/beluga/Beluga/Check/index.html deleted file mode 100644 index 4c0b49668..000000000 --- a/beluga/Beluga/Check/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Check (beluga.Beluga.Check)

Module Beluga.Check

modified: Joshua Dunfield

module LF : sig ... end
module Comp : sig ... end
diff --git a/beluga/Beluga/Command/index.html b/beluga/Beluga/Command/index.html deleted file mode 100644 index 6bf5b6a07..000000000 --- a/beluga/Beluga/Command/index.html +++ /dev/null @@ -1,5 +0,0 @@ - -Command (beluga.Beluga.Command)

Module Beluga.Command

type state
val fprintf : - state -> - ('a, Stdlib.Format.formatter, Stdlib.Unit.t) Stdlib.format -> - 'a
val create_initial_state : Stdlib.Unit.t -> state
val print_usage : state -> Stdlib.Unit.t
val interpret_command : state -> input:Stdlib.String.t -> Stdlib.Unit.t
val load : state -> filename:Stdlib.String.t -> Synint.Sgn.sgn
diff --git a/beluga/Beluga/Context/index.html b/beluga/Beluga/Context/index.html deleted file mode 100644 index e86a2953e..000000000 --- a/beluga/Beluga/Context/index.html +++ /dev/null @@ -1,114 +0,0 @@ - -Context (beluga.Beluga.Context)

Module Beluga.Context

Contexts

exception NoTypAvailable

Function form of the LF.Dec constructor with the arguments reversed. Useful for extending contexts multiple times without the need for parentheses.

cD |> Context.dec ... |> Context.dec ...
val decs : - 'a list -> - 'a Beluga_syntax.Synint.LF.ctx -> - 'a Beluga_syntax.Synint.LF.ctx

Extends a context with multiple entries from left to right. That is,

ctx |> decs [ d1; d2; d3 ]

is equivalent to

ctx |> dec d1 |> dec d2 |> dec d3
val containsSigma : Beluga_syntax.Synint.LF.dctx -> bool
val hasCtxVar : Beluga_syntax.Synint.LF.dctx -> bool
val fold : 'b -> ('b -> 'a -> 'b) -> 'a Beluga_syntax.Synint.LF.ctx -> 'b

General eliminator for contexts.

val map : - ('a -> 'b) -> - 'a Beluga_syntax.Synint.LF.ctx -> - 'b Beluga_syntax.Synint.LF.ctx

Lift a function into contexts.

val to_list_map_rev : - 'a Beluga_syntax.Synint.LF.ctx -> - ('a Beluga_syntax.Synint.LF.ctx -> 'a -> 'b) -> - 'b list
val to_list_map : - 'a Beluga_syntax.Synint.LF.ctx -> - ('a Beluga_syntax.Synint.LF.ctx -> 'a -> 'b) -> - 'b list
val to_list_rev : 'a Beluga_syntax.Synint.LF.ctx -> 'a list
val to_list : 'a Beluga_syntax.Synint.LF.ctx -> 'a list
val to_sublist : - 'a Beluga_syntax.Synint.LF.ctx -> - ('a Beluga_syntax.Synint.LF.ctx * 'a) list
val to_sublist_rev : - 'a Beluga_syntax.Synint.LF.ctx -> - ('a Beluga_syntax.Synint.LF.ctx * 'a) list
val of_list_map : 'a list -> ('a -> 'b) -> 'b Beluga_syntax.Synint.LF.ctx
val of_list_map_rev : 'a list -> ('a -> 'b) -> 'b Beluga_syntax.Synint.LF.ctx
val of_list : 'a list -> 'a Beluga_syntax.Synint.LF.ctx
val of_list_rev : 'a list -> 'a Beluga_syntax.Synint.LF.ctx
val iter : - 'a Beluga_syntax.Synint.LF.ctx -> - ('a Beluga_syntax.Synint.LF.ctx -> 'a -> unit) -> - unit
val iter' : 'a Beluga_syntax.Synint.LF.ctx -> ('a -> unit) -> unit
val iter_rev : - 'a Beluga_syntax.Synint.LF.ctx -> - ('a Beluga_syntax.Synint.LF.ctx -> 'a -> unit) -> - unit
val iter_rev' : 'a Beluga_syntax.Synint.LF.ctx -> ('a -> unit) -> unit
val length : 'a Beluga_syntax.Synint.LF.ctx -> int
val dctxLength : Beluga_syntax.Synint.LF.dctx -> int
val find : - 'a Beluga_syntax.Synint.LF.ctx -> - ('a Beluga_syntax.Synint.LF.ctx -> 'a -> bool) -> - 'a option
val find' : 'a Beluga_syntax.Synint.LF.ctx -> ('a -> bool) -> 'a option
val find_rev : - 'a Beluga_syntax.Synint.LF.ctx -> - ('a Beluga_syntax.Synint.LF.ctx -> 'a -> bool) -> - 'a option
val find_rev' : 'a Beluga_syntax.Synint.LF.ctx -> ('a -> bool) -> 'a option
val find_index : - 'a Beluga_syntax.Synint.LF.ctx -> - ('a Beluga_syntax.Synint.LF.ctx -> 'a -> bool) -> - int option
val find_index' : 'a Beluga_syntax.Synint.LF.ctx -> ('a -> bool) -> int option
val find_index_rev : - 'a Beluga_syntax.Synint.LF.ctx -> - ('a Beluga_syntax.Synint.LF.ctx -> 'a -> bool) -> - int option
val find_index_rev' : - 'a Beluga_syntax.Synint.LF.ctx -> - ('a -> bool) -> - int option
val find_with_index : - 'a Beluga_syntax.Synint.LF.ctx -> - ('a Beluga_syntax.Synint.LF.ctx -> ('a * int) -> bool) -> - ('a * int) option

Finds the leftmost element of the context, together with its index, satisfying the given predicate

val find_with_index' : - 'a Beluga_syntax.Synint.LF.ctx -> - (('a * int) -> bool) -> - ('a * int) option
val find_with_index_rev : - 'a Beluga_syntax.Synint.LF.ctx -> - ('a Beluga_syntax.Synint.LF.ctx -> ('a * int) -> bool) -> - ('a * int) option
val find_with_index_rev' : - 'a Beluga_syntax.Synint.LF.ctx -> - (('a * int) -> bool) -> - ('a * int) option
val lookup' : 'a Beluga_syntax.Synint.LF.ctx -> int -> 'a option

Looks up an index in a meta-context, giving the type and `inductivity` field.

  • Warning: This function does not MShift the type it returns; typically you should do this so the type makes sense in the whole context Delta.
  • Warning: returns None if the index is out of bounds OR if the context declaration does not assign a type (i.e. it's a DeclOpt). If you need to distinguish these cases, then you should use lookup' and match on the ctyp_decl yourself.

Renames a variable in a meta-context. Returns None if there is no such variable, and otherwise returns the adjusted context with the name changed.

Renames a variable in a computational context. Returns None if there is no such variable, and otherwise returns the adjusted context with the name changed.

Erases an LF context to a list of names. To be used in preparation for contextual name generation. See nameGen.ml.

Erases a meta-context to a list of names. To be used in preparation for contextual name generation. See nameGen.ml.

Erases a program context to a list of names. To be used in preparation for contextual name generation. See nameGen.ml.

val names_of_proof_state : - Beluga_syntax.Synint.Comp.proof_state -> - Beluga_syntax.Name.t list

Computes the names in a proof state. This is the names from the meta-context and the program context. To be used in preparation for contextual name generation. See nameGen.ml.

val is_null : Beluga_syntax.Synint.LF.dctx -> bool
val is_empty : 'a Beluga_syntax.Synint.LF.ctx -> bool

Given two convertible meta-contexts, rebuilds the first using the names in the second.

Given two convertible computational contexts, rebuilds the first using the names in the second.

diff --git a/beluga/Beluga/ConvSigma/index.html b/beluga/Beluga/ConvSigma/index.html deleted file mode 100644 index e67de4486..000000000 --- a/beluga/Beluga/ConvSigma/index.html +++ /dev/null @@ -1,26 +0,0 @@ - -ConvSigma (beluga.Beluga.ConvSigma)

Module Beluga.ConvSigma

type t
val fmt_ppr_conv_list : Stdlib.Format.formatter -> t -> unit

Translates a bound variable index according to the sigma conversion.

val gen_proj_sub : t -> Beluga_syntax.Synint.LF.sub
val gen_tup_sub : t -> Beluga_syntax.Synint.LF.sub
val gen_proj_sub' : t -> Beluga_syntax.Synint.LF.sub
val gen_tup_sub' : t -> Beluga_syntax.Synint.LF.sub

Constructs a unification variable for the given tclo, strengthening its type.

Constructs a unification parameter variable for a given tclo, strengthening its type.

gen_flattening cD cPsi = (cPhi, lazy s_proj, lazy s_tup) Generates a flattened LF context cPhi in which all blocks present in cPsi have been decomposed. Packing and unpacking substitutions s_proj and s_tup are lazily computed to mediate between the contexts. Specifically: if cD |- cPsi ctx then cD |- cPhi ctx such that cD ; cPsi |- s_proj : cPhi cD ; cPhi |- s_tup : cPsi

The naming of s_proj and s_tup is based on what kind of terms these substitutions *contain*; e.g. s_proj contains projections, so it takes us from the block context to the flat context.

diff --git a/beluga/Beluga/Coverage/index.html b/beluga/Beluga/Coverage/index.html deleted file mode 100644 index 5caf58748..000000000 --- a/beluga/Beluga/Coverage/index.html +++ /dev/null @@ -1,48 +0,0 @@ - -Coverage (beluga.Beluga.Coverage)

Module Beluga.Coverage

type error =
  1. | NoCover of string
  2. | MatchError of string
  3. | NothingToRefine
  4. | NoCoverageGoalsGenerated
type cov_goal =
  1. | CovGoal of LF.dctx * LF.normal * LF.tclo
  2. | CovCtx of LF.dctx
  3. | CovSub of LF.dctx * LF.sub * LF.cltyp
  4. | CovPatt of Comp.gctx * Comp.pattern * Comp.tclo
type 'a inside = LF.mctx * 'a * LF.msub
type gen_pat_var_strategy
val withPatFVar : gen_pat_var_strategy
val withPatVar : gen_pat_var_strategy
val map_inside : ('a -> 'b) -> 'a inside -> 'b inside
exception Error of Beluga_syntax.Location.t * error
val enableCoverage : bool Stdlib.ref
val warningOnly : bool Stdlib.ref
val no_covers : int Stdlib.ref
type problem
val make : - Beluga_syntax.Location.t -> - Comp.case_pragma -> - LF.mctx -> - Comp.branch list -> - Comp.typ -> - Comp.meta_obj option -> - problem
type coverage_result =
  1. | Success
  2. | Failure of string
type depend =
  1. | Atomic
  2. | Dependent
val map : (coverage_result -> 'a) -> 'a list
val iter : (coverage_result -> unit) -> unit
val process : problem -> int option -> unit
val genNthSchemaElemGoal : - Beluga_syntax.Name.t list -> - LF.mctx -> - int -> - Beluga_syntax.Id.cid_schema -> - LF.dctx inside option

Generates the coverage goal for the nth schema element in the given schema. WARNING: Schema element indices are 1-based!

genNthSchemaElemGoal cD n w = Some (cD', cPsi, t)

  • provided n is a valid index for the schema elements of w
  • cD' |- t : cD
  • cD' |- cPsi dctx is the pattern for this case
  • cD' will contain an extra context variable (see remark below) as well as new variables for each of the existential variables for the schema element that is looked up.

Returns None if the schema element index n is out of bounds.

Remark: this function will internally extend cD with an additional (dummy) context variable. Unification for dependent pattern matching (see Reconstruct.synPatRefine) eliminates this extra variable later. However, the preliminary branch context

val genPVarGoal : - LF.sch_elem -> - LF.mctx -> - LF.dctx -> - LF.ctx_var -> - (LF.dctx * LF.head * LF.typ) inside

genPVarGoal sch_elem cD cPsi psi = (cD', cPsi', h, tA', t) calculates a preliminary branch context for a parameter variable referring to the given schema element, without taking projection into account.

cD |- cPsi ctx cD |- psi ctxvar cD' |- t : cD cD' |- cPsi' ctx cD'; cPsi' |- h <= tA' and h is an LF head, namely the PVar for this case.

The resulting meta-context cD' will contain an entry for the PVar itself as well as for any existential variables bound by the schema element. The returned substitution t is an appropriate weakening.

val genObj : - (LF.mctx * LF.dctx * LF.typ) -> - (LF.head * LF.typ * int) -> - (LF.dctx * LF.normal * LF.tclo) inside option

genObj (cD, cPsi, tP) (tH, tA) = (cD', CovGoal (cPsi', tR, tP'), ms)

if cD; cPsi |- tH => tA and there exists a spine tS s.t. cD; cPsi |- tS : tA > tP then tR = Root (tH, tS) and cD'; tcPsi |- tR <= ttP and cD' |- t : cD

Concretely, this function is used to generate a pattern for a meta-object in splitting. tP is the type of the scrutinee, which is unified against the conclusion type of tA. tA, being the type of the head tH, is typically a pi-type, so we walk it to construct a spine by calling genSpine. Together with the given head, this generated spine is used to form the normal tR that is returned. Since this unification can eliminate variables, the resulting normal makes sense inside the "branch context" cD', so the msub t together with its target context cD' are also returned.

genPatt (cD, tau_i) (c, tau_c) = None | Some (cD', (cG, pat, ttau_p), t) generates a pattern with the given constructor c that matches the type tau_i.

If cD |- tau_i <= type .; . |- c <= tau_c

then genPatt tries to generate a spine S such that pat = c S

cD'; cG |- pat <= ttau_p cD' |- t : cD (cD' |- ttau_p <= type) (cD' |- cG <= gctx)

This process can fail, if ttau_p is not unifiable with the conclusion type of tau_c, in which case the constructor `c` is impossible for the scrutinee type `tau_i`.

The given list of names are those in the current scope, to ensure that generated names do not shadow.

val genPatCGoals : - Beluga_syntax.Name.t list -> - gen_pat_var_strategy -> - LF.mctx -> - Comp.typ -> - (Comp.gctx * Comp.pattern * Comp.tclo) inside list
val genCGoals : - LF.mctx -> - LF.ctyp -> - (LF.mctx * cov_goal * LF.msub) list * depend
val genCovGoals : - (LF.mctx * LF.dctx * LF.typ) -> - (LF.dctx * LF.normal * LF.tclo) inside list
val genBCovGoals : - (LF.mctx * LF.dctx * LF.typ) -> - (LF.dctx * LF.normal * LF.tclo) inside list
val genBVar : - (LF.mctx * LF.dctx * LF.typ) -> - int -> - (LF.dctx * LF.normal * LF.tclo) inside list

Generates one coverage goal for every bound variable that appears in the given LF context.

val addToMCtx : LF.mctx -> (LF.ctyp_decl list * LF.msub) -> LF.mctx * LF.msub
val is_impossible : LF.mctx -> Comp.typ -> bool

Decide whether a given computational type is impossible.

Error-reporting

val reset_information : unit -> unit
val get_information : unit -> string
val add_information : string -> unit
diff --git a/beluga/Beluga/Ctxsub/index.html b/beluga/Beluga/Ctxsub/index.html deleted file mode 100644 index 376fcabd3..000000000 --- a/beluga/Beluga/Ctxsub/index.html +++ /dev/null @@ -1,10 +0,0 @@ - -Ctxsub (beluga.Beluga.Ctxsub)

Module Beluga.Ctxsub

modified: Joshua Dunfield

val ctxShift : Synint.LF.dctx -> Synint.LF.sub
val ctxToSub_mclosed : - Synint.LF.mctx -> - Synint.LF.ctx_var -> - Synint.LF.dctx -> - Synint.LF.mctx * Synint.LF.sub * int
val mctxToMSub : Synint.LF.mctx -> Synint.LF.msub

Constructs a meta-substitution consisting of MMVars, with types coming from the given meta-context.

val drop : int -> Synint.LF.msub -> Synint.LF.msub

drop n t = t' Drops `n` entries from `t`.

val length : Synint.LF.msub -> int

length t = n Counts the entries in `t`.

diff --git a/beluga/Beluga/Erase/index.html b/beluga/Beluga/Erase/index.html deleted file mode 100644 index 0315cd078..000000000 --- a/beluga/Beluga/Erase/index.html +++ /dev/null @@ -1,5 +0,0 @@ - -Erase (beluga.Beluga.Erase)

Module Beluga.Erase

diff --git a/beluga/Beluga/Holes/index.html b/beluga/Beluga/Holes/index.html deleted file mode 100644 index 8e2ab43fd..000000000 --- a/beluga/Beluga/Holes/index.html +++ /dev/null @@ -1,5 +0,0 @@ - -Holes (beluga.Beluga.Holes)

Module Beluga.Holes

type lf_hole_info = {
  1. cPsi : Beluga_syntax.Synint.LF.dctx;
  2. lfGoal : Beluga_syntax.Synint.LF.tclo;
  3. mutable lfSolution : Beluga_syntax.Synint.LF.nclo option;
}
type _ hole_info =
  1. | LFInfo : lf_hole_info hole_info
  2. | CompInfo : comp_hole_info hole_info
type 'a hole = {
  1. location : Beluga_syntax.Location.t;
  2. name : Beluga_syntax.HoleId.name;
  3. cD : Beluga_syntax.Synint.LF.mctx;
    (*

    "Context Delta", for metavariables.

    *)
  4. info : 'a;
    (*

    information specific to the hole type.

    *)
}

A hole with a known kind of information.

type some_hole =
  1. | Exists : 'a hole_info * 'a hole -> some_hole

Existential wrapper for 'a hole with a singleton type.

type lookup_strategy

A strategy for retrieving a hole.

val string_of_lookup_strategy : lookup_strategy -> string

Gets a string representation of the given strategy.

val parse_lookup_strategy : string -> lookup_strategy option

Parses a lookup strategy.

An integer gives the `by_id` strategy, whereas a non-integer gives the `by_name` strategy Returns None if the parsing fails.

val unsafe_parse_lookup_strategy : - Beluga_syntax.Location.t -> - string -> - lookup_strategy

Parses a lookup strategy, throwing an exception on failure. The given location is used in the thrown exception.

Looks up a hole by its number. Use strategies with `get`.

val by_name : string -> lookup_strategy

Looks up a hole by its name. Use strategies with `get`.

type snapshot
val get_snapshot : unit -> snapshot

Gets a snapshot of the current hole ids.

val holes_since : snapshot -> (Beluga_syntax.HoleId.t * some_hole) list

Gets a list of holes added since the given snapshot. This can be used to whether an ad hoc expression contained any holes.

val catch : (unit -> 'a) -> (Beluga_syntax.HoleId.t * some_hole) list * 'a

Runs a function, and catches any new holes added as a result of running it.

val to_lf_hole : some_hole -> lf_hole_info hole option

Decides whether this is an LF hole.

val to_comp_hole : some_hole -> comp_hole_info hole option

Decides whether this is a computational hole.

val is_solved : some_hole -> bool

Decides whether this hole is solved.

val is_unsolved : some_hole -> bool

Decides whether this hole is unsolved.

val hole_is_named : some_hole -> bool

Decides whether a hole has a name (is not anonymous).

val none : unit -> bool

Checks whether the internal array of holes is empty.

Retrieves a single hole using the given strategy.

Retrieves a single hole using the given strategy, * raising NoSuchHole if the hole does not exist.

val lookup : string -> (Beluga_syntax.HoleId.t * some_hole) option

Looks up a hole, retrieving the hole itself and its number.

Decides whether a location is contained within a location.

val count : unit -> int

Counts the number of holes.

val destroy_holes_within : Beluga_syntax.Location.t -> unit

Removes all holes contained in the given location.

val allocate : unit -> Beluga_syntax.HoleId.t

Allocates a new hole ID.

val assign : Beluga_syntax.HoleId.t -> some_hole -> unit

Assigns the hole to the given ID.

val clear : unit -> unit

Clears the hole arrays.

val list : unit -> (Beluga_syntax.HoleId.t * some_hole) list

Gets the current list of holes. The list is in sorted order of the hole locations in the source file.

val add_harpoon_subgoal : Beluga_syntax.Synint.Comp.open_subgoal -> unit

Adds a Harpoon subgoal to the internal list.

val get_harpoon_subgoals : unit -> Beluga_syntax.Synint.Comp.open_subgoal list

Gets the list of Harpoon subgoals.

diff --git a/beluga/Beluga/Index/Indexer/index.html b/beluga/Beluga/Index/Indexer/index.html deleted file mode 100644 index 09730d1b8..000000000 --- a/beluga/Beluga/Index/Indexer/index.html +++ /dev/null @@ -1,334 +0,0 @@ - -Indexer (beluga.Beluga.Index.Indexer)

Module Index.Indexer

include INDEXER with type state = Index_state.Indexing_state.state
val index_open_lf_kind : - state -> - Synext.lf_kind -> - Beluga_syntax.Synapx.LF.kind

index_open_lf_kind state kind is kind with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in kind with respect to state.

val index_closed_lf_kind : - state -> - Synext.lf_kind -> - Beluga_syntax.Synapx.LF.kind

index_closed_lf_kind state kind is kind with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in kind with respect to state.

val index_open_lf_typ : state -> Synext.lf_typ -> Beluga_syntax.Synapx.LF.typ

index_open_lf_typ state typ is typ with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in typ with respect to state

val index_closed_lf_typ : state -> Synext.lf_typ -> Beluga_syntax.Synapx.LF.typ

index_closed_lf_typ state typ is typ with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in typ with respect to state

val index_open_comp_kind : - state -> - Synext.comp_kind -> - Beluga_syntax.Synapx.Comp.kind

index_open_comp_kind state kind is kind with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in kind with respect to state.

val index_closed_comp_kind : - state -> - Synext.comp_kind -> - Beluga_syntax.Synapx.Comp.kind

index_closed_comp_kind state kind is kind with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in kind with respect to state.

val index_open_comp_typ : - state -> - Synext.comp_typ -> - Beluga_syntax.Synapx.Comp.typ

index_open_comp_typ state typ is typ with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in typ with respect to state.

val index_closed_comp_typ : - state -> - Synext.comp_typ -> - Beluga_syntax.Synapx.Comp.typ

index_closed_comp_typ state typ is typ with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in typ with respect to state.

val index_comp_expression : - state -> - Synext.comp_expression -> - Beluga_syntax.Synapx.Comp.exp

index_comp_expression state expression is expression with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in expression with respect to state.

index_schema state schema is schema with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in schema with respect to state.

val index_comp_theorem : - state -> - Synext.comp_expression -> - Beluga_syntax.Synapx.Comp.thm

index_comp_theorem state theorem is theorem with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in theorem with respect to state.

val index_harpoon_proof : - state -> - Synext.harpoon_proof -> - Beluga_syntax.Synapx.Comp.thm

index_harpoon_proof state proof is proof with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in proof with respect to state.

val index_computation_typ_abbreviation : - state -> - Synext.comp_typ -> - Synext.comp_kind -> - Beluga_syntax.Synapx.Comp.typ * Beluga_syntax.Synapx.Comp.kind

index_computation_typ_abbreviation state typ kind is (typ', kind') where kind' is kind and typ' is typ, both with bound variables and constants replaced with de Bruijn indices and IDs respectively. Overall, free variables are disallowed with respect to state. Variables bound in Pi-kinds in kind count as bound in typ.

include Index_state.INDEXING_STATE with type state := state
include Support.Imperative_state.IMPERATIVE_STATE with type state := state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val fresh_identifier : state -> Beluga_syntax.Identifier.t

fresh_identifier state is an identifier that is not bound in state. This is used in the indexing of arrow types to Pi-types, and to generate parameter identifiers for lambda abstractions that omit the parameter identifier.

In order to avoid potential captures, identifier is not a syntactically valid identifier. That is, identifier printed as is cannot be parsed into an identifier.

For debugging purposes, identifier is of the form "\"i#" where '#' is a positive integer. Ideally, fresh name generation would not be needed, but that would require that every AST node in the concrete syntax is directly expressible in the approximate and internal syntaxes.

FIXME: The indexing phase should not have to generate fresh identifiers.

fresh_identifier_opt state identifier_opt is fresh_identifier state if identifier_opt = Option.None, and identifier if identifier_opt = Option.Some identifier.

Index of Constants

val index_of_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - [ `Lf_type_constant of Beluga_syntax.Id.cid_typ - | `Lf_term_constant of Beluga_syntax.Id.cid_term - | `Computation_inductive_type_constant of Beluga_syntax.Id.cid_comp_typ - | `Computation_stratified_type_constant of Beluga_syntax.Id.cid_comp_typ - | `Computation_coinductive_type_constant of Beluga_syntax.Id.cid_comp_cotyp - | `Computation_abbreviation_type_constant of Beluga_syntax.Id.cid_comp_typdef - | `Computation_term_constructor of Beluga_syntax.Id.cid_comp_const - | `Computation_term_destructor of Beluga_syntax.Id.cid_comp_dest - | `Schema_constant of Beluga_syntax.Id.cid_schema - | `Program_constant of Beluga_syntax.Id.cid_prog - | `Module of Beluga_syntax.Id.module_id ]
val index_of_lf_type_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_typ

index_of_lf_type_constant state identifier is the constant ID of identifier in state if it is bound to an LF type-level constant. If identifier is bound to any other entry, then an exception is raised.

val index_of_lf_term_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_term

index_of_lf_term_constant state identifier is like index_of_lf_type_constant state identifier, but for LF term-level constants.

val index_of_comp_type_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typ

index_of_comp_type_constant state identifier is a lookup for the ID corresponding to identifier in state for computation-level inductive or stratified type constant.

val index_of_inductive_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typ
val index_of_stratified_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typ
val index_of_coinductive_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_cotyp
val index_of_abbreviation_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typdef

Index of Variables

val index_of_lf_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset

index_of_lf_variable state identifier is the LF-bound de Bruijn index of identifier in state.

If identifier is unbound, then an exception is raised.

index_of_lf_variable_opt state identifier is the LF-bound de Bruijn index of identifier in state.

If identifier is unbound, then offset_opt = Option.None.

If state is a pattern state, then offset_opt is additionally Option.None if it is not an inner pattern-bound variable.

val index_of_meta_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset

index_of_meta_variable state identifier is the meta-level de Bruijn index of identifier in state.

If identifier is unbound, bound to a different entry than a meta-variable, or bound to a meta-variable of unknown de Bruijn level, then an exception is raised.

val index_of_meta_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t

index_of_meta_variable_opt state identifier is the meta-level de Bruijn index of identifier in state.

  • If identifier is unbound, then offset_opt = Option.None.
  • If identifier is a bound meta-variable whose de Bruijn level is unknown (i.e. its binder is a meta-variable in a pattern), then offset_opt = Option.None.
  • If state is a pattern state, then offset_opt = Option.None if it is not an inner pattern-bound variable.
val index_of_parameter_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset
val index_of_parameter_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t
val index_of_substitution_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset
val index_of_substitution_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t
val index_of_context_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset
val index_of_context_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t
val index_of_comp_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset

Binding Variables

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state identifier m runs m in a state where identifier is a bound LF variable.

If state is a pattern state, then identifier is additionally considered as an inner bound variable.

val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state identifier m runs m in a state where identifier is either a bound meta, parameter, substitution or context variable. This is necessary for mlam-expressions.

If state is a pattern state, then identifier is additionally considered as an inner bound variable.

val with_bound_comp_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_shifted_lf_context : state -> (state -> 'a) -> 'a

with_shifted_lf_context state m is like with_bound_lf_variable state _ m without adding any identifier in the namespace. That is, de Bruijn indices looked up in m with respect to the context of LF-bound variables are + 1 of what they were in state. This is used for omitted parameters to lambda terms, like \_. x.

val with_shifted_meta_context : state -> (state -> 'a) -> 'a

with_shifted_meta_context state m is like with_shifted_lf_context state m but for meta-level variables.

val with_shifted_comp_context : state -> (state -> 'a) -> 'a

with_shifted_comp_context state m is like with_shifted_lf_context state m but for computation-level variables.

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_typ -> - Stdlib.Unit.t
val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_term -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_schema -> - Stdlib.Unit.t
val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_cotyp -> - Stdlib.Unit.t
val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_typdef -> - Stdlib.Unit.t
val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_const -> - Stdlib.Unit.t
val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_dest -> - Stdlib.Unit.t
val add_program_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_prog -> - Stdlib.Unit.t
val add_module : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.module_id -> - (state -> 'a) -> - 'a

add_module state ?location module_identifier cid m starts a module, computes m, then stops the module. This effectively adds a new module with identifier module_identifier to state, along with the declarations added in m as declarations in that module.

val open_module : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state ?location module_identifier opens the module module_identifier it is a bound module. This effectively adds all the declarations in that module to the current scope, but not as declarations (i.e., this opens the module like in OCaml).

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val with_scope : state -> (state -> 'a) -> 'a
val with_parent_scope : state -> (state -> 'a) -> 'a
val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used in REPLs to safely run functions and recover the state in case of a raised exception during indexing.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Pattern Variables

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression runs pattern while keeping track of free and pattern variables, then runs expression with the free and pattern variables as bound variables.

val add_computation_pattern_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t

Free Variables

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state identifier adds identifier as a free LF variable.

If identifier is a free variable in state of a different kind than LF variables, then an exception is raised.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val add_free_context_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val allow_free_variables : state -> (state -> 'a) -> 'a

allow_free_variables state m runs m and discards the tracked free variables therein.

val disallow_free_variables : state -> (state -> 'a) -> 'a

disallow_free_variables state m runs m and raises an exception if m adds a free variable to the state.

Interoperability

val add_all_mctx : state -> Beluga_syntax.Synint.LF.mctx -> Stdlib.Unit.t

add_all_mctx state cD adds all contextual variables in cD.

val add_all_gctx : state -> Beluga_syntax.Synint.Comp.gctx -> Stdlib.Unit.t

add_all_gctx state cG adds all computation-level variables in cG.

diff --git a/beluga/Beluga/Index/Make_indexer/argument-1-Indexing_state/index.html b/beluga/Beluga/Index/Make_indexer/argument-1-Indexing_state/index.html deleted file mode 100644 index fc5c258dc..000000000 --- a/beluga/Beluga/Index/Make_indexer/argument-1-Indexing_state/index.html +++ /dev/null @@ -1,302 +0,0 @@ - -Indexing_state (beluga.Beluga.Index.Make_indexer.Indexing_state)

Parameter Make_indexer.Indexing_state

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val fresh_identifier : state -> Beluga_syntax.Identifier.t

fresh_identifier state is an identifier that is not bound in state. This is used in the indexing of arrow types to Pi-types, and to generate parameter identifiers for lambda abstractions that omit the parameter identifier.

In order to avoid potential captures, identifier is not a syntactically valid identifier. That is, identifier printed as is cannot be parsed into an identifier.

For debugging purposes, identifier is of the form "\"i#" where '#' is a positive integer. Ideally, fresh name generation would not be needed, but that would require that every AST node in the concrete syntax is directly expressible in the approximate and internal syntaxes.

FIXME: The indexing phase should not have to generate fresh identifiers.

fresh_identifier_opt state identifier_opt is fresh_identifier state if identifier_opt = Option.None, and identifier if identifier_opt = Option.Some identifier.

Index of Constants

val index_of_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - [ `Lf_type_constant of Beluga_syntax.Id.cid_typ - | `Lf_term_constant of Beluga_syntax.Id.cid_term - | `Computation_inductive_type_constant of Beluga_syntax.Id.cid_comp_typ - | `Computation_stratified_type_constant of Beluga_syntax.Id.cid_comp_typ - | `Computation_coinductive_type_constant of Beluga_syntax.Id.cid_comp_cotyp - | `Computation_abbreviation_type_constant of Beluga_syntax.Id.cid_comp_typdef - | `Computation_term_constructor of Beluga_syntax.Id.cid_comp_const - | `Computation_term_destructor of Beluga_syntax.Id.cid_comp_dest - | `Schema_constant of Beluga_syntax.Id.cid_schema - | `Program_constant of Beluga_syntax.Id.cid_prog - | `Module of Beluga_syntax.Id.module_id ]
val index_of_lf_type_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_typ

index_of_lf_type_constant state identifier is the constant ID of identifier in state if it is bound to an LF type-level constant. If identifier is bound to any other entry, then an exception is raised.

val index_of_lf_term_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_term

index_of_lf_term_constant state identifier is like index_of_lf_type_constant state identifier, but for LF term-level constants.

val index_of_comp_type_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typ

index_of_comp_type_constant state identifier is a lookup for the ID corresponding to identifier in state for computation-level inductive or stratified type constant.

val index_of_inductive_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typ
val index_of_stratified_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typ
val index_of_coinductive_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_cotyp
val index_of_abbreviation_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typdef

Index of Variables

val index_of_lf_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset

index_of_lf_variable state identifier is the LF-bound de Bruijn index of identifier in state.

If identifier is unbound, then an exception is raised.

index_of_lf_variable_opt state identifier is the LF-bound de Bruijn index of identifier in state.

If identifier is unbound, then offset_opt = Option.None.

If state is a pattern state, then offset_opt is additionally Option.None if it is not an inner pattern-bound variable.

val index_of_meta_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset

index_of_meta_variable state identifier is the meta-level de Bruijn index of identifier in state.

If identifier is unbound, bound to a different entry than a meta-variable, or bound to a meta-variable of unknown de Bruijn level, then an exception is raised.

val index_of_meta_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t

index_of_meta_variable_opt state identifier is the meta-level de Bruijn index of identifier in state.

  • If identifier is unbound, then offset_opt = Option.None.
  • If identifier is a bound meta-variable whose de Bruijn level is unknown (i.e. its binder is a meta-variable in a pattern), then offset_opt = Option.None.
  • If state is a pattern state, then offset_opt = Option.None if it is not an inner pattern-bound variable.
val index_of_parameter_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset
val index_of_parameter_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t
val index_of_substitution_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset
val index_of_substitution_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t
val index_of_context_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset
val index_of_context_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t
val index_of_comp_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset

Binding Variables

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state identifier m runs m in a state where identifier is a bound LF variable.

If state is a pattern state, then identifier is additionally considered as an inner bound variable.

val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state identifier m runs m in a state where identifier is either a bound meta, parameter, substitution or context variable. This is necessary for mlam-expressions.

If state is a pattern state, then identifier is additionally considered as an inner bound variable.

val with_bound_comp_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_shifted_lf_context : state -> (state -> 'a) -> 'a

with_shifted_lf_context state m is like with_bound_lf_variable state _ m without adding any identifier in the namespace. That is, de Bruijn indices looked up in m with respect to the context of LF-bound variables are + 1 of what they were in state. This is used for omitted parameters to lambda terms, like \_. x.

val with_shifted_meta_context : state -> (state -> 'a) -> 'a

with_shifted_meta_context state m is like with_shifted_lf_context state m but for meta-level variables.

val with_shifted_comp_context : state -> (state -> 'a) -> 'a

with_shifted_comp_context state m is like with_shifted_lf_context state m but for computation-level variables.

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_typ -> - Stdlib.Unit.t
val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_term -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_schema -> - Stdlib.Unit.t
val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_cotyp -> - Stdlib.Unit.t
val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_typdef -> - Stdlib.Unit.t
val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_const -> - Stdlib.Unit.t
val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_dest -> - Stdlib.Unit.t
val add_program_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_prog -> - Stdlib.Unit.t
val add_module : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.module_id -> - (state -> 'a) -> - 'a

add_module state ?location module_identifier cid m starts a module, computes m, then stops the module. This effectively adds a new module with identifier module_identifier to state, along with the declarations added in m as declarations in that module.

val open_module : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state ?location module_identifier opens the module module_identifier it is a bound module. This effectively adds all the declarations in that module to the current scope, but not as declarations (i.e., this opens the module like in OCaml).

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val with_scope : state -> (state -> 'a) -> 'a
val with_parent_scope : state -> (state -> 'a) -> 'a
val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used in REPLs to safely run functions and recover the state in case of a raised exception during indexing.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Pattern Variables

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression runs pattern while keeping track of free and pattern variables, then runs expression with the free and pattern variables as bound variables.

val add_computation_pattern_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t

Free Variables

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state identifier adds identifier as a free LF variable.

If identifier is a free variable in state of a different kind than LF variables, then an exception is raised.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val add_free_context_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val allow_free_variables : state -> (state -> 'a) -> 'a

allow_free_variables state m runs m and discards the tracked free variables therein.

val disallow_free_variables : state -> (state -> 'a) -> 'a

disallow_free_variables state m runs m and raises an exception if m adds a free variable to the state.

Interoperability

val add_all_mctx : state -> Beluga_syntax.Synint.LF.mctx -> Stdlib.Unit.t

add_all_mctx state cD adds all contextual variables in cD.

val add_all_gctx : state -> Beluga_syntax.Synint.Comp.gctx -> Stdlib.Unit.t

add_all_gctx state cG adds all computation-level variables in cG.

diff --git a/beluga/Beluga/Index/Make_indexer/index.html b/beluga/Beluga/Index/Make_indexer/index.html deleted file mode 100644 index 1f89c84ba..000000000 --- a/beluga/Beluga/Index/Make_indexer/index.html +++ /dev/null @@ -1,104 +0,0 @@ - -Make_indexer (beluga.Beluga.Index.Make_indexer)

Module Index.Make_indexer

Parameters

Signature

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Indexing_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val index_open_lf_kind : - state -> - Synext.lf_kind -> - Beluga_syntax.Synapx.LF.kind

index_open_lf_kind state kind is kind with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in kind with respect to state.

val index_closed_lf_kind : - state -> - Synext.lf_kind -> - Beluga_syntax.Synapx.LF.kind

index_closed_lf_kind state kind is kind with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in kind with respect to state.

val index_open_lf_typ : state -> Synext.lf_typ -> Beluga_syntax.Synapx.LF.typ

index_open_lf_typ state typ is typ with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in typ with respect to state

val index_closed_lf_typ : state -> Synext.lf_typ -> Beluga_syntax.Synapx.LF.typ

index_closed_lf_typ state typ is typ with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in typ with respect to state

val index_open_comp_kind : - state -> - Synext.comp_kind -> - Beluga_syntax.Synapx.Comp.kind

index_open_comp_kind state kind is kind with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in kind with respect to state.

val index_closed_comp_kind : - state -> - Synext.comp_kind -> - Beluga_syntax.Synapx.Comp.kind

index_closed_comp_kind state kind is kind with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in kind with respect to state.

val index_open_comp_typ : - state -> - Synext.comp_typ -> - Beluga_syntax.Synapx.Comp.typ

index_open_comp_typ state typ is typ with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in typ with respect to state.

val index_closed_comp_typ : - state -> - Synext.comp_typ -> - Beluga_syntax.Synapx.Comp.typ

index_closed_comp_typ state typ is typ with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in typ with respect to state.

val index_comp_expression : - state -> - Synext.comp_expression -> - Beluga_syntax.Synapx.Comp.exp

index_comp_expression state expression is expression with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in expression with respect to state.

index_schema state schema is schema with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in schema with respect to state.

val index_comp_theorem : - state -> - Synext.comp_expression -> - Beluga_syntax.Synapx.Comp.thm

index_comp_theorem state theorem is theorem with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in theorem with respect to state.

val index_harpoon_proof : - state -> - Synext.harpoon_proof -> - Beluga_syntax.Synapx.Comp.thm

index_harpoon_proof state proof is proof with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in proof with respect to state.

val index_computation_typ_abbreviation : - state -> - Synext.comp_typ -> - Synext.comp_kind -> - Beluga_syntax.Synapx.Comp.typ * Beluga_syntax.Synapx.Comp.kind

index_computation_typ_abbreviation state typ kind is (typ', kind') where kind' is kind and typ' is typ, both with bound variables and constants replaced with de Bruijn indices and IDs respectively. Overall, free variables are disallowed with respect to state. Variables bound in Pi-kinds in kind count as bound in typ.

diff --git a/beluga/Beluga/Index/index.html b/beluga/Beluga/Index/index.html deleted file mode 100644 index fb09d6720..000000000 --- a/beluga/Beluga/Index/index.html +++ /dev/null @@ -1,4 +0,0 @@ - -Index (beluga.Beluga.Index)

Module Beluga.Index

Name resolution and translation from the concrete syntax to the approximate syntax.

module type INDEXER = sig ... end
module Indexer : sig ... end
diff --git a/beluga/Beluga/Index/module-type-INDEXER/index.html b/beluga/Beluga/Index/module-type-INDEXER/index.html deleted file mode 100644 index e0e7f014d..000000000 --- a/beluga/Beluga/Index/module-type-INDEXER/index.html +++ /dev/null @@ -1,103 +0,0 @@ - -INDEXER (beluga.Beluga.Index.INDEXER)

Module type Index.INDEXER

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val index_open_lf_kind : - state -> - Synext.lf_kind -> - Beluga_syntax.Synapx.LF.kind

index_open_lf_kind state kind is kind with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in kind with respect to state.

val index_closed_lf_kind : - state -> - Synext.lf_kind -> - Beluga_syntax.Synapx.LF.kind

index_closed_lf_kind state kind is kind with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in kind with respect to state.

val index_open_lf_typ : state -> Synext.lf_typ -> Beluga_syntax.Synapx.LF.typ

index_open_lf_typ state typ is typ with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in typ with respect to state

val index_closed_lf_typ : state -> Synext.lf_typ -> Beluga_syntax.Synapx.LF.typ

index_closed_lf_typ state typ is typ with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in typ with respect to state

val index_open_comp_kind : - state -> - Synext.comp_kind -> - Beluga_syntax.Synapx.Comp.kind

index_open_comp_kind state kind is kind with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in kind with respect to state.

val index_closed_comp_kind : - state -> - Synext.comp_kind -> - Beluga_syntax.Synapx.Comp.kind

index_closed_comp_kind state kind is kind with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in kind with respect to state.

val index_open_comp_typ : - state -> - Synext.comp_typ -> - Beluga_syntax.Synapx.Comp.typ

index_open_comp_typ state typ is typ with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in typ with respect to state.

val index_closed_comp_typ : - state -> - Synext.comp_typ -> - Beluga_syntax.Synapx.Comp.typ

index_closed_comp_typ state typ is typ with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in typ with respect to state.

val index_comp_expression : - state -> - Synext.comp_expression -> - Beluga_syntax.Synapx.Comp.exp

index_comp_expression state expression is expression with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in expression with respect to state.

index_schema state schema is schema with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in schema with respect to state.

val index_comp_theorem : - state -> - Synext.comp_expression -> - Beluga_syntax.Synapx.Comp.thm

index_comp_theorem state theorem is theorem with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in theorem with respect to state.

val index_harpoon_proof : - state -> - Synext.harpoon_proof -> - Beluga_syntax.Synapx.Comp.thm

index_harpoon_proof state proof is proof with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in proof with respect to state.

val index_computation_typ_abbreviation : - state -> - Synext.comp_typ -> - Synext.comp_kind -> - Beluga_syntax.Synapx.Comp.typ * Beluga_syntax.Synapx.Comp.kind

index_computation_typ_abbreviation state typ kind is (typ', kind') where kind' is kind and typ' is typ, both with bound variables and constants replaced with de Bruijn indices and IDs respectively. Overall, free variables are disallowed with respect to state. Variables bound in Pi-kinds in kind count as bound in typ.

diff --git a/beluga/Beluga/Index_state/Indexing_state/index.html b/beluga/Beluga/Index_state/Indexing_state/index.html deleted file mode 100644 index e73a05315..000000000 --- a/beluga/Beluga/Index_state/Indexing_state/index.html +++ /dev/null @@ -1,302 +0,0 @@ - -Indexing_state (beluga.Beluga.Index_state.Indexing_state)

Module Index_state.Indexing_state

Concrete instance of INDEXING_STATE.

include INDEXING_STATE
include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val fresh_identifier : state -> Beluga_syntax.Identifier.t

fresh_identifier state is an identifier that is not bound in state. This is used in the indexing of arrow types to Pi-types, and to generate parameter identifiers for lambda abstractions that omit the parameter identifier.

In order to avoid potential captures, identifier is not a syntactically valid identifier. That is, identifier printed as is cannot be parsed into an identifier.

For debugging purposes, identifier is of the form "\"i#" where '#' is a positive integer. Ideally, fresh name generation would not be needed, but that would require that every AST node in the concrete syntax is directly expressible in the approximate and internal syntaxes.

FIXME: The indexing phase should not have to generate fresh identifiers.

fresh_identifier_opt state identifier_opt is fresh_identifier state if identifier_opt = Option.None, and identifier if identifier_opt = Option.Some identifier.

Index of Constants

val index_of_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - [ `Lf_type_constant of Beluga_syntax.Id.cid_typ - | `Lf_term_constant of Beluga_syntax.Id.cid_term - | `Computation_inductive_type_constant of Beluga_syntax.Id.cid_comp_typ - | `Computation_stratified_type_constant of Beluga_syntax.Id.cid_comp_typ - | `Computation_coinductive_type_constant of Beluga_syntax.Id.cid_comp_cotyp - | `Computation_abbreviation_type_constant of Beluga_syntax.Id.cid_comp_typdef - | `Computation_term_constructor of Beluga_syntax.Id.cid_comp_const - | `Computation_term_destructor of Beluga_syntax.Id.cid_comp_dest - | `Schema_constant of Beluga_syntax.Id.cid_schema - | `Program_constant of Beluga_syntax.Id.cid_prog - | `Module of Beluga_syntax.Id.module_id ]
val index_of_lf_type_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_typ

index_of_lf_type_constant state identifier is the constant ID of identifier in state if it is bound to an LF type-level constant. If identifier is bound to any other entry, then an exception is raised.

val index_of_lf_term_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_term

index_of_lf_term_constant state identifier is like index_of_lf_type_constant state identifier, but for LF term-level constants.

val index_of_comp_type_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typ

index_of_comp_type_constant state identifier is a lookup for the ID corresponding to identifier in state for computation-level inductive or stratified type constant.

val index_of_inductive_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typ
val index_of_stratified_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typ
val index_of_coinductive_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_cotyp
val index_of_abbreviation_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typdef

Index of Variables

val index_of_lf_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset

index_of_lf_variable state identifier is the LF-bound de Bruijn index of identifier in state.

If identifier is unbound, then an exception is raised.

index_of_lf_variable_opt state identifier is the LF-bound de Bruijn index of identifier in state.

If identifier is unbound, then offset_opt = Option.None.

If state is a pattern state, then offset_opt is additionally Option.None if it is not an inner pattern-bound variable.

val index_of_meta_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset

index_of_meta_variable state identifier is the meta-level de Bruijn index of identifier in state.

If identifier is unbound, bound to a different entry than a meta-variable, or bound to a meta-variable of unknown de Bruijn level, then an exception is raised.

val index_of_meta_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t

index_of_meta_variable_opt state identifier is the meta-level de Bruijn index of identifier in state.

  • If identifier is unbound, then offset_opt = Option.None.
  • If identifier is a bound meta-variable whose de Bruijn level is unknown (i.e. its binder is a meta-variable in a pattern), then offset_opt = Option.None.
  • If state is a pattern state, then offset_opt = Option.None if it is not an inner pattern-bound variable.
val index_of_parameter_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset
val index_of_parameter_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t
val index_of_substitution_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset
val index_of_substitution_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t
val index_of_context_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset
val index_of_context_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t
val index_of_comp_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset

Binding Variables

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state identifier m runs m in a state where identifier is a bound LF variable.

If state is a pattern state, then identifier is additionally considered as an inner bound variable.

val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state identifier m runs m in a state where identifier is either a bound meta, parameter, substitution or context variable. This is necessary for mlam-expressions.

If state is a pattern state, then identifier is additionally considered as an inner bound variable.

val with_bound_comp_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_shifted_lf_context : state -> (state -> 'a) -> 'a

with_shifted_lf_context state m is like with_bound_lf_variable state _ m without adding any identifier in the namespace. That is, de Bruijn indices looked up in m with respect to the context of LF-bound variables are + 1 of what they were in state. This is used for omitted parameters to lambda terms, like \_. x.

val with_shifted_meta_context : state -> (state -> 'a) -> 'a

with_shifted_meta_context state m is like with_shifted_lf_context state m but for meta-level variables.

val with_shifted_comp_context : state -> (state -> 'a) -> 'a

with_shifted_comp_context state m is like with_shifted_lf_context state m but for computation-level variables.

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_typ -> - Stdlib.Unit.t
val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_term -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_schema -> - Stdlib.Unit.t
val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_cotyp -> - Stdlib.Unit.t
val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_typdef -> - Stdlib.Unit.t
val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_const -> - Stdlib.Unit.t
val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_dest -> - Stdlib.Unit.t
val add_program_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_prog -> - Stdlib.Unit.t
val add_module : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.module_id -> - (state -> 'a) -> - 'a

add_module state ?location module_identifier cid m starts a module, computes m, then stops the module. This effectively adds a new module with identifier module_identifier to state, along with the declarations added in m as declarations in that module.

val open_module : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state ?location module_identifier opens the module module_identifier it is a bound module. This effectively adds all the declarations in that module to the current scope, but not as declarations (i.e., this opens the module like in OCaml).

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val with_scope : state -> (state -> 'a) -> 'a
val with_parent_scope : state -> (state -> 'a) -> 'a
val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used in REPLs to safely run functions and recover the state in case of a raised exception during indexing.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Pattern Variables

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression runs pattern while keeping track of free and pattern variables, then runs expression with the free and pattern variables as bound variables.

val add_computation_pattern_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t

Free Variables

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state identifier adds identifier as a free LF variable.

If identifier is a free variable in state of a different kind than LF variables, then an exception is raised.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val add_free_context_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val allow_free_variables : state -> (state -> 'a) -> 'a

allow_free_variables state m runs m and discards the tracked free variables therein.

val disallow_free_variables : state -> (state -> 'a) -> 'a

disallow_free_variables state m runs m and raises an exception if m adds a free variable to the state.

Interoperability

val add_all_mctx : state -> Beluga_syntax.Synint.LF.mctx -> Stdlib.Unit.t

add_all_mctx state cD adds all contextual variables in cD.

val add_all_gctx : state -> Beluga_syntax.Synint.Comp.gctx -> Stdlib.Unit.t

add_all_gctx state cG adds all computation-level variables in cG.

val create_initial_state : Stdlib.Unit.t -> state

create_initial_state () is a fresh empty indexing state.

val clear_state : state -> Stdlib.Unit.t

clear_state state resets state to its initial state.

val snapshot_state : state -> state

snapshot_state state is a surface copy of state, meaning that it is effectively a frozen copy of state. Only the latest bindings in state are kept.

diff --git a/beluga/Beluga/Index_state/index.html b/beluga/Beluga/Index_state/index.html deleted file mode 100644 index 3529d5aea..000000000 --- a/beluga/Beluga/Index_state/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Index_state (beluga.Beluga.Index_state)

Module Beluga.Index_state

State definition for the indexing phase.

module type INDEXING_STATE = sig ... end

Abstract definition of an indexing state.

module Indexing_state : sig ... end

Concrete instance of INDEXING_STATE.

diff --git a/beluga/Beluga/Index_state/module-type-INDEXING_STATE/index.html b/beluga/Beluga/Index_state/module-type-INDEXING_STATE/index.html deleted file mode 100644 index ddc425341..000000000 --- a/beluga/Beluga/Index_state/module-type-INDEXING_STATE/index.html +++ /dev/null @@ -1,302 +0,0 @@ - -INDEXING_STATE (beluga.Beluga.Index_state.INDEXING_STATE)

Module type Index_state.INDEXING_STATE

Abstract definition of an indexing state.

An indexing state is the auxiliary data structure used during the indexing phase found in module Index. This data structure is responsible for keeping track of the referencing environment (bindings in scope) during the traversal of the external syntax. In particular, it keeps track of constant IDs as generated from the Store, and de Bruijn levels for pure LF-bound variables, meta-level variables and computation-level variables, to subsequently compute their de Bruijn indices.

An additional concern with de Bruijn indices in computation-level expressions is that the de Bruijn level cannot be known for all binders. This is because the abstraction phase of signature reconstruction introduces binders after abstraction, particularly for meta-level pattern variables. While such meta-level pattern variables shadow previous bindings, no de Bruijn variables may be computed for them during indexing. In those cases, functions like INDEXING_STATE.index_of_meta_variable_opt return Option.None, for unbound identifiers, meaning that the meta-level variable whose binder is in a meta-object pattern will be indexed like a free meta-variable. Abstraction will rewrite it to a bound meta-variable afterwards.

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val fresh_identifier : state -> Beluga_syntax.Identifier.t

fresh_identifier state is an identifier that is not bound in state. This is used in the indexing of arrow types to Pi-types, and to generate parameter identifiers for lambda abstractions that omit the parameter identifier.

In order to avoid potential captures, identifier is not a syntactically valid identifier. That is, identifier printed as is cannot be parsed into an identifier.

For debugging purposes, identifier is of the form "\"i#" where '#' is a positive integer. Ideally, fresh name generation would not be needed, but that would require that every AST node in the concrete syntax is directly expressible in the approximate and internal syntaxes.

FIXME: The indexing phase should not have to generate fresh identifiers.

fresh_identifier_opt state identifier_opt is fresh_identifier state if identifier_opt = Option.None, and identifier if identifier_opt = Option.Some identifier.

Index of Constants

val index_of_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - [ `Lf_type_constant of Beluga_syntax.Id.cid_typ - | `Lf_term_constant of Beluga_syntax.Id.cid_term - | `Computation_inductive_type_constant of Beluga_syntax.Id.cid_comp_typ - | `Computation_stratified_type_constant of Beluga_syntax.Id.cid_comp_typ - | `Computation_coinductive_type_constant of Beluga_syntax.Id.cid_comp_cotyp - | `Computation_abbreviation_type_constant of Beluga_syntax.Id.cid_comp_typdef - | `Computation_term_constructor of Beluga_syntax.Id.cid_comp_const - | `Computation_term_destructor of Beluga_syntax.Id.cid_comp_dest - | `Schema_constant of Beluga_syntax.Id.cid_schema - | `Program_constant of Beluga_syntax.Id.cid_prog - | `Module of Beluga_syntax.Id.module_id ]
val index_of_lf_type_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_typ

index_of_lf_type_constant state identifier is the constant ID of identifier in state if it is bound to an LF type-level constant. If identifier is bound to any other entry, then an exception is raised.

val index_of_lf_term_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_term

index_of_lf_term_constant state identifier is like index_of_lf_type_constant state identifier, but for LF term-level constants.

val index_of_comp_type_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typ

index_of_comp_type_constant state identifier is a lookup for the ID corresponding to identifier in state for computation-level inductive or stratified type constant.

val index_of_inductive_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typ
val index_of_stratified_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typ
val index_of_coinductive_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_cotyp
val index_of_abbreviation_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typdef

Index of Variables

val index_of_lf_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset

index_of_lf_variable state identifier is the LF-bound de Bruijn index of identifier in state.

If identifier is unbound, then an exception is raised.

index_of_lf_variable_opt state identifier is the LF-bound de Bruijn index of identifier in state.

If identifier is unbound, then offset_opt = Option.None.

If state is a pattern state, then offset_opt is additionally Option.None if it is not an inner pattern-bound variable.

val index_of_meta_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset

index_of_meta_variable state identifier is the meta-level de Bruijn index of identifier in state.

If identifier is unbound, bound to a different entry than a meta-variable, or bound to a meta-variable of unknown de Bruijn level, then an exception is raised.

val index_of_meta_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t

index_of_meta_variable_opt state identifier is the meta-level de Bruijn index of identifier in state.

  • If identifier is unbound, then offset_opt = Option.None.
  • If identifier is a bound meta-variable whose de Bruijn level is unknown (i.e. its binder is a meta-variable in a pattern), then offset_opt = Option.None.
  • If state is a pattern state, then offset_opt = Option.None if it is not an inner pattern-bound variable.
val index_of_parameter_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset
val index_of_parameter_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t
val index_of_substitution_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset
val index_of_substitution_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t
val index_of_context_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset
val index_of_context_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t
val index_of_comp_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset

Binding Variables

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state identifier m runs m in a state where identifier is a bound LF variable.

If state is a pattern state, then identifier is additionally considered as an inner bound variable.

val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state identifier m runs m in a state where identifier is either a bound meta, parameter, substitution or context variable. This is necessary for mlam-expressions.

If state is a pattern state, then identifier is additionally considered as an inner bound variable.

val with_bound_comp_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_shifted_lf_context : state -> (state -> 'a) -> 'a

with_shifted_lf_context state m is like with_bound_lf_variable state _ m without adding any identifier in the namespace. That is, de Bruijn indices looked up in m with respect to the context of LF-bound variables are + 1 of what they were in state. This is used for omitted parameters to lambda terms, like \_. x.

val with_shifted_meta_context : state -> (state -> 'a) -> 'a

with_shifted_meta_context state m is like with_shifted_lf_context state m but for meta-level variables.

val with_shifted_comp_context : state -> (state -> 'a) -> 'a

with_shifted_comp_context state m is like with_shifted_lf_context state m but for computation-level variables.

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_typ -> - Stdlib.Unit.t
val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_term -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_schema -> - Stdlib.Unit.t
val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_cotyp -> - Stdlib.Unit.t
val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_typdef -> - Stdlib.Unit.t
val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_const -> - Stdlib.Unit.t
val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_dest -> - Stdlib.Unit.t
val add_program_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_prog -> - Stdlib.Unit.t
val add_module : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.module_id -> - (state -> 'a) -> - 'a

add_module state ?location module_identifier cid m starts a module, computes m, then stops the module. This effectively adds a new module with identifier module_identifier to state, along with the declarations added in m as declarations in that module.

val open_module : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state ?location module_identifier opens the module module_identifier it is a bound module. This effectively adds all the declarations in that module to the current scope, but not as declarations (i.e., this opens the module like in OCaml).

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val with_scope : state -> (state -> 'a) -> 'a
val with_parent_scope : state -> (state -> 'a) -> 'a
val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used in REPLs to safely run functions and recover the state in case of a raised exception during indexing.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Pattern Variables

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression runs pattern while keeping track of free and pattern variables, then runs expression with the free and pattern variables as bound variables.

val add_computation_pattern_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t

Free Variables

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state identifier adds identifier as a free LF variable.

If identifier is a free variable in state of a different kind than LF variables, then an exception is raised.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val add_free_context_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val allow_free_variables : state -> (state -> 'a) -> 'a

allow_free_variables state m runs m and discards the tracked free variables therein.

val disallow_free_variables : state -> (state -> 'a) -> 'a

disallow_free_variables state m runs m and raises an exception if m adds a free variable to the state.

Interoperability

val add_all_mctx : state -> Beluga_syntax.Synint.LF.mctx -> Stdlib.Unit.t

add_all_mctx state cD adds all contextual variables in cD.

val add_all_gctx : state -> Beluga_syntax.Synint.Comp.gctx -> Stdlib.Unit.t

add_all_gctx state cG adds all computation-level variables in cG.

diff --git a/beluga/Beluga/Interactive/index.html b/beluga/Beluga/Interactive/index.html deleted file mode 100644 index 7ac685470..000000000 --- a/beluga/Beluga/Interactive/index.html +++ /dev/null @@ -1,29 +0,0 @@ - -Interactive (beluga.Beluga.Interactive)

Module Beluga.Interactive

module F = Support.Fun
module ExtComp = Beluga_syntax.Ext.Comp
module Cover = Coverage
module S = Substitution
val branchCovGoals : - 'a -> - 'b -> - (Synint.LF.mctx * Cover.cov_goal * Synint.LF.msub) list -> - Comp.branch list
val matchFromPatterns : - Syncom.Location.t -> - Comp.exp -> - Comp.branch list -> - Comp.exp
val genVarName : Beluga_syntax.Synint.LF.typ -> (unit -> string) option

Traverses a computation-level type-checkable expression and applies the given function to all computational holes.

val is_inferred : LF.ctyp_decl -> bool
val split : - string -> - (Beluga_syntax.HoleId.t * Holes.comp_hole_info Holes.hole) -> - Comp.exp option
val whale_str : string
val pp_whale : Support.Format.formatter -> unit
val whale : string
val iterMctx : LF.mctx -> LF.dctx -> LF.tclo -> Beluga_syntax.Name.t list
val iterDctx : LF.mctx -> LF.dctx -> LF.tclo -> Beluga_syntax.Name.t list
val iterGctx : LF.mctx -> Comp.gctx -> Comp.tclo -> Beluga_syntax.Name.t list
val thin_line : Support.Format.formatter -> unit -> unit
val fmt_ppr_hole : - Support.Format.formatter -> - (Beluga_syntax.HoleId.t * Holes.some_hole) -> - unit
diff --git a/beluga/Beluga/Lfcheck/index.html b/beluga/Beluga/Lfcheck/index.html deleted file mode 100644 index e21d6070d..000000000 --- a/beluga/Beluga/Lfcheck/index.html +++ /dev/null @@ -1,194 +0,0 @@ - -Lfcheck (beluga.Beluga.Lfcheck)

Module Beluga.Lfcheck

val dprint : (unit -> string) Support.Debug.io
val dprnt : string Support.Debug.io
module Unify = Unify.EmptyTrail
module S = Substitution
type error =
  1. | CtxVarMisCheck of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.tclo - * Beluga_syntax.Name.t - * Beluga_syntax.Synint.LF.schema
  2. | CtxVarMismatch of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.ctx_var - * Beluga_syntax.Name.t - * Beluga_syntax.Synint.LF.schema
  3. | CtxVarDiffer of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.ctx_var - * Beluga_syntax.Synint.LF.ctx_var
  4. | CheckError of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.nclo - * Beluga_syntax.Synint.LF.tclo
  5. | TupleArity of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.nclo - * Beluga_syntax.Synint.LF.trec_clo
  6. | SigmaMismatch of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.trec_clo - * Beluga_syntax.Synint.LF.trec_clo
  7. | KindMismatch of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.sclo - * Beluga_syntax.Synint.LF.kind * Beluga_syntax.Synint.LF.sub
  8. | TypMismatch of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.nclo - * Beluga_syntax.Synint.LF.tclo - * Beluga_syntax.Synint.LF.tclo
  9. | IllTypedSub of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.sub - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.normal option
  10. | SpineIllTyped of int * int
  11. | LeftoverFV of Beluga_syntax.Name.t
  12. | ParamVarInst of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.tclo
  13. | CtxHatMismatch of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.dctx_hat - * Beluga_syntax.Location.t * Beluga_syntax.Synint.LF.mfront
  14. | IllTypedMetaObj of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.clobj - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.cltyp
  15. | TermWhenVar of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.normal
  16. | SubWhenRen of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.sub
  17. | MissingType of string
exception Error of Beluga_syntax.Location.t * error
val throw : Beluga_syntax.Location.t -> error -> 'a
val error_printer : error -> Support.Format.formatter -> unit
exception SpineMismatch

checkSub loc cD cPsi s cPsi' = ()

Succeeds iff cD ; cPsi |- s : cPsi'

The optional term tM_opt, which is the term to which the substitution is being applied, is added to error messages to make them more informative. If tM_opt = Some tM then require tM be well-formed in cD; cPsi'

val checkSchemaWf : Beluga_syntax.Synint.LF.schema -> unit
diff --git a/beluga/Beluga/Lfrecon/index.html b/beluga/Beluga/Lfrecon/index.html deleted file mode 100644 index d15dad260..000000000 --- a/beluga/Beluga/Lfrecon/index.html +++ /dev/null @@ -1,265 +0,0 @@ - -Lfrecon (beluga.Beluga.Lfrecon)

Module Beluga.Lfrecon

module Unify = Unify.StdTrail
module C = Whnf
module S = Substitution
val strengthen : bool Stdlib.ref
val dprint : (unit -> string) Support.Debug.io
val dprnt : string Support.Debug.io
type typeVariant =
  1. | VariantAtom
  2. | VariantPi
  3. | VariantSigma
type hint = [
  1. | `accidental_free_variable of Beluga_syntax.Name.t
  2. | `maybe_eta_expand of Beluga_syntax.Name.t
]
type error =
  1. | ProjBVarImpossible of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Id.offset - * Beluga_syntax.Apx.LF.proj
  2. | BVarTypMissing of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.head
  3. | IdCtxsub
  4. | SubstTyp
  5. | MissingInformationCtx of Beluga_syntax.Int.LF.mctx * Beluga_syntax.Int.LF.dctx
  6. | TypMismatchElab of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.tclo - * Beluga_syntax.Int.LF.tclo
  7. | IllTypedElab of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.tclo - * typeVariant
  8. | IllTypedSub of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Apx.LF.sub option - * Beluga_syntax.Int.LF.dctx
  9. | LeftoverConstraints of Beluga_syntax.Name.t
  10. | PruningFailed
  11. | CompTypAnn
  12. | SynthesizableLFHole of string option
  13. | CompTypAnnSub
  14. | NotPatternSpine
  15. | MissingSchemaForCtxVar of Beluga_syntax.Name.t
  16. | ProjNotValid of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * int - * Beluga_syntax.Int.LF.tclo
  17. | ProjNotFound of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Name.t - * Beluga_syntax.Int.LF.tclo
  18. | HolesFunction
  19. | ParamFun
  20. | CtxVarSchema of Beluga_syntax.Name.t
  21. | SigmaTypImpos of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.tclo
  22. | SpineLengthMisMatch
  23. | IllTypedSubVar of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.dctx
  24. | NotPatSub
  25. | IncompatibleSchemaForCtxVar of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.ctx_var - * Beluga_syntax.Id.cid_schema - * Beluga_syntax.Id.cid_schema
  26. | TermWhenVar of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Apx.LF.normal
  27. | SubWhenRen of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Apx.LF.sub
  28. | HOMVarNotSupported
  29. | SubstVarConflict of Beluga_syntax.Name.t
  30. | UnboundName of Beluga_syntax.Name.t
  31. | UnboundIdSub
  32. | InvalidProjection of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.LF.dctx - * Beluga_syntax.Int.LF.typ - * Beluga_syntax.Apx.LF.proj
exception Error of Beluga_syntax.Location.t * error * hint list
val throw_hint : Beluga_syntax.Location.t -> error -> hint list -> 'a
val throw : Beluga_syntax.Location.t -> error -> 'a
val string_of_typeVariant : typeVariant -> string
val string_of_proj : Beluga_syntax.Apx.LF.proj -> string
val error_printer : error -> Support.Format.formatter -> unit
val print_hint : Support.Format.formatter -> hint -> unit
val what_head : Beluga_syntax.Apx.LF.head -> string
type reconType =
  1. | Pibox
  2. | Pi
exception NotPatSpine
val unify_phat : - Beluga_syntax.Synint.LF.mctx -> - (Beluga_syntax.Int.LF.ctx_var option * int) -> - (Beluga_syntax.Int.LF.ctx_var option * int) -> - bool

This is very similar to Unify.unify_phat. Why are there two functions for unifying hats?

eta-expand a substitution. The substitution could be None (representing the "real" identity substitution in the source program). In this case, if we need to eta-expand it, we convert it to a true identity substitution, and then proceed to eta-expand.

val etaExpandFMV : 'a -> 'b -> 'c -> 'd
val isPatSub : Beluga_syntax.Apx.LF.sub -> bool
val isPatSubOpt : Beluga_syntax.Apx.LF.sub option -> bool
val isProjPatSub : Beluga_syntax.Apx.LF.sub option -> bool
val isTuplePatSub : Beluga_syntax.Apx.LF.sub -> bool
val isVar : Beluga_syntax.Apx.LF.normal -> bool
val isVarTuple : Beluga_syntax.Apx.LF.tuple -> bool
val reset_fvarCnstr : unit -> unit
val fcvar_cnstr : - (Beluga_syntax.Apx.LF.normal * Beluga_syntax.Int.LF.mm_var) list Stdlib.ref
val add_fcvarCnstr : - (Beluga_syntax.Apx.LF.normal * Beluga_syntax.Int.LF.mm_var) -> - unit
val reset_fcvarCnstr : unit -> unit
exception SubTypingFailure
val solve_fcvarCnstr : - (Beluga_syntax.Apx.LF.normal * Beluga_syntax.Int.LF.mm_var) list -> - unit
val solve_constraints : 'a -> unit
val solve_fvarCnstr : reconType -> unit
diff --git a/beluga/Beluga/Load/Make_load/argument-1-Load_state/index.html b/beluga/Beluga/Load/Make_load/argument-1-Load_state/index.html deleted file mode 100644 index 38e2331fb..000000000 --- a/beluga/Beluga/Load/Make_load/argument-1-Load_state/index.html +++ /dev/null @@ -1,81 +0,0 @@ - -Load_state (beluga.Beluga.Load.Make_load.Load_state)

Parameter Make_load.Load_state

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val read_signature_file : - state -> - filename:Support.String.t -> - Synext.signature_file
val reconstruct_signature_file : - state -> - Synext.signature_file -> - Beluga_syntax.Synint.Sgn.sgn_file
diff --git a/beluga/Beluga/Load/Make_load/index.html b/beluga/Beluga/Load/Make_load/index.html deleted file mode 100644 index 6add2e545..000000000 --- a/beluga/Beluga/Load/Make_load/index.html +++ /dev/null @@ -1,76 +0,0 @@ - -Make_load (beluga.Beluga.Load.Make_load)

Module Load.Make_load

Parameters

Signature

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Load_state.state
type state = Load_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
diff --git a/beluga/Beluga/Load/Make_load_state/argument-1-Disambiguation_state/Entry/index.html b/beluga/Beluga/Load/Make_load_state/argument-1-Disambiguation_state/Entry/index.html deleted file mode 100644 index 2a340c758..000000000 --- a/beluga/Beluga/Load/Make_load_state/argument-1-Disambiguation_state/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga.Load.Make_load_state.Disambiguation_state.Entry)

Module Disambiguation_state.Entry

Recorded data on bindings in Beluga signatures.

type t

The type of entry.

val is_lf_variable : t -> Stdlib.Bool.t

is_lf_variable entry is true if and only if entry describes an LF variable.

val is_meta_variable : t -> Stdlib.Bool.t

is_meta_variable entry is true if entry describes a meta-variable or a contextual variable.

Contextual variables exist only because mlam-expressions ambiguously introduce either a meta-variable, a parameter variable, a substitution variable or a context variable.

val is_parameter_variable : t -> Stdlib.Bool.t

is_parameter_variable is like is_meta_variable, but for entries describing parameter variables.

val is_substitution_variable : t -> Stdlib.Bool.t

is_substitution_variable is like is_meta_variable, but for entries describing parameter variables.

val is_context_variable : t -> Stdlib.Bool.t

is_context_variable is like is_meta_variable, but for entries describing context variables.

val is_computation_variable : t -> Stdlib.Bool.t

is_computation_variable entry is true if and only if entry describes a computation-level variable.

val is_variable : t -> Stdlib.Bool.t

is_variable entry is true if and only if entry describes an LF variable, a meta-level variable, or a computation-level variable.

This is used to discern between the following two cases when disambiguating identifiers in patterns:

  • The case where an exception should be raised because the identifier is a bound variable of the wrong sort.
  • The case where the identifier should be a free variable shadowing a constant.
val is_lf_type_constant : t -> Stdlib.Bool.t

is_lf_type_constant entry is true if and only if entry describes an LF type-level constant.

val is_lf_term_constant : t -> Stdlib.Bool.t

is_lf_term_constant is like is_lf_type_constant, but for entries describing LF term-level constants.

val is_schema_constant : t -> Stdlib.Bool.t

is_schema_constant is like is_lf_type_constant, but for entries describing context schemas.

val is_computation_inductive_type_constant : t -> Stdlib.Bool.t

is_computation_inductive_type_constant is like is_lf_type_constant, but for entries describing inductive computation-level type constants.

val is_computation_stratified_type_constant : t -> Stdlib.Bool.t

is_computation_stratified_type_constant is like is_lf_type_constant, but for entries describing stratified computation-level type constants.

val is_computation_coinductive_type_constant : t -> Stdlib.Bool.t

is_computation_coinductive_type_constant is like is_lf_type_constant, but for entries describing coinductive computation-level type constants.

val is_computation_abbreviation_type_constant : t -> Stdlib.Bool.t

is_computation_abbreviation_type_constant is like is_lf_type_constant, but for entries describing computation-level type constant abbreviations (introduced by the Beluga keyword typedef).

val is_computation_term_constructor : t -> Stdlib.Bool.t

is_computation_term_constructor is like is_lf_type_constant, but for entries describing computation-level constructors.

val is_computation_term_destructor : t -> Stdlib.Bool.t

is_computation_term_destructor is like is_lf_type_constant, but for entries describing computation-level destructors.

val is_program_constant : t -> Stdlib.Bool.t

is_program_constant is like is_lf_type_constant, but for entries describing computation-level programs (introduced by the Beluga keyword rec or val).

val is_module : t -> Stdlib.Bool.t

is_module is like is_lf_type_constant, but for entries describing modules.

diff --git a/beluga/Beluga/Load/Make_load_state/argument-1-Disambiguation_state/index.html b/beluga/Beluga/Load/Make_load_state/argument-1-Disambiguation_state/index.html deleted file mode 100644 index 9a0b4e32c..000000000 --- a/beluga/Beluga/Load/Make_load_state/argument-1-Disambiguation_state/index.html +++ /dev/null @@ -1,284 +0,0 @@ - -Disambiguation_state (beluga.Beluga.Load.Make_load_state.Disambiguation_state)

Parameter Make_load_state.Disambiguation_state

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
module Entry : Beluga_parser.Disambiguation_state.ENTRY

Recorded data on bindings in Beluga signatures.

Variables

val add_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_variable state ?location identifier adds identifier as a bound LF variable, with binding site location. If location = Option.None, then identifier's location is used instead.

This is mostly used for testing. For locally binding an LF variable, see with_bound_lf_variable.

val add_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_meta_variable is like add_lf_variable, but the identifier is added as a bound meta-variable.

val add_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_parameter_variable is like add_lf_variable, but the identifier is added as a bound parameter variable (those variables prefixed by '#' like "#p").

val add_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_substitution_variable is like add_lf_variable, but the identifier is added as a bound substitution variable (those variables prefixed by '$' like "$S").

val add_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_context_variable is like add_lf_variable, but the identifier is added as a bound context variable.

val add_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_contextual_variable is like add_lf_variable, but the identifier is added as a bound contextual variable, meaning that it is ambiguously bound as either a meta, parameter, substitution or context variable.

val add_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_variable is like add_lf_variable, but the identifier is added as a bound computation-level variable.

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state ?location identifier is add_lf_variable state ?location identifier, with the additional behaviour of adding identifier as an inner pattern bound identifier and as a free variable during pattern disambiguation. This means that identifier can subsequently be looked up as a bound LF variable during pattern disambiguation. This effectively allows free LF variables to appear multiple times (non-linearly) in patterns.

See with_free_variables_as_pattern_variables for the handler for converting free variables in patterns to binders for use as bound variables in expressions.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free meta-variable.

val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free parameter variable.

val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free substitution variable.

val add_free_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free context variable.

val add_free_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_computation_variable state ?location identifier adds identifier to state as a free variable during pattern disambiguation. This differs from add_free_lf_variable in that free computation-level variables in patterns do not have implicit binders (because they are not part of the meta-context), and hence must appear only once (linearly) in the overall pattern.

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state ?location identifier m is the result of running m in the local state derived from state having identifier as a bound LF variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

For example, the disambiguation of an LF term-level lambda-abstraction \x. m requires that the parameter x is locally added in scope when disambiguating the body m. This is achieved like this:

with_bound_lf_variable state x (fun state ->
-    disambiguate_lf_term state m)
val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_meta_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound meta-variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound contextual variable. This is different from with_bound_meta_variable, with_bound_parameter_variable, with_bound_substitution_variable and with_bound_context_variable in that it is unknown whether identifier should be a meta-variable, parameter variable, substitution variable or context variable. This is used in particular for mlam expressions.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_computation_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound computation-level variable.

val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_meta_variable state ?location identifier m is like with_bound_meta_variable state ?location identifier m except that identifier is also treated as a free variable so that in with_free_variables_as_pattern_variables it can be treated as a pattern variable usable in the expression.

This is used for meta-variables introduced in the meta-context of a pattern during case analysis. Those variables are considered bound in both the pattern and expression.

For example, B as below is one such bound pattern meta-variable, and appears in scope for ?.

case x of
-| { B : [g |- o] } [g |- impi \u. D] => ?
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_parameter_variable is like with_bound_pattern_meta_variable, but for a parameter variable introduced in the meta-context of a pattern.

val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_substitution_variable is like with_bound_pattern_meta_variable, but for a substitution variable introduced in the meta-context of a pattern.

val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_context_variable is like with_bound_pattern_meta_variable, but for a context variable introduced in the meta-context of a pattern.

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression state is the result of running expression with the free variables added in pattern as bound variables. This is used to disambiguate expression with bound variables arising from free variables in pattern.

  1. pattern is run with respect to state while keeping track of free variables. Variables bound outside the pattern are ignored in lookups.
  2. expression is run with respect to state with the addition of the tracked free variables from patterns as bound variables.

Lookups performed in pattern are more complex. The variables in state count as being unbound, but the variables with binders in the pattern count as bound. Binders in a pattern can be user-specified, or to be reconstructed during abstraction.

A variable is specifically inner bound if it is introduced explicitly by a lambda abstraction or the pattern meta-context, as an explicit or implicit parameter. Free meta-level variables are reconstructed inner bound. For instance, assuming s and ctx are constants:

  • In the pattern (x, x), both occurrences of x are pattern variables, and that pattern is not linear.
  • In the pattern {M : [ |- nat]} [ |- s M], M as introduced in the meta-context is a pattern variable, and M is an inner pattern-bound identifier in s M, so that pattern is linear.
  • In the pattern [ |- \x. s x], there are no pattern variables.
  • In the pattern ([g |- s M], [g |- s M]), g and M are pattern variables in the left projection of the tuple pattern, and inner pattern-bound in the right projection of the tuple pattern. This is because the pattern is reconstructed as {g : ctx} {M : [g |- nat]} ([g |- s M], [g |- s M]).
val with_scope : state -> (state -> 'a) -> 'a

with_scope state m runs m in a nested bindings scope that is discarded afterwards.

val with_parent_scope : state -> (state -> 'a) -> 'a

with_parent_scope state m runs m while ignoring the topmost scope.

This is used for the disambiguation of Harpoon proof scripts because Harpoon hypotheticals are already serialized with all the identifiers in the meta-level and computation-level contexts of the proof.

val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used for backtracking when disambiguating old-style LF type-level and term-level declarations (i.e., x : X where X may be an LF kind or an LF type).

This is also used in REPLs to safely run parsing functions and recover the state in case of a raised exception during disambiguation.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Constants

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_type_constant state ?location ?arity identifier adds identifier as a bound LF type-level constant.

In the disambiguation of a module's declaration, this also adds the constant as one of the module's declarations.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_term_constant is like add_lf_type_constant, but for LF term-level constants.

val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_schema_constant is like add_lf_type_constant, but for schema constants.

val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_inductive_computation_type_constant is like add_lf_type_constant, but for inductive computation-level type constants.

val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_stratified_computation_type_constant is like add_lf_type_constant, but for stratified computation-level type constants.

val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_coinductive_computation_type_constant is like add_lf_type_constant, but for coinductive computation-level type constants.

val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation_computation_type_constant is like add_lf_type_constant, but for computation-level abbreviation type constants.

val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_constructor is like add_lf_type_constant, but for computation-level term constructors.

val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_destructor is like add_lf_type_constant, but for computation-level term destructors.

val add_program_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_program_constant is like add_lf_type_constant, but for computation-level program constants.

val add_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

add_module state ?location identifier m is the result of running m in a module disambiguation state, whereby added constants are kept track of as declarations in the module having identifier.

Lookups

exception Unbound_identifier of Beluga_syntax.Syncom.Identifier.t

Unbound_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is caught whenever a variable lookup fails and identifier can be disambiguated as a free variable.

exception Unbound_qualified_identifier of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_qualified_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is unrecoverable, but is caught during disambiguation to provide better error messages.

exception Unbound_namespace of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_namespace namespace_identifier is raised if a qualified identifier could not be looked up in a disambiguation state because the namespace with identifier namespace_identifier is unbound.

val lookup_toplevel : state -> Beluga_syntax.Syncom.Identifier.t -> Entry.t

lookup_toplevel state identifier is entry if identifier resolves to entry in state. If identifier is unbound in state, then Unbound_identifier identifier is raised.

lookup state identifier is entry if identifier resolves to entry in state. Otherwise:

  • Unbound_identifier ident) is raised if the first segment ident in identifier is unbound.
  • Unbound_namespace namespace_identifier is raised if a segment in identifier other than the first or last is unbound.
  • Unbound_qualified_identifier identifier is raised if the last segment in identifier is unbound.
type maximum_lookup_result =
  1. | Unbound of {
    1. segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  2. | Partially_bound of {
    1. leading_segments : Beluga_syntax.Syncom.Identifier.t Support.List.t;
    2. segment : Beluga_syntax.Syncom.Identifier.t;
    3. entry : Entry.t;
    4. trailing_segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  3. | Bound of {
    1. entry : Entry.t;
    }

maximum_lookup state segments is either:

  • Unbound { segments } if the first segment in segments is unbound in state.
  • Partially_bound { leading_segments; segment; entry; trailing_segments } if the qualified identifier with namespaces leading_segments and name segment is bound to entry in state.
  • Bound { identifier; entry } if segments form a qualified identifier bound to entry in state.
val actual_binding_exn : - Beluga_syntax.Syncom.Qualified_identifier.t -> - Entry.t -> - exn

actual_binding_exn identifier entry is an exception reporting what sort of entry is bound at identifier. The exception is annotated with the entry's binding location.

Signature Operations

val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state module_identifier adds the exported constants from the module bound to module_identifier as toplevel entries in state. If module_identifier is unbound in state, then an exception is raised.

val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t

get_default_associativity state is the associativity to use for infix operators defined by the user using a pragma, without specifying the infix operator's associativity.

val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state default_associativity sets default_associativity as the associativity to return from get_default_associativity.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the precedence to use for operators defined by the user using a pragma, without specifying the operator's precedence.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state default_precedence sets default_precedence as the precedence to return from get_default_precedence.

val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence identifier adds a prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity identifier adds an infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence identifier adds a postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state identifier is Option.Some operator if identifier is bound to an operator with descriptor operator in state, and Option.None otherwise.

This is used to resolve operators in the disambiguation of applications, which are parsed as lists of expressions.

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_module_abbreviation state ?location module_identifier abbreviation adds the synonym abbreviation for the module bound to identifier in state.

An exception is raised if module_identifier is unbound in state, or if module_identifier is not bound to a module in state.

diff --git a/beluga/Beluga/Load/Make_load_state/argument-2-Disambiguation/Entry/index.html b/beluga/Beluga/Load/Make_load_state/argument-2-Disambiguation/Entry/index.html deleted file mode 100644 index a0e880e53..000000000 --- a/beluga/Beluga/Load/Make_load_state/argument-2-Disambiguation/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga.Load.Make_load_state.Disambiguation.Entry)

Module Disambiguation.Entry

Recorded data on bindings in Beluga signatures.

type t

The type of entry.

val is_lf_variable : t -> Stdlib.Bool.t

is_lf_variable entry is true if and only if entry describes an LF variable.

val is_meta_variable : t -> Stdlib.Bool.t

is_meta_variable entry is true if entry describes a meta-variable or a contextual variable.

Contextual variables exist only because mlam-expressions ambiguously introduce either a meta-variable, a parameter variable, a substitution variable or a context variable.

val is_parameter_variable : t -> Stdlib.Bool.t

is_parameter_variable is like is_meta_variable, but for entries describing parameter variables.

val is_substitution_variable : t -> Stdlib.Bool.t

is_substitution_variable is like is_meta_variable, but for entries describing parameter variables.

val is_context_variable : t -> Stdlib.Bool.t

is_context_variable is like is_meta_variable, but for entries describing context variables.

val is_computation_variable : t -> Stdlib.Bool.t

is_computation_variable entry is true if and only if entry describes a computation-level variable.

val is_variable : t -> Stdlib.Bool.t

is_variable entry is true if and only if entry describes an LF variable, a meta-level variable, or a computation-level variable.

This is used to discern between the following two cases when disambiguating identifiers in patterns:

  • The case where an exception should be raised because the identifier is a bound variable of the wrong sort.
  • The case where the identifier should be a free variable shadowing a constant.
val is_lf_type_constant : t -> Stdlib.Bool.t

is_lf_type_constant entry is true if and only if entry describes an LF type-level constant.

val is_lf_term_constant : t -> Stdlib.Bool.t

is_lf_term_constant is like is_lf_type_constant, but for entries describing LF term-level constants.

val is_schema_constant : t -> Stdlib.Bool.t

is_schema_constant is like is_lf_type_constant, but for entries describing context schemas.

val is_computation_inductive_type_constant : t -> Stdlib.Bool.t

is_computation_inductive_type_constant is like is_lf_type_constant, but for entries describing inductive computation-level type constants.

val is_computation_stratified_type_constant : t -> Stdlib.Bool.t

is_computation_stratified_type_constant is like is_lf_type_constant, but for entries describing stratified computation-level type constants.

val is_computation_coinductive_type_constant : t -> Stdlib.Bool.t

is_computation_coinductive_type_constant is like is_lf_type_constant, but for entries describing coinductive computation-level type constants.

val is_computation_abbreviation_type_constant : t -> Stdlib.Bool.t

is_computation_abbreviation_type_constant is like is_lf_type_constant, but for entries describing computation-level type constant abbreviations (introduced by the Beluga keyword typedef).

val is_computation_term_constructor : t -> Stdlib.Bool.t

is_computation_term_constructor is like is_lf_type_constant, but for entries describing computation-level constructors.

val is_computation_term_destructor : t -> Stdlib.Bool.t

is_computation_term_destructor is like is_lf_type_constant, but for entries describing computation-level destructors.

val is_program_constant : t -> Stdlib.Bool.t

is_program_constant is like is_lf_type_constant, but for entries describing computation-level programs (introduced by the Beluga keyword rec or val).

val is_module : t -> Stdlib.Bool.t

is_module is like is_lf_type_constant, but for entries describing modules.

diff --git a/beluga/Beluga/Load/Make_load_state/argument-2-Disambiguation/index.html b/beluga/Beluga/Load/Make_load_state/argument-2-Disambiguation/index.html deleted file mode 100644 index 1c2d82711..000000000 --- a/beluga/Beluga/Load/Make_load_state/argument-2-Disambiguation/index.html +++ /dev/null @@ -1,382 +0,0 @@ - -Disambiguation (beluga.Beluga.Load.Make_load_state.Disambiguation)

Parameter Make_load_state.Disambiguation

include Beluga_parser.DISAMBIGUATION_STATE - with type state = Disambiguation_state.state
module Entry : Beluga_parser.Disambiguation_state.ENTRY

Recorded data on bindings in Beluga signatures.

Variables

val add_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_variable state ?location identifier adds identifier as a bound LF variable, with binding site location. If location = Option.None, then identifier's location is used instead.

This is mostly used for testing. For locally binding an LF variable, see with_bound_lf_variable.

val add_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_meta_variable is like add_lf_variable, but the identifier is added as a bound meta-variable.

val add_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_parameter_variable is like add_lf_variable, but the identifier is added as a bound parameter variable (those variables prefixed by '#' like "#p").

val add_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_substitution_variable is like add_lf_variable, but the identifier is added as a bound substitution variable (those variables prefixed by '$' like "$S").

val add_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_context_variable is like add_lf_variable, but the identifier is added as a bound context variable.

val add_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_contextual_variable is like add_lf_variable, but the identifier is added as a bound contextual variable, meaning that it is ambiguously bound as either a meta, parameter, substitution or context variable.

val add_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_variable is like add_lf_variable, but the identifier is added as a bound computation-level variable.

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state ?location identifier is add_lf_variable state ?location identifier, with the additional behaviour of adding identifier as an inner pattern bound identifier and as a free variable during pattern disambiguation. This means that identifier can subsequently be looked up as a bound LF variable during pattern disambiguation. This effectively allows free LF variables to appear multiple times (non-linearly) in patterns.

See with_free_variables_as_pattern_variables for the handler for converting free variables in patterns to binders for use as bound variables in expressions.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free meta-variable.

val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free parameter variable.

val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free substitution variable.

val add_free_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free context variable.

val add_free_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_computation_variable state ?location identifier adds identifier to state as a free variable during pattern disambiguation. This differs from add_free_lf_variable in that free computation-level variables in patterns do not have implicit binders (because they are not part of the meta-context), and hence must appear only once (linearly) in the overall pattern.

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state ?location identifier m is the result of running m in the local state derived from state having identifier as a bound LF variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

For example, the disambiguation of an LF term-level lambda-abstraction \x. m requires that the parameter x is locally added in scope when disambiguating the body m. This is achieved like this:

with_bound_lf_variable state x (fun state ->
-    disambiguate_lf_term state m)
val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_meta_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound meta-variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound contextual variable. This is different from with_bound_meta_variable, with_bound_parameter_variable, with_bound_substitution_variable and with_bound_context_variable in that it is unknown whether identifier should be a meta-variable, parameter variable, substitution variable or context variable. This is used in particular for mlam expressions.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_computation_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound computation-level variable.

val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_meta_variable state ?location identifier m is like with_bound_meta_variable state ?location identifier m except that identifier is also treated as a free variable so that in with_free_variables_as_pattern_variables it can be treated as a pattern variable usable in the expression.

This is used for meta-variables introduced in the meta-context of a pattern during case analysis. Those variables are considered bound in both the pattern and expression.

For example, B as below is one such bound pattern meta-variable, and appears in scope for ?.

case x of
-| { B : [g |- o] } [g |- impi \u. D] => ?
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_parameter_variable is like with_bound_pattern_meta_variable, but for a parameter variable introduced in the meta-context of a pattern.

val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_substitution_variable is like with_bound_pattern_meta_variable, but for a substitution variable introduced in the meta-context of a pattern.

val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_context_variable is like with_bound_pattern_meta_variable, but for a context variable introduced in the meta-context of a pattern.

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression state is the result of running expression with the free variables added in pattern as bound variables. This is used to disambiguate expression with bound variables arising from free variables in pattern.

  1. pattern is run with respect to state while keeping track of free variables. Variables bound outside the pattern are ignored in lookups.
  2. expression is run with respect to state with the addition of the tracked free variables from patterns as bound variables.

Lookups performed in pattern are more complex. The variables in state count as being unbound, but the variables with binders in the pattern count as bound. Binders in a pattern can be user-specified, or to be reconstructed during abstraction.

A variable is specifically inner bound if it is introduced explicitly by a lambda abstraction or the pattern meta-context, as an explicit or implicit parameter. Free meta-level variables are reconstructed inner bound. For instance, assuming s and ctx are constants:

  • In the pattern (x, x), both occurrences of x are pattern variables, and that pattern is not linear.
  • In the pattern {M : [ |- nat]} [ |- s M], M as introduced in the meta-context is a pattern variable, and M is an inner pattern-bound identifier in s M, so that pattern is linear.
  • In the pattern [ |- \x. s x], there are no pattern variables.
  • In the pattern ([g |- s M], [g |- s M]), g and M are pattern variables in the left projection of the tuple pattern, and inner pattern-bound in the right projection of the tuple pattern. This is because the pattern is reconstructed as {g : ctx} {M : [g |- nat]} ([g |- s M], [g |- s M]).
val with_scope : state -> (state -> 'a) -> 'a

with_scope state m runs m in a nested bindings scope that is discarded afterwards.

val with_parent_scope : state -> (state -> 'a) -> 'a

with_parent_scope state m runs m while ignoring the topmost scope.

This is used for the disambiguation of Harpoon proof scripts because Harpoon hypotheticals are already serialized with all the identifiers in the meta-level and computation-level contexts of the proof.

val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used for backtracking when disambiguating old-style LF type-level and term-level declarations (i.e., x : X where X may be an LF kind or an LF type).

This is also used in REPLs to safely run parsing functions and recover the state in case of a raised exception during disambiguation.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Constants

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_type_constant state ?location ?arity identifier adds identifier as a bound LF type-level constant.

In the disambiguation of a module's declaration, this also adds the constant as one of the module's declarations.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_term_constant is like add_lf_type_constant, but for LF term-level constants.

val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_schema_constant is like add_lf_type_constant, but for schema constants.

val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_inductive_computation_type_constant is like add_lf_type_constant, but for inductive computation-level type constants.

val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_stratified_computation_type_constant is like add_lf_type_constant, but for stratified computation-level type constants.

val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_coinductive_computation_type_constant is like add_lf_type_constant, but for coinductive computation-level type constants.

val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation_computation_type_constant is like add_lf_type_constant, but for computation-level abbreviation type constants.

val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_constructor is like add_lf_type_constant, but for computation-level term constructors.

val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_destructor is like add_lf_type_constant, but for computation-level term destructors.

val add_program_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_program_constant is like add_lf_type_constant, but for computation-level program constants.

val add_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

add_module state ?location identifier m is the result of running m in a module disambiguation state, whereby added constants are kept track of as declarations in the module having identifier.

Lookups

exception Unbound_identifier of Beluga_syntax.Syncom.Identifier.t

Unbound_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is caught whenever a variable lookup fails and identifier can be disambiguated as a free variable.

exception Unbound_qualified_identifier of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_qualified_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is unrecoverable, but is caught during disambiguation to provide better error messages.

exception Unbound_namespace of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_namespace namespace_identifier is raised if a qualified identifier could not be looked up in a disambiguation state because the namespace with identifier namespace_identifier is unbound.

val lookup_toplevel : state -> Beluga_syntax.Syncom.Identifier.t -> Entry.t

lookup_toplevel state identifier is entry if identifier resolves to entry in state. If identifier is unbound in state, then Unbound_identifier identifier is raised.

lookup state identifier is entry if identifier resolves to entry in state. Otherwise:

  • Unbound_identifier ident) is raised if the first segment ident in identifier is unbound.
  • Unbound_namespace namespace_identifier is raised if a segment in identifier other than the first or last is unbound.
  • Unbound_qualified_identifier identifier is raised if the last segment in identifier is unbound.
type maximum_lookup_result =
  1. | Unbound of {
    1. segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  2. | Partially_bound of {
    1. leading_segments : Beluga_syntax.Syncom.Identifier.t Support.List.t;
    2. segment : Beluga_syntax.Syncom.Identifier.t;
    3. entry : Entry.t;
    4. trailing_segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  3. | Bound of {
    1. entry : Entry.t;
    }

maximum_lookup state segments is either:

  • Unbound { segments } if the first segment in segments is unbound in state.
  • Partially_bound { leading_segments; segment; entry; trailing_segments } if the qualified identifier with namespaces leading_segments and name segment is bound to entry in state.
  • Bound { identifier; entry } if segments form a qualified identifier bound to entry in state.
val actual_binding_exn : - Beluga_syntax.Syncom.Qualified_identifier.t -> - Entry.t -> - exn

actual_binding_exn identifier entry is an exception reporting what sort of entry is bound at identifier. The exception is annotated with the entry's binding location.

Signature Operations

val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state module_identifier adds the exported constants from the module bound to module_identifier as toplevel entries in state. If module_identifier is unbound in state, then an exception is raised.

val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t

get_default_associativity state is the associativity to use for infix operators defined by the user using a pragma, without specifying the infix operator's associativity.

val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state default_associativity sets default_associativity as the associativity to return from get_default_associativity.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the precedence to use for operators defined by the user using a pragma, without specifying the operator's precedence.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state default_precedence sets default_precedence as the precedence to return from get_default_precedence.

val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence identifier adds a prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity identifier adds an infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence identifier adds a postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state identifier is Option.Some operator if identifier is bound to an operator with descriptor operator in state, and Option.None otherwise.

This is used to resolve operators in the disambiguation of applications, which are parsed as lists of expressions.

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_module_abbreviation state ?location module_identifier abbreviation adds the synonym abbreviation for the module bound to identifier in state.

An exception is raised if module_identifier is unbound in state, or if module_identifier is not bound to a module in state.

include Beluga_parser.Lf_disambiguation.LF_DISAMBIGUATION - with type state := state

Disambiguation

val disambiguate_lf_kind : state -> Synprs.lf_object -> Synext.lf_kind

disambiguate_lf_kind state object_ is kind', the LF kind disambiguated from kind in the disambiguation state state.

val disambiguate_lf_typ : state -> Synprs.lf_object -> Synext.lf_typ

disambiguate_lf_typ state typ is typ', the LF type disambiguated from typ in the disambiguation state state.

val disambiguate_lf_term : state -> Synprs.lf_object -> Synext.lf_term

disambiguate_lf_term state term is term', the LF term disambiguated from term in the disambiguation state state.

include Beluga_parser.Clf_disambiguation.CLF_DISAMBIGUATION - with type state := state

Disambiguation

val disambiguate_clf_typ : state -> Synprs.clf_object -> Synext.clf_typ
val disambiguate_clf_term : state -> Synprs.clf_object -> Synext.clf_term
val disambiguate_clf_substitution : - state -> - Synprs.clf_context_object -> - Synext.clf_substitution
val with_disambiguated_clf_context : - state -> - Synprs.clf_context_object -> - (state -> Synext.clf_context -> 'a) -> - 'a
val disambiguate_clf_term_pattern : - state -> - Synprs.clf_object -> - Synext.clf_term_pattern
val disambiguate_clf_substitution_pattern : - state -> - Synprs.clf_context_object -> - Synext.clf_substitution_pattern
val with_disambiguated_clf_context_pattern : - state -> - Synprs.clf_context_object -> - (state -> Synext.clf_context_pattern -> 'a) -> - 'a
val disambiguate_clf_context_pattern : - state -> - Synprs.clf_context_object -> - Synext.clf_context_pattern
include Beluga_parser.Meta_disambiguation.META_DISAMBIGUATION - with type state := state

Disambiguation

val disambiguate_meta_typ : state -> Synprs.meta_thing -> Synext.meta_typ
val disambiguate_meta_object : state -> Synprs.meta_thing -> Synext.meta_object
val disambiguate_meta_pattern : - state -> - Synprs.meta_thing -> - Beluga_syntax.Synext.Meta.Pattern.t
val disambiguate_schema : state -> Synprs.schema_object -> Synext.schema
val with_disambiguated_meta_context : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
val with_disambiguated_meta_context_pattern : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
include Beluga_parser.Comp_disambiguation.COMP_DISAMBIGUATION - with type state := state

Disambiguation

val disambiguate_comp_kind : - state -> - Synprs.comp_sort_object -> - Synext.comp_kind
val disambiguate_comp_typ : state -> Synprs.comp_sort_object -> Synext.comp_typ
val disambiguate_comp_expression : - state -> - Synprs.comp_expression_object -> - Synext.comp_expression
val disambiguate_comp_pattern : - state -> - Synprs.comp_pattern_object -> - Synext.comp_pattern
val disambiguate_comp_copattern : - state -> - Synprs.comp_copattern_object Support.List1.t -> - Synext.comp_copattern
val with_disambiguated_comp_context : - state -> - Synprs.comp_context_object -> - (state -> Synext.comp_context -> 'a) -> - 'a
include Beluga_parser.Harpoon_disambiguation.HARPOON_DISAMBIGUATION - with type state := state

Disambiguation

val disambiguate_harpoon_proof : - state -> - Synprs.harpoon_proof -> - Synext.harpoon_proof
val with_disambiguated_harpoon_command : - state -> - Synprs.harpoon_command -> - (state -> Synext.harpoon_command -> 'a) -> - 'a
val disambiguate_harpoon_directive : - state -> - Synprs.harpoon_directive -> - Synext.harpoon_directive
val disambiguate_harpoon_split_branch : - state -> - Synprs.harpoon_split_branch -> - Synext.harpoon_split_branch
val disambiguate_harpoon_suffices_branch : - state -> - Synprs.harpoon_suffices_branch -> - Synext.harpoon_suffices_branch
val disambiguate_harpoon_hypothetical : - state -> - Synprs.harpoon_hypothetical -> - Synext.harpoon_hypothetical
val disambiguate_harpoon_repl_command : - state -> - Synprs.harpoon_repl_command -> - Synext.harpoon_repl_command
include Beluga_parser.Signature_disambiguation.SIGNATURE_DISAMBIGUATION - with type state := state
include Support.Imperative_state.IMPERATIVE_STATE with type state := state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_pragma : - state -> - Synprs.signature_pragma -> - Synext.signature_pragma
val disambiguate_global_pragma : - state -> - Synprs.signature_global_pragma -> - Synext.signature_global_pragma
val disambiguate_totality_declaration : - state -> - Synprs.signature_totality_declaration -> - Synext.signature_totality_declaration
val disambiguate_declaration : - state -> - Synprs.signature_declaration -> - Synext.signature_declaration
val disambiguate_signature_file : - state -> - Synprs.signature_file -> - Synext.signature_file
val disambiguate_signature : state -> Synprs.signature -> Synext.signature
diff --git a/beluga/Beluga/Load/Make_load_state/argument-3-Signature_reconstruction_state/index.html b/beluga/Beluga/Load/Make_load_state/argument-3-Signature_reconstruction_state/index.html deleted file mode 100644 index d1503042c..000000000 --- a/beluga/Beluga/Load/Make_load_state/argument-3-Signature_reconstruction_state/index.html +++ /dev/null @@ -1,214 +0,0 @@ - -Signature_reconstruction_state (beluga.Beluga.Load.Make_load_state.Signature_reconstruction_state)

Parameter Make_load_state.Signature_reconstruction_state

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val add_leftover_vars : - state -> - Abstract.free_var Synint.LF.ctx -> - Beluga_syntax.Syncom.Location.t -> - Stdlib.Unit.t
val with_disabled_lf_strengthening : - state -> - location:Beluga_syntax.Syncom.Location.t -> - (state -> 'a) -> - 'a

disable_lf_strengthening state ~location disables the strengthening of LF terms and types during LF reconstruction.

location is the location to use for error-reporting in case of failure to perform disable_lf_strengthening ~location.

val with_warn_on_coverage_error : - state -> - location:Beluga_syntax.Syncom.Location.t -> - (state -> 'a) -> - 'a

with_warn_on_coverage_error state ~location sets the error-reporting mode of pattern coverage-checking to `warn'.

location is the location to use for error-reporting in case of failure to perform with_warn_on_coverage_error ~location.

val with_coverage_checking : - state -> - location:Beluga_syntax.Syncom.Location.t -> - (state -> 'a) -> - 'a

with_coverage_checking state ~location enables coverage-checking.

location is the location to use for error-reporting in case of failure to perform with_coverage_checking ~location.

val set_name_generation_bases : - state -> - location:Beluga_syntax.Syncom.Location.t -> - meta_variable_base:Beluga_syntax.Syncom.Identifier.t -> - ?computation_variable_base:Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

set_name_generation_bases state ~location ~meta_variable_base ?computation_variable_base constant sets the naming convention for name generation of meta-level and computation-level variables using meta_variable_base and computation_variable_base respectively for a type-level constant constant.

location is the location to use for error-reporting in case of failure to perform set_name_generation_bases ~location ~meta_variable_base ?computation_variable_base constant.

val set_default_associativity : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t
val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t
val set_default_precedence : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Support.Int.t -> - Stdlib.Unit.t
val get_default_precedence : state -> Support.Int.t
val add_prefix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_infix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_postfix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_postponed_prefix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?location ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?location ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?location ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

val apply_postponed_fixity_pragmas_for_constant : - state -> - Beluga_syntax.Syncom.Identifier.t -> - unit

apply_postponed_fixity_pragmas_for_constant state identifier adds in scope the postponed fixity pragmas for the constant having identifier identifier.

val open_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - abbreviation:Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val with_checkpoint : state -> (state -> 'a) -> 'a

with_checkpoint state m is the result of running m with state. Note that the state is rolled back entirely.

ID Allocation

Indexing

val index_lf_kind : state -> Synext.lf_kind -> Synapx.LF.kind

index_lf_kind state kind is kind indexed with respect to state. Free variables in kind are discarded.

val index_lf_typ : state -> Synext.lf_typ -> Synapx.LF.typ
val index_schema : state -> Synext.schema -> Synapx.LF.schema
val index_comp_kind : state -> Synext.comp_kind -> Synapx.Comp.kind
val index_comp_typ : state -> Synext.comp_typ -> Synapx.Comp.typ
val index_comp_expression : state -> Synext.comp_expression -> Synapx.Comp.exp
val index_comp_typedef : - state -> - Synext.comp_typ -> - Synext.comp_kind -> - Synapx.Comp.typ * Synapx.Comp.kind
val index_comp_theorem : state -> Synext.comp_expression -> Synapx.Comp.thm
val index_harpoon_proof : state -> Synext.harpoon_proof -> Synapx.Comp.thm

Adding a constant or module introduces an identifier in the state. Whenever an extensible declaration is shadowed, it is frozen.

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_typ -> - Stdlib.Unit.t

add_lf_type_constant state ?location identifier id adds the LF type constant having identifier identifier, ID cid and binding site location to the state. If location = Option.None, then the identifier's location is used as binding site.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_term -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_schema -> - Stdlib.Unit.t
val add_comp_val : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_prog -> - Stdlib.Unit.t
val add_comp_typedef : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_typdef -> - Stdlib.Unit.t
val add_comp_inductive_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_comp_stratified_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_comp_cotype_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_cotyp -> - Stdlib.Unit.t
val add_comp_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_const -> - Stdlib.Unit.t
val add_comp_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_dest -> - Stdlib.Unit.t

add_module state ?location identifier cid m adds the module having identifier identifier and binding site location to the state. The action m is executed in the module's state. m is typically the reconstruction of the module's entries.

val freeze_all_unfrozen_declarations : state -> Stdlib.Unit.t

freeze_all_unfrozen_declarations state freezes all the unfrozen declarations. Unfrozen declarations are LF type families in oldstyle syntax, and to which new LF term-level constants may be added.

diff --git a/beluga/Beluga/Load/Make_load_state/argument-4-Signature_reconstruction/index.html b/beluga/Beluga/Load/Make_load_state/argument-4-Signature_reconstruction/index.html deleted file mode 100644 index 84467708e..000000000 --- a/beluga/Beluga/Load/Make_load_state/argument-4-Signature_reconstruction/index.html +++ /dev/null @@ -1,79 +0,0 @@ - -Signature_reconstruction (beluga.Beluga.Load.Make_load_state.Signature_reconstruction)

Parameter Make_load_state.Signature_reconstruction

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Signature_reconstruction_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val reconstruct_signature : - state -> - Synext.signature -> - Beluga_syntax.Synint.Sgn.sgn
val reconstruct_signature_file : - state -> - Synext.signature_file -> - Beluga_syntax.Synint.Sgn.sgn_file
diff --git a/beluga/Beluga/Load/Make_load_state/index.html b/beluga/Beluga/Load/Make_load_state/index.html deleted file mode 100644 index 0cbf0c5c3..000000000 --- a/beluga/Beluga/Load/Make_load_state/index.html +++ /dev/null @@ -1,86 +0,0 @@ - -Make_load_state (beluga.Beluga.Load.Make_load_state)

Module Load.Make_load_state

Parameters

Signature

include LOAD_STATE
include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val read_signature_file : - state -> - filename:Support.String.t -> - Synext.signature_file
val reconstruct_signature_file : - state -> - Synext.signature_file -> - Beluga_syntax.Synint.Sgn.sgn_file
diff --git a/beluga/Beluga/Load/index.html b/beluga/Beluga/Load/index.html deleted file mode 100644 index d690d153c..000000000 --- a/beluga/Beluga/Load/index.html +++ /dev/null @@ -1,17 +0,0 @@ - -Load (beluga.Beluga.Load)

Module Beluga.Load

module type LOAD_STATE = sig ... end
module type LOAD = sig ... end
val load_fresh : string -> string list * Beluga_syntax.Synint.Sgn.sgn

load_fresh filename clears all internal state and loads the given path to a .cfg or .bel file. The list of resolved paths (paths to .bel files) is returned, along with the loaded signature.

diff --git a/beluga/Beluga/Load/module-type-LOAD/index.html b/beluga/Beluga/Load/module-type-LOAD/index.html deleted file mode 100644 index e44e24d83..000000000 --- a/beluga/Beluga/Load/module-type-LOAD/index.html +++ /dev/null @@ -1,75 +0,0 @@ - -LOAD (beluga.Beluga.Load.LOAD)

Module type Load.LOAD

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
diff --git a/beluga/Beluga/Load/module-type-LOAD_STATE/index.html b/beluga/Beluga/Load/module-type-LOAD_STATE/index.html deleted file mode 100644 index ee490d379..000000000 --- a/beluga/Beluga/Load/module-type-LOAD_STATE/index.html +++ /dev/null @@ -1,81 +0,0 @@ - -LOAD_STATE (beluga.Beluga.Load.LOAD_STATE)

Module type Load.LOAD_STATE

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val read_signature_file : - state -> - filename:Support.String.t -> - Synext.signature_file
val reconstruct_signature_file : - state -> - Synext.signature_file -> - Beluga_syntax.Synint.Sgn.sgn_file
diff --git a/beluga/Beluga/Logic/CSolver/index.html b/beluga/Beluga/Logic/CSolver/index.html deleted file mode 100644 index fa36a8ac3..000000000 --- a/beluga/Beluga/Logic/CSolver/index.html +++ /dev/null @@ -1,12 +0,0 @@ - -CSolver (beluga.Beluga.Logic.CSolver)

Module Logic.CSolver

diff --git a/beluga/Beluga/Logic/Convert/index.html b/beluga/Beluga/Logic/Convert/index.html deleted file mode 100644 index 2c4c15488..000000000 --- a/beluga/Beluga/Logic/Convert/index.html +++ /dev/null @@ -1,14 +0,0 @@ - -Convert (beluga.Beluga.Logic.Convert)

Module Logic.Convert

val comptypToCompGoal : Beluga_syntax.Synint.Comp.typ -> comp_goal
diff --git a/beluga/Beluga/Logic/Frontend/index.html b/beluga/Beluga/Logic/Frontend/index.html deleted file mode 100644 index 5431c163a..000000000 --- a/beluga/Beluga/Logic/Frontend/index.html +++ /dev/null @@ -1,14 +0,0 @@ - -Frontend (beluga.Beluga.Logic.Frontend)

Module Logic.Frontend

exception Done
diff --git a/beluga/Beluga/Logic/Index/index.html b/beluga/Beluga/Logic/Index/index.html deleted file mode 100644 index 3cb65ad82..000000000 --- a/beluga/Beluga/Logic/Index/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Index (beluga.Beluga.Logic.Index)

Module Logic.Index

type inst
diff --git a/beluga/Beluga/Logic/Options/index.html b/beluga/Beluga/Logic/Options/index.html deleted file mode 100644 index 487d716cc..000000000 --- a/beluga/Beluga/Logic/Options/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Options (beluga.Beluga.Logic.Options)

Module Logic.Options

val enableLogic : bool Stdlib.ref
diff --git a/beluga/Beluga/Logic/Solver/index.html b/beluga/Beluga/Logic/Solver/index.html deleted file mode 100644 index 6612d9734..000000000 --- a/beluga/Beluga/Logic/Solver/index.html +++ /dev/null @@ -1,8 +0,0 @@ - -Solver (beluga.Beluga.Logic.Solver)

Module Logic.Solver

diff --git a/beluga/Beluga/Logic/index.html b/beluga/Beluga/Logic/index.html deleted file mode 100644 index 6141f311c..000000000 --- a/beluga/Beluga/Logic/index.html +++ /dev/null @@ -1,14 +0,0 @@ - -Logic (beluga.Beluga.Logic)

Module Beluga.Logic

type goal
type comp_goal
type query
type mquery
type comp_res
module Options : sig ... end
module Convert : sig ... end
module Index : sig ... end
module Frontend : sig ... end
type bound = int option
module Solver : sig ... end
module CSolver : sig ... end
val runLogic : unit -> unit

Clears the local storage of the logic programming engine, * and loads the LF signature.

val prepare : unit -> unit

Clears the local storage of the logic programming engine, * and loads the LF signature.

diff --git a/beluga/Beluga/Monitor/index.html b/beluga/Beluga/Monitor/index.html deleted file mode 100644 index 14968bd3a..000000000 --- a/beluga/Beluga/Monitor/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Monitor (beluga.Beluga.Monitor)

Module Beluga.Monitor

Timing utilities for monitoring the execution time of functions.

type timer

The type of labelled record for accumulating execution times.

val on : bool Stdlib.ref

The flag for enabling execution time monitoring in calls to timer.

val onf : bool Stdlib.ref

The flag for enabling execution time monitoring in calls to timer and saving the statistics to the file "./time.txt".

val timer : (timer * (unit -> 'a)) -> 'a

timer t f is f (), with its execution time added to t.

val print_timers : unit -> unit

print_timers () prints the execution time statistics:

  • to the standard output if !on
  • to the file "./time.txt" if Bool.not !on && !onf

Timers

val type_abbrev_kind_check : timer
val type_abbrev_type_check : timer
val ctype_elaboration : timer
val ctype_abstraction : timer
val ctype_check : timer
val datatype_constant_type_elaboration : timer
val datatype_constant_type_abstraction : timer
val datatype_constant_type_check : timer
val codatatype_constant_type_elaboration : timer
val codatatype_constant_type_abstraction : timer
val codatatype_constant_type_check : timer
val type_elaboration : timer
val type_abstraction : timer
val type_check : timer
val function_type_elaboration : timer
val function_type_abstraction : timer
val function_type_check : timer
val function_elaboration : timer
val function_abstraction : timer
val function_check : timer
val constant_elaboration : timer
val constant_abstraction : timer
val constant_check : timer
val normalisation : timer
diff --git a/beluga/Beluga/NameGen/index.html b/beluga/Beluga/NameGen/index.html deleted file mode 100644 index edb03bc54..000000000 --- a/beluga/Beluga/NameGen/index.html +++ /dev/null @@ -1,5 +0,0 @@ - -NameGen (beluga.Beluga.NameGen)

Module Beluga.NameGen

Contextual type-based name generator. This name generator will use programmer-supplied naming hints (falling back to good old X, Y, Z) but adjust the numeric counter on the name so it is the smallest allowed in a given context.

This name generation strategy notably does not use any global counters, so its results are independent of order of operations. The result of this generator depends only on what ambient context of names is passed as input.

The general idiom to use this generator is: NameGen.(var tau |> renumber names) where names : Name.t list can be calculated using helper functions from context.ml. (See the names_of_Xctx family of functions.)

Caveats. 1. In general you need to be conscious of when you calculate name lists, as this does incur a traversal of the context. 2. This name generation strategy is strictly less efficient than global variable-based strategies, as the `renumber` function -- the core algorithm of this module -- traverses the entire name list to decide what number to assign the input name.

As for point 2, a more efficient data structure for representing the name list could improve efficiency substantially. In particular, a hashtable or a trie that associates to each name its highest count.

Generates a raw parameter variable name for a given LF type. Uses the programmer-supplied name hint, with a fallback.

Generates a raw bound variable name for a given LF type. Uses the programmer-supplied name hint, with a fallback.

Generate a raw metavariable name for a given LF type. Uses programmer-supplied name hints with a fallback.

diff --git a/beluga/Beluga/Opsem/index.html b/beluga/Beluga/Opsem/index.html deleted file mode 100644 index f69864924..000000000 --- a/beluga/Beluga/Opsem/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Opsem (beluga.Beluga.Opsem)

Module Beluga.Opsem

diff --git a/beluga/Beluga/Options/Debug/index.html b/beluga/Beluga/Options/Debug/index.html deleted file mode 100644 index 36a025592..000000000 --- a/beluga/Beluga/Options/Debug/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Debug (beluga.Beluga.Options.Debug)

Module Options.Debug

val chatter_level : int Stdlib.ref
diff --git a/beluga/Beluga/Options/Html/index.html b/beluga/Beluga/Options/Html/index.html deleted file mode 100644 index edc163785..000000000 --- a/beluga/Beluga/Options/Html/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Html (beluga.Beluga.Options.Html)

Module Options.Html

val enabled : bool Stdlib.ref
diff --git a/beluga/Beluga/Options/Subord/index.html b/beluga/Beluga/Options/Subord/index.html deleted file mode 100644 index 14c1ee900..000000000 --- a/beluga/Beluga/Options/Subord/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Subord (beluga.Beluga.Options.Subord)

Module Options.Subord

val dump : bool Stdlib.ref
diff --git a/beluga/Beluga/Options/index.html b/beluga/Beluga/Options/index.html deleted file mode 100644 index 4d8d5b916..000000000 --- a/beluga/Beluga/Options/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Options (beluga.Beluga.Options)

Module Beluga.Options

Centralized module for global flags.

Think twice (no, make it thrice) about adding anything here.

module Subord : sig ... end
module Debug : sig ... end
module Html : sig ... end
diff --git a/beluga/Beluga/Order/index.html b/beluga/Beluga/Order/index.html deleted file mode 100644 index e7c3c44e4..000000000 --- a/beluga/Beluga/Order/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Order (beluga.Beluga.Order)

Module Beluga.Order

type mutual =
  1. | Empty
  2. | LE of Beluga_syntax.Id.cid_prog * mutual
  3. | LT of Beluga_syntax.Id.cid_prog * mutual
type dec =
  1. | Dec of I.order * mutual
val list_of_order : I.order -> int list option

Converts the order to a list of argument positions If the order is too complicated, returns None.

diff --git a/beluga/Beluga/Prettyint/DefaultPrinter/index.html b/beluga/Beluga/Prettyint/DefaultPrinter/index.html deleted file mode 100644 index cf2730341..000000000 --- a/beluga/Beluga/Prettyint/DefaultPrinter/index.html +++ /dev/null @@ -1,293 +0,0 @@ - -DefaultPrinter (beluga.Beluga.Prettyint.DefaultPrinter)

Module Prettyint.DefaultPrinter

val l0 : lvl
type depend_print_style = [
  1. | `clean
  2. | `depend
  3. | `inductive
]
val fmt_ppr_plicity : - Stdlib.Format.formatter -> - Beluga_syntax.Plicity.t -> - unit
val fmt_ppr_lf_depend : - Stdlib.Format.formatter -> - (Beluga_syntax.Plicity.t * Beluga_syntax.Inductivity.t) -> - unit
val fmt_ppr_lf_depend_clean : - Stdlib.Format.formatter -> - Beluga_syntax.Inductivity.t -> - unit
val fmt_ppr_lf_depend_inductive : - Stdlib.Format.formatter -> - Beluga_syntax.Inductivity.t -> - unit
val fmt_ppr_cmp_split_kind : - Stdlib.Format.formatter -> - [ `impossible | `invert | `split ] -> - unit
val fmt_ppr_cmp_context_case : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.context_case -> - unit
val fmt_ppr_sgn : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Sgn.sgn -> - unit
val fmt_ppr_sgn_decl : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Sgn.decl -> - unit
val fmt_ppr_lf_svar_class : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.svar_class -> - unit
val fmt_ppr_lf_kind : - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.kind -> - unit
val fmt_ppr_lf_ctyp_decl : - ?fmt_ppr_depend: - (Stdlib.Format.formatter -> - (Beluga_syntax.Plicity.t * Beluga_syntax.Inductivity.t) -> - unit) -> - Beluga_syntax.Synint.LF.mctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.ctyp_decl -> - unit
val fmt_ppr_lf_typ_rec : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.typ_rec -> - unit
val fmt_ppr_lf_typ : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.typ -> - unit
val fmt_ppr_lf_mtyp : - Beluga_syntax.Synint.LF.mctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.ctyp -> - unit
val fmt_ppr_lf_tuple : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.tuple -> - unit
val fmt_ppr_lf_normal : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.normal -> - unit
val fmt_ppr_lf_head : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.head -> - unit
val fmt_ppr_lf_spine : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.spine -> - unit
val fmt_ppr_lf_sub : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.sub -> - unit
val fmt_ppr_lf_schema : - ?useName:bool -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.schema -> - unit
val fmt_ppr_lf_sch_elem : - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.sch_elem -> - unit
val fmt_ppr_lf_dctx_hat : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.dctx -> - unit
val fmt_ppr_lf_dctx : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.dctx -> - unit
val fmt_ppr_lf_mctx : - ?all:bool -> - ?sep:(Stdlib.Format.formatter -> unit -> unit) -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.mctx -> - unit
val fmt_ppr_lf_ctx_var : - Beluga_syntax.Synint.LF.mctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.ctx_var -> - unit
val fmt_ppr_lf_mfront : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.mfront -> - unit
val fmt_ppr_lf_iterm : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.iterm -> - unit
val fmt_ppr_lf_constraint : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.constrnt -> - unit
val fmt_ppr_lf_constraints : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.cnstr list -> - unit
val fmt_ppr_lf_msub : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.msub -> - unit
val fmt_ppr_lf_msub_typing : - Stdlib.Format.formatter -> - (Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.msub - * Beluga_syntax.Synint.LF.mctx) -> - unit
val fmt_ppr_lf_typ_typing : - Stdlib.Format.formatter -> - (Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.typ) -> - unit
val fmt_ppr_lf_sub_typing : - Stdlib.Format.formatter -> - (Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.sub - * Beluga_syntax.Synint.LF.dctx) -> - unit
val fmt_ppr_cmp_kind : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.kind -> - unit
val fmt_ppr_cmp_typ : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.typ -> - unit
val fmt_ppr_cmp_suffices_typ : - Beluga_syntax.Synint.LF.mctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.suffices_typ -> - unit
val fmt_ppr_cmp_ctyp_decl : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.ctyp_decl -> - unit
val fmt_ppr_cmp_gctx : - ?sep:(Stdlib.Format.formatter -> unit -> unit) -> - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.gctx -> - unit
val fmt_ppr_cmp_exp : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.exp -> - unit
val fmt_ppr_cmp_value : - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.value -> - unit
val fmt_ppr_cmp_branches : - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.branch list -> - unit
val fmt_ppr_cmp_branch : - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.branch -> - unit
val fmt_ppr_cmp_ih_args : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.ih_arg list -> - unit
val fmt_ppr_cmp_ih : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.ih_decl -> - unit
val fmt_ppr_cmp_ihctx : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.ihctx -> - unit
val fmt_ppr_cmp_total_dec_kind : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.order Beluga_syntax.Synint.Comp.total_dec_kind -> - unit
val fmt_ppr_cmp_total_dec : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.total_dec -> - unit
val fmt_ppr_cmp_gctx_typing : - Stdlib.Format.formatter -> - (Beluga_syntax.Synint.LF.mctx * Beluga_syntax.Synint.Comp.gctx) -> - unit
val fmt_ppr_cmp_typ_typing : - Stdlib.Format.formatter -> - (Beluga_syntax.Synint.LF.mctx * Beluga_syntax.Synint.Comp.typ) -> - unit
val fmt_ppr_cmp_numeric_order : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.order -> - unit
val fmt_ppr_cmp_hypotheses_listing : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.hypotheses -> - unit
val fmt_ppr_cmp_subgoal_path : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.SubgoalPath.t -> - unit
val fmt_ppr_cmp_proof_state : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.proof_state -> - unit
val fmt_ppr_cmp_proof : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.proof -> - unit
val fmt_ppr_cmp_command : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.command -> - unit
val fmt_ppr_cmp_directive : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.directive -> - unit
val fmt_ppr_cmp_hypothetical : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.hypothetical -> - unit
val fmt_ppr_cmp_pattern : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.pattern -> - unit
val fmt_ppr_cmp_meta_typ : - Beluga_syntax.Synint.LF.mctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.meta_typ -> - unit
val fmt_ppr_cmp_meta_obj : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.meta_obj -> - unit
val fmt_ppr_cmp_meta_spine : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.meta_spine -> - unit
val fmt_ppr_cmp_comp_prog_info : - Stdlib.Format.formatter -> - Store.Cid.Comp.entry -> - unit
val fmt_ppr_cmp_thm : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.thm -> - unit
val fmt_ppr_sgn_file : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Sgn.sgn_file -> - unit
val fmt_ppr_theorem : - Stdlib.Format.formatter -> - (Beluga_syntax.Identifier.t - * Beluga_syntax.Synint.Comp.thm - * Beluga_syntax.Synint.Comp.typ) -> - unit
diff --git a/beluga/Beluga/Prettyint/Make/argument-1-R/index.html b/beluga/Beluga/Prettyint/Make/argument-1-R/index.html deleted file mode 100644 index 744e34a01..000000000 --- a/beluga/Beluga/Prettyint/Make/argument-1-R/index.html +++ /dev/null @@ -1,14 +0,0 @@ - -R (beluga.Beluga.Prettyint.Make.R)

Parameter Make.R

val render_cid_comp_typ : Beluga_syntax.Id.cid_comp_typ -> string
val render_cid_comp_cotyp : Beluga_syntax.Id.cid_comp_cotyp -> string
val render_cid_comp_const : Beluga_syntax.Id.cid_comp_const -> string
val render_cid_comp_dest : Beluga_syntax.Id.cid_comp_dest -> string
val render_cid_typ : Beluga_syntax.Id.cid_typ -> string
val render_cid_term : Beluga_syntax.Id.cid_term -> string
val render_cid_schema : Beluga_syntax.Id.cid_schema -> string
val render_cid_prog : Beluga_syntax.Id.cid_prog -> string
val render_cid_mutual_group : Beluga_syntax.Id.cid_mutual_group -> string
val render_offset : Beluga_syntax.Id.offset -> string
val render_ctx_var : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Id.offset -> - string
val render_cvar : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Id.offset -> - string
val render_bvar : - Beluga_syntax.Synint.LF.dctx -> - Beluga_syntax.Id.offset -> - string
val render_var : - Beluga_syntax.Synint.Comp.gctx -> - Beluga_syntax.Id.var -> - string
diff --git a/beluga/Beluga/Prettyint/Make/index.html b/beluga/Beluga/Prettyint/Make/index.html deleted file mode 100644 index 856a66d54..000000000 --- a/beluga/Beluga/Prettyint/Make/index.html +++ /dev/null @@ -1,293 +0,0 @@ - -Make (beluga.Beluga.Prettyint.Make)

Module Prettyint.Make

Parameters

Signature

type lvl
val l0 : lvl
type depend_print_style = [
  1. | `depend
  2. | `inductive
  3. | `clean
]
val fmt_ppr_plicity : - Stdlib.Format.formatter -> - Beluga_syntax.Plicity.t -> - unit
val fmt_ppr_lf_depend : - Stdlib.Format.formatter -> - (Beluga_syntax.Plicity.t * Beluga_syntax.Inductivity.t) -> - unit
val fmt_ppr_lf_depend_clean : - Stdlib.Format.formatter -> - Beluga_syntax.Inductivity.t -> - unit
val fmt_ppr_lf_depend_inductive : - Stdlib.Format.formatter -> - Beluga_syntax.Inductivity.t -> - unit
val fmt_ppr_cmp_split_kind : - Stdlib.Format.formatter -> - [ `split | `invert | `impossible ] -> - unit
val fmt_ppr_cmp_context_case : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.context_case -> - unit
val fmt_ppr_sgn : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Sgn.sgn -> - unit
val fmt_ppr_sgn_decl : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Sgn.decl -> - unit
val fmt_ppr_lf_svar_class : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.svar_class -> - unit
val fmt_ppr_lf_kind : - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.kind -> - unit
val fmt_ppr_lf_ctyp_decl : - ?fmt_ppr_depend: - (Stdlib.Format.formatter -> - (Beluga_syntax.Plicity.t * Beluga_syntax.Inductivity.t) -> - unit) -> - Beluga_syntax.Synint.LF.mctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.ctyp_decl -> - unit
val fmt_ppr_lf_typ_rec : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.typ_rec -> - unit
val fmt_ppr_lf_typ : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.typ -> - unit
val fmt_ppr_lf_mtyp : - Beluga_syntax.Synint.LF.mctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.ctyp -> - unit
val fmt_ppr_lf_tuple : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.tuple -> - unit
val fmt_ppr_lf_normal : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.normal -> - unit
val fmt_ppr_lf_head : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.head -> - unit
val fmt_ppr_lf_spine : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.spine -> - unit
val fmt_ppr_lf_sub : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.sub -> - unit
val fmt_ppr_lf_schema : - ?useName:bool -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.schema -> - unit
val fmt_ppr_lf_sch_elem : - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.sch_elem -> - unit
val fmt_ppr_lf_dctx_hat : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.dctx -> - unit
val fmt_ppr_lf_dctx : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.dctx -> - unit
val fmt_ppr_lf_mctx : - ?all:bool -> - ?sep:(Stdlib.Format.formatter -> unit -> unit) -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.mctx -> - unit
val fmt_ppr_lf_ctx_var : - Beluga_syntax.Synint.LF.mctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.ctx_var -> - unit
val fmt_ppr_lf_mfront : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.mfront -> - unit
val fmt_ppr_lf_iterm : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.iterm -> - unit
val fmt_ppr_lf_constraint : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.constrnt -> - unit
val fmt_ppr_lf_constraints : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.cnstr list -> - unit
val fmt_ppr_lf_msub : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.msub -> - unit
val fmt_ppr_lf_msub_typing : - Stdlib.Format.formatter -> - (Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.msub - * Beluga_syntax.Synint.LF.mctx) -> - unit

Prints a typing judgment for an msub: cD' |- theta : cD

val fmt_ppr_lf_typ_typing : - Stdlib.Format.formatter -> - (Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.typ) -> - unit

Prints a typing judgment for an LF type: cD ; cPsi |- tA : type

val fmt_ppr_lf_sub_typing : - Stdlib.Format.formatter -> - (Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.sub - * Beluga_syntax.Synint.LF.dctx) -> - unit

Prints a typing judgment for an LF substitution: cD ; cPsi |- s : cPsi'

val fmt_ppr_cmp_kind : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.kind -> - unit
val fmt_ppr_cmp_typ : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.typ -> - unit
val fmt_ppr_cmp_suffices_typ : - Beluga_syntax.Synint.LF.mctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.suffices_typ -> - unit
val fmt_ppr_cmp_ctyp_decl : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.ctyp_decl -> - unit
val fmt_ppr_cmp_gctx : - ?sep:(Stdlib.Format.formatter -> unit -> unit) -> - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.gctx -> - unit
val fmt_ppr_cmp_exp : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.exp -> - unit
val fmt_ppr_cmp_value : - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.value -> - unit
val fmt_ppr_cmp_branches : - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.branch list -> - unit
val fmt_ppr_cmp_branch : - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.branch -> - unit
val fmt_ppr_cmp_ih_args : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.ih_arg list -> - unit
val fmt_ppr_cmp_ih : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.ih_decl -> - unit
val fmt_ppr_cmp_ihctx : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.ihctx -> - unit
val fmt_ppr_cmp_total_dec_kind : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.order Beluga_syntax.Synint.Comp.total_dec_kind -> - unit
val fmt_ppr_cmp_total_dec : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.total_dec -> - unit
val fmt_ppr_cmp_gctx_typing : - Stdlib.Format.formatter -> - (Beluga_syntax.Synint.LF.mctx * Beluga_syntax.Synint.Comp.gctx) -> - unit
val fmt_ppr_cmp_typ_typing : - Stdlib.Format.formatter -> - (Beluga_syntax.Synint.LF.mctx * Beluga_syntax.Synint.Comp.typ) -> - unit
val fmt_ppr_cmp_numeric_order : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.order -> - unit
val fmt_ppr_cmp_hypotheses_listing : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.hypotheses -> - unit
val fmt_ppr_cmp_subgoal_path : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.SubgoalPath.t -> - unit
val fmt_ppr_cmp_proof_state : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.proof_state -> - unit
val fmt_ppr_cmp_proof : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.proof -> - unit
val fmt_ppr_cmp_command : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.command -> - unit
val fmt_ppr_cmp_directive : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.directive -> - unit
val fmt_ppr_cmp_hypothetical : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.hypothetical -> - unit
val fmt_ppr_cmp_pattern : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.pattern -> - unit
val fmt_ppr_cmp_meta_typ : - Beluga_syntax.Synint.LF.mctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.meta_typ -> - unit
val fmt_ppr_cmp_meta_obj : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.meta_obj -> - unit
val fmt_ppr_cmp_meta_spine : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.meta_spine -> - unit
val fmt_ppr_cmp_comp_prog_info : - Stdlib.Format.formatter -> - Store.Cid.Comp.entry -> - unit
val fmt_ppr_cmp_thm : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.thm -> - unit
val fmt_ppr_sgn_file : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Sgn.sgn_file -> - unit
val fmt_ppr_theorem : - Stdlib.Format.formatter -> - (Beluga_syntax.Identifier.t - * Beluga_syntax.Synint.Comp.thm - * Beluga_syntax.Synint.Comp.typ) -> - unit
diff --git a/beluga/Beluga/Prettyint/index.html b/beluga/Beluga/Prettyint/index.html deleted file mode 100644 index dd8f177b4..000000000 --- a/beluga/Beluga/Prettyint/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Prettyint (beluga.Beluga.Prettyint)

Module Beluga.Prettyint

val dprnt : string Support.Debug.io
module PC = Printer.Control
val ident_regexp : Str.regexp
val is_name_syntactically_valid : Beluga_syntax.Name.t -> bool

is_name_syntactically_valid name is a heuristic for determining whether name is syntactically valid. If that is not the case, then the name must not have been user-defined, so it was generated during signature reconstruction.

module DefaultPrinter : sig ... end
diff --git a/beluga/Beluga/Printer/Control/index.html b/beluga/Beluga/Printer/Control/index.html deleted file mode 100644 index b7301c631..000000000 --- a/beluga/Beluga/Printer/Control/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Control (beluga.Beluga.Printer.Control)

Module Printer.Control

type substitution_style =
  1. | Natural
  2. | DeBruijn
val substitutionStyle : substitution_style Stdlib.ref
val printImplicit : bool Stdlib.ref
val printNormal : bool Stdlib.ref
val printCtxUnderscore : bool Stdlib.ref
val db : unit -> bool
diff --git a/beluga/Beluga/Printer/Int/index.html b/beluga/Beluga/Printer/Int/index.html deleted file mode 100644 index 326e12271..000000000 --- a/beluga/Beluga/Printer/Int/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Int (beluga.Beluga.Printer.Int)

Module Printer.Int

module type T = sig ... end
diff --git a/beluga/Beluga/Printer/Int/module-type-T/index.html b/beluga/Beluga/Printer/Int/module-type-T/index.html deleted file mode 100644 index e2d31e2d0..000000000 --- a/beluga/Beluga/Printer/Int/module-type-T/index.html +++ /dev/null @@ -1,293 +0,0 @@ - -T (beluga.Beluga.Printer.Int.T)

Module type Int.T

type lvl
val l0 : lvl
type depend_print_style = [
  1. | `depend
  2. | `inductive
  3. | `clean
]
val fmt_ppr_plicity : - Stdlib.Format.formatter -> - Beluga_syntax.Plicity.t -> - unit
val fmt_ppr_lf_depend : - Stdlib.Format.formatter -> - (Beluga_syntax.Plicity.t * Beluga_syntax.Inductivity.t) -> - unit
val fmt_ppr_lf_depend_clean : - Stdlib.Format.formatter -> - Beluga_syntax.Inductivity.t -> - unit
val fmt_ppr_lf_depend_inductive : - Stdlib.Format.formatter -> - Beluga_syntax.Inductivity.t -> - unit
val fmt_ppr_cmp_split_kind : - Stdlib.Format.formatter -> - [ `split | `invert | `impossible ] -> - unit
val fmt_ppr_cmp_context_case : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.context_case -> - unit
val fmt_ppr_sgn : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Sgn.sgn -> - unit
val fmt_ppr_sgn_decl : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Sgn.decl -> - unit
val fmt_ppr_lf_svar_class : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.svar_class -> - unit
val fmt_ppr_lf_kind : - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.kind -> - unit
val fmt_ppr_lf_ctyp_decl : - ?fmt_ppr_depend: - (Stdlib.Format.formatter -> - (Beluga_syntax.Plicity.t * Beluga_syntax.Inductivity.t) -> - unit) -> - Beluga_syntax.Synint.LF.mctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.ctyp_decl -> - unit
val fmt_ppr_lf_typ_rec : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.typ_rec -> - unit
val fmt_ppr_lf_typ : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.typ -> - unit
val fmt_ppr_lf_mtyp : - Beluga_syntax.Synint.LF.mctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.ctyp -> - unit
val fmt_ppr_lf_tuple : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.tuple -> - unit
val fmt_ppr_lf_normal : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.normal -> - unit
val fmt_ppr_lf_head : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.head -> - unit
val fmt_ppr_lf_spine : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.spine -> - unit
val fmt_ppr_lf_sub : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.sub -> - unit
val fmt_ppr_lf_schema : - ?useName:bool -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.schema -> - unit
val fmt_ppr_lf_sch_elem : - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.sch_elem -> - unit
val fmt_ppr_lf_dctx_hat : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.dctx -> - unit
val fmt_ppr_lf_dctx : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.dctx -> - unit
val fmt_ppr_lf_mctx : - ?all:bool -> - ?sep:(Stdlib.Format.formatter -> unit -> unit) -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.mctx -> - unit
val fmt_ppr_lf_ctx_var : - Beluga_syntax.Synint.LF.mctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.ctx_var -> - unit
val fmt_ppr_lf_mfront : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.mfront -> - unit
val fmt_ppr_lf_iterm : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.LF.dctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.iterm -> - unit
val fmt_ppr_lf_constraint : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.constrnt -> - unit
val fmt_ppr_lf_constraints : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.cnstr list -> - unit
val fmt_ppr_lf_msub : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.LF.msub -> - unit
val fmt_ppr_lf_msub_typing : - Stdlib.Format.formatter -> - (Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.msub - * Beluga_syntax.Synint.LF.mctx) -> - unit

Prints a typing judgment for an msub: cD' |- theta : cD

val fmt_ppr_lf_typ_typing : - Stdlib.Format.formatter -> - (Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.typ) -> - unit

Prints a typing judgment for an LF type: cD ; cPsi |- tA : type

val fmt_ppr_lf_sub_typing : - Stdlib.Format.formatter -> - (Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.LF.dctx - * Beluga_syntax.Synint.LF.sub - * Beluga_syntax.Synint.LF.dctx) -> - unit

Prints a typing judgment for an LF substitution: cD ; cPsi |- s : cPsi'

val fmt_ppr_cmp_kind : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.kind -> - unit
val fmt_ppr_cmp_typ : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.typ -> - unit
val fmt_ppr_cmp_suffices_typ : - Beluga_syntax.Synint.LF.mctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.suffices_typ -> - unit
val fmt_ppr_cmp_ctyp_decl : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.ctyp_decl -> - unit
val fmt_ppr_cmp_gctx : - ?sep:(Stdlib.Format.formatter -> unit -> unit) -> - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.gctx -> - unit
val fmt_ppr_cmp_exp : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.exp -> - unit
val fmt_ppr_cmp_value : - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.value -> - unit
val fmt_ppr_cmp_branches : - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.branch list -> - unit
val fmt_ppr_cmp_branch : - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.branch -> - unit
val fmt_ppr_cmp_ih_args : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.ih_arg list -> - unit
val fmt_ppr_cmp_ih : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.ih_decl -> - unit
val fmt_ppr_cmp_ihctx : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.ihctx -> - unit
val fmt_ppr_cmp_total_dec_kind : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.order Beluga_syntax.Synint.Comp.total_dec_kind -> - unit
val fmt_ppr_cmp_total_dec : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.total_dec -> - unit
val fmt_ppr_cmp_gctx_typing : - Stdlib.Format.formatter -> - (Beluga_syntax.Synint.LF.mctx * Beluga_syntax.Synint.Comp.gctx) -> - unit
val fmt_ppr_cmp_typ_typing : - Stdlib.Format.formatter -> - (Beluga_syntax.Synint.LF.mctx * Beluga_syntax.Synint.Comp.typ) -> - unit
val fmt_ppr_cmp_numeric_order : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.order -> - unit
val fmt_ppr_cmp_hypotheses_listing : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.hypotheses -> - unit
val fmt_ppr_cmp_subgoal_path : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.SubgoalPath.t -> - unit
val fmt_ppr_cmp_proof_state : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.proof_state -> - unit
val fmt_ppr_cmp_proof : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.proof -> - unit
val fmt_ppr_cmp_command : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.command -> - unit
val fmt_ppr_cmp_directive : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.directive -> - unit
val fmt_ppr_cmp_hypothetical : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.hypothetical -> - unit
val fmt_ppr_cmp_pattern : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Synint.Comp.gctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.pattern -> - unit
val fmt_ppr_cmp_meta_typ : - Beluga_syntax.Synint.LF.mctx -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.meta_typ -> - unit
val fmt_ppr_cmp_meta_obj : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.meta_obj -> - unit
val fmt_ppr_cmp_meta_spine : - Beluga_syntax.Synint.LF.mctx -> - lvl -> - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.meta_spine -> - unit
val fmt_ppr_cmp_comp_prog_info : - Stdlib.Format.formatter -> - Store.Cid.Comp.entry -> - unit
val fmt_ppr_cmp_thm : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Comp.thm -> - unit
val fmt_ppr_sgn_file : - Stdlib.Format.formatter -> - Beluga_syntax.Synint.Sgn.sgn_file -> - unit
val fmt_ppr_theorem : - Stdlib.Format.formatter -> - (Beluga_syntax.Identifier.t - * Beluga_syntax.Synint.Comp.thm - * Beluga_syntax.Synint.Comp.typ) -> - unit
diff --git a/beluga/Beluga/Printer/index.html b/beluga/Beluga/Printer/index.html deleted file mode 100644 index aca2be43c..000000000 --- a/beluga/Beluga/Printer/index.html +++ /dev/null @@ -1,12 +0,0 @@ - -Printer (beluga.Beluga.Printer)

Module Beluga.Printer

module Control : sig ... end
val generic_with : (unit -> 'a) -> ('b -> unit) -> 'c -> (unit -> unit) -> unit
val generic_with_ref : 'a Stdlib.ref -> 'b -> (unit -> unit) -> unit
val with_normal : bool -> (unit -> unit) -> unit
val with_implicits : bool -> (unit -> unit) -> unit
val with_ctx_underscore : bool -> (unit -> unit) -> unit
val fmt_ppr_implicits : - bool -> - (Stdlib.Format.formatter -> 'a -> unit) -> - Stdlib.Format.formatter -> - 'b -> - unit
val fmt_ppr_ctx_underscore : - bool -> - (Stdlib.Format.formatter -> 'a -> unit) -> - Stdlib.Format.formatter -> - 'b -> - unit
module Int : sig ... end
diff --git a/beluga/Beluga/Reconstruct/index.html b/beluga/Beluga/Reconstruct/index.html deleted file mode 100644 index 73c8836d3..000000000 --- a/beluga/Beluga/Reconstruct/index.html +++ /dev/null @@ -1,52 +0,0 @@ - -Reconstruct (beluga.Beluga.Reconstruct)

Module Beluga.Reconstruct

val solve_fvarCnstr : Lfrecon.reconType -> unit
val reset_fvarCnstr : unit -> unit
type case_type

Type of case to reconstruct. Either a plain data object, or an index object. In the case of an index object, we store the scrutinee in order to correctly implement dependent pattern matching.

val case_type : - Beluga_syntax.Int.Comp.pattern Stdlib.Lazy.t -> - Beluga_syntax.Int.Comp.exp -> - case_type

Analyzes the given case scrutinee to decide what kind of case we have. The case type is used by other elaboration functions to generate appropriate substitutions. (Specifically, see synPatRefine, which is the main consumer of case_type.)

The given pattern is passed lazily as it is only needed when the synthesizable expression happens to be a box. (This is related to the implementation of dependent pattern matching.) If you know that the synthesizable expression is definitely not a box, then you can pass lazy (Error.raise_violation "appropriate message") as the pattern.

Transforms a case_type if it was actually an index object.

Constructs the refinement substitution for a case analysis. If * cD; cG |- tau_s <= type * cD'; cG' |- tau_p <= type * cD' |- t : cD * if caseT = IndexObj C then

  • tau_s = U
  • cD; cG |- C <= U then synPatRefine' loc caseT (cD, cD') t (tau_s, tau_p) = t', t1', cD'' such that * cD'' |- t' : cD * cD'' |- t1' : cD'

Remark: * cD'' is the meta-context in which the branch of the case should be elaborated. * t' is just t1' composed with t.

diff --git a/beluga/Beluga/Recsgn/Make/argument-1-Signature_reconstruction_state/index.html b/beluga/Beluga/Recsgn/Make/argument-1-Signature_reconstruction_state/index.html deleted file mode 100644 index 2099fcea7..000000000 --- a/beluga/Beluga/Recsgn/Make/argument-1-Signature_reconstruction_state/index.html +++ /dev/null @@ -1,214 +0,0 @@ - -Signature_reconstruction_state (beluga.Beluga.Recsgn.Make.Signature_reconstruction_state)

Parameter Make.Signature_reconstruction_state

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val add_leftover_vars : - state -> - Abstract.free_var Synint.LF.ctx -> - Beluga_syntax.Syncom.Location.t -> - Stdlib.Unit.t
val with_disabled_lf_strengthening : - state -> - location:Beluga_syntax.Syncom.Location.t -> - (state -> 'a) -> - 'a

disable_lf_strengthening state ~location disables the strengthening of LF terms and types during LF reconstruction.

location is the location to use for error-reporting in case of failure to perform disable_lf_strengthening ~location.

val with_warn_on_coverage_error : - state -> - location:Beluga_syntax.Syncom.Location.t -> - (state -> 'a) -> - 'a

with_warn_on_coverage_error state ~location sets the error-reporting mode of pattern coverage-checking to `warn'.

location is the location to use for error-reporting in case of failure to perform with_warn_on_coverage_error ~location.

val with_coverage_checking : - state -> - location:Beluga_syntax.Syncom.Location.t -> - (state -> 'a) -> - 'a

with_coverage_checking state ~location enables coverage-checking.

location is the location to use for error-reporting in case of failure to perform with_coverage_checking ~location.

val set_name_generation_bases : - state -> - location:Beluga_syntax.Syncom.Location.t -> - meta_variable_base:Beluga_syntax.Syncom.Identifier.t -> - ?computation_variable_base:Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

set_name_generation_bases state ~location ~meta_variable_base ?computation_variable_base constant sets the naming convention for name generation of meta-level and computation-level variables using meta_variable_base and computation_variable_base respectively for a type-level constant constant.

location is the location to use for error-reporting in case of failure to perform set_name_generation_bases ~location ~meta_variable_base ?computation_variable_base constant.

val set_default_associativity : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t
val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t
val set_default_precedence : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Support.Int.t -> - Stdlib.Unit.t
val get_default_precedence : state -> Support.Int.t
val add_prefix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_infix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_postfix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_postponed_prefix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?location ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?location ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?location ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

val apply_postponed_fixity_pragmas_for_constant : - state -> - Beluga_syntax.Syncom.Identifier.t -> - unit

apply_postponed_fixity_pragmas_for_constant state identifier adds in scope the postponed fixity pragmas for the constant having identifier identifier.

val open_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - abbreviation:Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val with_checkpoint : state -> (state -> 'a) -> 'a

with_checkpoint state m is the result of running m with state. Note that the state is rolled back entirely.

ID Allocation

Indexing

val index_lf_kind : state -> Synext.lf_kind -> Synapx.LF.kind

index_lf_kind state kind is kind indexed with respect to state. Free variables in kind are discarded.

val index_lf_typ : state -> Synext.lf_typ -> Synapx.LF.typ
val index_schema : state -> Synext.schema -> Synapx.LF.schema
val index_comp_kind : state -> Synext.comp_kind -> Synapx.Comp.kind
val index_comp_typ : state -> Synext.comp_typ -> Synapx.Comp.typ
val index_comp_expression : state -> Synext.comp_expression -> Synapx.Comp.exp
val index_comp_typedef : - state -> - Synext.comp_typ -> - Synext.comp_kind -> - Synapx.Comp.typ * Synapx.Comp.kind
val index_comp_theorem : state -> Synext.comp_expression -> Synapx.Comp.thm
val index_harpoon_proof : state -> Synext.harpoon_proof -> Synapx.Comp.thm

Adding a constant or module introduces an identifier in the state. Whenever an extensible declaration is shadowed, it is frozen.

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_typ -> - Stdlib.Unit.t

add_lf_type_constant state ?location identifier id adds the LF type constant having identifier identifier, ID cid and binding site location to the state. If location = Option.None, then the identifier's location is used as binding site.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_term -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_schema -> - Stdlib.Unit.t
val add_comp_val : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_prog -> - Stdlib.Unit.t
val add_comp_typedef : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_typdef -> - Stdlib.Unit.t
val add_comp_inductive_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_comp_stratified_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_comp_cotype_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_cotyp -> - Stdlib.Unit.t
val add_comp_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_const -> - Stdlib.Unit.t
val add_comp_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_dest -> - Stdlib.Unit.t

add_module state ?location identifier cid m adds the module having identifier identifier and binding site location to the state. The action m is executed in the module's state. m is typically the reconstruction of the module's entries.

val freeze_all_unfrozen_declarations : state -> Stdlib.Unit.t

freeze_all_unfrozen_declarations state freezes all the unfrozen declarations. Unfrozen declarations are LF type families in oldstyle syntax, and to which new LF term-level constants may be added.

diff --git a/beluga/Beluga/Recsgn/Make/index.html b/beluga/Beluga/Recsgn/Make/index.html deleted file mode 100644 index ab991457b..000000000 --- a/beluga/Beluga/Recsgn/Make/index.html +++ /dev/null @@ -1,79 +0,0 @@ - -Make (beluga.Beluga.Recsgn.Make)

Module Recsgn.Make

Parameters

Signature

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Signature_reconstruction_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val reconstruct_signature : - state -> - Synext.signature -> - Beluga_syntax.Synint.Sgn.sgn
val reconstruct_signature_file : - state -> - Synext.signature_file -> - Beluga_syntax.Synint.Sgn.sgn_file
diff --git a/beluga/Beluga/Recsgn/Signature_reconstruction/index.html b/beluga/Beluga/Recsgn/Signature_reconstruction/index.html deleted file mode 100644 index 06b51c9cc..000000000 --- a/beluga/Beluga/Recsgn/Signature_reconstruction/index.html +++ /dev/null @@ -1,78 +0,0 @@ - -Signature_reconstruction (beluga.Beluga.Recsgn.Signature_reconstruction)

Module Recsgn.Signature_reconstruction

val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t
val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t
val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t
val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t
val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val reconstruct_signature : - state -> - Synext.signature -> - Beluga_syntax.Synint.Sgn.sgn
val reconstruct_signature_file : - state -> - Synext.signature_file -> - Beluga_syntax.Synint.Sgn.sgn_file
diff --git a/beluga/Beluga/Recsgn/index.html b/beluga/Beluga/Recsgn/index.html deleted file mode 100644 index 660844528..000000000 --- a/beluga/Beluga/Recsgn/index.html +++ /dev/null @@ -1,9 +0,0 @@ - -Recsgn (beluga.Beluga.Recsgn)

Module Beluga.Recsgn

module C = Whnf
module S = Substitution
module Unify = Unify.StdTrail
val dprint : (unit -> string) Support.Debug.io
exception Dangling_not_pragma
exception Unexpected_entry_reconstruction_success
exception Unsupported_recursive_declaration
exception Missing_totality_declarations of {
  1. programs_with : Beluga_syntax.Identifier.t Support.List.t;
  2. programs_without : Beluga_syntax.Identifier.t Support.List.t;
}
exception Too_many_totality_declaration_arguments of Beluga_syntax.Identifier.t
exception Totality_declaration_program_mismatch of {
  1. expected_program : Beluga_syntax.Identifier.t;
    (*

    The identifier of the program the totality declaration is attached to

    *)
  2. actual_program : Beluga_syntax.Identifier.t;
    (*

    The program identifier in the totality declaration

    *)
}
exception Unbound_totality_declaration_argument of {
  1. unbound_argument : Beluga_syntax.Identifier.t;
  2. arguments : Beluga_syntax.Identifier.t Support.Option.t Support.List.t;
}
exception Invalid_lf_typ_target
exception Invalid_comp_typ_target
exception Invalid_comp_cotyp_target
exception Lf_typ_target_mismatch of {
  1. constant : Beluga_syntax.Identifier.t;
  2. expected : Beluga_syntax.Identifier.t;
  3. actual : Beluga_syntax.Qualified_identifier.t;
}
exception Comp_typ_target_mismatch of {
  1. constant : Beluga_syntax.Identifier.t;
  2. expected : Beluga_syntax.Identifier.t;
  3. actual : Beluga_syntax.Qualified_identifier.t;
}
exception Comp_cotyp_target_mismatch of {
  1. constant : Beluga_syntax.Identifier.t;
  2. expected : Beluga_syntax.Identifier.t;
  3. actual : Beluga_syntax.Qualified_identifier.t;
}
exception No_positive of Beluga_syntax.Identifier.t
exception No_stratify of Beluga_syntax.Identifier.t
exception No_stratify_or_positive of Support.String.t
val fmt_ppr_leftover_vars : - Support.Format.formatter -> - (Abstract.fctx * Beluga_syntax.Location.t) list -> - unit
val ppr_leftover_vars : (Abstract.fctx * Beluga_syntax.Location.t) list -> unit
module type SIGNATURE_RECONSTRUCTION = sig ... end
module Signature_reconstruction : sig ... end
diff --git a/beluga/Beluga/Recsgn/module-type-SIGNATURE_RECONSTRUCTION/index.html b/beluga/Beluga/Recsgn/module-type-SIGNATURE_RECONSTRUCTION/index.html deleted file mode 100644 index b48be866f..000000000 --- a/beluga/Beluga/Recsgn/module-type-SIGNATURE_RECONSTRUCTION/index.html +++ /dev/null @@ -1,78 +0,0 @@ - -SIGNATURE_RECONSTRUCTION (beluga.Beluga.Recsgn.SIGNATURE_RECONSTRUCTION)

Module type Recsgn.SIGNATURE_RECONSTRUCTION

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val reconstruct_signature : - state -> - Synext.signature -> - Beluga_syntax.Synint.Sgn.sgn
val reconstruct_signature_file : - state -> - Synext.signature_file -> - Beluga_syntax.Synint.Sgn.sgn_file
diff --git a/beluga/Beluga/Recsgn_state/Make_signature_reconstruction_state/argument-1-Index_state/index.html b/beluga/Beluga/Recsgn_state/Make_signature_reconstruction_state/argument-1-Index_state/index.html deleted file mode 100644 index de10e1666..000000000 --- a/beluga/Beluga/Recsgn_state/Make_signature_reconstruction_state/argument-1-Index_state/index.html +++ /dev/null @@ -1,302 +0,0 @@ - -Index_state (beluga.Beluga.Recsgn_state.Make_signature_reconstruction_state.Index_state)

Parameter Make_signature_reconstruction_state.Index_state

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val fresh_identifier : state -> Beluga_syntax.Identifier.t

fresh_identifier state is an identifier that is not bound in state. This is used in the indexing of arrow types to Pi-types, and to generate parameter identifiers for lambda abstractions that omit the parameter identifier.

In order to avoid potential captures, identifier is not a syntactically valid identifier. That is, identifier printed as is cannot be parsed into an identifier.

For debugging purposes, identifier is of the form "\"i#" where '#' is a positive integer. Ideally, fresh name generation would not be needed, but that would require that every AST node in the concrete syntax is directly expressible in the approximate and internal syntaxes.

FIXME: The indexing phase should not have to generate fresh identifiers.

fresh_identifier_opt state identifier_opt is fresh_identifier state if identifier_opt = Option.None, and identifier if identifier_opt = Option.Some identifier.

Index of Constants

val index_of_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - [ `Lf_type_constant of Beluga_syntax.Id.cid_typ - | `Lf_term_constant of Beluga_syntax.Id.cid_term - | `Computation_inductive_type_constant of Beluga_syntax.Id.cid_comp_typ - | `Computation_stratified_type_constant of Beluga_syntax.Id.cid_comp_typ - | `Computation_coinductive_type_constant of Beluga_syntax.Id.cid_comp_cotyp - | `Computation_abbreviation_type_constant of Beluga_syntax.Id.cid_comp_typdef - | `Computation_term_constructor of Beluga_syntax.Id.cid_comp_const - | `Computation_term_destructor of Beluga_syntax.Id.cid_comp_dest - | `Schema_constant of Beluga_syntax.Id.cid_schema - | `Program_constant of Beluga_syntax.Id.cid_prog - | `Module of Beluga_syntax.Id.module_id ]
val index_of_lf_type_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_typ

index_of_lf_type_constant state identifier is the constant ID of identifier in state if it is bound to an LF type-level constant. If identifier is bound to any other entry, then an exception is raised.

val index_of_lf_term_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_term

index_of_lf_term_constant state identifier is like index_of_lf_type_constant state identifier, but for LF term-level constants.

val index_of_comp_type_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typ

index_of_comp_type_constant state identifier is a lookup for the ID corresponding to identifier in state for computation-level inductive or stratified type constant.

val index_of_inductive_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typ
val index_of_stratified_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typ
val index_of_coinductive_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_cotyp
val index_of_abbreviation_comp_constant : - state -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Id.cid_comp_typdef

Index of Variables

val index_of_lf_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset

index_of_lf_variable state identifier is the LF-bound de Bruijn index of identifier in state.

If identifier is unbound, then an exception is raised.

index_of_lf_variable_opt state identifier is the LF-bound de Bruijn index of identifier in state.

If identifier is unbound, then offset_opt = Option.None.

If state is a pattern state, then offset_opt is additionally Option.None if it is not an inner pattern-bound variable.

val index_of_meta_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset

index_of_meta_variable state identifier is the meta-level de Bruijn index of identifier in state.

If identifier is unbound, bound to a different entry than a meta-variable, or bound to a meta-variable of unknown de Bruijn level, then an exception is raised.

val index_of_meta_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t

index_of_meta_variable_opt state identifier is the meta-level de Bruijn index of identifier in state.

  • If identifier is unbound, then offset_opt = Option.None.
  • If identifier is a bound meta-variable whose de Bruijn level is unknown (i.e. its binder is a meta-variable in a pattern), then offset_opt = Option.None.
  • If state is a pattern state, then offset_opt = Option.None if it is not an inner pattern-bound variable.
val index_of_parameter_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset
val index_of_parameter_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t
val index_of_substitution_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset
val index_of_substitution_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t
val index_of_context_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset
val index_of_context_variable_opt : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset Support.Option.t
val index_of_comp_variable : - state -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.offset

Binding Variables

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state identifier m runs m in a state where identifier is a bound LF variable.

If state is a pattern state, then identifier is additionally considered as an inner bound variable.

val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state identifier m runs m in a state where identifier is either a bound meta, parameter, substitution or context variable. This is necessary for mlam-expressions.

If state is a pattern state, then identifier is additionally considered as an inner bound variable.

val with_bound_comp_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_shifted_lf_context : state -> (state -> 'a) -> 'a

with_shifted_lf_context state m is like with_bound_lf_variable state _ m without adding any identifier in the namespace. That is, de Bruijn indices looked up in m with respect to the context of LF-bound variables are + 1 of what they were in state. This is used for omitted parameters to lambda terms, like \_. x.

val with_shifted_meta_context : state -> (state -> 'a) -> 'a

with_shifted_meta_context state m is like with_shifted_lf_context state m but for meta-level variables.

val with_shifted_comp_context : state -> (state -> 'a) -> 'a

with_shifted_comp_context state m is like with_shifted_lf_context state m but for computation-level variables.

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_typ -> - Stdlib.Unit.t
val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_term -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_schema -> - Stdlib.Unit.t
val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_cotyp -> - Stdlib.Unit.t
val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_typdef -> - Stdlib.Unit.t
val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_const -> - Stdlib.Unit.t
val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_comp_dest -> - Stdlib.Unit.t
val add_program_constant : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.cid_prog -> - Stdlib.Unit.t
val add_module : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Beluga_syntax.Id.module_id -> - (state -> 'a) -> - 'a

add_module state ?location module_identifier cid m starts a module, computes m, then stops the module. This effectively adds a new module with identifier module_identifier to state, along with the declarations added in m as declarations in that module.

val open_module : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state ?location module_identifier opens the module module_identifier it is a bound module. This effectively adds all the declarations in that module to the current scope, but not as declarations (i.e., this opens the module like in OCaml).

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Qualified_identifier.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val with_scope : state -> (state -> 'a) -> 'a
val with_parent_scope : state -> (state -> 'a) -> 'a
val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used in REPLs to safely run functions and recover the state in case of a raised exception during indexing.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Pattern Variables

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression runs pattern while keeping track of free and pattern variables, then runs expression with the free and pattern variables as bound variables.

val add_computation_pattern_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t

Free Variables

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state identifier adds identifier as a free LF variable.

If identifier is a free variable in state of a different kind than LF variables, then an exception is raised.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val add_free_context_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - Stdlib.Unit.t
val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Location.t -> - Beluga_syntax.Identifier.t -> - (state -> 'a) -> - 'a
val allow_free_variables : state -> (state -> 'a) -> 'a

allow_free_variables state m runs m and discards the tracked free variables therein.

val disallow_free_variables : state -> (state -> 'a) -> 'a

disallow_free_variables state m runs m and raises an exception if m adds a free variable to the state.

Interoperability

val add_all_mctx : state -> Beluga_syntax.Synint.LF.mctx -> Stdlib.Unit.t

add_all_mctx state cD adds all contextual variables in cD.

val add_all_gctx : state -> Beluga_syntax.Synint.Comp.gctx -> Stdlib.Unit.t

add_all_gctx state cG adds all computation-level variables in cG.

diff --git a/beluga/Beluga/Recsgn_state/Make_signature_reconstruction_state/argument-2-Index/index.html b/beluga/Beluga/Recsgn_state/Make_signature_reconstruction_state/argument-2-Index/index.html deleted file mode 100644 index 81762987d..000000000 --- a/beluga/Beluga/Recsgn_state/Make_signature_reconstruction_state/argument-2-Index/index.html +++ /dev/null @@ -1,104 +0,0 @@ - -Index (beluga.Beluga.Recsgn_state.Make_signature_reconstruction_state.Index)

Parameter Make_signature_reconstruction_state.Index

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Index_state.state
type state = Index_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val index_open_lf_kind : - state -> - Synext.lf_kind -> - Beluga_syntax.Synapx.LF.kind

index_open_lf_kind state kind is kind with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in kind with respect to state.

val index_closed_lf_kind : - state -> - Synext.lf_kind -> - Beluga_syntax.Synapx.LF.kind

index_closed_lf_kind state kind is kind with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in kind with respect to state.

val index_open_lf_typ : state -> Synext.lf_typ -> Beluga_syntax.Synapx.LF.typ

index_open_lf_typ state typ is typ with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in typ with respect to state

val index_closed_lf_typ : state -> Synext.lf_typ -> Beluga_syntax.Synapx.LF.typ

index_closed_lf_typ state typ is typ with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in typ with respect to state

val index_open_comp_kind : - state -> - Synext.comp_kind -> - Beluga_syntax.Synapx.Comp.kind

index_open_comp_kind state kind is kind with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in kind with respect to state.

val index_closed_comp_kind : - state -> - Synext.comp_kind -> - Beluga_syntax.Synapx.Comp.kind

index_closed_comp_kind state kind is kind with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in kind with respect to state.

val index_open_comp_typ : - state -> - Synext.comp_typ -> - Beluga_syntax.Synapx.Comp.typ

index_open_comp_typ state typ is typ with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in typ with respect to state.

val index_closed_comp_typ : - state -> - Synext.comp_typ -> - Beluga_syntax.Synapx.Comp.typ

index_closed_comp_typ state typ is typ with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in typ with respect to state.

val index_comp_expression : - state -> - Synext.comp_expression -> - Beluga_syntax.Synapx.Comp.exp

index_comp_expression state expression is expression with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in expression with respect to state.

index_schema state schema is schema with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are allowed in schema with respect to state.

val index_comp_theorem : - state -> - Synext.comp_expression -> - Beluga_syntax.Synapx.Comp.thm

index_comp_theorem state theorem is theorem with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in theorem with respect to state.

val index_harpoon_proof : - state -> - Synext.harpoon_proof -> - Beluga_syntax.Synapx.Comp.thm

index_harpoon_proof state proof is proof with bound variables and constants replaced with de Bruijn indices and IDs respectively. Free variables are disallowed in proof with respect to state.

val index_computation_typ_abbreviation : - state -> - Synext.comp_typ -> - Synext.comp_kind -> - Beluga_syntax.Synapx.Comp.typ * Beluga_syntax.Synapx.Comp.kind

index_computation_typ_abbreviation state typ kind is (typ', kind') where kind' is kind and typ' is typ, both with bound variables and constants replaced with de Bruijn indices and IDs respectively. Overall, free variables are disallowed with respect to state. Variables bound in Pi-kinds in kind count as bound in typ.

diff --git a/beluga/Beluga/Recsgn_state/Make_signature_reconstruction_state/index.html b/beluga/Beluga/Recsgn_state/Make_signature_reconstruction_state/index.html deleted file mode 100644 index a386b4544..000000000 --- a/beluga/Beluga/Recsgn_state/Make_signature_reconstruction_state/index.html +++ /dev/null @@ -1,217 +0,0 @@ - -Make_signature_reconstruction_state (beluga.Beluga.Recsgn_state.Make_signature_reconstruction_state)

Module Recsgn_state.Make_signature_reconstruction_state

Parameters

Signature

include SIGNATURE_RECONSTRUCTION_STATE
include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val add_leftover_vars : - state -> - Abstract.free_var Synint.LF.ctx -> - Beluga_syntax.Syncom.Location.t -> - Stdlib.Unit.t
val with_disabled_lf_strengthening : - state -> - location:Beluga_syntax.Syncom.Location.t -> - (state -> 'a) -> - 'a

disable_lf_strengthening state ~location disables the strengthening of LF terms and types during LF reconstruction.

location is the location to use for error-reporting in case of failure to perform disable_lf_strengthening ~location.

val with_warn_on_coverage_error : - state -> - location:Beluga_syntax.Syncom.Location.t -> - (state -> 'a) -> - 'a

with_warn_on_coverage_error state ~location sets the error-reporting mode of pattern coverage-checking to `warn'.

location is the location to use for error-reporting in case of failure to perform with_warn_on_coverage_error ~location.

val with_coverage_checking : - state -> - location:Beluga_syntax.Syncom.Location.t -> - (state -> 'a) -> - 'a

with_coverage_checking state ~location enables coverage-checking.

location is the location to use for error-reporting in case of failure to perform with_coverage_checking ~location.

val set_name_generation_bases : - state -> - location:Beluga_syntax.Syncom.Location.t -> - meta_variable_base:Beluga_syntax.Syncom.Identifier.t -> - ?computation_variable_base:Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

set_name_generation_bases state ~location ~meta_variable_base ?computation_variable_base constant sets the naming convention for name generation of meta-level and computation-level variables using meta_variable_base and computation_variable_base respectively for a type-level constant constant.

location is the location to use for error-reporting in case of failure to perform set_name_generation_bases ~location ~meta_variable_base ?computation_variable_base constant.

val set_default_associativity : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t
val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t
val set_default_precedence : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Support.Int.t -> - Stdlib.Unit.t
val get_default_precedence : state -> Support.Int.t
val add_prefix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_infix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_postfix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_postponed_prefix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?location ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?location ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?location ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

val apply_postponed_fixity_pragmas_for_constant : - state -> - Beluga_syntax.Syncom.Identifier.t -> - unit

apply_postponed_fixity_pragmas_for_constant state identifier adds in scope the postponed fixity pragmas for the constant having identifier identifier.

val open_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - abbreviation:Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val with_checkpoint : state -> (state -> 'a) -> 'a

with_checkpoint state m is the result of running m with state. Note that the state is rolled back entirely.

ID Allocation

Indexing

val index_lf_kind : state -> Synext.lf_kind -> Synapx.LF.kind

index_lf_kind state kind is kind indexed with respect to state. Free variables in kind are discarded.

val index_lf_typ : state -> Synext.lf_typ -> Synapx.LF.typ
val index_schema : state -> Synext.schema -> Synapx.LF.schema
val index_comp_kind : state -> Synext.comp_kind -> Synapx.Comp.kind
val index_comp_typ : state -> Synext.comp_typ -> Synapx.Comp.typ
val index_comp_expression : state -> Synext.comp_expression -> Synapx.Comp.exp
val index_comp_typedef : - state -> - Synext.comp_typ -> - Synext.comp_kind -> - Synapx.Comp.typ * Synapx.Comp.kind
val index_comp_theorem : state -> Synext.comp_expression -> Synapx.Comp.thm
val index_harpoon_proof : state -> Synext.harpoon_proof -> Synapx.Comp.thm

Adding a constant or module introduces an identifier in the state. Whenever an extensible declaration is shadowed, it is frozen.

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_typ -> - Stdlib.Unit.t

add_lf_type_constant state ?location identifier id adds the LF type constant having identifier identifier, ID cid and binding site location to the state. If location = Option.None, then the identifier's location is used as binding site.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_term -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_schema -> - Stdlib.Unit.t
val add_comp_val : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_prog -> - Stdlib.Unit.t
val add_comp_typedef : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_typdef -> - Stdlib.Unit.t
val add_comp_inductive_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_comp_stratified_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_comp_cotype_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_cotyp -> - Stdlib.Unit.t
val add_comp_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_const -> - Stdlib.Unit.t
val add_comp_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_dest -> - Stdlib.Unit.t

add_module state ?location identifier cid m adds the module having identifier identifier and binding site location to the state. The action m is executed in the module's state. m is typically the reconstruction of the module's entries.

val freeze_all_unfrozen_declarations : state -> Stdlib.Unit.t

freeze_all_unfrozen_declarations state freezes all the unfrozen declarations. Unfrozen declarations are LF type families in oldstyle syntax, and to which new LF term-level constants may be added.

val create_initial_state : Index_state.state -> state
val clear_state : - clear_index_state:(Index_state.state -> unit) -> - state -> - unit
diff --git a/beluga/Beluga/Recsgn_state/Signature_reconstruction_state/index.html b/beluga/Beluga/Recsgn_state/Signature_reconstruction_state/index.html deleted file mode 100644 index 0d7ce83d2..000000000 --- a/beluga/Beluga/Recsgn_state/Signature_reconstruction_state/index.html +++ /dev/null @@ -1,218 +0,0 @@ - -Signature_reconstruction_state (beluga.Beluga.Recsgn_state.Signature_reconstruction_state)

Module Recsgn_state.Signature_reconstruction_state

val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t
val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t
val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t
val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t
val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val add_leftover_vars : - state -> - Abstract.free_var Synint.LF.ctx -> - Beluga_syntax.Syncom.Location.t -> - Stdlib.Unit.t
val with_disabled_lf_strengthening : - state -> - location:Beluga_syntax.Syncom.Location.t -> - (state -> 'a) -> - 'a

disable_lf_strengthening state ~location disables the strengthening of LF terms and types during LF reconstruction.

location is the location to use for error-reporting in case of failure to perform disable_lf_strengthening ~location.

val with_warn_on_coverage_error : - state -> - location:Beluga_syntax.Syncom.Location.t -> - (state -> 'a) -> - 'a

with_warn_on_coverage_error state ~location sets the error-reporting mode of pattern coverage-checking to `warn'.

location is the location to use for error-reporting in case of failure to perform with_warn_on_coverage_error ~location.

val with_coverage_checking : - state -> - location:Beluga_syntax.Syncom.Location.t -> - (state -> 'a) -> - 'a

with_coverage_checking state ~location enables coverage-checking.

location is the location to use for error-reporting in case of failure to perform with_coverage_checking ~location.

val set_name_generation_bases : - state -> - location:Beluga_syntax.Syncom.Location.t -> - meta_variable_base:Beluga_syntax.Syncom.Identifier.t -> - ?computation_variable_base:Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

set_name_generation_bases state ~location ~meta_variable_base ?computation_variable_base constant sets the naming convention for name generation of meta-level and computation-level variables using meta_variable_base and computation_variable_base respectively for a type-level constant constant.

location is the location to use for error-reporting in case of failure to perform set_name_generation_bases ~location ~meta_variable_base ?computation_variable_base constant.

val set_default_associativity : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t
val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t
val set_default_precedence : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Support.Int.t -> - Stdlib.Unit.t
val get_default_precedence : state -> Support.Int.t
val add_prefix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_infix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_postfix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_postponed_prefix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?location ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?location ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?location ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

val apply_postponed_fixity_pragmas_for_constant : - state -> - Beluga_syntax.Syncom.Identifier.t -> - unit

apply_postponed_fixity_pragmas_for_constant state identifier adds in scope the postponed fixity pragmas for the constant having identifier identifier.

val open_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - abbreviation:Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val with_checkpoint : state -> (state -> 'a) -> 'a

with_checkpoint state m is the result of running m with state. Note that the state is rolled back entirely.

val index_lf_kind : state -> Synext.lf_kind -> Synapx.LF.kind

index_lf_kind state kind is kind indexed with respect to state. Free variables in kind are discarded.

val index_lf_typ : state -> Synext.lf_typ -> Synapx.LF.typ
val index_schema : state -> Synext.schema -> Synapx.LF.schema
val index_comp_kind : state -> Synext.comp_kind -> Synapx.Comp.kind
val index_comp_typ : state -> Synext.comp_typ -> Synapx.Comp.typ
val index_comp_expression : state -> Synext.comp_expression -> Synapx.Comp.exp
val index_comp_typedef : - state -> - Synext.comp_typ -> - Synext.comp_kind -> - Synapx.Comp.typ * Synapx.Comp.kind
val index_comp_theorem : state -> Synext.comp_expression -> Synapx.Comp.thm
val index_harpoon_proof : state -> Synext.harpoon_proof -> Synapx.Comp.thm
val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_typ -> - Stdlib.Unit.t

add_lf_type_constant state ?location identifier id adds the LF type constant having identifier identifier, ID cid and binding site location to the state. If location = Option.None, then the identifier's location is used as binding site.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_term -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_schema -> - Stdlib.Unit.t
val add_comp_val : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_prog -> - Stdlib.Unit.t
val add_comp_typedef : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_typdef -> - Stdlib.Unit.t
val add_comp_inductive_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_comp_stratified_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_comp_cotype_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_cotyp -> - Stdlib.Unit.t
val add_comp_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_const -> - Stdlib.Unit.t
val add_comp_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_dest -> - Stdlib.Unit.t

add_module state ?location identifier cid m adds the module having identifier identifier and binding site location to the state. The action m is executed in the module's state. m is typically the reconstruction of the module's entries.

val freeze_all_unfrozen_declarations : state -> Stdlib.Unit.t

freeze_all_unfrozen_declarations state freezes all the unfrozen declarations. Unfrozen declarations are LF type families in oldstyle syntax, and to which new LF term-level constants may be added.

val create_initial_state : Index_state.Indexing_state.state -> state
val clear_state : - clear_index_state:(Index_state.Indexing_state.state -> unit) -> - state -> - unit
diff --git a/beluga/Beluga/Recsgn_state/index.html b/beluga/Beluga/Recsgn_state/index.html deleted file mode 100644 index e5187cd27..000000000 --- a/beluga/Beluga/Recsgn_state/index.html +++ /dev/null @@ -1,5 +0,0 @@ - -Recsgn_state (beluga.Beluga.Recsgn_state)

Module Beluga.Recsgn_state

module type SIGNATURE_RECONSTRUCTION_STATE = sig ... end
module Signature_reconstruction_state : sig ... end
diff --git a/beluga/Beluga/Recsgn_state/module-type-SIGNATURE_RECONSTRUCTION_STATE/index.html b/beluga/Beluga/Recsgn_state/module-type-SIGNATURE_RECONSTRUCTION_STATE/index.html deleted file mode 100644 index 1d1fc746b..000000000 --- a/beluga/Beluga/Recsgn_state/module-type-SIGNATURE_RECONSTRUCTION_STATE/index.html +++ /dev/null @@ -1,214 +0,0 @@ - -SIGNATURE_RECONSTRUCTION_STATE (beluga.Beluga.Recsgn_state.SIGNATURE_RECONSTRUCTION_STATE)

Module type Recsgn_state.SIGNATURE_RECONSTRUCTION_STATE

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val add_leftover_vars : - state -> - Abstract.free_var Synint.LF.ctx -> - Beluga_syntax.Syncom.Location.t -> - Stdlib.Unit.t
val with_disabled_lf_strengthening : - state -> - location:Beluga_syntax.Syncom.Location.t -> - (state -> 'a) -> - 'a

disable_lf_strengthening state ~location disables the strengthening of LF terms and types during LF reconstruction.

location is the location to use for error-reporting in case of failure to perform disable_lf_strengthening ~location.

val with_warn_on_coverage_error : - state -> - location:Beluga_syntax.Syncom.Location.t -> - (state -> 'a) -> - 'a

with_warn_on_coverage_error state ~location sets the error-reporting mode of pattern coverage-checking to `warn'.

location is the location to use for error-reporting in case of failure to perform with_warn_on_coverage_error ~location.

val with_coverage_checking : - state -> - location:Beluga_syntax.Syncom.Location.t -> - (state -> 'a) -> - 'a

with_coverage_checking state ~location enables coverage-checking.

location is the location to use for error-reporting in case of failure to perform with_coverage_checking ~location.

val set_name_generation_bases : - state -> - location:Beluga_syntax.Syncom.Location.t -> - meta_variable_base:Beluga_syntax.Syncom.Identifier.t -> - ?computation_variable_base:Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

set_name_generation_bases state ~location ~meta_variable_base ?computation_variable_base constant sets the naming convention for name generation of meta-level and computation-level variables using meta_variable_base and computation_variable_base respectively for a type-level constant constant.

location is the location to use for error-reporting in case of failure to perform set_name_generation_bases ~location ~meta_variable_base ?computation_variable_base constant.

val set_default_associativity : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t
val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t
val set_default_precedence : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Support.Int.t -> - Stdlib.Unit.t
val get_default_precedence : state -> Support.Int.t
val add_prefix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_infix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_postfix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_postponed_prefix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?location ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?location ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?location ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

val apply_postponed_fixity_pragmas_for_constant : - state -> - Beluga_syntax.Syncom.Identifier.t -> - unit

apply_postponed_fixity_pragmas_for_constant state identifier adds in scope the postponed fixity pragmas for the constant having identifier identifier.

val open_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - abbreviation:Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val with_checkpoint : state -> (state -> 'a) -> 'a

with_checkpoint state m is the result of running m with state. Note that the state is rolled back entirely.

ID Allocation

Indexing

val index_lf_kind : state -> Synext.lf_kind -> Synapx.LF.kind

index_lf_kind state kind is kind indexed with respect to state. Free variables in kind are discarded.

val index_lf_typ : state -> Synext.lf_typ -> Synapx.LF.typ
val index_schema : state -> Synext.schema -> Synapx.LF.schema
val index_comp_kind : state -> Synext.comp_kind -> Synapx.Comp.kind
val index_comp_typ : state -> Synext.comp_typ -> Synapx.Comp.typ
val index_comp_expression : state -> Synext.comp_expression -> Synapx.Comp.exp
val index_comp_typedef : - state -> - Synext.comp_typ -> - Synext.comp_kind -> - Synapx.Comp.typ * Synapx.Comp.kind
val index_comp_theorem : state -> Synext.comp_expression -> Synapx.Comp.thm
val index_harpoon_proof : state -> Synext.harpoon_proof -> Synapx.Comp.thm

Adding a constant or module introduces an identifier in the state. Whenever an extensible declaration is shadowed, it is frozen.

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_typ -> - Stdlib.Unit.t

add_lf_type_constant state ?location identifier id adds the LF type constant having identifier identifier, ID cid and binding site location to the state. If location = Option.None, then the identifier's location is used as binding site.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_term -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_schema -> - Stdlib.Unit.t
val add_comp_val : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_prog -> - Stdlib.Unit.t
val add_comp_typedef : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_typdef -> - Stdlib.Unit.t
val add_comp_inductive_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_comp_stratified_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_typ -> - Stdlib.Unit.t
val add_comp_cotype_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_cotyp -> - Stdlib.Unit.t
val add_comp_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_const -> - Stdlib.Unit.t
val add_comp_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Beluga_syntax.Syncom.Id.cid_comp_dest -> - Stdlib.Unit.t

add_module state ?location identifier cid m adds the module having identifier identifier and binding site location to the state. The action m is executed in the module's state. m is typically the reconstruction of the module's entries.

val freeze_all_unfrozen_declarations : state -> Stdlib.Unit.t

freeze_all_unfrozen_declarations state freezes all the unfrozen declarations. Unfrozen declarations are LF type families in oldstyle syntax, and to which new LF term-level constants may be added.

diff --git a/beluga/Beluga/Sigma/index.html b/beluga/Beluga/Sigma/index.html deleted file mode 100644 index 3c094a424..000000000 --- a/beluga/Beluga/Sigma/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sigma (beluga.Beluga.Sigma)

Module Beluga.Sigma

module LF = Synint.LF
val project : int -> LF.head -> LF.typ_rec -> LF.tclo option

Calculates the type of a projection of a sigma. project k tH tRec = Some (tA, s) if k is a valid projection for tRec where tH is a head representing the parameter variable we're projecting.

diff --git a/beluga/Beluga/Store/Cid/Comp/Entry/index.html b/beluga/Beluga/Store/Cid/Comp/Entry/index.html deleted file mode 100644 index 8566d5192..000000000 --- a/beluga/Beluga/Store/Cid/Comp/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga.Store.Cid.Comp.Entry)

Module Comp.Entry

type t = {
  1. name : Beluga_syntax.Name.t;
  2. implicit_arguments : int;
  3. typ : Beluga_syntax.Synint.Comp.typ;
  4. prog : Beluga_syntax.Synint.Comp.value option;
  5. mutual_group : Beluga_syntax.Id.cid_mutual_group;
}
val name_of_entry : t -> Beluga_syntax.Name.t
diff --git a/beluga/Beluga/Store/Cid/Comp/index.html b/beluga/Beluga/Store/Cid/Comp/index.html deleted file mode 100644 index b71192e59..000000000 --- a/beluga/Beluga/Store/Cid/Comp/index.html +++ /dev/null @@ -1,22 +0,0 @@ - -Comp (beluga.Beluga.Store.Cid.Comp)

Module Cid.Comp

module Entry : sig ... end
type entry = Entry.t

Gets the Name.t of the given theorem ID.

Looks up the total declarations for the given mutual group.

Gets the mutual group ID for a given function reference.

Looks up the total declarations for the mutual group of the given function.

Looks up the totality declaration for the given theorem.

If the value we store in the entry is a recursive value, it itself needs the cid_prog that we are creating to store this entry. Therefore, unlike 'add' functions in other modules, this 'add' function expects a function to which it will provide the cid_prog it generated to store the entry, thus tying the recursive knot.

val current_entries : unit -> (Beluga_syntax.Id.cid_prog * entry) list
val explicit_arguments : entry -> int
val clear : unit -> unit

Update the associated program of an existing entry. This is notably used for two-step elaboration of functions:

  • a function is added to the store with its type *before* its bodies is elaborated
  • indexing can find the cid of the function immediately from the store.
  • when the function body is elaborated, the store entry is updated to hold the body as well.
diff --git a/beluga/Beluga/Store/Cid/CompConst/Entry/index.html b/beluga/Beluga/Store/Cid/CompConst/Entry/index.html deleted file mode 100644 index 7ea0b4639..000000000 --- a/beluga/Beluga/Store/Cid/CompConst/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga.Store.Cid.CompConst.Entry)

Module CompConst.Entry

type t = private {
  1. name : Beluga_syntax.Name.t;
  2. implicit_arguments : int;
  3. typ : Beluga_syntax.Synint.Comp.typ;
}
val name_of_entry : t -> Beluga_syntax.Name.t
diff --git a/beluga/Beluga/Store/Cid/CompConst/index.html b/beluga/Beluga/Store/Cid/CompConst/index.html deleted file mode 100644 index 4a6c11542..000000000 --- a/beluga/Beluga/Store/Cid/CompConst/index.html +++ /dev/null @@ -1,9 +0,0 @@ - -CompConst (beluga.Beluga.Store.Cid.CompConst)

Module Cid.CompConst

module Entry : sig ... end
type entry = Entry.t
val mk_entry : - Beluga_syntax.Name.t -> - Beluga_syntax.Synint.Comp.typ -> - int -> - entry
val current_entries : unit -> (Beluga_syntax.Id.cid_comp_const * entry) list
val explicit_arguments : entry -> int
val get_implicit_arguments : Beluga_syntax.Id.cid_comp_const -> int
val clear : unit -> unit
diff --git a/beluga/Beluga/Store/Cid/CompCotyp/Entry/index.html b/beluga/Beluga/Store/Cid/CompCotyp/Entry/index.html deleted file mode 100644 index 5b03501b4..000000000 --- a/beluga/Beluga/Store/Cid/CompCotyp/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga.Store.Cid.CompCotyp.Entry)

Module CompCotyp.Entry

type t = private {
  1. name : Beluga_syntax.Name.t;
  2. implicit_arguments : int;
  3. kind : Beluga_syntax.Synint.Comp.kind;
  4. frozen : bool Stdlib.ref;
  5. destructors : Beluga_syntax.Id.cid_comp_dest list Stdlib.ref;
}
val name_of_entry : t -> Beluga_syntax.Name.t
diff --git a/beluga/Beluga/Store/Cid/CompCotyp/index.html b/beluga/Beluga/Store/Cid/CompCotyp/index.html deleted file mode 100644 index db7dcdfac..000000000 --- a/beluga/Beluga/Store/Cid/CompCotyp/index.html +++ /dev/null @@ -1,11 +0,0 @@ - -CompCotyp (beluga.Beluga.Store.Cid.CompCotyp)

Module Cid.CompCotyp

module Entry : sig ... end
type entry = Entry.t
val mk_entry : - Beluga_syntax.Name.t -> - Beluga_syntax.Synint.Comp.kind -> - int -> - entry
val current_entries : unit -> (Beluga_syntax.Id.cid_comp_cotyp * entry) list
val freeze : Beluga_syntax.Id.cid_comp_cotyp -> unit
val clear : unit -> unit
val explicit_arguments : entry -> int
diff --git a/beluga/Beluga/Store/Cid/CompDest/Entry/index.html b/beluga/Beluga/Store/Cid/CompDest/Entry/index.html deleted file mode 100644 index da183d0a6..000000000 --- a/beluga/Beluga/Store/Cid/CompDest/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga.Store.Cid.CompDest.Entry)

Module CompDest.Entry

type t = private {
  1. name : Beluga_syntax.Name.t;
  2. implicit_arguments : int;
  3. mctx : Beluga_syntax.Synint.LF.mctx;
  4. obs_type : Beluga_syntax.Synint.Comp.typ;
  5. return_type : Beluga_syntax.Synint.Comp.typ;
}
val name_of_entry : t -> Beluga_syntax.Name.t
diff --git a/beluga/Beluga/Store/Cid/CompDest/index.html b/beluga/Beluga/Store/Cid/CompDest/index.html deleted file mode 100644 index abc0b414a..000000000 --- a/beluga/Beluga/Store/Cid/CompDest/index.html +++ /dev/null @@ -1,11 +0,0 @@ - -CompDest (beluga.Beluga.Store.Cid.CompDest)

Module Cid.CompDest

module Entry : sig ... end
type entry = Entry.t
val current_entries : unit -> (Beluga_syntax.Id.cid_comp_dest * entry) list
val get_implicit_arguments : Beluga_syntax.Id.cid_comp_dest -> int
val clear : unit -> unit
diff --git a/beluga/Beluga/Store/Cid/CompTyp/Entry/index.html b/beluga/Beluga/Store/Cid/CompTyp/Entry/index.html deleted file mode 100644 index d9f8b5f97..000000000 --- a/beluga/Beluga/Store/Cid/CompTyp/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga.Store.Cid.CompTyp.Entry)

Module CompTyp.Entry

type t = private {
  1. name : Beluga_syntax.Name.t;
  2. implicit_arguments : int;
  3. kind : Beluga_syntax.Synint.Comp.kind;
  4. positivity : Beluga_syntax.Synint.Sgn.positivity_flag;
  5. mutable frozen : bool;
  6. constructors : Beluga_syntax.Id.cid_comp_const list Stdlib.ref;
}
val name_of_entry : t -> Beluga_syntax.Name.t
diff --git a/beluga/Beluga/Store/Cid/CompTyp/index.html b/beluga/Beluga/Store/Cid/CompTyp/index.html deleted file mode 100644 index 18ef9021d..000000000 --- a/beluga/Beluga/Store/Cid/CompTyp/index.html +++ /dev/null @@ -1,12 +0,0 @@ - -CompTyp (beluga.Beluga.Store.Cid.CompTyp)

Module Cid.CompTyp

module Entry : sig ... end
type entry = Entry.t
val current_entries : unit -> (Beluga_syntax.Id.cid_comp_typ * entry) list
val freeze : Beluga_syntax.Id.cid_comp_typ -> unit
val clear : unit -> unit
val explicit_arguments : entry -> int
val get_implicit_arguments : Beluga_syntax.Id.cid_comp_typ -> int
diff --git a/beluga/Beluga/Store/Cid/CompTypDef/Entry/index.html b/beluga/Beluga/Store/Cid/CompTypDef/Entry/index.html deleted file mode 100644 index f2401b1c1..000000000 --- a/beluga/Beluga/Store/Cid/CompTypDef/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga.Store.Cid.CompTypDef.Entry)

Module CompTypDef.Entry

type t = private {
  1. name : Beluga_syntax.Name.t;
  2. implicit_arguments : int;
  3. kind : Beluga_syntax.Synint.Comp.kind;
  4. mctx : Beluga_syntax.Synint.LF.mctx;
  5. typ : Beluga_syntax.Synint.Comp.typ;
}
val name_of_entry : t -> Beluga_syntax.Name.t
diff --git a/beluga/Beluga/Store/Cid/CompTypDef/index.html b/beluga/Beluga/Store/Cid/CompTypDef/index.html deleted file mode 100644 index 85d2582d1..000000000 --- a/beluga/Beluga/Store/Cid/CompTypDef/index.html +++ /dev/null @@ -1,9 +0,0 @@ - -CompTypDef (beluga.Beluga.Store.Cid.CompTypDef)

Module Cid.CompTypDef

module Entry : sig ... end
type entry = Entry.t
val current_entries : unit -> (Beluga_syntax.Id.cid_comp_typdef * entry) list
val explicit_arguments : entry -> int
val get_implicit_arguments : Beluga_syntax.Id.cid_comp_typdef -> int
val clear : unit -> unit
diff --git a/beluga/Beluga/Store/Cid/DefaultRenderer/index.html b/beluga/Beluga/Store/Cid/DefaultRenderer/index.html deleted file mode 100644 index 6a5c74a50..000000000 --- a/beluga/Beluga/Store/Cid/DefaultRenderer/index.html +++ /dev/null @@ -1,14 +0,0 @@ - -DefaultRenderer (beluga.Beluga.Store.Cid.DefaultRenderer)

Module Cid.DefaultRenderer

val render_cid_comp_typ : Beluga_syntax.Id.cid_comp_typ -> string
val render_cid_comp_cotyp : Beluga_syntax.Id.cid_comp_cotyp -> string
val render_cid_comp_const : Beluga_syntax.Id.cid_comp_const -> string
val render_cid_comp_dest : Beluga_syntax.Id.cid_comp_dest -> string
val render_cid_typ : Beluga_syntax.Id.cid_typ -> string
val render_cid_term : Beluga_syntax.Id.cid_term -> string
val render_cid_schema : Beluga_syntax.Id.cid_schema -> string
val render_cid_prog : Beluga_syntax.Id.cid_prog -> string
val render_cid_mutual_group : Beluga_syntax.Id.cid_mutual_group -> string
val render_offset : Beluga_syntax.Id.offset -> string
val render_ctx_var : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Id.offset -> - string
val render_cvar : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Id.offset -> - string
val render_bvar : - Beluga_syntax.Synint.LF.dctx -> - Beluga_syntax.Id.offset -> - string
val render_var : - Beluga_syntax.Synint.Comp.gctx -> - Beluga_syntax.Id.var -> - string
diff --git a/beluga/Beluga/Store/Cid/NamedRenderer/index.html b/beluga/Beluga/Store/Cid/NamedRenderer/index.html deleted file mode 100644 index a269e4ce1..000000000 --- a/beluga/Beluga/Store/Cid/NamedRenderer/index.html +++ /dev/null @@ -1,14 +0,0 @@ - -NamedRenderer (beluga.Beluga.Store.Cid.NamedRenderer)

Module Cid.NamedRenderer

val render_cid_comp_typ : Beluga_syntax.Id.cid_comp_typ -> string
val render_cid_comp_cotyp : Beluga_syntax.Id.cid_comp_cotyp -> string
val render_cid_comp_const : Beluga_syntax.Id.cid_comp_const -> string
val render_cid_comp_dest : Beluga_syntax.Id.cid_comp_dest -> string
val render_cid_typ : Beluga_syntax.Id.cid_typ -> string
val render_cid_term : Beluga_syntax.Id.cid_term -> string
val render_cid_schema : Beluga_syntax.Id.cid_schema -> string
val render_cid_prog : Beluga_syntax.Id.cid_prog -> string
val render_cid_mutual_group : Beluga_syntax.Id.cid_mutual_group -> string
val render_offset : Beluga_syntax.Id.offset -> string
val render_ctx_var : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Id.offset -> - string
val render_cvar : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Id.offset -> - string
val render_bvar : - Beluga_syntax.Synint.LF.dctx -> - Beluga_syntax.Id.offset -> - string
val render_var : - Beluga_syntax.Synint.Comp.gctx -> - Beluga_syntax.Id.var -> - string
diff --git a/beluga/Beluga/Store/Cid/Schema/Entry/index.html b/beluga/Beluga/Store/Cid/Schema/Entry/index.html deleted file mode 100644 index f83dd1009..000000000 --- a/beluga/Beluga/Store/Cid/Schema/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga.Store.Cid.Schema.Entry)

Module Schema.Entry

type t = private {
  1. name : Beluga_syntax.Name.t;
  2. schema : Beluga_syntax.Synint.LF.schema;
}
val name_of_entry : t -> Beluga_syntax.Name.t
diff --git a/beluga/Beluga/Store/Cid/Schema/index.html b/beluga/Beluga/Store/Cid/Schema/index.html deleted file mode 100644 index a63249e28..000000000 --- a/beluga/Beluga/Store/Cid/Schema/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Schema (beluga.Beluga.Store.Cid.Schema)

Module Cid.Schema

module Entry : sig ... end
type entry = Entry.t
val clear : unit -> unit
diff --git a/beluga/Beluga/Store/Cid/Term/Entry/index.html b/beluga/Beluga/Store/Cid/Term/Entry/index.html deleted file mode 100644 index c6fb6f212..000000000 --- a/beluga/Beluga/Store/Cid/Term/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga.Store.Cid.Term.Entry)

Module Term.Entry

type t = private {
  1. name : Beluga_syntax.Name.t;
  2. implicit_arguments : int;
  3. typ : Beluga_syntax.Synint.LF.typ;
}
val name_of_entry : t -> Beluga_syntax.Name.t
diff --git a/beluga/Beluga/Store/Cid/Term/index.html b/beluga/Beluga/Store/Cid/Term/index.html deleted file mode 100644 index 72604287b..000000000 --- a/beluga/Beluga/Store/Cid/Term/index.html +++ /dev/null @@ -1,10 +0,0 @@ - -Term (beluga.Beluga.Store.Cid.Term)

Module Cid.Term

module Entry : sig ... end
type entry = Entry.t
val mk_entry : - Beluga_syntax.Name.t -> - Beluga_syntax.Synint.LF.typ -> - int -> - entry
val explicit_arguments : entry -> int
val get_implicit_arguments : Beluga_syntax.Id.cid_term -> int
val clear : unit -> unit
diff --git a/beluga/Beluga/Store/Cid/Typ/Entry/index.html b/beluga/Beluga/Store/Cid/Typ/Entry/index.html deleted file mode 100644 index 6444899e2..000000000 --- a/beluga/Beluga/Store/Cid/Typ/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga.Store.Cid.Typ.Entry)

Module Typ.Entry

type t = private {
  1. name : Beluga_syntax.Name.t;
  2. implicit_arguments : int;
  3. kind : Beluga_syntax.Synint.LF.kind;
  4. var_generator : (unit -> string) option;
  5. mvar_generator : (unit -> string) option;
  6. frozen : bool Stdlib.ref;
  7. constructors : Beluga_syntax.Id.cid_term list Stdlib.ref;
  8. subordinates : BitSet.t Stdlib.ref;
  9. typesubordinated : BitSet.t Stdlib.ref;
}
diff --git a/beluga/Beluga/Store/Cid/Typ/index.html b/beluga/Beluga/Store/Cid/Typ/index.html deleted file mode 100644 index 3fb39f7eb..000000000 --- a/beluga/Beluga/Store/Cid/Typ/index.html +++ /dev/null @@ -1,21 +0,0 @@ - -Typ (beluga.Beluga.Store.Cid.Typ)

Module Cid.Typ

module Entry : sig ... end
type entry = Entry.t
val freeze : Beluga_syntax.Id.cid_typ -> unit
val mk_entry : - Beluga_syntax.Name.t -> - Beluga_syntax.Synint.LF.kind -> - int -> - entry
val set_name_convention : - Beluga_syntax.Id.cid_typ -> - (unit -> string) option -> - (unit -> string) option -> - unit
val gen_var_name : Beluga_syntax.Synint.LF.typ -> (unit -> string) option
val gen_mvar_name : Beluga_syntax.Synint.LF.typ -> (unit -> string) option
val clear : unit -> unit
val explicit_arguments : entry -> int
val current_entries : unit -> (Beluga_syntax.Id.cid_typ * entry) list
val is_subordinate_to : - Beluga_syntax.Id.cid_typ -> - Beluga_syntax.Id.cid_typ -> - bool
val is_typesubordinate_to : - Beluga_syntax.Id.cid_typ -> - Beluga_syntax.Id.cid_typ -> - bool
diff --git a/beluga/Beluga/Store/Cid/index.html b/beluga/Beluga/Store/Cid/index.html deleted file mode 100644 index d855c2610..000000000 --- a/beluga/Beluga/Store/Cid/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Cid (beluga.Beluga.Store.Cid)

Module Store.Cid

module Typ : sig ... end
module Term : sig ... end
module CompTyp : sig ... end
module CompCotyp : sig ... end
module CompConst : sig ... end
module CompDest : sig ... end
module CompTypDef : sig ... end
module Comp : sig ... end
module Schema : sig ... end
module type RENDERER = sig ... end
diff --git a/beluga/Beluga/Store/Cid/module-type-RENDERER/index.html b/beluga/Beluga/Store/Cid/module-type-RENDERER/index.html deleted file mode 100644 index 2f4251235..000000000 --- a/beluga/Beluga/Store/Cid/module-type-RENDERER/index.html +++ /dev/null @@ -1,14 +0,0 @@ - -RENDERER (beluga.Beluga.Store.Cid.RENDERER)

Module type Cid.RENDERER

val render_cid_comp_typ : Beluga_syntax.Id.cid_comp_typ -> string
val render_cid_comp_cotyp : Beluga_syntax.Id.cid_comp_cotyp -> string
val render_cid_comp_const : Beluga_syntax.Id.cid_comp_const -> string
val render_cid_comp_dest : Beluga_syntax.Id.cid_comp_dest -> string
val render_cid_typ : Beluga_syntax.Id.cid_typ -> string
val render_cid_term : Beluga_syntax.Id.cid_term -> string
val render_cid_schema : Beluga_syntax.Id.cid_schema -> string
val render_cid_prog : Beluga_syntax.Id.cid_prog -> string
val render_cid_mutual_group : Beluga_syntax.Id.cid_mutual_group -> string
val render_offset : Beluga_syntax.Id.offset -> string
val render_ctx_var : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Id.offset -> - string
val render_cvar : - Beluga_syntax.Synint.LF.mctx -> - Beluga_syntax.Id.offset -> - string
val render_bvar : - Beluga_syntax.Synint.LF.dctx -> - Beluga_syntax.Id.offset -> - string
val render_var : - Beluga_syntax.Synint.Comp.gctx -> - Beluga_syntax.Id.var -> - string
diff --git a/beluga/Beluga/Store/FCVar/index.html b/beluga/Beluga/Store/FCVar/index.html deleted file mode 100644 index 6c7f7fce3..000000000 --- a/beluga/Beluga/Store/FCVar/index.html +++ /dev/null @@ -1,7 +0,0 @@ - -FCVar (beluga.Beluga.Store.FCVar)

Module Store.FCVar

The global mutable store of free contextual variables.

This is a mutable list of free contextual variables occuring in meta-level objects. It is used during reconstruction.

Free contextual variables include:

val clear : unit -> unit
diff --git a/beluga/Beluga/Store/FVar/index.html b/beluga/Beluga/Store/FVar/index.html deleted file mode 100644 index 6c244d0d6..000000000 --- a/beluga/Beluga/Store/FVar/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -FVar (beluga.Beluga.Store.FVar)

Module Store.FVar

The global mutable store of free variables in pure LF.

This is a mutable list of free LF term-level variables occurring in LF type-level or term-level constant declarations. It is used during LF reconstruction.

For free contextual variables, see FCVar.

val clear : unit -> unit
diff --git a/beluga/Beluga/Store/OpPragmas/index.html b/beluga/Beluga/Store/OpPragmas/index.html deleted file mode 100644 index 60dd58948..000000000 --- a/beluga/Beluga/Store/OpPragmas/index.html +++ /dev/null @@ -1,7 +0,0 @@ - -OpPragmas (beluga.Beluga.Store.OpPragmas)

Module Store.OpPragmas

type fixPragma = {
  1. name : Beluga_syntax.Name.t;
  2. fix : Beluga_syntax.Fixity.t;
  3. precedence : int;
  4. assoc : Beluga_syntax.Associativity.t;
}
val clear : unit -> unit
val addPragma : - Beluga_syntax.Name.t -> - Beluga_syntax.Fixity.t -> - int -> - Beluga_syntax.Associativity.t -> - unit
val getPragma : Beluga_syntax.Name.t -> fixPragma option
val pragmaExists : Beluga_syntax.Name.t -> bool
diff --git a/beluga/Beluga/Store/index.html b/beluga/Beluga/Store/index.html deleted file mode 100644 index 19d75e301..000000000 --- a/beluga/Beluga/Store/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Store (beluga.Beluga.Store)

Module Beluga.Store

module OpPragmas : sig ... end
module type ENTRY = sig ... end
module Cid : sig ... end
val clear : unit -> unit
module FVar : sig ... end

The global mutable store of free variables in pure LF.

module FCVar : sig ... end

The global mutable store of free contextual variables.

diff --git a/beluga/Beluga/Store/module-type-ENTRY/index.html b/beluga/Beluga/Store/module-type-ENTRY/index.html deleted file mode 100644 index e95a997e5..000000000 --- a/beluga/Beluga/Store/module-type-ENTRY/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -ENTRY (beluga.Beluga.Store.ENTRY)

Module type Store.ENTRY

type t
val name_of_entry : t -> Beluga_syntax.Name.t
type cid
diff --git a/beluga/Beluga/Subord/index.html b/beluga/Beluga/Subord/index.html deleted file mode 100644 index 6b36ce879..000000000 --- a/beluga/Beluga/Subord/index.html +++ /dev/null @@ -1,9 +0,0 @@ - -Subord (beluga.Beluga.Subord)

Module Beluga.Subord

val dump : bool Stdlib.ref
diff --git a/beluga/Beluga/Substitution/LF/index.html b/beluga/Beluga/Substitution/LF/index.html deleted file mode 100644 index af9f04639..000000000 --- a/beluga/Beluga/Substitution/LF/index.html +++ /dev/null @@ -1,20 +0,0 @@ - -LF (beluga.Beluga.Substitution.LF)

Module Substitution.LF

exception NotComposable of string
val isId : Beluga_syntax.Synint.LF.sub -> bool
val isMId : Beluga_syntax.Synint.LF.msub -> bool
diff --git a/beluga/Beluga/Substitution/index.html b/beluga/Beluga/Substitution/index.html deleted file mode 100644 index c733d55c4..000000000 --- a/beluga/Beluga/Substitution/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Substitution (beluga.Beluga.Substitution)

Module Beluga.Substitution

Substitutions

module LF : sig ... end
diff --git a/beluga/Beluga/Total/index.html b/beluga/Beluga/Total/index.html deleted file mode 100644 index 1a4ab04c6..000000000 --- a/beluga/Beluga/Total/index.html +++ /dev/null @@ -1,204 +0,0 @@ - -Total (beluga.Beluga.Total)

Module Beluga.Total

Checking termination of a function

module Unify = Unify.StdTrail
val dprint : (unit -> string) Support.Debug.io
val dprnt : string Support.Debug.io
type error =
  1. | NoPositiveCheck of string
  2. | NoStratifyCheck of string
  3. | NoStratifyOrPositiveCheck of string
  4. | WrongArgNum of Beluga_syntax.Id.cid_comp_typ * int
  5. | RecCallIncompatible of Beluga_syntax.Int.LF.mctx - * Beluga_syntax.Int.Comp.ih_arg - * Beluga_syntax.Int.Comp.ih_decl
  6. | NotImplemented of string
  7. | TooManyArg
val throw : Beluga_syntax.Location.t -> error -> 'a
val error_printer : error -> Support.Format.formatter -> unit
val print_str : (unit -> string) -> unit
exception Not_compatible
exception CtxNot_compatible
val enabled : bool Stdlib.ref
val sub_smaller : ('a * int) -> Beluga_syntax.Int.LF.sub -> bool
val smaller_meta_obj : Beluga_syntax.Int.LF.mfront -> bool
val struct_smaller : Beluga_syntax.Int.Comp.pattern -> bool
val order_to_string : int Beluga_syntax.Int.Comp.generic_order option -> string
val is_valid_args : Beluga_syntax.Int.Comp.typ -> int -> bool

Determine whether the arguments given in a totality declaration are valid. n: number of args tau: type of the recursive function

val get_order : - Beluga_syntax.Int.Comp.total_dec list -> - (Syncom.Name.t - * int list option - * (Beluga_syntax.Int.Comp.typ * Beluga_syntax.Synint.LF.msub)) - list

Converts the list of totality declarations into an induction ordering list

Looks up a declaration based on a function name

val get_order_for : - Beluga_syntax.Int.Comp.total_dec list -> - Beluga_syntax.Name.t -> - int list option

Gets the induction order for the function with name `f` Returns None if the

val uninstantiated_arg : Beluga_syntax.Synint.Comp.meta_obj -> bool
val valid_args : Beluga_syntax.Int.Comp.ih_arg list -> bool
val gen_ctx : - 'a -> - 'b -> - (Beluga_syntax.Id.cid_schema * 'c) -> - 'd * Beluga_syntax.Synint.LF.sub

Computes the well-founded recursive calls for the given group of mutual functions on the given contexts. If the list of functions is empty, then an empty context is computed.

exception WkViolation
val pos : - Beluga_syntax.Int.LF.dctx -> - Beluga_syntax.Synint.LF.typ -> - int -> - int option
val prefixDCtx' : - 'a -> - Beluga_syntax.Int.LF.dctx -> - Beluga_syntax.Int.LF.dctx -> - int option
val prefixDCtx : - 'a -> - Beluga_syntax.Int.LF.dctx -> - Beluga_syntax.Int.LF.dctx -> - int option
val prefix_hat : - (Beluga_syntax.Int.LF.ctx_var option * int) -> - (Beluga_syntax.Int.LF.ctx_var option * int) -> - int option
val annotate' : - Beluga_syntax.Synint.Comp.typ -> - int list -> - Beluga_syntax.Synint.Comp.typ option

Adjusts the given type signature with annotations for the induction arguments according to the given order. Returns Option.None if the order does not match the type, i.e. goes out of bounds.

Removes all TypInd marks in a computational type.

exception Unimplemented
val check_positive : - Beluga_syntax.Id.cid_comp_typ -> - Beluga_syntax.Int.Comp.typ -> - bool
val equal_meta_obj : - 'a -> - Beluga_syntax.Synint.Comp.meta_obj -> - Beluga_syntax.Synint.Comp.meta_obj -> - bool
val less_meta_obj : - 'a -> - Beluga_syntax.Synint.Comp.meta_obj -> - Beluga_syntax.Synint.Comp.meta_obj -> - bool
val stratify : - Beluga_syntax.Id.cid_comp_typ -> - Beluga_syntax.Int.Comp.typ -> - int -> - bool
val is_comp_inductive : - Beluga_syntax.Int.Comp.gctx -> - Beluga_syntax.Int.Comp.exp -> - bool

Decides whether a data object is something we're doing induction on, i.e. it's a computational variable whose type is TypInd or with a WF flag

This is similar to the logic used in check.ml to determine the kind of a branch: IndDataObj or IndIndexObj.

val is_meta_inductive : - Beluga_syntax.Int.LF.mctx -> - Beluga_syntax.Int.LF.mfront -> - bool

Decides whether an index object is something we're doing induction on, i.e. it's a metavariable with the Inductive flag set when we look it up in the meta-context.

Checks if the scrutinee of a case is on an inductive computational variable or an inductive meta-variable.

val requires_checking : - Beluga_syntax.Name.t -> - Beluga_syntax.Int.Comp.total_dec list -> - bool

Decides, in the context of a given list of totality declarations, whether the given function (name) requires totality checking. A function requires totality checking only if its totality declaration in the given list, if any, is an `inductive declaraction.

Applies the given induction order to produce an annotated type.

Filters an ihctx to contain only those IHs for the given function name.

Drops n leading arguments from all recursive calls in a given ihctx.

Drops one argument from all recursive calls in a given ihctx.

diff --git a/beluga/Beluga/Trail/EmptyTrail/index.html b/beluga/Beluga/Trail/EmptyTrail/index.html deleted file mode 100644 index 7c91321a0..000000000 --- a/beluga/Beluga/Trail/EmptyTrail/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -EmptyTrail (beluga.Beluga.Trail.EmptyTrail)

Module Trail.EmptyTrail

type 'a t
val trail : unit -> 'a t
val reset : 'a t -> unit
val mark : 'a t -> unit
val unwind : 'a t -> ('a -> unit) -> unit
val log : 'a t -> 'a -> unit
diff --git a/beluga/Beluga/Trail/StdTrail/index.html b/beluga/Beluga/Trail/StdTrail/index.html deleted file mode 100644 index e24ff16d6..000000000 --- a/beluga/Beluga/Trail/StdTrail/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -StdTrail (beluga.Beluga.Trail.StdTrail)

Module Trail.StdTrail

type 'a t
val trail : unit -> 'a t
val reset : 'a t -> unit
val mark : 'a t -> unit
val unwind : 'a t -> ('a -> unit) -> unit
val log : 'a t -> 'a -> unit
diff --git a/beluga/Beluga/Trail/index.html b/beluga/Beluga/Trail/index.html deleted file mode 100644 index e10905d55..000000000 --- a/beluga/Beluga/Trail/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Trail (beluga.Beluga.Trail)

Module Beluga.Trail

Trailing Abstract Operations

Modified: Costin Badescu

module type TRAIL = sig ... end
module EmptyTrail : TRAIL
module StdTrail : TRAIL
diff --git a/beluga/Beluga/Trail/module-type-TRAIL/index.html b/beluga/Beluga/Trail/module-type-TRAIL/index.html deleted file mode 100644 index e901aedda..000000000 --- a/beluga/Beluga/Trail/module-type-TRAIL/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -TRAIL (beluga.Beluga.Trail.TRAIL)

Module type Trail.TRAIL

type 'a t
val trail : unit -> 'a t
val reset : 'a t -> unit
val mark : 'a t -> unit
val unwind : 'a t -> ('a -> unit) -> unit
val log : 'a t -> 'a -> unit
diff --git a/beluga/Beluga/Typeinfo/Annot/index.html b/beluga/Beluga/Typeinfo/Annot/index.html deleted file mode 100644 index bf0a181b6..000000000 --- a/beluga/Beluga/Typeinfo/Annot/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Annot (beluga.Beluga.Typeinfo.Annot)

Module Typeinfo.Annot

type entry = {
  1. typ : string;
}
val mk_entry : string -> entry
val add : Beluga_syntax.Location.t -> entry -> unit
val clear : unit -> unit
val to_string : entry -> string
diff --git a/beluga/Beluga/Typeinfo/Comp/index.html b/beluga/Beluga/Typeinfo/Comp/index.html deleted file mode 100644 index 0a8dba337..000000000 --- a/beluga/Beluga/Typeinfo/Comp/index.html +++ /dev/null @@ -1,5 +0,0 @@ - -Comp (beluga.Beluga.Typeinfo.Comp)

Module Typeinfo.Comp

val add : Beluga_syntax.Location.t -> entry -> string -> unit
val clear : unit -> unit
diff --git a/beluga/Beluga/Typeinfo/LF/index.html b/beluga/Beluga/Typeinfo/LF/index.html deleted file mode 100644 index cb518c8ef..000000000 --- a/beluga/Beluga/Typeinfo/LF/index.html +++ /dev/null @@ -1,6 +0,0 @@ - -LF (beluga.Beluga.Typeinfo.LF)

Module Typeinfo.LF

val add : Beluga_syntax.Location.t -> entry -> string -> unit
val clear : unit -> unit
diff --git a/beluga/Beluga/Typeinfo/Sgn/index.html b/beluga/Beluga/Typeinfo/Sgn/index.html deleted file mode 100644 index 332cd97bd..000000000 --- a/beluga/Beluga/Typeinfo/Sgn/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sgn (beluga.Beluga.Typeinfo.Sgn)

Module Typeinfo.Sgn

type typ_or_kind =
  1. | Typ of Beluga_syntax.Synint.LF.typ
  2. | Kind of Beluga_syntax.Synint.LF.kind
type entry = {
  1. sgn : typ_or_kind;
}
val mk_entry : typ_or_kind -> entry
val add : Beluga_syntax.Location.t -> entry -> string -> unit
val clear : unit -> unit
diff --git a/beluga/Beluga/Typeinfo/index.html b/beluga/Beluga/Typeinfo/index.html deleted file mode 100644 index adc4a94a9..000000000 --- a/beluga/Beluga/Typeinfo/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Typeinfo (beluga.Beluga.Typeinfo)

Module Beluga.Typeinfo

val generate_annotations : bool Stdlib.ref
val print_annot : string -> unit
val clear_all : unit -> unit
val type_of_position : int -> int -> string
module Annot : sig ... end
module LF : sig ... end
module Comp : sig ... end
module Sgn : sig ... end
diff --git a/beluga/Beluga/Unify/EmptyTrail/index.html b/beluga/Beluga/Unify/EmptyTrail/index.html deleted file mode 100644 index 8a0fc5805..000000000 --- a/beluga/Beluga/Unify/EmptyTrail/index.html +++ /dev/null @@ -1,92 +0,0 @@ - -EmptyTrail (beluga.Beluga.Unify.EmptyTrail)

Module Unify.EmptyTrail

exception Error of string
val reset : unit -> unit
val mark : unit -> unit
val unwind : unit -> unit
val instantiateMVar : - (Beluga_syntax.Synint.LF.iterm option Stdlib.ref - * Beluga_syntax.Synint.LF.normal - * Beluga_syntax.Synint.LF.cnstr list) -> - unit
val instantiateCtxVar : - (Beluga_syntax.Synint.LF.iterm option Stdlib.ref - * Beluga_syntax.Synint.LF.dctx) -> - unit
val resetDelayedCnstrs : unit -> unit
val resetGlobalCnstrs : unit -> unit
val globalCnstrs : Beluga_syntax.Synint.LF.cnstr list Stdlib.ref
val unresolvedGlobalCnstrs : unit -> bool
val nextCnstr : unit -> Beluga_syntax.Synint.LF.cnstr option
val addConstraint : - (Beluga_syntax.Synint.LF.cnstr list Stdlib.ref - * Beluga_syntax.Synint.LF.cnstr) -> - unit
val forceGlobalCnstr : unit -> unit
val solveConstraint : Beluga_syntax.Synint.LF.cnstr -> unit
val isVar : Beluga_syntax.Synint.LF.head -> bool
val isPatSub : Beluga_syntax.Synint.LF.sub -> bool
val isProjPatSub : Beluga_syntax.Synint.LF.sub -> bool
val isPatMSub : Beluga_syntax.Synint.LF.msub -> bool
exception Failure of string
exception GlobalCnstrFailure of Beluga_syntax.Location.t * string
exception NotInvertible
type cvarRef = Make(Trail.EmptyTrail).cvarRef =
  1. | MMVarRef of Beluga_syntax.Synint.LF.iterm option Stdlib.ref
diff --git a/beluga/Beluga/Unify/Make/argument-1-T/index.html b/beluga/Beluga/Unify/Make/argument-1-T/index.html deleted file mode 100644 index 11859e908..000000000 --- a/beluga/Beluga/Unify/Make/argument-1-T/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -T (beluga.Beluga.Unify.Make.T)

Parameter Make.T

type 'a t
val trail : unit -> 'a t
val reset : 'a t -> unit
val mark : 'a t -> unit
val unwind : 'a t -> ('a -> unit) -> unit
val log : 'a t -> 'a -> unit
diff --git a/beluga/Beluga/Unify/Make/index.html b/beluga/Beluga/Unify/Make/index.html deleted file mode 100644 index 8f2d5e3f6..000000000 --- a/beluga/Beluga/Unify/Make/index.html +++ /dev/null @@ -1,92 +0,0 @@ - -Make (beluga.Beluga.Unify.Make)

Module Unify.Make

Parameters

module T : Trail.TRAIL

Signature

type unifTrail
exception Error of string
val reset : unit -> unit
val mark : unit -> unit
val unwind : unit -> unit
val instantiateMVar : - (Beluga_syntax.Synint.LF.iterm option Stdlib.ref - * Beluga_syntax.Synint.LF.normal - * Beluga_syntax.Synint.LF.cnstr list) -> - unit
val instantiateCtxVar : - (Beluga_syntax.Synint.LF.iterm option Stdlib.ref - * Beluga_syntax.Synint.LF.dctx) -> - unit
val resetDelayedCnstrs : unit -> unit
val resetGlobalCnstrs : unit -> unit
val globalCnstrs : Beluga_syntax.Synint.LF.cnstr list Stdlib.ref
val unresolvedGlobalCnstrs : unit -> bool
val nextCnstr : unit -> Beluga_syntax.Synint.LF.cnstr option
val addConstraint : - (Beluga_syntax.Synint.LF.cnstr list Stdlib.ref - * Beluga_syntax.Synint.LF.cnstr) -> - unit
val forceGlobalCnstr : unit -> unit
val solveConstraint : Beluga_syntax.Synint.LF.cnstr -> unit
val isVar : Beluga_syntax.Synint.LF.head -> bool
val isPatSub : Beluga_syntax.Synint.LF.sub -> bool
val isProjPatSub : Beluga_syntax.Synint.LF.sub -> bool
val isPatMSub : Beluga_syntax.Synint.LF.msub -> bool
exception Failure of string
exception GlobalCnstrFailure of Beluga_syntax.Location.t * string
exception NotInvertible
type cvarRef =
  1. | MMVarRef of Beluga_syntax.Synint.LF.iterm option Stdlib.ref
diff --git a/beluga/Beluga/Unify/StdTrail/index.html b/beluga/Beluga/Unify/StdTrail/index.html deleted file mode 100644 index 7eff6788f..000000000 --- a/beluga/Beluga/Unify/StdTrail/index.html +++ /dev/null @@ -1,92 +0,0 @@ - -StdTrail (beluga.Beluga.Unify.StdTrail)

Module Unify.StdTrail

exception Error of string
val reset : unit -> unit
val mark : unit -> unit
val unwind : unit -> unit
val instantiateMVar : - (Beluga_syntax.Synint.LF.iterm option Stdlib.ref - * Beluga_syntax.Synint.LF.normal - * Beluga_syntax.Synint.LF.cnstr list) -> - unit
val instantiateCtxVar : - (Beluga_syntax.Synint.LF.iterm option Stdlib.ref - * Beluga_syntax.Synint.LF.dctx) -> - unit
val resetDelayedCnstrs : unit -> unit
val resetGlobalCnstrs : unit -> unit
val globalCnstrs : Beluga_syntax.Synint.LF.cnstr list Stdlib.ref
val unresolvedGlobalCnstrs : unit -> bool
val nextCnstr : unit -> Beluga_syntax.Synint.LF.cnstr option
val addConstraint : - (Beluga_syntax.Synint.LF.cnstr list Stdlib.ref - * Beluga_syntax.Synint.LF.cnstr) -> - unit
val forceGlobalCnstr : unit -> unit
val solveConstraint : Beluga_syntax.Synint.LF.cnstr -> unit
val isVar : Beluga_syntax.Synint.LF.head -> bool
val isPatSub : Beluga_syntax.Synint.LF.sub -> bool
val isProjPatSub : Beluga_syntax.Synint.LF.sub -> bool
val isPatMSub : Beluga_syntax.Synint.LF.msub -> bool
exception Failure of string
exception GlobalCnstrFailure of Beluga_syntax.Location.t * string
exception NotInvertible
type cvarRef = Make(Trail.StdTrail).cvarRef =
  1. | MMVarRef of Beluga_syntax.Synint.LF.iterm option Stdlib.ref
diff --git a/beluga/Beluga/Unify/index.html b/beluga/Beluga/Unify/index.html deleted file mode 100644 index cab6f02d3..000000000 --- a/beluga/Beluga/Unify/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Unify (beluga.Beluga.Unify)

Module Beluga.Unify

code walk with Joshua Dunfield, Dec 3 2008

val dprint : (unit -> string) Support.Debug.io
val dprnt : string Support.Debug.io
val next_constraint_id : unit -> int

Call when creating a new constraint so constraints can have a recognizable identity in debug messages.

val numPruneSub : int Stdlib.ref
module type UNIFY = sig ... end
module Make (T : Trail.TRAIL) : UNIFY
module EmptyTrail : sig ... end
module StdTrail : sig ... end
diff --git a/beluga/Beluga/Unify/module-type-UNIFY/index.html b/beluga/Beluga/Unify/module-type-UNIFY/index.html deleted file mode 100644 index 8b0db3bcc..000000000 --- a/beluga/Beluga/Unify/module-type-UNIFY/index.html +++ /dev/null @@ -1,92 +0,0 @@ - -UNIFY (beluga.Beluga.Unify.UNIFY)

Module type Unify.UNIFY

type unifTrail
exception Error of string
val reset : unit -> unit
val mark : unit -> unit
val unwind : unit -> unit
val instantiateMVar : - (Beluga_syntax.Synint.LF.iterm option Stdlib.ref - * Beluga_syntax.Synint.LF.normal - * Beluga_syntax.Synint.LF.cnstr list) -> - unit
val instantiateCtxVar : - (Beluga_syntax.Synint.LF.iterm option Stdlib.ref - * Beluga_syntax.Synint.LF.dctx) -> - unit
val resetDelayedCnstrs : unit -> unit
val resetGlobalCnstrs : unit -> unit
val globalCnstrs : Beluga_syntax.Synint.LF.cnstr list Stdlib.ref
val unresolvedGlobalCnstrs : unit -> bool
val nextCnstr : unit -> Beluga_syntax.Synint.LF.cnstr option
val addConstraint : - (Beluga_syntax.Synint.LF.cnstr list Stdlib.ref - * Beluga_syntax.Synint.LF.cnstr) -> - unit
val forceGlobalCnstr : unit -> unit
val solveConstraint : Beluga_syntax.Synint.LF.cnstr -> unit
val isVar : Beluga_syntax.Synint.LF.head -> bool
val isPatSub : Beluga_syntax.Synint.LF.sub -> bool
val isProjPatSub : Beluga_syntax.Synint.LF.sub -> bool
val isPatMSub : Beluga_syntax.Synint.LF.msub -> bool
exception Failure of string
exception GlobalCnstrFailure of Beluga_syntax.Location.t * string
exception NotInvertible
type cvarRef =
  1. | MMVarRef of Beluga_syntax.Synint.LF.iterm option Stdlib.ref
diff --git a/beluga/Beluga/Whnf/index.html b/beluga/Beluga/Whnf/index.html deleted file mode 100644 index 6b70b8f4f..000000000 --- a/beluga/Beluga/Whnf/index.html +++ /dev/null @@ -1,258 +0,0 @@ - -Whnf (beluga.Beluga.Whnf)

Module Beluga.Whnf

modified: Joshua Dunfield

exception Fmvar_not_found
exception FreeMVar of Beluga_syntax.Synint.LF.head
exception NonInvertible
exception InvalidLFHole of Beluga_syntax.Location.t

mcomp t1 t2 = t' Eagerly composes the modal substitutions t1 and t2.

If cD_2 |- t1 : cD_1 and cD_3 |- t2 : cD_2 then cD_3 |- t' : cD_1 where t' = mcomp t1 t2

For example, suppose cD |- tau <= type for some tau cD' |- t' : cD cD'' |- t'' : cD'

cnormCTyp (tau, mcomp t' t'') = cnormCTyp (cnormCTyp (tau, t'), t'')

That is, applying a composition of substitutions is equivalent to applying the composed substitutions from *left-to-right*.

Flipped version of mcomp which is more useful as a higher-order function.

If cD_2 |- t1 : cD_1 and cD_3 |- t2 : cD_2 then cD_3 |- t' : cD_1 where t' = mcomp' t2 t1

val closed : Beluga_syntax.Synint.LF.nclo -> bool
val closedTyp : Beluga_syntax.Synint.LF.tclo -> bool
val closedDCtx : Beluga_syntax.Synint.LF.dctx -> bool
val closedCTyp : Beluga_syntax.Synint.Comp.typ -> bool
val closedGCtx : Beluga_syntax.Synint.Comp.gctx -> bool
val closedMetaObj : Beluga_syntax.Synint.Comp.meta_obj -> bool
val closedExp : Beluga_syntax.Synint.Comp.exp -> bool
val constraints_solved : Beluga_syntax.Synint.LF.cnstr list -> bool

Convert a meta-context to a list of declarations in which the * types have been shifted to make sense in the whole context. * * This would go in Context, but we need to invoke Whnf to perform * the shifting, and Whnf depends on Context.

Eliminates the level of indirection from having a Sigma with just one component.

Checks strong convertibility between two meta-contexts. We say _strong_ because reordering of entries is forbidden.

Checks strong convertibility between two computational contexts. We say _strong_ because reordering of entries is forbidden.

lowerTyp cPsi (tA, s) = (cPsi', (tA', s')) where

  • cPsi |- s : cPhi
  • cPsi |- tAs <= type
  • cPsi' |- tA's' <= type
  • cPsi' is an extension of cPsi formed by shifting all Pi-type declarations in tA to cPsi.

Converts an MMVar to a contextual object according to its contextual type.

Converts an MMVar to a meta object according to its meta type.

diff --git a/beluga/Beluga_html/Synext_html_pp/Html_printer/index.html b/beluga/Beluga_html/Synext_html_pp/Html_printer/index.html deleted file mode 100644 index 26b0ee485..000000000 --- a/beluga/Beluga_html/Synext_html_pp/Html_printer/index.html +++ /dev/null @@ -1,229 +0,0 @@ - -Html_printer (beluga.Beluga_html.Synext_html_pp.Html_printer)

Module Synext_html_pp.Html_printer

Concrete implementation of HTML pretty-printing for Beluga signatures.

include sig ... end
val pp_signature_file : - Synext_html_pp_state.Html_printing_state.state -> - Synext.signature_file -> - Stdlib.Unit.t

pp_signature_file state signature_file pretty-prints signature_file to HTML as the concatenation of its signature files.

val pp_signature : - Synext_html_pp_state.Html_printing_state.state -> - Synext.signature -> - Stdlib.Unit.t

pp_signature state signature pretty-prints signature to HTML as the concatenation of its signature files.

include module type of Synext_html_pp_state.Html_printing_state

Concrete implementation of HTML_PRINTING_STATE backed by a (mostly) immutable data structure. The instance of Format.formatter is mutable, and concurrent writes to it will lead to unexpected results.

include Synext_html_pp_state.HTML_PRINTING_STATE
include Support.Format_state.S with type state := state
include Support.Imperative_state.IMPERATIVE_STATE with type state := state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val pp_flush : state -> Stdlib.Unit.t

pp_flush state is analogous to Format.pp_print_flush.

val pp_newline : state -> Stdlib.Unit.t

pp_newline state is analogous to Format.pp_print_newline.

val pp_nop : state -> Stdlib.Unit.t

pp_nop state is (). This is useful to signal that nothing should be printed for some execution branch.

val pp_cut : state -> Stdlib.Unit.t

pp_cut state is analogous to Format.pp_print_cut.

val pp_space : state -> Stdlib.Unit.t

pp_space state is analogous to Format.pp_print_space. Note that this is a possibly breaking space, meaning that a newline may be printed at this point.

val pp_non_breaking_space : state -> Stdlib.Unit.t

pp_non_breaking_space state pretty-prints a non-breaking space, meaning that the printer does not insert break directives to that space.

val pp_break : state -> Support.Int.t -> Support.Int.t -> Stdlib.Unit.t

pp_break state width offset is analogous to Format.pp_print_break.

val pp_as : state -> Support.Int.t -> Support.String.t -> Stdlib.Unit.t

pp_as state size is analogous to Format.pp_print_as to pretty-print a string as if it were of length size. This is useful to pretty-print UTF-8 encoded strings of known codepoint count, or to print a string as if it isn't there, like for HTML tags or ASCII escape sequences.

val pp_box : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_box state ?(indent = 0) f evaluates f state in a compacting pretty-printing box wth offset indent in the formatter (see Format.pp_open_box). The box is opened before f state, and closed afterwards.

val pp_hbox : state -> (state -> Stdlib.Unit.t) -> Stdlib.Unit.t

pp_hbox state f evaluates f state in a horizontal pretty-printing box (see Format.pp_open_hbox). The box is opened before f state, and closed afterwards.

val pp_vbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_vbox state ?(indent = 0) f evaluates f state in a vertical pretty-printing box with offset indent (see Format.pp_open_vbox). The box is opened before f state, and closed afterwards.

val pp_hvbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_hovbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_bool : state -> Stdlib.Bool.t -> Stdlib.Unit.t
val pp_int : state -> Support.Int.t -> Stdlib.Unit.t
val pp_float : state -> Stdlib.Float.t -> Stdlib.Unit.t
val pp_char : state -> Stdlib.Char.t -> Stdlib.Unit.t
val pp_string : state -> Support.String.t -> Stdlib.Unit.t
val pp_option : - state -> - ?none:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val pp_list : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t
val pp_list1 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val pp_list2 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val pp_text : state -> Support.String.t -> Stdlib.Unit.t
val pp_utf_8 : state -> Support.String.t -> Stdlib.Unit.t
val pp_utf_8_text : state -> Support.String.t -> Stdlib.Unit.t
val set_formatter : state -> Support.Format.formatter -> Stdlib.Unit.t

fresh_id state ?prefix identifier is the unique ID generated from identifier and state, and optionally using prefix. This ID is intended to be used as an HTML ID for anchor elements to refer to. If prefix = Option.Some p, then id starts with p (this is just for aesthetics).

state is updated to keep track of id to guarantee that subsequent generated IDs are unique.

val preallocate_id : - state -> - ?prefix:Support.String.t -> - Beluga_syntax.Syncom.Identifier.t -> - Support.String.t

preallocate_id state ?prefix identifier is the unique ID generated from identifier and state, and optionally using prefix that will be bound to the next declaration added to state with identifier identifier. That is, the preallocated ID is reserved for the next time we want to generate a fresh ID for identifier.

This is used specifically for postponed fixity pragmas. A postponed fixity pragma needs an ID reference to the declaration it is attached to, but this declaration appears later in the signature file. Hence we preallocate an ID for that subsequent declaration, and use it as reference for the postponed pragma.

val set_current_page : state -> Support.String.t -> Stdlib.Unit.t

lookup_id state constant is the HTML ID for the bound constant in state.

If constant is unbound in state, then an exception is raised.

val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state module_identifier adds the bindings in the module having identifier module_identifier in state.

If module_identifier is unbound in state, then an exception is raised.

val add_abbreviation : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation module_identifier state abbreviation adds abbreviation for referring to the module module_identifier in state.

If module_identifier is unbound in state, then an exception is raised.

val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state associativity sets associativity as the default associativity for new user-defined infix operators.

val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t

get_default_associativity state is the default associativity for new user-defined infix operators.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state precedence sets precedence as the default precedence for new user-defined operators.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the default precedence for new user-defined operators.

val add_lf_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_lf_term_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_inductive_computation_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_stratified_computation_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_coinductive_computation_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_abbreviation_computation_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_computation_term_constructor : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_computation_term_destructor : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_program_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_module : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - (state -> 'a) -> - 'a

add_module state ?location module_identifier ~id f is the result of f when run in a state in a new module with identifier and ~id. Bindings added by declarations are added to the new module only. The derived state has identifier bound to the newly created module.

val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence constant sets constant as a prefix operator with precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.

If constant is unbound in state, then an exception is raised.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity constant sets constant as an infix operator with:

  • precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.
  • associativity a if associativity = Option.Some a, or state's default associativity if associativity = Option.None.

If constant is unbound in state, then an exception is raised.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence constant sets constant as a postfix operator with precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.

If constant is unbound, then an exception is raised.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state constant is the operator description corresponding to constant bound in state.

If constant is unbound in state, then an exception is raised.

val create_initial_state : - current_page:Support.String.t -> - Support.Format.formatter -> - state

create_initial_state ~current_page ppf constructs an empty printing state.

diff --git a/beluga/Beluga_html/Synext_html_pp/Make_html_printer/argument-1-Html_printing_state/index.html b/beluga/Beluga_html/Synext_html_pp/Make_html_printer/argument-1-Html_printing_state/index.html deleted file mode 100644 index 99a446130..000000000 --- a/beluga/Beluga_html/Synext_html_pp/Make_html_printer/argument-1-Html_printing_state/index.html +++ /dev/null @@ -1,220 +0,0 @@ - -Html_printing_state (beluga.Beluga_html.Synext_html_pp.Make_html_printer.Html_printing_state)

Parameter Make_html_printer.Html_printing_state

include Support.Format_state.S with type state := state
include Support.Imperative_state.IMPERATIVE_STATE with type state := state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val pp_flush : state -> Stdlib.Unit.t

pp_flush state is analogous to Format.pp_print_flush.

val pp_newline : state -> Stdlib.Unit.t

pp_newline state is analogous to Format.pp_print_newline.

val pp_nop : state -> Stdlib.Unit.t

pp_nop state is (). This is useful to signal that nothing should be printed for some execution branch.

val pp_cut : state -> Stdlib.Unit.t

pp_cut state is analogous to Format.pp_print_cut.

val pp_space : state -> Stdlib.Unit.t

pp_space state is analogous to Format.pp_print_space. Note that this is a possibly breaking space, meaning that a newline may be printed at this point.

val pp_non_breaking_space : state -> Stdlib.Unit.t

pp_non_breaking_space state pretty-prints a non-breaking space, meaning that the printer does not insert break directives to that space.

val pp_break : state -> Support.Int.t -> Support.Int.t -> Stdlib.Unit.t

pp_break state width offset is analogous to Format.pp_print_break.

val pp_as : state -> Support.Int.t -> Support.String.t -> Stdlib.Unit.t

pp_as state size is analogous to Format.pp_print_as to pretty-print a string as if it were of length size. This is useful to pretty-print UTF-8 encoded strings of known codepoint count, or to print a string as if it isn't there, like for HTML tags or ASCII escape sequences.

val pp_box : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_box state ?(indent = 0) f evaluates f state in a compacting pretty-printing box wth offset indent in the formatter (see Format.pp_open_box). The box is opened before f state, and closed afterwards.

val pp_hbox : state -> (state -> Stdlib.Unit.t) -> Stdlib.Unit.t

pp_hbox state f evaluates f state in a horizontal pretty-printing box (see Format.pp_open_hbox). The box is opened before f state, and closed afterwards.

val pp_vbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_vbox state ?(indent = 0) f evaluates f state in a vertical pretty-printing box with offset indent (see Format.pp_open_vbox). The box is opened before f state, and closed afterwards.

val pp_hvbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_hovbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_bool : state -> Stdlib.Bool.t -> Stdlib.Unit.t
val pp_int : state -> Support.Int.t -> Stdlib.Unit.t
val pp_float : state -> Stdlib.Float.t -> Stdlib.Unit.t
val pp_char : state -> Stdlib.Char.t -> Stdlib.Unit.t
val pp_string : state -> Support.String.t -> Stdlib.Unit.t
val pp_option : - state -> - ?none:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val pp_list : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t
val pp_list1 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val pp_list2 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val pp_text : state -> Support.String.t -> Stdlib.Unit.t
val pp_utf_8 : state -> Support.String.t -> Stdlib.Unit.t
val pp_utf_8_text : state -> Support.String.t -> Stdlib.Unit.t
val set_formatter : state -> Support.Format.formatter -> Stdlib.Unit.t

fresh_id state ?prefix identifier is the unique ID generated from identifier and state, and optionally using prefix. This ID is intended to be used as an HTML ID for anchor elements to refer to. If prefix = Option.Some p, then id starts with p (this is just for aesthetics).

state is updated to keep track of id to guarantee that subsequent generated IDs are unique.

val preallocate_id : - state -> - ?prefix:Support.String.t -> - Beluga_syntax.Syncom.Identifier.t -> - Support.String.t

preallocate_id state ?prefix identifier is the unique ID generated from identifier and state, and optionally using prefix that will be bound to the next declaration added to state with identifier identifier. That is, the preallocated ID is reserved for the next time we want to generate a fresh ID for identifier.

This is used specifically for postponed fixity pragmas. A postponed fixity pragma needs an ID reference to the declaration it is attached to, but this declaration appears later in the signature file. Hence we preallocate an ID for that subsequent declaration, and use it as reference for the postponed pragma.

val set_current_page : state -> Support.String.t -> Stdlib.Unit.t

lookup_id state constant is the HTML ID for the bound constant in state.

If constant is unbound in state, then an exception is raised.

val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state module_identifier adds the bindings in the module having identifier module_identifier in state.

If module_identifier is unbound in state, then an exception is raised.

val add_abbreviation : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation module_identifier state abbreviation adds abbreviation for referring to the module module_identifier in state.

If module_identifier is unbound in state, then an exception is raised.

val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state associativity sets associativity as the default associativity for new user-defined infix operators.

val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t

get_default_associativity state is the default associativity for new user-defined infix operators.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state precedence sets precedence as the default precedence for new user-defined operators.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the default precedence for new user-defined operators.

val add_lf_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_lf_term_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_inductive_computation_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_stratified_computation_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_coinductive_computation_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_abbreviation_computation_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_computation_term_constructor : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_computation_term_destructor : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_program_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_module : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - (state -> 'a) -> - 'a

add_module state ?location module_identifier ~id f is the result of f when run in a state in a new module with identifier and ~id. Bindings added by declarations are added to the new module only. The derived state has identifier bound to the newly created module.

val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence constant sets constant as a prefix operator with precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.

If constant is unbound in state, then an exception is raised.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity constant sets constant as an infix operator with:

  • precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.
  • associativity a if associativity = Option.Some a, or state's default associativity if associativity = Option.None.

If constant is unbound in state, then an exception is raised.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence constant sets constant as a postfix operator with precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.

If constant is unbound, then an exception is raised.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state constant is the operator description corresponding to constant bound in state.

If constant is unbound in state, then an exception is raised.

diff --git a/beluga/Beluga_html/Synext_html_pp/Make_html_printer/index.html b/beluga/Beluga_html/Synext_html_pp/Make_html_printer/index.html deleted file mode 100644 index f8ed2c239..000000000 --- a/beluga/Beluga_html/Synext_html_pp/Make_html_printer/index.html +++ /dev/null @@ -1,73 +0,0 @@ - -Make_html_printer (beluga.Beluga_html.Synext_html_pp.Make_html_printer)

Module Synext_html_pp.Make_html_printer

Parameters

Signature

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Html_printing_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val pp_signature_file : state -> Synext.signature_file -> Stdlib.Unit.t

pp_signature_file state signature_file pretty-prints signature_file to HTML as the concatenation of its signature files.

val pp_signature : state -> Synext.signature -> Stdlib.Unit.t

pp_signature state signature pretty-prints signature to HTML as the concatenation of its signature files.

diff --git a/beluga/Beluga_html/Synext_html_pp/index.html b/beluga/Beluga_html/Synext_html_pp/index.html deleted file mode 100644 index f900273c9..000000000 --- a/beluga/Beluga_html/Synext_html_pp/index.html +++ /dev/null @@ -1,4 +0,0 @@ - -Synext_html_pp (beluga.Beluga_html.Synext_html_pp)

Module Beluga_html.Synext_html_pp

Stateful pretty-printing of concrete Beluga signatures to HTML.

module type HTML_PRINTER = sig ... end

Abstract definition for HTML pretty-printing concrete Beluga signatures.

module Html_printer : sig ... end

Concrete implementation of HTML pretty-printing for Beluga signatures.

diff --git a/beluga/Beluga_html/Synext_html_pp/module-type-HTML_PRINTER/index.html b/beluga/Beluga_html/Synext_html_pp/module-type-HTML_PRINTER/index.html deleted file mode 100644 index 7ed1114f5..000000000 --- a/beluga/Beluga_html/Synext_html_pp/module-type-HTML_PRINTER/index.html +++ /dev/null @@ -1,72 +0,0 @@ - -HTML_PRINTER (beluga.Beluga_html.Synext_html_pp.HTML_PRINTER)

Module type Synext_html_pp.HTML_PRINTER

Abstract definition for HTML pretty-printing concrete Beluga signatures.

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val pp_signature_file : state -> Synext.signature_file -> Stdlib.Unit.t

pp_signature_file state signature_file pretty-prints signature_file to HTML as the concatenation of its signature files.

val pp_signature : state -> Synext.signature -> Stdlib.Unit.t

pp_signature state signature pretty-prints signature to HTML as the concatenation of its signature files.

diff --git a/beluga/Beluga_html/Synext_html_pp_state/Html_printing_state/index.html b/beluga/Beluga_html/Synext_html_pp_state/Html_printing_state/index.html deleted file mode 100644 index 110215e77..000000000 --- a/beluga/Beluga_html/Synext_html_pp_state/Html_printing_state/index.html +++ /dev/null @@ -1,223 +0,0 @@ - -Html_printing_state (beluga.Beluga_html.Synext_html_pp_state.Html_printing_state)

Module Synext_html_pp_state.Html_printing_state

Concrete implementation of HTML_PRINTING_STATE backed by a (mostly) immutable data structure. The instance of Format.formatter is mutable, and concurrent writes to it will lead to unexpected results.

include HTML_PRINTING_STATE
include Support.Format_state.S with type state := state
include Support.Imperative_state.IMPERATIVE_STATE with type state := state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val pp_flush : state -> Stdlib.Unit.t

pp_flush state is analogous to Format.pp_print_flush.

val pp_newline : state -> Stdlib.Unit.t

pp_newline state is analogous to Format.pp_print_newline.

val pp_nop : state -> Stdlib.Unit.t

pp_nop state is (). This is useful to signal that nothing should be printed for some execution branch.

val pp_cut : state -> Stdlib.Unit.t

pp_cut state is analogous to Format.pp_print_cut.

val pp_space : state -> Stdlib.Unit.t

pp_space state is analogous to Format.pp_print_space. Note that this is a possibly breaking space, meaning that a newline may be printed at this point.

val pp_non_breaking_space : state -> Stdlib.Unit.t

pp_non_breaking_space state pretty-prints a non-breaking space, meaning that the printer does not insert break directives to that space.

val pp_break : state -> Support.Int.t -> Support.Int.t -> Stdlib.Unit.t

pp_break state width offset is analogous to Format.pp_print_break.

val pp_as : state -> Support.Int.t -> Support.String.t -> Stdlib.Unit.t

pp_as state size is analogous to Format.pp_print_as to pretty-print a string as if it were of length size. This is useful to pretty-print UTF-8 encoded strings of known codepoint count, or to print a string as if it isn't there, like for HTML tags or ASCII escape sequences.

val pp_box : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_box state ?(indent = 0) f evaluates f state in a compacting pretty-printing box wth offset indent in the formatter (see Format.pp_open_box). The box is opened before f state, and closed afterwards.

val pp_hbox : state -> (state -> Stdlib.Unit.t) -> Stdlib.Unit.t

pp_hbox state f evaluates f state in a horizontal pretty-printing box (see Format.pp_open_hbox). The box is opened before f state, and closed afterwards.

val pp_vbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_vbox state ?(indent = 0) f evaluates f state in a vertical pretty-printing box with offset indent (see Format.pp_open_vbox). The box is opened before f state, and closed afterwards.

val pp_hvbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_hovbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_bool : state -> Stdlib.Bool.t -> Stdlib.Unit.t
val pp_int : state -> Support.Int.t -> Stdlib.Unit.t
val pp_float : state -> Stdlib.Float.t -> Stdlib.Unit.t
val pp_char : state -> Stdlib.Char.t -> Stdlib.Unit.t
val pp_string : state -> Support.String.t -> Stdlib.Unit.t
val pp_option : - state -> - ?none:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val pp_list : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t
val pp_list1 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val pp_list2 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val pp_text : state -> Support.String.t -> Stdlib.Unit.t
val pp_utf_8 : state -> Support.String.t -> Stdlib.Unit.t
val pp_utf_8_text : state -> Support.String.t -> Stdlib.Unit.t
val set_formatter : state -> Support.Format.formatter -> Stdlib.Unit.t

fresh_id state ?prefix identifier is the unique ID generated from identifier and state, and optionally using prefix. This ID is intended to be used as an HTML ID for anchor elements to refer to. If prefix = Option.Some p, then id starts with p (this is just for aesthetics).

state is updated to keep track of id to guarantee that subsequent generated IDs are unique.

val preallocate_id : - state -> - ?prefix:Support.String.t -> - Beluga_syntax.Syncom.Identifier.t -> - Support.String.t

preallocate_id state ?prefix identifier is the unique ID generated from identifier and state, and optionally using prefix that will be bound to the next declaration added to state with identifier identifier. That is, the preallocated ID is reserved for the next time we want to generate a fresh ID for identifier.

This is used specifically for postponed fixity pragmas. A postponed fixity pragma needs an ID reference to the declaration it is attached to, but this declaration appears later in the signature file. Hence we preallocate an ID for that subsequent declaration, and use it as reference for the postponed pragma.

val set_current_page : state -> Support.String.t -> Stdlib.Unit.t

lookup_id state constant is the HTML ID for the bound constant in state.

If constant is unbound in state, then an exception is raised.

val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state module_identifier adds the bindings in the module having identifier module_identifier in state.

If module_identifier is unbound in state, then an exception is raised.

val add_abbreviation : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation module_identifier state abbreviation adds abbreviation for referring to the module module_identifier in state.

If module_identifier is unbound in state, then an exception is raised.

val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state associativity sets associativity as the default associativity for new user-defined infix operators.

val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t

get_default_associativity state is the default associativity for new user-defined infix operators.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state precedence sets precedence as the default precedence for new user-defined operators.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the default precedence for new user-defined operators.

val add_lf_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_lf_term_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_inductive_computation_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_stratified_computation_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_coinductive_computation_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_abbreviation_computation_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_computation_term_constructor : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_computation_term_destructor : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_program_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_module : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - (state -> 'a) -> - 'a

add_module state ?location module_identifier ~id f is the result of f when run in a state in a new module with identifier and ~id. Bindings added by declarations are added to the new module only. The derived state has identifier bound to the newly created module.

val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence constant sets constant as a prefix operator with precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.

If constant is unbound in state, then an exception is raised.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity constant sets constant as an infix operator with:

  • precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.
  • associativity a if associativity = Option.Some a, or state's default associativity if associativity = Option.None.

If constant is unbound in state, then an exception is raised.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence constant sets constant as a postfix operator with precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.

If constant is unbound, then an exception is raised.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state constant is the operator description corresponding to constant bound in state.

If constant is unbound in state, then an exception is raised.

val create_initial_state : - current_page:Support.String.t -> - Support.Format.formatter -> - state

create_initial_state ~current_page ppf constructs an empty printing state.

diff --git a/beluga/Beluga_html/Synext_html_pp_state/index.html b/beluga/Beluga_html/Synext_html_pp_state/index.html deleted file mode 100644 index 261b547c7..000000000 --- a/beluga/Beluga_html/Synext_html_pp_state/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Synext_html_pp_state (beluga.Beluga_html.Synext_html_pp_state)

Module Beluga_html.Synext_html_pp_state

HTML printing state for the concrete syntax.

The generation of HTML pages corresponding to concrete Beluga signatures requires keeping track of HTML IDs for constant declarations (to be referred to by anchors), and keeping track of user-defined notations of constants for printing applications. This means that module bindings have to be kept track of, and pragmas have to be applied during printing.

module type HTML_PRINTING_STATE = sig ... end

Abstract definition for the HTML printing state.

module Html_printing_state : sig ... end

Concrete implementation of HTML_PRINTING_STATE backed by a (mostly) immutable data structure. The instance of Format.formatter is mutable, and concurrent writes to it will lead to unexpected results.

diff --git a/beluga/Beluga_html/Synext_html_pp_state/module-type-HTML_PRINTING_STATE/index.html b/beluga/Beluga_html/Synext_html_pp_state/module-type-HTML_PRINTING_STATE/index.html deleted file mode 100644 index 93f553de2..000000000 --- a/beluga/Beluga_html/Synext_html_pp_state/module-type-HTML_PRINTING_STATE/index.html +++ /dev/null @@ -1,220 +0,0 @@ - -HTML_PRINTING_STATE (beluga.Beluga_html.Synext_html_pp_state.HTML_PRINTING_STATE)

Module type Synext_html_pp_state.HTML_PRINTING_STATE

Abstract definition for the HTML printing state.

include Support.Format_state.S with type state := state
include Support.Imperative_state.IMPERATIVE_STATE with type state := state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val pp_flush : state -> Stdlib.Unit.t

pp_flush state is analogous to Format.pp_print_flush.

val pp_newline : state -> Stdlib.Unit.t

pp_newline state is analogous to Format.pp_print_newline.

val pp_nop : state -> Stdlib.Unit.t

pp_nop state is (). This is useful to signal that nothing should be printed for some execution branch.

val pp_cut : state -> Stdlib.Unit.t

pp_cut state is analogous to Format.pp_print_cut.

val pp_space : state -> Stdlib.Unit.t

pp_space state is analogous to Format.pp_print_space. Note that this is a possibly breaking space, meaning that a newline may be printed at this point.

val pp_non_breaking_space : state -> Stdlib.Unit.t

pp_non_breaking_space state pretty-prints a non-breaking space, meaning that the printer does not insert break directives to that space.

val pp_break : state -> Support.Int.t -> Support.Int.t -> Stdlib.Unit.t

pp_break state width offset is analogous to Format.pp_print_break.

val pp_as : state -> Support.Int.t -> Support.String.t -> Stdlib.Unit.t

pp_as state size is analogous to Format.pp_print_as to pretty-print a string as if it were of length size. This is useful to pretty-print UTF-8 encoded strings of known codepoint count, or to print a string as if it isn't there, like for HTML tags or ASCII escape sequences.

val pp_box : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_box state ?(indent = 0) f evaluates f state in a compacting pretty-printing box wth offset indent in the formatter (see Format.pp_open_box). The box is opened before f state, and closed afterwards.

val pp_hbox : state -> (state -> Stdlib.Unit.t) -> Stdlib.Unit.t

pp_hbox state f evaluates f state in a horizontal pretty-printing box (see Format.pp_open_hbox). The box is opened before f state, and closed afterwards.

val pp_vbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_vbox state ?(indent = 0) f evaluates f state in a vertical pretty-printing box with offset indent (see Format.pp_open_vbox). The box is opened before f state, and closed afterwards.

val pp_hvbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_hovbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_bool : state -> Stdlib.Bool.t -> Stdlib.Unit.t
val pp_int : state -> Support.Int.t -> Stdlib.Unit.t
val pp_float : state -> Stdlib.Float.t -> Stdlib.Unit.t
val pp_char : state -> Stdlib.Char.t -> Stdlib.Unit.t
val pp_string : state -> Support.String.t -> Stdlib.Unit.t
val pp_option : - state -> - ?none:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val pp_list : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t
val pp_list1 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val pp_list2 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val pp_text : state -> Support.String.t -> Stdlib.Unit.t
val pp_utf_8 : state -> Support.String.t -> Stdlib.Unit.t
val pp_utf_8_text : state -> Support.String.t -> Stdlib.Unit.t
val set_formatter : state -> Support.Format.formatter -> Stdlib.Unit.t

fresh_id state ?prefix identifier is the unique ID generated from identifier and state, and optionally using prefix. This ID is intended to be used as an HTML ID for anchor elements to refer to. If prefix = Option.Some p, then id starts with p (this is just for aesthetics).

state is updated to keep track of id to guarantee that subsequent generated IDs are unique.

val preallocate_id : - state -> - ?prefix:Support.String.t -> - Beluga_syntax.Syncom.Identifier.t -> - Support.String.t

preallocate_id state ?prefix identifier is the unique ID generated from identifier and state, and optionally using prefix that will be bound to the next declaration added to state with identifier identifier. That is, the preallocated ID is reserved for the next time we want to generate a fresh ID for identifier.

This is used specifically for postponed fixity pragmas. A postponed fixity pragma needs an ID reference to the declaration it is attached to, but this declaration appears later in the signature file. Hence we preallocate an ID for that subsequent declaration, and use it as reference for the postponed pragma.

val set_current_page : state -> Support.String.t -> Stdlib.Unit.t

lookup_id state constant is the HTML ID for the bound constant in state.

If constant is unbound in state, then an exception is raised.

val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state module_identifier adds the bindings in the module having identifier module_identifier in state.

If module_identifier is unbound in state, then an exception is raised.

val add_abbreviation : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation module_identifier state abbreviation adds abbreviation for referring to the module module_identifier in state.

If module_identifier is unbound in state, then an exception is raised.

val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state associativity sets associativity as the default associativity for new user-defined infix operators.

val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t

get_default_associativity state is the default associativity for new user-defined infix operators.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state precedence sets precedence as the default precedence for new user-defined operators.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the default precedence for new user-defined operators.

val add_lf_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_lf_term_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_inductive_computation_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_stratified_computation_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_coinductive_computation_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_abbreviation_computation_type_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_computation_term_constructor : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_computation_term_destructor : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_program_constant : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - Stdlib.Unit.t
val add_module : - state -> - ?location:'a -> - Beluga_syntax.Syncom.Identifier.t -> - id:Support.String.t -> - (state -> 'a) -> - 'a

add_module state ?location module_identifier ~id f is the result of f when run in a state in a new module with identifier and ~id. Bindings added by declarations are added to the new module only. The derived state has identifier bound to the newly created module.

val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence constant sets constant as a prefix operator with precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.

If constant is unbound in state, then an exception is raised.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity constant sets constant as an infix operator with:

  • precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.
  • associativity a if associativity = Option.Some a, or state's default associativity if associativity = Option.None.

If constant is unbound in state, then an exception is raised.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence constant sets constant as a postfix operator with precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.

If constant is unbound, then an exception is raised.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state constant is the operator description corresponding to constant bound in state.

If constant is unbound in state, then an exception is raised.

diff --git a/beluga/Beluga_parser/Application_disambiguation/Make_application_disambiguation/argument-1-Expression/index.html b/beluga/Beluga_parser/Application_disambiguation/Make_application_disambiguation/argument-1-Expression/index.html deleted file mode 100644 index 2ed0b598f..000000000 --- a/beluga/Beluga_parser/Application_disambiguation/Make_application_disambiguation/argument-1-Expression/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Expression (beluga.Beluga_parser.Application_disambiguation.Make_application_disambiguation.Expression)

Parameter Make_application_disambiguation.Expression

type t
type location = Beluga_syntax.Location.t
val location : t -> location
diff --git a/beluga/Beluga_parser/Application_disambiguation/Make_application_disambiguation/index.html b/beluga/Beluga_parser/Application_disambiguation/Make_application_disambiguation/index.html deleted file mode 100644 index 97369b5f6..000000000 --- a/beluga/Beluga_parser/Application_disambiguation/Make_application_disambiguation/index.html +++ /dev/null @@ -1,8 +0,0 @@ - -Make_application_disambiguation (beluga.Beluga_parser.Application_disambiguation.Make_application_disambiguation)

Module Application_disambiguation.Make_application_disambiguation

Parameters

Signature

type expression = Expression.t
type source
val make_expression : expression -> source
type target = private
  1. | Atom of {
    1. expression : expression;
    2. location : Beluga_syntax.Location.t;
    }
  2. | Application of {
    1. applicand : expression;
    2. arguments : target Support.List1.t;
    3. location : Beluga_syntax.Location.t;
    }
val disambiguate_application : - source Support.List2.t -> - expression * target Support.List1.t
diff --git a/beluga/Beluga_parser/Application_disambiguation/index.html b/beluga/Beluga_parser/Application_disambiguation/index.html deleted file mode 100644 index f9b27375a..000000000 --- a/beluga/Beluga_parser/Application_disambiguation/index.html +++ /dev/null @@ -1,4 +0,0 @@ - -Application_disambiguation (beluga.Beluga_parser.Application_disambiguation)

Module Beluga_parser.Application_disambiguation

Disambiguation of expression applications with user-defined operators and juxtapositions.

module type EXPRESSION = sig ... end
module type APPLICATION_DISAMBIGUATION = sig ... end
diff --git a/beluga/Beluga_parser/Application_disambiguation/module-type-APPLICATION_DISAMBIGUATION/index.html b/beluga/Beluga_parser/Application_disambiguation/module-type-APPLICATION_DISAMBIGUATION/index.html deleted file mode 100644 index dc9fc98c6..000000000 --- a/beluga/Beluga_parser/Application_disambiguation/module-type-APPLICATION_DISAMBIGUATION/index.html +++ /dev/null @@ -1,8 +0,0 @@ - -APPLICATION_DISAMBIGUATION (beluga.Beluga_parser.Application_disambiguation.APPLICATION_DISAMBIGUATION)

Module type Application_disambiguation.APPLICATION_DISAMBIGUATION

type expression
type source
val make_expression : expression -> source
type target = private
  1. | Atom of {
    1. expression : expression;
    2. location : Beluga_syntax.Location.t;
    }
  2. | Application of {
    1. applicand : expression;
    2. arguments : target Support.List1.t;
    3. location : Beluga_syntax.Location.t;
    }
val disambiguate_application : - source Support.List2.t -> - expression * target Support.List1.t
diff --git a/beluga/Beluga_parser/Application_disambiguation/module-type-EXPRESSION/index.html b/beluga/Beluga_parser/Application_disambiguation/module-type-EXPRESSION/index.html deleted file mode 100644 index 6215cf4b7..000000000 --- a/beluga/Beluga_parser/Application_disambiguation/module-type-EXPRESSION/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -EXPRESSION (beluga.Beluga_parser.Application_disambiguation.EXPRESSION)

Module type Application_disambiguation.EXPRESSION

type t
type location
val location : t -> location
diff --git a/beluga/Beluga_parser/Clf_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html b/beluga/Beluga_parser/Clf_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html deleted file mode 100644 index 48a81d8d5..000000000 --- a/beluga/Beluga_parser/Clf_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga_parser.Clf_disambiguation.Make.Disambiguation_state.Entry)

Module Disambiguation_state.Entry

Recorded data on bindings in Beluga signatures.

type t

The type of entry.

val is_lf_variable : t -> Stdlib.Bool.t

is_lf_variable entry is true if and only if entry describes an LF variable.

val is_meta_variable : t -> Stdlib.Bool.t

is_meta_variable entry is true if entry describes a meta-variable or a contextual variable.

Contextual variables exist only because mlam-expressions ambiguously introduce either a meta-variable, a parameter variable, a substitution variable or a context variable.

val is_parameter_variable : t -> Stdlib.Bool.t

is_parameter_variable is like is_meta_variable, but for entries describing parameter variables.

val is_substitution_variable : t -> Stdlib.Bool.t

is_substitution_variable is like is_meta_variable, but for entries describing parameter variables.

val is_context_variable : t -> Stdlib.Bool.t

is_context_variable is like is_meta_variable, but for entries describing context variables.

val is_computation_variable : t -> Stdlib.Bool.t

is_computation_variable entry is true if and only if entry describes a computation-level variable.

val is_variable : t -> Stdlib.Bool.t

is_variable entry is true if and only if entry describes an LF variable, a meta-level variable, or a computation-level variable.

This is used to discern between the following two cases when disambiguating identifiers in patterns:

  • The case where an exception should be raised because the identifier is a bound variable of the wrong sort.
  • The case where the identifier should be a free variable shadowing a constant.
val is_lf_type_constant : t -> Stdlib.Bool.t

is_lf_type_constant entry is true if and only if entry describes an LF type-level constant.

val is_lf_term_constant : t -> Stdlib.Bool.t

is_lf_term_constant is like is_lf_type_constant, but for entries describing LF term-level constants.

val is_schema_constant : t -> Stdlib.Bool.t

is_schema_constant is like is_lf_type_constant, but for entries describing context schemas.

val is_computation_inductive_type_constant : t -> Stdlib.Bool.t

is_computation_inductive_type_constant is like is_lf_type_constant, but for entries describing inductive computation-level type constants.

val is_computation_stratified_type_constant : t -> Stdlib.Bool.t

is_computation_stratified_type_constant is like is_lf_type_constant, but for entries describing stratified computation-level type constants.

val is_computation_coinductive_type_constant : t -> Stdlib.Bool.t

is_computation_coinductive_type_constant is like is_lf_type_constant, but for entries describing coinductive computation-level type constants.

val is_computation_abbreviation_type_constant : t -> Stdlib.Bool.t

is_computation_abbreviation_type_constant is like is_lf_type_constant, but for entries describing computation-level type constant abbreviations (introduced by the Beluga keyword typedef).

val is_computation_term_constructor : t -> Stdlib.Bool.t

is_computation_term_constructor is like is_lf_type_constant, but for entries describing computation-level constructors.

val is_computation_term_destructor : t -> Stdlib.Bool.t

is_computation_term_destructor is like is_lf_type_constant, but for entries describing computation-level destructors.

val is_program_constant : t -> Stdlib.Bool.t

is_program_constant is like is_lf_type_constant, but for entries describing computation-level programs (introduced by the Beluga keyword rec or val).

val is_module : t -> Stdlib.Bool.t

is_module is like is_lf_type_constant, but for entries describing modules.

diff --git a/beluga/Beluga_parser/Clf_disambiguation/Make/argument-1-Disambiguation_state/index.html b/beluga/Beluga_parser/Clf_disambiguation/Make/argument-1-Disambiguation_state/index.html deleted file mode 100644 index 6ad8b6cfa..000000000 --- a/beluga/Beluga_parser/Clf_disambiguation/Make/argument-1-Disambiguation_state/index.html +++ /dev/null @@ -1,284 +0,0 @@ - -Disambiguation_state (beluga.Beluga_parser.Clf_disambiguation.Make.Disambiguation_state)

Parameter Make.Disambiguation_state

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
module Entry : Disambiguation_state.ENTRY

Recorded data on bindings in Beluga signatures.

Variables

val add_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_variable state ?location identifier adds identifier as a bound LF variable, with binding site location. If location = Option.None, then identifier's location is used instead.

This is mostly used for testing. For locally binding an LF variable, see with_bound_lf_variable.

val add_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_meta_variable is like add_lf_variable, but the identifier is added as a bound meta-variable.

val add_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_parameter_variable is like add_lf_variable, but the identifier is added as a bound parameter variable (those variables prefixed by '#' like "#p").

val add_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_substitution_variable is like add_lf_variable, but the identifier is added as a bound substitution variable (those variables prefixed by '$' like "$S").

val add_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_context_variable is like add_lf_variable, but the identifier is added as a bound context variable.

val add_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_contextual_variable is like add_lf_variable, but the identifier is added as a bound contextual variable, meaning that it is ambiguously bound as either a meta, parameter, substitution or context variable.

val add_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_variable is like add_lf_variable, but the identifier is added as a bound computation-level variable.

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state ?location identifier is add_lf_variable state ?location identifier, with the additional behaviour of adding identifier as an inner pattern bound identifier and as a free variable during pattern disambiguation. This means that identifier can subsequently be looked up as a bound LF variable during pattern disambiguation. This effectively allows free LF variables to appear multiple times (non-linearly) in patterns.

See with_free_variables_as_pattern_variables for the handler for converting free variables in patterns to binders for use as bound variables in expressions.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free meta-variable.

val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free parameter variable.

val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free substitution variable.

val add_free_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free context variable.

val add_free_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_computation_variable state ?location identifier adds identifier to state as a free variable during pattern disambiguation. This differs from add_free_lf_variable in that free computation-level variables in patterns do not have implicit binders (because they are not part of the meta-context), and hence must appear only once (linearly) in the overall pattern.

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state ?location identifier m is the result of running m in the local state derived from state having identifier as a bound LF variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

For example, the disambiguation of an LF term-level lambda-abstraction \x. m requires that the parameter x is locally added in scope when disambiguating the body m. This is achieved like this:

with_bound_lf_variable state x (fun state ->
-    disambiguate_lf_term state m)
val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_meta_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound meta-variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound contextual variable. This is different from with_bound_meta_variable, with_bound_parameter_variable, with_bound_substitution_variable and with_bound_context_variable in that it is unknown whether identifier should be a meta-variable, parameter variable, substitution variable or context variable. This is used in particular for mlam expressions.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_computation_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound computation-level variable.

val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_meta_variable state ?location identifier m is like with_bound_meta_variable state ?location identifier m except that identifier is also treated as a free variable so that in with_free_variables_as_pattern_variables it can be treated as a pattern variable usable in the expression.

This is used for meta-variables introduced in the meta-context of a pattern during case analysis. Those variables are considered bound in both the pattern and expression.

For example, B as below is one such bound pattern meta-variable, and appears in scope for ?.

case x of
-| { B : [g |- o] } [g |- impi \u. D] => ?
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_parameter_variable is like with_bound_pattern_meta_variable, but for a parameter variable introduced in the meta-context of a pattern.

val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_substitution_variable is like with_bound_pattern_meta_variable, but for a substitution variable introduced in the meta-context of a pattern.

val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_context_variable is like with_bound_pattern_meta_variable, but for a context variable introduced in the meta-context of a pattern.

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression state is the result of running expression with the free variables added in pattern as bound variables. This is used to disambiguate expression with bound variables arising from free variables in pattern.

  1. pattern is run with respect to state while keeping track of free variables. Variables bound outside the pattern are ignored in lookups.
  2. expression is run with respect to state with the addition of the tracked free variables from patterns as bound variables.

Lookups performed in pattern are more complex. The variables in state count as being unbound, but the variables with binders in the pattern count as bound. Binders in a pattern can be user-specified, or to be reconstructed during abstraction.

A variable is specifically inner bound if it is introduced explicitly by a lambda abstraction or the pattern meta-context, as an explicit or implicit parameter. Free meta-level variables are reconstructed inner bound. For instance, assuming s and ctx are constants:

  • In the pattern (x, x), both occurrences of x are pattern variables, and that pattern is not linear.
  • In the pattern {M : [ |- nat]} [ |- s M], M as introduced in the meta-context is a pattern variable, and M is an inner pattern-bound identifier in s M, so that pattern is linear.
  • In the pattern [ |- \x. s x], there are no pattern variables.
  • In the pattern ([g |- s M], [g |- s M]), g and M are pattern variables in the left projection of the tuple pattern, and inner pattern-bound in the right projection of the tuple pattern. This is because the pattern is reconstructed as {g : ctx} {M : [g |- nat]} ([g |- s M], [g |- s M]).
val with_scope : state -> (state -> 'a) -> 'a

with_scope state m runs m in a nested bindings scope that is discarded afterwards.

val with_parent_scope : state -> (state -> 'a) -> 'a

with_parent_scope state m runs m while ignoring the topmost scope.

This is used for the disambiguation of Harpoon proof scripts because Harpoon hypotheticals are already serialized with all the identifiers in the meta-level and computation-level contexts of the proof.

val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used for backtracking when disambiguating old-style LF type-level and term-level declarations (i.e., x : X where X may be an LF kind or an LF type).

This is also used in REPLs to safely run parsing functions and recover the state in case of a raised exception during disambiguation.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Constants

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_type_constant state ?location ?arity identifier adds identifier as a bound LF type-level constant.

In the disambiguation of a module's declaration, this also adds the constant as one of the module's declarations.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_term_constant is like add_lf_type_constant, but for LF term-level constants.

val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_schema_constant is like add_lf_type_constant, but for schema constants.

val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_inductive_computation_type_constant is like add_lf_type_constant, but for inductive computation-level type constants.

val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_stratified_computation_type_constant is like add_lf_type_constant, but for stratified computation-level type constants.

val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_coinductive_computation_type_constant is like add_lf_type_constant, but for coinductive computation-level type constants.

val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation_computation_type_constant is like add_lf_type_constant, but for computation-level abbreviation type constants.

val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_constructor is like add_lf_type_constant, but for computation-level term constructors.

val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_destructor is like add_lf_type_constant, but for computation-level term destructors.

val add_program_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_program_constant is like add_lf_type_constant, but for computation-level program constants.

val add_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

add_module state ?location identifier m is the result of running m in a module disambiguation state, whereby added constants are kept track of as declarations in the module having identifier.

Lookups

exception Unbound_identifier of Beluga_syntax.Syncom.Identifier.t

Unbound_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is caught whenever a variable lookup fails and identifier can be disambiguated as a free variable.

exception Unbound_qualified_identifier of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_qualified_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is unrecoverable, but is caught during disambiguation to provide better error messages.

exception Unbound_namespace of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_namespace namespace_identifier is raised if a qualified identifier could not be looked up in a disambiguation state because the namespace with identifier namespace_identifier is unbound.

val lookup_toplevel : state -> Beluga_syntax.Syncom.Identifier.t -> Entry.t

lookup_toplevel state identifier is entry if identifier resolves to entry in state. If identifier is unbound in state, then Unbound_identifier identifier is raised.

lookup state identifier is entry if identifier resolves to entry in state. Otherwise:

  • Unbound_identifier ident) is raised if the first segment ident in identifier is unbound.
  • Unbound_namespace namespace_identifier is raised if a segment in identifier other than the first or last is unbound.
  • Unbound_qualified_identifier identifier is raised if the last segment in identifier is unbound.
type maximum_lookup_result =
  1. | Unbound of {
    1. segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  2. | Partially_bound of {
    1. leading_segments : Beluga_syntax.Syncom.Identifier.t Support.List.t;
    2. segment : Beluga_syntax.Syncom.Identifier.t;
    3. entry : Entry.t;
    4. trailing_segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  3. | Bound of {
    1. entry : Entry.t;
    }

maximum_lookup state segments is either:

  • Unbound { segments } if the first segment in segments is unbound in state.
  • Partially_bound { leading_segments; segment; entry; trailing_segments } if the qualified identifier with namespaces leading_segments and name segment is bound to entry in state.
  • Bound { identifier; entry } if segments form a qualified identifier bound to entry in state.
val actual_binding_exn : - Beluga_syntax.Syncom.Qualified_identifier.t -> - Entry.t -> - exn

actual_binding_exn identifier entry is an exception reporting what sort of entry is bound at identifier. The exception is annotated with the entry's binding location.

Signature Operations

val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state module_identifier adds the exported constants from the module bound to module_identifier as toplevel entries in state. If module_identifier is unbound in state, then an exception is raised.

val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t

get_default_associativity state is the associativity to use for infix operators defined by the user using a pragma, without specifying the infix operator's associativity.

val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state default_associativity sets default_associativity as the associativity to return from get_default_associativity.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the precedence to use for operators defined by the user using a pragma, without specifying the operator's precedence.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state default_precedence sets default_precedence as the precedence to return from get_default_precedence.

val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence identifier adds a prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity identifier adds an infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence identifier adds a postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state identifier is Option.Some operator if identifier is bound to an operator with descriptor operator in state, and Option.None otherwise.

This is used to resolve operators in the disambiguation of applications, which are parsed as lists of expressions.

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_module_abbreviation state ?location module_identifier abbreviation adds the synonym abbreviation for the module bound to identifier in state.

An exception is raised if module_identifier is unbound in state, or if module_identifier is not bound to a module in state.

diff --git a/beluga/Beluga_parser/Clf_disambiguation/Make/index.html b/beluga/Beluga_parser/Clf_disambiguation/Make/index.html deleted file mode 100644 index 0f3f994ce..000000000 --- a/beluga/Beluga_parser/Clf_disambiguation/Make/index.html +++ /dev/null @@ -1,93 +0,0 @@ - -Make (beluga.Beluga_parser.Clf_disambiguation.Make)

Module Clf_disambiguation.Make

Parameters

Signature

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Disambiguation_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_clf_typ : state -> Synprs.clf_object -> Synext.clf_typ
val disambiguate_clf_term : state -> Synprs.clf_object -> Synext.clf_term
val disambiguate_clf_substitution : - state -> - Synprs.clf_context_object -> - Synext.clf_substitution
val with_disambiguated_clf_context : - state -> - Synprs.clf_context_object -> - (state -> Synext.clf_context -> 'a) -> - 'a
val disambiguate_clf_term_pattern : - state -> - Synprs.clf_object -> - Synext.clf_term_pattern
val disambiguate_clf_substitution_pattern : - state -> - Synprs.clf_context_object -> - Synext.clf_substitution_pattern
val with_disambiguated_clf_context_pattern : - state -> - Synprs.clf_context_object -> - (state -> Synext.clf_context_pattern -> 'a) -> - 'a
val disambiguate_clf_context_pattern : - state -> - Synprs.clf_context_object -> - Synext.clf_context_pattern
diff --git a/beluga/Beluga_parser/Clf_disambiguation/index.html b/beluga/Beluga_parser/Clf_disambiguation/index.html deleted file mode 100644 index 769a6cf4d..000000000 --- a/beluga/Beluga_parser/Clf_disambiguation/index.html +++ /dev/null @@ -1,4 +0,0 @@ - -Clf_disambiguation (beluga.Beluga_parser.Clf_disambiguation)

Module Beluga_parser.Clf_disambiguation

module type CLF_DISAMBIGUATION = sig ... end
diff --git a/beluga/Beluga_parser/Clf_disambiguation/module-type-CLF_DISAMBIGUATION/index.html b/beluga/Beluga_parser/Clf_disambiguation/module-type-CLF_DISAMBIGUATION/index.html deleted file mode 100644 index f8ff5ba72..000000000 --- a/beluga/Beluga_parser/Clf_disambiguation/module-type-CLF_DISAMBIGUATION/index.html +++ /dev/null @@ -1,92 +0,0 @@ - -CLF_DISAMBIGUATION (beluga.Beluga_parser.Clf_disambiguation.CLF_DISAMBIGUATION)

Module type Clf_disambiguation.CLF_DISAMBIGUATION

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_clf_typ : state -> Synprs.clf_object -> Synext.clf_typ
val disambiguate_clf_term : state -> Synprs.clf_object -> Synext.clf_term
val disambiguate_clf_substitution : - state -> - Synprs.clf_context_object -> - Synext.clf_substitution
val with_disambiguated_clf_context : - state -> - Synprs.clf_context_object -> - (state -> Synext.clf_context -> 'a) -> - 'a
val disambiguate_clf_term_pattern : - state -> - Synprs.clf_object -> - Synext.clf_term_pattern
val disambiguate_clf_substitution_pattern : - state -> - Synprs.clf_context_object -> - Synext.clf_substitution_pattern
val with_disambiguated_clf_context_pattern : - state -> - Synprs.clf_context_object -> - (state -> Synext.clf_context_pattern -> 'a) -> - 'a
val disambiguate_clf_context_pattern : - state -> - Synprs.clf_context_object -> - Synext.clf_context_pattern
diff --git a/beluga/Beluga_parser/Clf_parser/Make/argument-1-Parser/index.html b/beluga/Beluga_parser/Clf_parser/Make/argument-1-Parser/index.html deleted file mode 100644 index 61914da6d..000000000 --- a/beluga/Beluga_parser/Clf_parser/Make/argument-1-Parser/index.html +++ /dev/null @@ -1,31 +0,0 @@ - -Parser (beluga.Beluga_parser.Clf_parser.Make.Parser)

Parameter Make.Parser

include Parser_combinator.PARSER - with type token = Located_token.t - with type location = Beluga_syntax.Location.t
type token = Located_token.t
type location = Beluga_syntax.Location.t
type state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

diff --git a/beluga/Beluga_parser/Clf_parser/Make/index.html b/beluga/Beluga_parser/Clf_parser/Make/index.html deleted file mode 100644 index 256b19d04..000000000 --- a/beluga/Beluga_parser/Clf_parser/Make/index.html +++ /dev/null @@ -1,38 +0,0 @@ - -Make (beluga.Beluga_parser.Clf_parser.Make)

Module Clf_parser.Make

Parameters

Signature

include Common_parser.COMMON_PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
include Parser_combinator.PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
type token = Parser.token
type location = Parser.location
type state = Parser.state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val clf_typ : Synprs.clf_object t
val clf_term : Synprs.clf_object t
val clf_term_pattern : Synprs.clf_object t
val clf_context : Synprs.clf_context_object t
val clf_substitution : Synprs.clf_context_object t
diff --git a/beluga/Beluga_parser/Clf_parser/index.html b/beluga/Beluga_parser/Clf_parser/index.html deleted file mode 100644 index 732677143..000000000 --- a/beluga/Beluga_parser/Clf_parser/index.html +++ /dev/null @@ -1,10 +0,0 @@ - -Clf_parser (beluga.Beluga_parser.Clf_parser)

Module Beluga_parser.Clf_parser

module type CLF_PARSER = sig ... end
diff --git a/beluga/Beluga_parser/Clf_parser/module-type-CLF_PARSER/index.html b/beluga/Beluga_parser/Clf_parser/module-type-CLF_PARSER/index.html deleted file mode 100644 index ab3141f37..000000000 --- a/beluga/Beluga_parser/Clf_parser/module-type-CLF_PARSER/index.html +++ /dev/null @@ -1,29 +0,0 @@ - -CLF_PARSER (beluga.Beluga_parser.Clf_parser.CLF_PARSER)

Module type Clf_parser.CLF_PARSER

include Common_parser.COMMON_PARSER
include Parser_combinator.PARSER
type token
type location
type state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val clf_typ : Synprs.clf_object t
val clf_term : Synprs.clf_object t
val clf_term_pattern : Synprs.clf_object t
val clf_context : Synprs.clf_context_object t
val clf_substitution : Synprs.clf_context_object t
diff --git a/beluga/Beluga_parser/Common_parser/Make/argument-1-Parser/index.html b/beluga/Beluga_parser/Common_parser/Make/argument-1-Parser/index.html deleted file mode 100644 index 71f5f9369..000000000 --- a/beluga/Beluga_parser/Common_parser/Make/argument-1-Parser/index.html +++ /dev/null @@ -1,24 +0,0 @@ - -Parser (beluga.Beluga_parser.Common_parser.Make.Parser)

Parameter Make.Parser

type token = Located_token.t
type location = Beluga_syntax.Location.t
type state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

diff --git a/beluga/Beluga_parser/Common_parser/Make/index.html b/beluga/Beluga_parser/Common_parser/Make/index.html deleted file mode 100644 index d9f8ee028..000000000 --- a/beluga/Beluga_parser/Common_parser/Make/index.html +++ /dev/null @@ -1,35 +0,0 @@ - -Make (beluga.Beluga_parser.Common_parser.Make)

Module Common_parser.Make

Parameters

Signature

include Parser_combinator.PARSER - with type token = Parser.token - with type location = Parser.location - with type state = Parser.state
type token = Parser.token
type location = Parser.location
type state = Parser.state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

diff --git a/beluga/Beluga_parser/Common_parser/index.html b/beluga/Beluga_parser/Common_parser/index.html deleted file mode 100644 index d2e740401..000000000 --- a/beluga/Beluga_parser/Common_parser/index.html +++ /dev/null @@ -1,10 +0,0 @@ - -Common_parser (beluga.Beluga_parser.Common_parser)

Module Beluga_parser.Common_parser

Common parser definitions for parsing Beluga signatures.

module type COMMON_PARSER = sig ... end
diff --git a/beluga/Beluga_parser/Common_parser/module-type-COMMON_PARSER/index.html b/beluga/Beluga_parser/Common_parser/module-type-COMMON_PARSER/index.html deleted file mode 100644 index fa688615e..000000000 --- a/beluga/Beluga_parser/Common_parser/module-type-COMMON_PARSER/index.html +++ /dev/null @@ -1,29 +0,0 @@ - -COMMON_PARSER (beluga.Beluga_parser.Common_parser.COMMON_PARSER)

Module type Common_parser.COMMON_PARSER

include Parser_combinator.PARSER
type token
type location
type state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

diff --git a/beluga/Beluga_parser/Comp_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html b/beluga/Beluga_parser/Comp_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html deleted file mode 100644 index 23914f643..000000000 --- a/beluga/Beluga_parser/Comp_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga_parser.Comp_disambiguation.Make.Disambiguation_state.Entry)

Module Disambiguation_state.Entry

Recorded data on bindings in Beluga signatures.

type t

The type of entry.

val is_lf_variable : t -> Stdlib.Bool.t

is_lf_variable entry is true if and only if entry describes an LF variable.

val is_meta_variable : t -> Stdlib.Bool.t

is_meta_variable entry is true if entry describes a meta-variable or a contextual variable.

Contextual variables exist only because mlam-expressions ambiguously introduce either a meta-variable, a parameter variable, a substitution variable or a context variable.

val is_parameter_variable : t -> Stdlib.Bool.t

is_parameter_variable is like is_meta_variable, but for entries describing parameter variables.

val is_substitution_variable : t -> Stdlib.Bool.t

is_substitution_variable is like is_meta_variable, but for entries describing parameter variables.

val is_context_variable : t -> Stdlib.Bool.t

is_context_variable is like is_meta_variable, but for entries describing context variables.

val is_computation_variable : t -> Stdlib.Bool.t

is_computation_variable entry is true if and only if entry describes a computation-level variable.

val is_variable : t -> Stdlib.Bool.t

is_variable entry is true if and only if entry describes an LF variable, a meta-level variable, or a computation-level variable.

This is used to discern between the following two cases when disambiguating identifiers in patterns:

  • The case where an exception should be raised because the identifier is a bound variable of the wrong sort.
  • The case where the identifier should be a free variable shadowing a constant.
val is_lf_type_constant : t -> Stdlib.Bool.t

is_lf_type_constant entry is true if and only if entry describes an LF type-level constant.

val is_lf_term_constant : t -> Stdlib.Bool.t

is_lf_term_constant is like is_lf_type_constant, but for entries describing LF term-level constants.

val is_schema_constant : t -> Stdlib.Bool.t

is_schema_constant is like is_lf_type_constant, but for entries describing context schemas.

val is_computation_inductive_type_constant : t -> Stdlib.Bool.t

is_computation_inductive_type_constant is like is_lf_type_constant, but for entries describing inductive computation-level type constants.

val is_computation_stratified_type_constant : t -> Stdlib.Bool.t

is_computation_stratified_type_constant is like is_lf_type_constant, but for entries describing stratified computation-level type constants.

val is_computation_coinductive_type_constant : t -> Stdlib.Bool.t

is_computation_coinductive_type_constant is like is_lf_type_constant, but for entries describing coinductive computation-level type constants.

val is_computation_abbreviation_type_constant : t -> Stdlib.Bool.t

is_computation_abbreviation_type_constant is like is_lf_type_constant, but for entries describing computation-level type constant abbreviations (introduced by the Beluga keyword typedef).

val is_computation_term_constructor : t -> Stdlib.Bool.t

is_computation_term_constructor is like is_lf_type_constant, but for entries describing computation-level constructors.

val is_computation_term_destructor : t -> Stdlib.Bool.t

is_computation_term_destructor is like is_lf_type_constant, but for entries describing computation-level destructors.

val is_program_constant : t -> Stdlib.Bool.t

is_program_constant is like is_lf_type_constant, but for entries describing computation-level programs (introduced by the Beluga keyword rec or val).

val is_module : t -> Stdlib.Bool.t

is_module is like is_lf_type_constant, but for entries describing modules.

diff --git a/beluga/Beluga_parser/Comp_disambiguation/Make/argument-1-Disambiguation_state/index.html b/beluga/Beluga_parser/Comp_disambiguation/Make/argument-1-Disambiguation_state/index.html deleted file mode 100644 index b3e36f72d..000000000 --- a/beluga/Beluga_parser/Comp_disambiguation/Make/argument-1-Disambiguation_state/index.html +++ /dev/null @@ -1,284 +0,0 @@ - -Disambiguation_state (beluga.Beluga_parser.Comp_disambiguation.Make.Disambiguation_state)

Parameter Make.Disambiguation_state

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
module Entry : Disambiguation_state.ENTRY

Recorded data on bindings in Beluga signatures.

Variables

val add_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_variable state ?location identifier adds identifier as a bound LF variable, with binding site location. If location = Option.None, then identifier's location is used instead.

This is mostly used for testing. For locally binding an LF variable, see with_bound_lf_variable.

val add_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_meta_variable is like add_lf_variable, but the identifier is added as a bound meta-variable.

val add_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_parameter_variable is like add_lf_variable, but the identifier is added as a bound parameter variable (those variables prefixed by '#' like "#p").

val add_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_substitution_variable is like add_lf_variable, but the identifier is added as a bound substitution variable (those variables prefixed by '$' like "$S").

val add_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_context_variable is like add_lf_variable, but the identifier is added as a bound context variable.

val add_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_contextual_variable is like add_lf_variable, but the identifier is added as a bound contextual variable, meaning that it is ambiguously bound as either a meta, parameter, substitution or context variable.

val add_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_variable is like add_lf_variable, but the identifier is added as a bound computation-level variable.

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state ?location identifier is add_lf_variable state ?location identifier, with the additional behaviour of adding identifier as an inner pattern bound identifier and as a free variable during pattern disambiguation. This means that identifier can subsequently be looked up as a bound LF variable during pattern disambiguation. This effectively allows free LF variables to appear multiple times (non-linearly) in patterns.

See with_free_variables_as_pattern_variables for the handler for converting free variables in patterns to binders for use as bound variables in expressions.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free meta-variable.

val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free parameter variable.

val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free substitution variable.

val add_free_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free context variable.

val add_free_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_computation_variable state ?location identifier adds identifier to state as a free variable during pattern disambiguation. This differs from add_free_lf_variable in that free computation-level variables in patterns do not have implicit binders (because they are not part of the meta-context), and hence must appear only once (linearly) in the overall pattern.

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state ?location identifier m is the result of running m in the local state derived from state having identifier as a bound LF variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

For example, the disambiguation of an LF term-level lambda-abstraction \x. m requires that the parameter x is locally added in scope when disambiguating the body m. This is achieved like this:

with_bound_lf_variable state x (fun state ->
-    disambiguate_lf_term state m)
val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_meta_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound meta-variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound contextual variable. This is different from with_bound_meta_variable, with_bound_parameter_variable, with_bound_substitution_variable and with_bound_context_variable in that it is unknown whether identifier should be a meta-variable, parameter variable, substitution variable or context variable. This is used in particular for mlam expressions.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_computation_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound computation-level variable.

val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_meta_variable state ?location identifier m is like with_bound_meta_variable state ?location identifier m except that identifier is also treated as a free variable so that in with_free_variables_as_pattern_variables it can be treated as a pattern variable usable in the expression.

This is used for meta-variables introduced in the meta-context of a pattern during case analysis. Those variables are considered bound in both the pattern and expression.

For example, B as below is one such bound pattern meta-variable, and appears in scope for ?.

case x of
-| { B : [g |- o] } [g |- impi \u. D] => ?
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_parameter_variable is like with_bound_pattern_meta_variable, but for a parameter variable introduced in the meta-context of a pattern.

val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_substitution_variable is like with_bound_pattern_meta_variable, but for a substitution variable introduced in the meta-context of a pattern.

val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_context_variable is like with_bound_pattern_meta_variable, but for a context variable introduced in the meta-context of a pattern.

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression state is the result of running expression with the free variables added in pattern as bound variables. This is used to disambiguate expression with bound variables arising from free variables in pattern.

  1. pattern is run with respect to state while keeping track of free variables. Variables bound outside the pattern are ignored in lookups.
  2. expression is run with respect to state with the addition of the tracked free variables from patterns as bound variables.

Lookups performed in pattern are more complex. The variables in state count as being unbound, but the variables with binders in the pattern count as bound. Binders in a pattern can be user-specified, or to be reconstructed during abstraction.

A variable is specifically inner bound if it is introduced explicitly by a lambda abstraction or the pattern meta-context, as an explicit or implicit parameter. Free meta-level variables are reconstructed inner bound. For instance, assuming s and ctx are constants:

  • In the pattern (x, x), both occurrences of x are pattern variables, and that pattern is not linear.
  • In the pattern {M : [ |- nat]} [ |- s M], M as introduced in the meta-context is a pattern variable, and M is an inner pattern-bound identifier in s M, so that pattern is linear.
  • In the pattern [ |- \x. s x], there are no pattern variables.
  • In the pattern ([g |- s M], [g |- s M]), g and M are pattern variables in the left projection of the tuple pattern, and inner pattern-bound in the right projection of the tuple pattern. This is because the pattern is reconstructed as {g : ctx} {M : [g |- nat]} ([g |- s M], [g |- s M]).
val with_scope : state -> (state -> 'a) -> 'a

with_scope state m runs m in a nested bindings scope that is discarded afterwards.

val with_parent_scope : state -> (state -> 'a) -> 'a

with_parent_scope state m runs m while ignoring the topmost scope.

This is used for the disambiguation of Harpoon proof scripts because Harpoon hypotheticals are already serialized with all the identifiers in the meta-level and computation-level contexts of the proof.

val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used for backtracking when disambiguating old-style LF type-level and term-level declarations (i.e., x : X where X may be an LF kind or an LF type).

This is also used in REPLs to safely run parsing functions and recover the state in case of a raised exception during disambiguation.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Constants

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_type_constant state ?location ?arity identifier adds identifier as a bound LF type-level constant.

In the disambiguation of a module's declaration, this also adds the constant as one of the module's declarations.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_term_constant is like add_lf_type_constant, but for LF term-level constants.

val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_schema_constant is like add_lf_type_constant, but for schema constants.

val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_inductive_computation_type_constant is like add_lf_type_constant, but for inductive computation-level type constants.

val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_stratified_computation_type_constant is like add_lf_type_constant, but for stratified computation-level type constants.

val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_coinductive_computation_type_constant is like add_lf_type_constant, but for coinductive computation-level type constants.

val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation_computation_type_constant is like add_lf_type_constant, but for computation-level abbreviation type constants.

val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_constructor is like add_lf_type_constant, but for computation-level term constructors.

val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_destructor is like add_lf_type_constant, but for computation-level term destructors.

val add_program_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_program_constant is like add_lf_type_constant, but for computation-level program constants.

val add_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

add_module state ?location identifier m is the result of running m in a module disambiguation state, whereby added constants are kept track of as declarations in the module having identifier.

Lookups

exception Unbound_identifier of Beluga_syntax.Syncom.Identifier.t

Unbound_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is caught whenever a variable lookup fails and identifier can be disambiguated as a free variable.

exception Unbound_qualified_identifier of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_qualified_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is unrecoverable, but is caught during disambiguation to provide better error messages.

exception Unbound_namespace of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_namespace namespace_identifier is raised if a qualified identifier could not be looked up in a disambiguation state because the namespace with identifier namespace_identifier is unbound.

val lookup_toplevel : state -> Beluga_syntax.Syncom.Identifier.t -> Entry.t

lookup_toplevel state identifier is entry if identifier resolves to entry in state. If identifier is unbound in state, then Unbound_identifier identifier is raised.

lookup state identifier is entry if identifier resolves to entry in state. Otherwise:

  • Unbound_identifier ident) is raised if the first segment ident in identifier is unbound.
  • Unbound_namespace namespace_identifier is raised if a segment in identifier other than the first or last is unbound.
  • Unbound_qualified_identifier identifier is raised if the last segment in identifier is unbound.
type maximum_lookup_result =
  1. | Unbound of {
    1. segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  2. | Partially_bound of {
    1. leading_segments : Beluga_syntax.Syncom.Identifier.t Support.List.t;
    2. segment : Beluga_syntax.Syncom.Identifier.t;
    3. entry : Entry.t;
    4. trailing_segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  3. | Bound of {
    1. entry : Entry.t;
    }

maximum_lookup state segments is either:

  • Unbound { segments } if the first segment in segments is unbound in state.
  • Partially_bound { leading_segments; segment; entry; trailing_segments } if the qualified identifier with namespaces leading_segments and name segment is bound to entry in state.
  • Bound { identifier; entry } if segments form a qualified identifier bound to entry in state.
val actual_binding_exn : - Beluga_syntax.Syncom.Qualified_identifier.t -> - Entry.t -> - exn

actual_binding_exn identifier entry is an exception reporting what sort of entry is bound at identifier. The exception is annotated with the entry's binding location.

Signature Operations

val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state module_identifier adds the exported constants from the module bound to module_identifier as toplevel entries in state. If module_identifier is unbound in state, then an exception is raised.

val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t

get_default_associativity state is the associativity to use for infix operators defined by the user using a pragma, without specifying the infix operator's associativity.

val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state default_associativity sets default_associativity as the associativity to return from get_default_associativity.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the precedence to use for operators defined by the user using a pragma, without specifying the operator's precedence.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state default_precedence sets default_precedence as the precedence to return from get_default_precedence.

val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence identifier adds a prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity identifier adds an infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence identifier adds a postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state identifier is Option.Some operator if identifier is bound to an operator with descriptor operator in state, and Option.None otherwise.

This is used to resolve operators in the disambiguation of applications, which are parsed as lists of expressions.

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_module_abbreviation state ?location module_identifier abbreviation adds the synonym abbreviation for the module bound to identifier in state.

An exception is raised if module_identifier is unbound in state, or if module_identifier is not bound to a module in state.

diff --git a/beluga/Beluga_parser/Comp_disambiguation/Make/argument-2-Meta_disambiguator/index.html b/beluga/Beluga_parser/Comp_disambiguation/Make/argument-2-Meta_disambiguator/index.html deleted file mode 100644 index 89a3555fd..000000000 --- a/beluga/Beluga_parser/Comp_disambiguation/Make/argument-2-Meta_disambiguator/index.html +++ /dev/null @@ -1,84 +0,0 @@ - -Meta_disambiguator (beluga.Beluga_parser.Comp_disambiguation.Make.Meta_disambiguator)

Parameter Make.Meta_disambiguator

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Disambiguation_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_meta_typ : state -> Synprs.meta_thing -> Synext.meta_typ
val disambiguate_meta_object : state -> Synprs.meta_thing -> Synext.meta_object
val disambiguate_meta_pattern : - state -> - Synprs.meta_thing -> - Beluga_syntax.Synext.Meta.Pattern.t
val disambiguate_schema : state -> Synprs.schema_object -> Synext.schema
val with_disambiguated_meta_context : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
val with_disambiguated_meta_context_pattern : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
diff --git a/beluga/Beluga_parser/Comp_disambiguation/Make/index.html b/beluga/Beluga_parser/Comp_disambiguation/Make/index.html deleted file mode 100644 index 842b897ce..000000000 --- a/beluga/Beluga_parser/Comp_disambiguation/Make/index.html +++ /dev/null @@ -1,91 +0,0 @@ - -Make (beluga.Beluga_parser.Comp_disambiguation.Make)

Module Comp_disambiguation.Make

Parameters

Signature

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Disambiguation_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_comp_kind : - state -> - Synprs.comp_sort_object -> - Synext.comp_kind
val disambiguate_comp_typ : state -> Synprs.comp_sort_object -> Synext.comp_typ
val disambiguate_comp_expression : - state -> - Synprs.comp_expression_object -> - Synext.comp_expression
val disambiguate_comp_pattern : - state -> - Synprs.comp_pattern_object -> - Synext.comp_pattern
val disambiguate_comp_copattern : - state -> - Synprs.comp_copattern_object Support.List1.t -> - Synext.comp_copattern
val with_disambiguated_comp_context : - state -> - Synprs.comp_context_object -> - (state -> Synext.comp_context -> 'a) -> - 'a
diff --git a/beluga/Beluga_parser/Comp_disambiguation/index.html b/beluga/Beluga_parser/Comp_disambiguation/index.html deleted file mode 100644 index 6d6c86d1c..000000000 --- a/beluga/Beluga_parser/Comp_disambiguation/index.html +++ /dev/null @@ -1,7 +0,0 @@ - -Comp_disambiguation (beluga.Beluga_parser.Comp_disambiguation)

Module Beluga_parser.Comp_disambiguation

module type COMP_DISAMBIGUATION = sig ... end
diff --git a/beluga/Beluga_parser/Comp_disambiguation/module-type-COMP_DISAMBIGUATION/index.html b/beluga/Beluga_parser/Comp_disambiguation/module-type-COMP_DISAMBIGUATION/index.html deleted file mode 100644 index 96e69383e..000000000 --- a/beluga/Beluga_parser/Comp_disambiguation/module-type-COMP_DISAMBIGUATION/index.html +++ /dev/null @@ -1,88 +0,0 @@ - -COMP_DISAMBIGUATION (beluga.Beluga_parser.Comp_disambiguation.COMP_DISAMBIGUATION)

Module type Comp_disambiguation.COMP_DISAMBIGUATION

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_comp_kind : - state -> - Synprs.comp_sort_object -> - Synext.comp_kind
val disambiguate_comp_typ : state -> Synprs.comp_sort_object -> Synext.comp_typ
val disambiguate_comp_expression : - state -> - Synprs.comp_expression_object -> - Synext.comp_expression
val disambiguate_comp_pattern : - state -> - Synprs.comp_pattern_object -> - Synext.comp_pattern
val disambiguate_comp_copattern : - state -> - Synprs.comp_copattern_object Support.List1.t -> - Synext.comp_copattern
val with_disambiguated_comp_context : - state -> - Synprs.comp_context_object -> - (state -> Synext.comp_context -> 'a) -> - 'a
diff --git a/beluga/Beluga_parser/Comp_parser/Make/argument-1-Parser/index.html b/beluga/Beluga_parser/Comp_parser/Make/argument-1-Parser/index.html deleted file mode 100644 index 6ba6c25a8..000000000 --- a/beluga/Beluga_parser/Comp_parser/Make/argument-1-Parser/index.html +++ /dev/null @@ -1,31 +0,0 @@ - -Parser (beluga.Beluga_parser.Comp_parser.Make.Parser)

Parameter Make.Parser

include Parser_combinator.PARSER - with type token = Located_token.t - with type location = Beluga_syntax.Location.t
type token = Located_token.t
type location = Beluga_syntax.Location.t
type state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

diff --git a/beluga/Beluga_parser/Comp_parser/Make/argument-2-Meta_parser/index.html b/beluga/Beluga_parser/Comp_parser/Make/argument-2-Meta_parser/index.html deleted file mode 100644 index 5fb36bdfb..000000000 --- a/beluga/Beluga_parser/Comp_parser/Make/argument-2-Meta_parser/index.html +++ /dev/null @@ -1,35 +0,0 @@ - -Meta_parser (beluga.Beluga_parser.Comp_parser.Make.Meta_parser)

Parameter Make.Meta_parser

include Common_parser.COMMON_PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
include Parser_combinator.PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
type token = Parser.token
type location = Parser.location
type state = Parser.state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val schema : Synprs.schema_object t
val meta_type : Synprs.meta_thing t
val meta_object : Synprs.meta_thing t
val meta_pattern : Synprs.meta_thing t
val meta_context : Synprs.meta_context_object t
diff --git a/beluga/Beluga_parser/Comp_parser/Make/index.html b/beluga/Beluga_parser/Comp_parser/Make/index.html deleted file mode 100644 index 55cbfb7a5..000000000 --- a/beluga/Beluga_parser/Comp_parser/Make/index.html +++ /dev/null @@ -1,42 +0,0 @@ - -Make (beluga.Beluga_parser.Comp_parser.Make)

Module Comp_parser.Make

Parameters

Signature

include Common_parser.COMMON_PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
include Parser_combinator.PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
type token = Parser.token
type location = Parser.location
type state = Parser.state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val comp_kind : Synprs.comp_sort_object t
val comp_typ : Synprs.comp_sort_object t
val comp_pattern : Synprs.comp_pattern_object t
val comp_copattern : Synprs.comp_copattern_object t
val comp_expression : Synprs.comp_expression_object t
val comp_context : Synprs.comp_context_object t
diff --git a/beluga/Beluga_parser/Comp_parser/index.html b/beluga/Beluga_parser/Comp_parser/index.html deleted file mode 100644 index 8d3005ac0..000000000 --- a/beluga/Beluga_parser/Comp_parser/index.html +++ /dev/null @@ -1,15 +0,0 @@ - -Comp_parser (beluga.Beluga_parser.Comp_parser)

Module Beluga_parser.Comp_parser

module type COMP_PARSER = sig ... end
diff --git a/beluga/Beluga_parser/Comp_parser/module-type-COMP_PARSER/index.html b/beluga/Beluga_parser/Comp_parser/module-type-COMP_PARSER/index.html deleted file mode 100644 index 3ef3ff822..000000000 --- a/beluga/Beluga_parser/Comp_parser/module-type-COMP_PARSER/index.html +++ /dev/null @@ -1,29 +0,0 @@ - -COMP_PARSER (beluga.Beluga_parser.Comp_parser.COMP_PARSER)

Module type Comp_parser.COMP_PARSER

include Common_parser.COMMON_PARSER
include Parser_combinator.PARSER
type token
type location
type state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val comp_kind : Synprs.comp_sort_object t
val comp_typ : Synprs.comp_sort_object t
val comp_pattern : Synprs.comp_pattern_object t
val comp_copattern : Synprs.comp_copattern_object t
val comp_expression : Synprs.comp_expression_object t
val comp_context : Synprs.comp_context_object t
diff --git a/beluga/Beluga_parser/Config_parser/index.html b/beluga/Beluga_parser/Config_parser/index.html deleted file mode 100644 index 43f1c5682..000000000 --- a/beluga/Beluga_parser/Config_parser/index.html +++ /dev/null @@ -1,14 +0,0 @@ - -Config_parser (beluga.Beluga_parser.Config_parser)

Module Beluga_parser.Config_parser

Reader for configuration files for Beluga signatures.

A configuration file is a list of Beluga source file names (with file extension .bel) or configuration file names (with file extension .cfg). Configuration files are read recursively.

For instance, the following is a valid configuration file:

      % Definitions
-      syntax.bel
-      join.bel
-
-      % Theorems
-      context_functions.bel
-      lemma1.bel
-      substitution.bel
-      judgments.bel
-      substitution_functions.bel
-      subst_split.bel
val read_configuration : - filename:string -> - (Beluga_syntax.Location.t * string) list

read_configuration ~filename is the list of Beluga file paths to load as configured in filename. If filename is not a configuration file, then filename is the only Beluga file path returned.

A configuration file is a UTF-8 encoded list of file paths. The configuration file may have line comments starting with %. Whitespaces in paths are supported.

diff --git a/beluga/Beluga_parser/Disambiguation_state/Disambiguation_state/Entry/index.html b/beluga/Beluga_parser/Disambiguation_state/Disambiguation_state/Entry/index.html deleted file mode 100644 index 68a49edea..000000000 --- a/beluga/Beluga_parser/Disambiguation_state/Disambiguation_state/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga_parser.Disambiguation_state.Disambiguation_state.Entry)

Module Disambiguation_state.Entry

Recorded data on bindings in Beluga signatures.

type t

The type of entry.

val is_lf_variable : t -> Stdlib.Bool.t

is_lf_variable entry is true if and only if entry describes an LF variable.

val is_meta_variable : t -> Stdlib.Bool.t

is_meta_variable entry is true if entry describes a meta-variable or a contextual variable.

Contextual variables exist only because mlam-expressions ambiguously introduce either a meta-variable, a parameter variable, a substitution variable or a context variable.

val is_parameter_variable : t -> Stdlib.Bool.t

is_parameter_variable is like is_meta_variable, but for entries describing parameter variables.

val is_substitution_variable : t -> Stdlib.Bool.t

is_substitution_variable is like is_meta_variable, but for entries describing parameter variables.

val is_context_variable : t -> Stdlib.Bool.t

is_context_variable is like is_meta_variable, but for entries describing context variables.

val is_computation_variable : t -> Stdlib.Bool.t

is_computation_variable entry is true if and only if entry describes a computation-level variable.

val is_variable : t -> Stdlib.Bool.t

is_variable entry is true if and only if entry describes an LF variable, a meta-level variable, or a computation-level variable.

This is used to discern between the following two cases when disambiguating identifiers in patterns:

  • The case where an exception should be raised because the identifier is a bound variable of the wrong sort.
  • The case where the identifier should be a free variable shadowing a constant.
val is_lf_type_constant : t -> Stdlib.Bool.t

is_lf_type_constant entry is true if and only if entry describes an LF type-level constant.

val is_lf_term_constant : t -> Stdlib.Bool.t

is_lf_term_constant is like is_lf_type_constant, but for entries describing LF term-level constants.

val is_schema_constant : t -> Stdlib.Bool.t

is_schema_constant is like is_lf_type_constant, but for entries describing context schemas.

val is_computation_inductive_type_constant : t -> Stdlib.Bool.t

is_computation_inductive_type_constant is like is_lf_type_constant, but for entries describing inductive computation-level type constants.

val is_computation_stratified_type_constant : t -> Stdlib.Bool.t

is_computation_stratified_type_constant is like is_lf_type_constant, but for entries describing stratified computation-level type constants.

val is_computation_coinductive_type_constant : t -> Stdlib.Bool.t

is_computation_coinductive_type_constant is like is_lf_type_constant, but for entries describing coinductive computation-level type constants.

val is_computation_abbreviation_type_constant : t -> Stdlib.Bool.t

is_computation_abbreviation_type_constant is like is_lf_type_constant, but for entries describing computation-level type constant abbreviations (introduced by the Beluga keyword typedef).

val is_computation_term_constructor : t -> Stdlib.Bool.t

is_computation_term_constructor is like is_lf_type_constant, but for entries describing computation-level constructors.

val is_computation_term_destructor : t -> Stdlib.Bool.t

is_computation_term_destructor is like is_lf_type_constant, but for entries describing computation-level destructors.

val is_program_constant : t -> Stdlib.Bool.t

is_program_constant is like is_lf_type_constant, but for entries describing computation-level programs (introduced by the Beluga keyword rec or val).

val is_module : t -> Stdlib.Bool.t

is_module is like is_lf_type_constant, but for entries describing modules.

diff --git a/beluga/Beluga_parser/Disambiguation_state/Disambiguation_state/index.html b/beluga/Beluga_parser/Disambiguation_state/Disambiguation_state/index.html deleted file mode 100644 index 1b7d5eaae..000000000 --- a/beluga/Beluga_parser/Disambiguation_state/Disambiguation_state/index.html +++ /dev/null @@ -1,284 +0,0 @@ - -Disambiguation_state (beluga.Beluga_parser.Disambiguation_state.Disambiguation_state)

Module Disambiguation_state.Disambiguation_state

Concrete implementation of DISAMBIGUATION_STATE backed by a mutable data structure.

include DISAMBIGUATION_STATE
include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
module Entry : ENTRY

Recorded data on bindings in Beluga signatures.

Variables

val add_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_variable state ?location identifier adds identifier as a bound LF variable, with binding site location. If location = Option.None, then identifier's location is used instead.

This is mostly used for testing. For locally binding an LF variable, see with_bound_lf_variable.

val add_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_meta_variable is like add_lf_variable, but the identifier is added as a bound meta-variable.

val add_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_parameter_variable is like add_lf_variable, but the identifier is added as a bound parameter variable (those variables prefixed by '#' like "#p").

val add_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_substitution_variable is like add_lf_variable, but the identifier is added as a bound substitution variable (those variables prefixed by '$' like "$S").

val add_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_context_variable is like add_lf_variable, but the identifier is added as a bound context variable.

val add_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_contextual_variable is like add_lf_variable, but the identifier is added as a bound contextual variable, meaning that it is ambiguously bound as either a meta, parameter, substitution or context variable.

val add_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_variable is like add_lf_variable, but the identifier is added as a bound computation-level variable.

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state ?location identifier is add_lf_variable state ?location identifier, with the additional behaviour of adding identifier as an inner pattern bound identifier and as a free variable during pattern disambiguation. This means that identifier can subsequently be looked up as a bound LF variable during pattern disambiguation. This effectively allows free LF variables to appear multiple times (non-linearly) in patterns.

See with_free_variables_as_pattern_variables for the handler for converting free variables in patterns to binders for use as bound variables in expressions.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free meta-variable.

val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free parameter variable.

val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free substitution variable.

val add_free_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free context variable.

val add_free_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_computation_variable state ?location identifier adds identifier to state as a free variable during pattern disambiguation. This differs from add_free_lf_variable in that free computation-level variables in patterns do not have implicit binders (because they are not part of the meta-context), and hence must appear only once (linearly) in the overall pattern.

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state ?location identifier m is the result of running m in the local state derived from state having identifier as a bound LF variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

For example, the disambiguation of an LF term-level lambda-abstraction \x. m requires that the parameter x is locally added in scope when disambiguating the body m. This is achieved like this:

with_bound_lf_variable state x (fun state ->
-    disambiguate_lf_term state m)
val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_meta_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound meta-variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound contextual variable. This is different from with_bound_meta_variable, with_bound_parameter_variable, with_bound_substitution_variable and with_bound_context_variable in that it is unknown whether identifier should be a meta-variable, parameter variable, substitution variable or context variable. This is used in particular for mlam expressions.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_computation_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound computation-level variable.

val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_meta_variable state ?location identifier m is like with_bound_meta_variable state ?location identifier m except that identifier is also treated as a free variable so that in with_free_variables_as_pattern_variables it can be treated as a pattern variable usable in the expression.

This is used for meta-variables introduced in the meta-context of a pattern during case analysis. Those variables are considered bound in both the pattern and expression.

For example, B as below is one such bound pattern meta-variable, and appears in scope for ?.

case x of
-| { B : [g |- o] } [g |- impi \u. D] => ?
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_parameter_variable is like with_bound_pattern_meta_variable, but for a parameter variable introduced in the meta-context of a pattern.

val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_substitution_variable is like with_bound_pattern_meta_variable, but for a substitution variable introduced in the meta-context of a pattern.

val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_context_variable is like with_bound_pattern_meta_variable, but for a context variable introduced in the meta-context of a pattern.

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression state is the result of running expression with the free variables added in pattern as bound variables. This is used to disambiguate expression with bound variables arising from free variables in pattern.

  1. pattern is run with respect to state while keeping track of free variables. Variables bound outside the pattern are ignored in lookups.
  2. expression is run with respect to state with the addition of the tracked free variables from patterns as bound variables.

Lookups performed in pattern are more complex. The variables in state count as being unbound, but the variables with binders in the pattern count as bound. Binders in a pattern can be user-specified, or to be reconstructed during abstraction.

A variable is specifically inner bound if it is introduced explicitly by a lambda abstraction or the pattern meta-context, as an explicit or implicit parameter. Free meta-level variables are reconstructed inner bound. For instance, assuming s and ctx are constants:

  • In the pattern (x, x), both occurrences of x are pattern variables, and that pattern is not linear.
  • In the pattern {M : [ |- nat]} [ |- s M], M as introduced in the meta-context is a pattern variable, and M is an inner pattern-bound identifier in s M, so that pattern is linear.
  • In the pattern [ |- \x. s x], there are no pattern variables.
  • In the pattern ([g |- s M], [g |- s M]), g and M are pattern variables in the left projection of the tuple pattern, and inner pattern-bound in the right projection of the tuple pattern. This is because the pattern is reconstructed as {g : ctx} {M : [g |- nat]} ([g |- s M], [g |- s M]).
val with_scope : state -> (state -> 'a) -> 'a

with_scope state m runs m in a nested bindings scope that is discarded afterwards.

val with_parent_scope : state -> (state -> 'a) -> 'a

with_parent_scope state m runs m while ignoring the topmost scope.

This is used for the disambiguation of Harpoon proof scripts because Harpoon hypotheticals are already serialized with all the identifiers in the meta-level and computation-level contexts of the proof.

val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used for backtracking when disambiguating old-style LF type-level and term-level declarations (i.e., x : X where X may be an LF kind or an LF type).

This is also used in REPLs to safely run parsing functions and recover the state in case of a raised exception during disambiguation.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Constants

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_type_constant state ?location ?arity identifier adds identifier as a bound LF type-level constant.

In the disambiguation of a module's declaration, this also adds the constant as one of the module's declarations.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_term_constant is like add_lf_type_constant, but for LF term-level constants.

val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_schema_constant is like add_lf_type_constant, but for schema constants.

val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_inductive_computation_type_constant is like add_lf_type_constant, but for inductive computation-level type constants.

val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_stratified_computation_type_constant is like add_lf_type_constant, but for stratified computation-level type constants.

val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_coinductive_computation_type_constant is like add_lf_type_constant, but for coinductive computation-level type constants.

val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation_computation_type_constant is like add_lf_type_constant, but for computation-level abbreviation type constants.

val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_constructor is like add_lf_type_constant, but for computation-level term constructors.

val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_destructor is like add_lf_type_constant, but for computation-level term destructors.

val add_program_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_program_constant is like add_lf_type_constant, but for computation-level program constants.

val add_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

add_module state ?location identifier m is the result of running m in a module disambiguation state, whereby added constants are kept track of as declarations in the module having identifier.

Lookups

exception Unbound_identifier of Beluga_syntax.Syncom.Identifier.t

Unbound_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is caught whenever a variable lookup fails and identifier can be disambiguated as a free variable.

exception Unbound_qualified_identifier of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_qualified_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is unrecoverable, but is caught during disambiguation to provide better error messages.

exception Unbound_namespace of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_namespace namespace_identifier is raised if a qualified identifier could not be looked up in a disambiguation state because the namespace with identifier namespace_identifier is unbound.

val lookup_toplevel : state -> Beluga_syntax.Syncom.Identifier.t -> Entry.t

lookup_toplevel state identifier is entry if identifier resolves to entry in state. If identifier is unbound in state, then Unbound_identifier identifier is raised.

lookup state identifier is entry if identifier resolves to entry in state. Otherwise:

  • Unbound_identifier ident) is raised if the first segment ident in identifier is unbound.
  • Unbound_namespace namespace_identifier is raised if a segment in identifier other than the first or last is unbound.
  • Unbound_qualified_identifier identifier is raised if the last segment in identifier is unbound.
type maximum_lookup_result =
  1. | Unbound of {
    1. segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  2. | Partially_bound of {
    1. leading_segments : Beluga_syntax.Syncom.Identifier.t Support.List.t;
    2. segment : Beluga_syntax.Syncom.Identifier.t;
    3. entry : Entry.t;
    4. trailing_segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  3. | Bound of {
    1. entry : Entry.t;
    }

maximum_lookup state segments is either:

  • Unbound { segments } if the first segment in segments is unbound in state.
  • Partially_bound { leading_segments; segment; entry; trailing_segments } if the qualified identifier with namespaces leading_segments and name segment is bound to entry in state.
  • Bound { identifier; entry } if segments form a qualified identifier bound to entry in state.
val actual_binding_exn : - Beluga_syntax.Syncom.Qualified_identifier.t -> - Entry.t -> - exn

actual_binding_exn identifier entry is an exception reporting what sort of entry is bound at identifier. The exception is annotated with the entry's binding location.

Signature Operations

val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state module_identifier adds the exported constants from the module bound to module_identifier as toplevel entries in state. If module_identifier is unbound in state, then an exception is raised.

val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t

get_default_associativity state is the associativity to use for infix operators defined by the user using a pragma, without specifying the infix operator's associativity.

val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state default_associativity sets default_associativity as the associativity to return from get_default_associativity.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the precedence to use for operators defined by the user using a pragma, without specifying the operator's precedence.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state default_precedence sets default_precedence as the precedence to return from get_default_precedence.

val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence identifier adds a prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity identifier adds an infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence identifier adds a postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state identifier is Option.Some operator if identifier is bound to an operator with descriptor operator in state, and Option.None otherwise.

This is used to resolve operators in the disambiguation of applications, which are parsed as lists of expressions.

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_module_abbreviation state ?location module_identifier abbreviation adds the synonym abbreviation for the module bound to identifier in state.

An exception is raised if module_identifier is unbound in state, or if module_identifier is not bound to a module in state.

val create_initial_state : Stdlib.Unit.t -> state

create_initial_state () is a fresh empty disambiguation state.

val clear_state : state -> Stdlib.Unit.t

clear_state state resets state to its initial state.

val snapshot_state : state -> state

snapshot_state state is a surface copy of state, meaning that it is effectively a frozen copy of state. Only the latest bindings in state are kept.

diff --git a/beluga/Beluga_parser/Disambiguation_state/index.html b/beluga/Beluga_parser/Disambiguation_state/index.html deleted file mode 100644 index 00b9fbe1e..000000000 --- a/beluga/Beluga_parser/Disambiguation_state/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Disambiguation_state (beluga.Beluga_parser.Disambiguation_state)

Module Beluga_parser.Disambiguation_state

Definition and implementation of the state required to disambiguate the Beluga syntax from the parser AST to the external AST.

module type ENTRY = sig ... end

Abstract definition of entries bound to identifiers.

module type DISAMBIGUATION_STATE = sig ... end

Abstract definition of a disambiguation state.

module Disambiguation_state : sig ... end

Concrete implementation of DISAMBIGUATION_STATE backed by a mutable data structure.

diff --git a/beluga/Beluga_parser/Disambiguation_state/module-type-DISAMBIGUATION_STATE/Entry/index.html b/beluga/Beluga_parser/Disambiguation_state/module-type-DISAMBIGUATION_STATE/Entry/index.html deleted file mode 100644 index b145d6595..000000000 --- a/beluga/Beluga_parser/Disambiguation_state/module-type-DISAMBIGUATION_STATE/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga_parser.Disambiguation_state.DISAMBIGUATION_STATE.Entry)

Module DISAMBIGUATION_STATE.Entry

Recorded data on bindings in Beluga signatures.

type t

The type of entry.

val is_lf_variable : t -> Stdlib.Bool.t

is_lf_variable entry is true if and only if entry describes an LF variable.

val is_meta_variable : t -> Stdlib.Bool.t

is_meta_variable entry is true if entry describes a meta-variable or a contextual variable.

Contextual variables exist only because mlam-expressions ambiguously introduce either a meta-variable, a parameter variable, a substitution variable or a context variable.

val is_parameter_variable : t -> Stdlib.Bool.t

is_parameter_variable is like is_meta_variable, but for entries describing parameter variables.

val is_substitution_variable : t -> Stdlib.Bool.t

is_substitution_variable is like is_meta_variable, but for entries describing parameter variables.

val is_context_variable : t -> Stdlib.Bool.t

is_context_variable is like is_meta_variable, but for entries describing context variables.

val is_computation_variable : t -> Stdlib.Bool.t

is_computation_variable entry is true if and only if entry describes a computation-level variable.

val is_variable : t -> Stdlib.Bool.t

is_variable entry is true if and only if entry describes an LF variable, a meta-level variable, or a computation-level variable.

This is used to discern between the following two cases when disambiguating identifiers in patterns:

  • The case where an exception should be raised because the identifier is a bound variable of the wrong sort.
  • The case where the identifier should be a free variable shadowing a constant.
val is_lf_type_constant : t -> Stdlib.Bool.t

is_lf_type_constant entry is true if and only if entry describes an LF type-level constant.

val is_lf_term_constant : t -> Stdlib.Bool.t

is_lf_term_constant is like is_lf_type_constant, but for entries describing LF term-level constants.

val is_schema_constant : t -> Stdlib.Bool.t

is_schema_constant is like is_lf_type_constant, but for entries describing context schemas.

val is_computation_inductive_type_constant : t -> Stdlib.Bool.t

is_computation_inductive_type_constant is like is_lf_type_constant, but for entries describing inductive computation-level type constants.

val is_computation_stratified_type_constant : t -> Stdlib.Bool.t

is_computation_stratified_type_constant is like is_lf_type_constant, but for entries describing stratified computation-level type constants.

val is_computation_coinductive_type_constant : t -> Stdlib.Bool.t

is_computation_coinductive_type_constant is like is_lf_type_constant, but for entries describing coinductive computation-level type constants.

val is_computation_abbreviation_type_constant : t -> Stdlib.Bool.t

is_computation_abbreviation_type_constant is like is_lf_type_constant, but for entries describing computation-level type constant abbreviations (introduced by the Beluga keyword typedef).

val is_computation_term_constructor : t -> Stdlib.Bool.t

is_computation_term_constructor is like is_lf_type_constant, but for entries describing computation-level constructors.

val is_computation_term_destructor : t -> Stdlib.Bool.t

is_computation_term_destructor is like is_lf_type_constant, but for entries describing computation-level destructors.

val is_program_constant : t -> Stdlib.Bool.t

is_program_constant is like is_lf_type_constant, but for entries describing computation-level programs (introduced by the Beluga keyword rec or val).

val is_module : t -> Stdlib.Bool.t

is_module is like is_lf_type_constant, but for entries describing modules.

diff --git a/beluga/Beluga_parser/Disambiguation_state/module-type-DISAMBIGUATION_STATE/index.html b/beluga/Beluga_parser/Disambiguation_state/module-type-DISAMBIGUATION_STATE/index.html deleted file mode 100644 index 3ed1019b1..000000000 --- a/beluga/Beluga_parser/Disambiguation_state/module-type-DISAMBIGUATION_STATE/index.html +++ /dev/null @@ -1,284 +0,0 @@ - -DISAMBIGUATION_STATE (beluga.Beluga_parser.Disambiguation_state.DISAMBIGUATION_STATE)

Module type Disambiguation_state.DISAMBIGUATION_STATE

Abstract definition of a disambiguation state.

A disambiguation state is the auxiliary data structure used during the disambiguation phase found in modules Lf_disambiguation, Clf_disambiguation, Meta_disambiguation, Comp_disambiguation, Harpoon_disambiguation and Signature_disambiguation. This data structure is responsible for keeping track of the referencing environment (bindings in scope) during the traversal of the parser syntax. In particular, it keeps track of user-defined notations (i.e., prefix, infix and postfix notations introduced by pragmas) for disambiguating applications.

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
module Entry : ENTRY

Recorded data on bindings in Beluga signatures.

Variables

val add_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_variable state ?location identifier adds identifier as a bound LF variable, with binding site location. If location = Option.None, then identifier's location is used instead.

This is mostly used for testing. For locally binding an LF variable, see with_bound_lf_variable.

val add_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_meta_variable is like add_lf_variable, but the identifier is added as a bound meta-variable.

val add_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_parameter_variable is like add_lf_variable, but the identifier is added as a bound parameter variable (those variables prefixed by '#' like "#p").

val add_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_substitution_variable is like add_lf_variable, but the identifier is added as a bound substitution variable (those variables prefixed by '$' like "$S").

val add_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_context_variable is like add_lf_variable, but the identifier is added as a bound context variable.

val add_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_contextual_variable is like add_lf_variable, but the identifier is added as a bound contextual variable, meaning that it is ambiguously bound as either a meta, parameter, substitution or context variable.

val add_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_variable is like add_lf_variable, but the identifier is added as a bound computation-level variable.

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state ?location identifier is add_lf_variable state ?location identifier, with the additional behaviour of adding identifier as an inner pattern bound identifier and as a free variable during pattern disambiguation. This means that identifier can subsequently be looked up as a bound LF variable during pattern disambiguation. This effectively allows free LF variables to appear multiple times (non-linearly) in patterns.

See with_free_variables_as_pattern_variables for the handler for converting free variables in patterns to binders for use as bound variables in expressions.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free meta-variable.

val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free parameter variable.

val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free substitution variable.

val add_free_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free context variable.

val add_free_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_computation_variable state ?location identifier adds identifier to state as a free variable during pattern disambiguation. This differs from add_free_lf_variable in that free computation-level variables in patterns do not have implicit binders (because they are not part of the meta-context), and hence must appear only once (linearly) in the overall pattern.

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state ?location identifier m is the result of running m in the local state derived from state having identifier as a bound LF variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

For example, the disambiguation of an LF term-level lambda-abstraction \x. m requires that the parameter x is locally added in scope when disambiguating the body m. This is achieved like this:

with_bound_lf_variable state x (fun state ->
-    disambiguate_lf_term state m)
val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_meta_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound meta-variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound contextual variable. This is different from with_bound_meta_variable, with_bound_parameter_variable, with_bound_substitution_variable and with_bound_context_variable in that it is unknown whether identifier should be a meta-variable, parameter variable, substitution variable or context variable. This is used in particular for mlam expressions.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_computation_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound computation-level variable.

val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_meta_variable state ?location identifier m is like with_bound_meta_variable state ?location identifier m except that identifier is also treated as a free variable so that in with_free_variables_as_pattern_variables it can be treated as a pattern variable usable in the expression.

This is used for meta-variables introduced in the meta-context of a pattern during case analysis. Those variables are considered bound in both the pattern and expression.

For example, B as below is one such bound pattern meta-variable, and appears in scope for ?.

case x of
-| { B : [g |- o] } [g |- impi \u. D] => ?
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_parameter_variable is like with_bound_pattern_meta_variable, but for a parameter variable introduced in the meta-context of a pattern.

val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_substitution_variable is like with_bound_pattern_meta_variable, but for a substitution variable introduced in the meta-context of a pattern.

val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_context_variable is like with_bound_pattern_meta_variable, but for a context variable introduced in the meta-context of a pattern.

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression state is the result of running expression with the free variables added in pattern as bound variables. This is used to disambiguate expression with bound variables arising from free variables in pattern.

  1. pattern is run with respect to state while keeping track of free variables. Variables bound outside the pattern are ignored in lookups.
  2. expression is run with respect to state with the addition of the tracked free variables from patterns as bound variables.

Lookups performed in pattern are more complex. The variables in state count as being unbound, but the variables with binders in the pattern count as bound. Binders in a pattern can be user-specified, or to be reconstructed during abstraction.

A variable is specifically inner bound if it is introduced explicitly by a lambda abstraction or the pattern meta-context, as an explicit or implicit parameter. Free meta-level variables are reconstructed inner bound. For instance, assuming s and ctx are constants:

  • In the pattern (x, x), both occurrences of x are pattern variables, and that pattern is not linear.
  • In the pattern {M : [ |- nat]} [ |- s M], M as introduced in the meta-context is a pattern variable, and M is an inner pattern-bound identifier in s M, so that pattern is linear.
  • In the pattern [ |- \x. s x], there are no pattern variables.
  • In the pattern ([g |- s M], [g |- s M]), g and M are pattern variables in the left projection of the tuple pattern, and inner pattern-bound in the right projection of the tuple pattern. This is because the pattern is reconstructed as {g : ctx} {M : [g |- nat]} ([g |- s M], [g |- s M]).
val with_scope : state -> (state -> 'a) -> 'a

with_scope state m runs m in a nested bindings scope that is discarded afterwards.

val with_parent_scope : state -> (state -> 'a) -> 'a

with_parent_scope state m runs m while ignoring the topmost scope.

This is used for the disambiguation of Harpoon proof scripts because Harpoon hypotheticals are already serialized with all the identifiers in the meta-level and computation-level contexts of the proof.

val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used for backtracking when disambiguating old-style LF type-level and term-level declarations (i.e., x : X where X may be an LF kind or an LF type).

This is also used in REPLs to safely run parsing functions and recover the state in case of a raised exception during disambiguation.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Constants

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_type_constant state ?location ?arity identifier adds identifier as a bound LF type-level constant.

In the disambiguation of a module's declaration, this also adds the constant as one of the module's declarations.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_term_constant is like add_lf_type_constant, but for LF term-level constants.

val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_schema_constant is like add_lf_type_constant, but for schema constants.

val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_inductive_computation_type_constant is like add_lf_type_constant, but for inductive computation-level type constants.

val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_stratified_computation_type_constant is like add_lf_type_constant, but for stratified computation-level type constants.

val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_coinductive_computation_type_constant is like add_lf_type_constant, but for coinductive computation-level type constants.

val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation_computation_type_constant is like add_lf_type_constant, but for computation-level abbreviation type constants.

val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_constructor is like add_lf_type_constant, but for computation-level term constructors.

val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_destructor is like add_lf_type_constant, but for computation-level term destructors.

val add_program_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_program_constant is like add_lf_type_constant, but for computation-level program constants.

val add_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

add_module state ?location identifier m is the result of running m in a module disambiguation state, whereby added constants are kept track of as declarations in the module having identifier.

Lookups

exception Unbound_identifier of Beluga_syntax.Syncom.Identifier.t

Unbound_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is caught whenever a variable lookup fails and identifier can be disambiguated as a free variable.

exception Unbound_qualified_identifier of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_qualified_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is unrecoverable, but is caught during disambiguation to provide better error messages.

exception Unbound_namespace of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_namespace namespace_identifier is raised if a qualified identifier could not be looked up in a disambiguation state because the namespace with identifier namespace_identifier is unbound.

val lookup_toplevel : state -> Beluga_syntax.Syncom.Identifier.t -> Entry.t

lookup_toplevel state identifier is entry if identifier resolves to entry in state. If identifier is unbound in state, then Unbound_identifier identifier is raised.

lookup state identifier is entry if identifier resolves to entry in state. Otherwise:

  • Unbound_identifier ident) is raised if the first segment ident in identifier is unbound.
  • Unbound_namespace namespace_identifier is raised if a segment in identifier other than the first or last is unbound.
  • Unbound_qualified_identifier identifier is raised if the last segment in identifier is unbound.
type maximum_lookup_result =
  1. | Unbound of {
    1. segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  2. | Partially_bound of {
    1. leading_segments : Beluga_syntax.Syncom.Identifier.t Support.List.t;
    2. segment : Beluga_syntax.Syncom.Identifier.t;
    3. entry : Entry.t;
    4. trailing_segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  3. | Bound of {
    1. entry : Entry.t;
    }

maximum_lookup state segments is either:

  • Unbound { segments } if the first segment in segments is unbound in state.
  • Partially_bound { leading_segments; segment; entry; trailing_segments } if the qualified identifier with namespaces leading_segments and name segment is bound to entry in state.
  • Bound { identifier; entry } if segments form a qualified identifier bound to entry in state.
val actual_binding_exn : - Beluga_syntax.Syncom.Qualified_identifier.t -> - Entry.t -> - exn

actual_binding_exn identifier entry is an exception reporting what sort of entry is bound at identifier. The exception is annotated with the entry's binding location.

Signature Operations

val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state module_identifier adds the exported constants from the module bound to module_identifier as toplevel entries in state. If module_identifier is unbound in state, then an exception is raised.

val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t

get_default_associativity state is the associativity to use for infix operators defined by the user using a pragma, without specifying the infix operator's associativity.

val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state default_associativity sets default_associativity as the associativity to return from get_default_associativity.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the precedence to use for operators defined by the user using a pragma, without specifying the operator's precedence.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state default_precedence sets default_precedence as the precedence to return from get_default_precedence.

val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence identifier adds a prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity identifier adds an infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence identifier adds a postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state identifier is Option.Some operator if identifier is bound to an operator with descriptor operator in state, and Option.None otherwise.

This is used to resolve operators in the disambiguation of applications, which are parsed as lists of expressions.

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_module_abbreviation state ?location module_identifier abbreviation adds the synonym abbreviation for the module bound to identifier in state.

An exception is raised if module_identifier is unbound in state, or if module_identifier is not bound to a module in state.

diff --git a/beluga/Beluga_parser/Disambiguation_state/module-type-ENTRY/index.html b/beluga/Beluga_parser/Disambiguation_state/module-type-ENTRY/index.html deleted file mode 100644 index 8d78c3718..000000000 --- a/beluga/Beluga_parser/Disambiguation_state/module-type-ENTRY/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -ENTRY (beluga.Beluga_parser.Disambiguation_state.ENTRY)

Module type Disambiguation_state.ENTRY

Abstract definition of entries bound to identifiers.

Disambiguation performs a traversal of the parser syntax to convert it to the external syntax. During this traversal, the disambiguation state is updated to keep track of the referencing environment at each node. Specifically, we add identifiers introduced by function abstractions, patterns, lambdas a Pis.

A disambiguation state entry is the data associated with an identifier in scope. Entries are constructed when a binding is added to the disambiguation state. Notation pragmas edit entries as well.

type t

The type of entry.

val is_lf_variable : t -> Stdlib.Bool.t

is_lf_variable entry is true if and only if entry describes an LF variable.

val is_meta_variable : t -> Stdlib.Bool.t

is_meta_variable entry is true if entry describes a meta-variable or a contextual variable.

Contextual variables exist only because mlam-expressions ambiguously introduce either a meta-variable, a parameter variable, a substitution variable or a context variable.

val is_parameter_variable : t -> Stdlib.Bool.t

is_parameter_variable is like is_meta_variable, but for entries describing parameter variables.

val is_substitution_variable : t -> Stdlib.Bool.t

is_substitution_variable is like is_meta_variable, but for entries describing parameter variables.

val is_context_variable : t -> Stdlib.Bool.t

is_context_variable is like is_meta_variable, but for entries describing context variables.

val is_computation_variable : t -> Stdlib.Bool.t

is_computation_variable entry is true if and only if entry describes a computation-level variable.

val is_variable : t -> Stdlib.Bool.t

is_variable entry is true if and only if entry describes an LF variable, a meta-level variable, or a computation-level variable.

This is used to discern between the following two cases when disambiguating identifiers in patterns:

  • The case where an exception should be raised because the identifier is a bound variable of the wrong sort.
  • The case where the identifier should be a free variable shadowing a constant.
val is_lf_type_constant : t -> Stdlib.Bool.t

is_lf_type_constant entry is true if and only if entry describes an LF type-level constant.

val is_lf_term_constant : t -> Stdlib.Bool.t

is_lf_term_constant is like is_lf_type_constant, but for entries describing LF term-level constants.

val is_schema_constant : t -> Stdlib.Bool.t

is_schema_constant is like is_lf_type_constant, but for entries describing context schemas.

val is_computation_inductive_type_constant : t -> Stdlib.Bool.t

is_computation_inductive_type_constant is like is_lf_type_constant, but for entries describing inductive computation-level type constants.

val is_computation_stratified_type_constant : t -> Stdlib.Bool.t

is_computation_stratified_type_constant is like is_lf_type_constant, but for entries describing stratified computation-level type constants.

val is_computation_coinductive_type_constant : t -> Stdlib.Bool.t

is_computation_coinductive_type_constant is like is_lf_type_constant, but for entries describing coinductive computation-level type constants.

val is_computation_abbreviation_type_constant : t -> Stdlib.Bool.t

is_computation_abbreviation_type_constant is like is_lf_type_constant, but for entries describing computation-level type constant abbreviations (introduced by the Beluga keyword typedef).

val is_computation_term_constructor : t -> Stdlib.Bool.t

is_computation_term_constructor is like is_lf_type_constant, but for entries describing computation-level constructors.

val is_computation_term_destructor : t -> Stdlib.Bool.t

is_computation_term_destructor is like is_lf_type_constant, but for entries describing computation-level destructors.

val is_program_constant : t -> Stdlib.Bool.t

is_program_constant is like is_lf_type_constant, but for entries describing computation-level programs (introduced by the Beluga keyword rec or val).

val is_module : t -> Stdlib.Bool.t

is_module is like is_lf_type_constant, but for entries describing modules.

diff --git a/beluga/Beluga_parser/Harpoon_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html b/beluga/Beluga_parser/Harpoon_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html deleted file mode 100644 index 67955b021..000000000 --- a/beluga/Beluga_parser/Harpoon_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga_parser.Harpoon_disambiguation.Make.Disambiguation_state.Entry)

Module Disambiguation_state.Entry

Recorded data on bindings in Beluga signatures.

type t

The type of entry.

val is_lf_variable : t -> Stdlib.Bool.t

is_lf_variable entry is true if and only if entry describes an LF variable.

val is_meta_variable : t -> Stdlib.Bool.t

is_meta_variable entry is true if entry describes a meta-variable or a contextual variable.

Contextual variables exist only because mlam-expressions ambiguously introduce either a meta-variable, a parameter variable, a substitution variable or a context variable.

val is_parameter_variable : t -> Stdlib.Bool.t

is_parameter_variable is like is_meta_variable, but for entries describing parameter variables.

val is_substitution_variable : t -> Stdlib.Bool.t

is_substitution_variable is like is_meta_variable, but for entries describing parameter variables.

val is_context_variable : t -> Stdlib.Bool.t

is_context_variable is like is_meta_variable, but for entries describing context variables.

val is_computation_variable : t -> Stdlib.Bool.t

is_computation_variable entry is true if and only if entry describes a computation-level variable.

val is_variable : t -> Stdlib.Bool.t

is_variable entry is true if and only if entry describes an LF variable, a meta-level variable, or a computation-level variable.

This is used to discern between the following two cases when disambiguating identifiers in patterns:

  • The case where an exception should be raised because the identifier is a bound variable of the wrong sort.
  • The case where the identifier should be a free variable shadowing a constant.
val is_lf_type_constant : t -> Stdlib.Bool.t

is_lf_type_constant entry is true if and only if entry describes an LF type-level constant.

val is_lf_term_constant : t -> Stdlib.Bool.t

is_lf_term_constant is like is_lf_type_constant, but for entries describing LF term-level constants.

val is_schema_constant : t -> Stdlib.Bool.t

is_schema_constant is like is_lf_type_constant, but for entries describing context schemas.

val is_computation_inductive_type_constant : t -> Stdlib.Bool.t

is_computation_inductive_type_constant is like is_lf_type_constant, but for entries describing inductive computation-level type constants.

val is_computation_stratified_type_constant : t -> Stdlib.Bool.t

is_computation_stratified_type_constant is like is_lf_type_constant, but for entries describing stratified computation-level type constants.

val is_computation_coinductive_type_constant : t -> Stdlib.Bool.t

is_computation_coinductive_type_constant is like is_lf_type_constant, but for entries describing coinductive computation-level type constants.

val is_computation_abbreviation_type_constant : t -> Stdlib.Bool.t

is_computation_abbreviation_type_constant is like is_lf_type_constant, but for entries describing computation-level type constant abbreviations (introduced by the Beluga keyword typedef).

val is_computation_term_constructor : t -> Stdlib.Bool.t

is_computation_term_constructor is like is_lf_type_constant, but for entries describing computation-level constructors.

val is_computation_term_destructor : t -> Stdlib.Bool.t

is_computation_term_destructor is like is_lf_type_constant, but for entries describing computation-level destructors.

val is_program_constant : t -> Stdlib.Bool.t

is_program_constant is like is_lf_type_constant, but for entries describing computation-level programs (introduced by the Beluga keyword rec or val).

val is_module : t -> Stdlib.Bool.t

is_module is like is_lf_type_constant, but for entries describing modules.

diff --git a/beluga/Beluga_parser/Harpoon_disambiguation/Make/argument-1-Disambiguation_state/index.html b/beluga/Beluga_parser/Harpoon_disambiguation/Make/argument-1-Disambiguation_state/index.html deleted file mode 100644 index 0f5416630..000000000 --- a/beluga/Beluga_parser/Harpoon_disambiguation/Make/argument-1-Disambiguation_state/index.html +++ /dev/null @@ -1,284 +0,0 @@ - -Disambiguation_state (beluga.Beluga_parser.Harpoon_disambiguation.Make.Disambiguation_state)

Parameter Make.Disambiguation_state

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
module Entry : Disambiguation_state.ENTRY

Recorded data on bindings in Beluga signatures.

Variables

val add_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_variable state ?location identifier adds identifier as a bound LF variable, with binding site location. If location = Option.None, then identifier's location is used instead.

This is mostly used for testing. For locally binding an LF variable, see with_bound_lf_variable.

val add_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_meta_variable is like add_lf_variable, but the identifier is added as a bound meta-variable.

val add_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_parameter_variable is like add_lf_variable, but the identifier is added as a bound parameter variable (those variables prefixed by '#' like "#p").

val add_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_substitution_variable is like add_lf_variable, but the identifier is added as a bound substitution variable (those variables prefixed by '$' like "$S").

val add_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_context_variable is like add_lf_variable, but the identifier is added as a bound context variable.

val add_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_contextual_variable is like add_lf_variable, but the identifier is added as a bound contextual variable, meaning that it is ambiguously bound as either a meta, parameter, substitution or context variable.

val add_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_variable is like add_lf_variable, but the identifier is added as a bound computation-level variable.

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state ?location identifier is add_lf_variable state ?location identifier, with the additional behaviour of adding identifier as an inner pattern bound identifier and as a free variable during pattern disambiguation. This means that identifier can subsequently be looked up as a bound LF variable during pattern disambiguation. This effectively allows free LF variables to appear multiple times (non-linearly) in patterns.

See with_free_variables_as_pattern_variables for the handler for converting free variables in patterns to binders for use as bound variables in expressions.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free meta-variable.

val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free parameter variable.

val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free substitution variable.

val add_free_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free context variable.

val add_free_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_computation_variable state ?location identifier adds identifier to state as a free variable during pattern disambiguation. This differs from add_free_lf_variable in that free computation-level variables in patterns do not have implicit binders (because they are not part of the meta-context), and hence must appear only once (linearly) in the overall pattern.

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state ?location identifier m is the result of running m in the local state derived from state having identifier as a bound LF variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

For example, the disambiguation of an LF term-level lambda-abstraction \x. m requires that the parameter x is locally added in scope when disambiguating the body m. This is achieved like this:

with_bound_lf_variable state x (fun state ->
-    disambiguate_lf_term state m)
val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_meta_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound meta-variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound contextual variable. This is different from with_bound_meta_variable, with_bound_parameter_variable, with_bound_substitution_variable and with_bound_context_variable in that it is unknown whether identifier should be a meta-variable, parameter variable, substitution variable or context variable. This is used in particular for mlam expressions.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_computation_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound computation-level variable.

val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_meta_variable state ?location identifier m is like with_bound_meta_variable state ?location identifier m except that identifier is also treated as a free variable so that in with_free_variables_as_pattern_variables it can be treated as a pattern variable usable in the expression.

This is used for meta-variables introduced in the meta-context of a pattern during case analysis. Those variables are considered bound in both the pattern and expression.

For example, B as below is one such bound pattern meta-variable, and appears in scope for ?.

case x of
-| { B : [g |- o] } [g |- impi \u. D] => ?
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_parameter_variable is like with_bound_pattern_meta_variable, but for a parameter variable introduced in the meta-context of a pattern.

val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_substitution_variable is like with_bound_pattern_meta_variable, but for a substitution variable introduced in the meta-context of a pattern.

val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_context_variable is like with_bound_pattern_meta_variable, but for a context variable introduced in the meta-context of a pattern.

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression state is the result of running expression with the free variables added in pattern as bound variables. This is used to disambiguate expression with bound variables arising from free variables in pattern.

  1. pattern is run with respect to state while keeping track of free variables. Variables bound outside the pattern are ignored in lookups.
  2. expression is run with respect to state with the addition of the tracked free variables from patterns as bound variables.

Lookups performed in pattern are more complex. The variables in state count as being unbound, but the variables with binders in the pattern count as bound. Binders in a pattern can be user-specified, or to be reconstructed during abstraction.

A variable is specifically inner bound if it is introduced explicitly by a lambda abstraction or the pattern meta-context, as an explicit or implicit parameter. Free meta-level variables are reconstructed inner bound. For instance, assuming s and ctx are constants:

  • In the pattern (x, x), both occurrences of x are pattern variables, and that pattern is not linear.
  • In the pattern {M : [ |- nat]} [ |- s M], M as introduced in the meta-context is a pattern variable, and M is an inner pattern-bound identifier in s M, so that pattern is linear.
  • In the pattern [ |- \x. s x], there are no pattern variables.
  • In the pattern ([g |- s M], [g |- s M]), g and M are pattern variables in the left projection of the tuple pattern, and inner pattern-bound in the right projection of the tuple pattern. This is because the pattern is reconstructed as {g : ctx} {M : [g |- nat]} ([g |- s M], [g |- s M]).
val with_scope : state -> (state -> 'a) -> 'a

with_scope state m runs m in a nested bindings scope that is discarded afterwards.

val with_parent_scope : state -> (state -> 'a) -> 'a

with_parent_scope state m runs m while ignoring the topmost scope.

This is used for the disambiguation of Harpoon proof scripts because Harpoon hypotheticals are already serialized with all the identifiers in the meta-level and computation-level contexts of the proof.

val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used for backtracking when disambiguating old-style LF type-level and term-level declarations (i.e., x : X where X may be an LF kind or an LF type).

This is also used in REPLs to safely run parsing functions and recover the state in case of a raised exception during disambiguation.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Constants

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_type_constant state ?location ?arity identifier adds identifier as a bound LF type-level constant.

In the disambiguation of a module's declaration, this also adds the constant as one of the module's declarations.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_term_constant is like add_lf_type_constant, but for LF term-level constants.

val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_schema_constant is like add_lf_type_constant, but for schema constants.

val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_inductive_computation_type_constant is like add_lf_type_constant, but for inductive computation-level type constants.

val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_stratified_computation_type_constant is like add_lf_type_constant, but for stratified computation-level type constants.

val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_coinductive_computation_type_constant is like add_lf_type_constant, but for coinductive computation-level type constants.

val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation_computation_type_constant is like add_lf_type_constant, but for computation-level abbreviation type constants.

val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_constructor is like add_lf_type_constant, but for computation-level term constructors.

val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_destructor is like add_lf_type_constant, but for computation-level term destructors.

val add_program_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_program_constant is like add_lf_type_constant, but for computation-level program constants.

val add_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

add_module state ?location identifier m is the result of running m in a module disambiguation state, whereby added constants are kept track of as declarations in the module having identifier.

Lookups

exception Unbound_identifier of Beluga_syntax.Syncom.Identifier.t

Unbound_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is caught whenever a variable lookup fails and identifier can be disambiguated as a free variable.

exception Unbound_qualified_identifier of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_qualified_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is unrecoverable, but is caught during disambiguation to provide better error messages.

exception Unbound_namespace of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_namespace namespace_identifier is raised if a qualified identifier could not be looked up in a disambiguation state because the namespace with identifier namespace_identifier is unbound.

val lookup_toplevel : state -> Beluga_syntax.Syncom.Identifier.t -> Entry.t

lookup_toplevel state identifier is entry if identifier resolves to entry in state. If identifier is unbound in state, then Unbound_identifier identifier is raised.

lookup state identifier is entry if identifier resolves to entry in state. Otherwise:

  • Unbound_identifier ident) is raised if the first segment ident in identifier is unbound.
  • Unbound_namespace namespace_identifier is raised if a segment in identifier other than the first or last is unbound.
  • Unbound_qualified_identifier identifier is raised if the last segment in identifier is unbound.
type maximum_lookup_result =
  1. | Unbound of {
    1. segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  2. | Partially_bound of {
    1. leading_segments : Beluga_syntax.Syncom.Identifier.t Support.List.t;
    2. segment : Beluga_syntax.Syncom.Identifier.t;
    3. entry : Entry.t;
    4. trailing_segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  3. | Bound of {
    1. entry : Entry.t;
    }

maximum_lookup state segments is either:

  • Unbound { segments } if the first segment in segments is unbound in state.
  • Partially_bound { leading_segments; segment; entry; trailing_segments } if the qualified identifier with namespaces leading_segments and name segment is bound to entry in state.
  • Bound { identifier; entry } if segments form a qualified identifier bound to entry in state.
val actual_binding_exn : - Beluga_syntax.Syncom.Qualified_identifier.t -> - Entry.t -> - exn

actual_binding_exn identifier entry is an exception reporting what sort of entry is bound at identifier. The exception is annotated with the entry's binding location.

Signature Operations

val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state module_identifier adds the exported constants from the module bound to module_identifier as toplevel entries in state. If module_identifier is unbound in state, then an exception is raised.

val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t

get_default_associativity state is the associativity to use for infix operators defined by the user using a pragma, without specifying the infix operator's associativity.

val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state default_associativity sets default_associativity as the associativity to return from get_default_associativity.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the precedence to use for operators defined by the user using a pragma, without specifying the operator's precedence.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state default_precedence sets default_precedence as the precedence to return from get_default_precedence.

val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence identifier adds a prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity identifier adds an infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence identifier adds a postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state identifier is Option.Some operator if identifier is bound to an operator with descriptor operator in state, and Option.None otherwise.

This is used to resolve operators in the disambiguation of applications, which are parsed as lists of expressions.

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_module_abbreviation state ?location module_identifier abbreviation adds the synonym abbreviation for the module bound to identifier in state.

An exception is raised if module_identifier is unbound in state, or if module_identifier is not bound to a module in state.

diff --git a/beluga/Beluga_parser/Harpoon_disambiguation/Make/argument-2-Meta_disambiguation/index.html b/beluga/Beluga_parser/Harpoon_disambiguation/Make/argument-2-Meta_disambiguation/index.html deleted file mode 100644 index dc6fb358c..000000000 --- a/beluga/Beluga_parser/Harpoon_disambiguation/Make/argument-2-Meta_disambiguation/index.html +++ /dev/null @@ -1,84 +0,0 @@ - -Meta_disambiguation (beluga.Beluga_parser.Harpoon_disambiguation.Make.Meta_disambiguation)

Parameter Make.Meta_disambiguation

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Disambiguation_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_meta_typ : state -> Synprs.meta_thing -> Synext.meta_typ
val disambiguate_meta_object : state -> Synprs.meta_thing -> Synext.meta_object
val disambiguate_meta_pattern : - state -> - Synprs.meta_thing -> - Beluga_syntax.Synext.Meta.Pattern.t
val disambiguate_schema : state -> Synprs.schema_object -> Synext.schema
val with_disambiguated_meta_context : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
val with_disambiguated_meta_context_pattern : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
diff --git a/beluga/Beluga_parser/Harpoon_disambiguation/Make/argument-3-Comp_disambiguation/index.html b/beluga/Beluga_parser/Harpoon_disambiguation/Make/argument-3-Comp_disambiguation/index.html deleted file mode 100644 index ad7853e54..000000000 --- a/beluga/Beluga_parser/Harpoon_disambiguation/Make/argument-3-Comp_disambiguation/index.html +++ /dev/null @@ -1,89 +0,0 @@ - -Comp_disambiguation (beluga.Beluga_parser.Harpoon_disambiguation.Make.Comp_disambiguation)

Parameter Make.Comp_disambiguation

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Disambiguation_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_comp_kind : - state -> - Synprs.comp_sort_object -> - Synext.comp_kind
val disambiguate_comp_typ : state -> Synprs.comp_sort_object -> Synext.comp_typ
val disambiguate_comp_expression : - state -> - Synprs.comp_expression_object -> - Synext.comp_expression
val disambiguate_comp_pattern : - state -> - Synprs.comp_pattern_object -> - Synext.comp_pattern
val disambiguate_comp_copattern : - state -> - Synprs.comp_copattern_object Support.List1.t -> - Synext.comp_copattern
val with_disambiguated_comp_context : - state -> - Synprs.comp_context_object -> - (state -> Synext.comp_context -> 'a) -> - 'a
diff --git a/beluga/Beluga_parser/Harpoon_disambiguation/Make/index.html b/beluga/Beluga_parser/Harpoon_disambiguation/Make/index.html deleted file mode 100644 index 20db21787..000000000 --- a/beluga/Beluga_parser/Harpoon_disambiguation/Make/index.html +++ /dev/null @@ -1,99 +0,0 @@ - -Make (beluga.Beluga_parser.Harpoon_disambiguation.Make)

Module Harpoon_disambiguation.Make

Parameters

Signature

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Disambiguation_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_harpoon_proof : - state -> - Synprs.harpoon_proof -> - Synext.harpoon_proof
val with_disambiguated_harpoon_command : - state -> - Synprs.harpoon_command -> - (state -> Synext.harpoon_command -> 'a) -> - 'a
val disambiguate_harpoon_directive : - state -> - Synprs.harpoon_directive -> - Synext.harpoon_directive
val disambiguate_harpoon_split_branch : - state -> - Synprs.harpoon_split_branch -> - Synext.harpoon_split_branch
val disambiguate_harpoon_suffices_branch : - state -> - Synprs.harpoon_suffices_branch -> - Synext.harpoon_suffices_branch
val disambiguate_harpoon_hypothetical : - state -> - Synprs.harpoon_hypothetical -> - Synext.harpoon_hypothetical
val disambiguate_harpoon_repl_command : - state -> - Synprs.harpoon_repl_command -> - Synext.harpoon_repl_command
diff --git a/beluga/Beluga_parser/Harpoon_disambiguation/index.html b/beluga/Beluga_parser/Harpoon_disambiguation/index.html deleted file mode 100644 index 9b5e5bb45..000000000 --- a/beluga/Beluga_parser/Harpoon_disambiguation/index.html +++ /dev/null @@ -1,10 +0,0 @@ - -Harpoon_disambiguation (beluga.Beluga_parser.Harpoon_disambiguation)

Module Beluga_parser.Harpoon_disambiguation

module type HARPOON_DISAMBIGUATION = sig ... end
diff --git a/beluga/Beluga_parser/Harpoon_disambiguation/module-type-HARPOON_DISAMBIGUATION/index.html b/beluga/Beluga_parser/Harpoon_disambiguation/module-type-HARPOON_DISAMBIGUATION/index.html deleted file mode 100644 index 72338480d..000000000 --- a/beluga/Beluga_parser/Harpoon_disambiguation/module-type-HARPOON_DISAMBIGUATION/index.html +++ /dev/null @@ -1,94 +0,0 @@ - -HARPOON_DISAMBIGUATION (beluga.Beluga_parser.Harpoon_disambiguation.HARPOON_DISAMBIGUATION)

Module type Harpoon_disambiguation.HARPOON_DISAMBIGUATION

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_harpoon_proof : - state -> - Synprs.harpoon_proof -> - Synext.harpoon_proof
val with_disambiguated_harpoon_command : - state -> - Synprs.harpoon_command -> - (state -> Synext.harpoon_command -> 'a) -> - 'a
val disambiguate_harpoon_directive : - state -> - Synprs.harpoon_directive -> - Synext.harpoon_directive
val disambiguate_harpoon_split_branch : - state -> - Synprs.harpoon_split_branch -> - Synext.harpoon_split_branch
val disambiguate_harpoon_suffices_branch : - state -> - Synprs.harpoon_suffices_branch -> - Synext.harpoon_suffices_branch
val disambiguate_harpoon_hypothetical : - state -> - Synprs.harpoon_hypothetical -> - Synext.harpoon_hypothetical
val disambiguate_harpoon_repl_command : - state -> - Synprs.harpoon_repl_command -> - Synext.harpoon_repl_command
diff --git a/beluga/Beluga_parser/Harpoon_parser/Make/argument-1-Parser/index.html b/beluga/Beluga_parser/Harpoon_parser/Make/argument-1-Parser/index.html deleted file mode 100644 index 4cf5ed168..000000000 --- a/beluga/Beluga_parser/Harpoon_parser/Make/argument-1-Parser/index.html +++ /dev/null @@ -1,31 +0,0 @@ - -Parser (beluga.Beluga_parser.Harpoon_parser.Make.Parser)

Parameter Make.Parser

include Parser_combinator.PARSER - with type token = Located_token.t - with type location = Beluga_syntax.Location.t
type token = Located_token.t
type location = Beluga_syntax.Location.t
type state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

diff --git a/beluga/Beluga_parser/Harpoon_parser/Make/argument-2-Meta_parser/index.html b/beluga/Beluga_parser/Harpoon_parser/Make/argument-2-Meta_parser/index.html deleted file mode 100644 index b797c7886..000000000 --- a/beluga/Beluga_parser/Harpoon_parser/Make/argument-2-Meta_parser/index.html +++ /dev/null @@ -1,35 +0,0 @@ - -Meta_parser (beluga.Beluga_parser.Harpoon_parser.Make.Meta_parser)

Parameter Make.Meta_parser

include Common_parser.COMMON_PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
include Parser_combinator.PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
type token = Parser.token
type location = Parser.location
type state = Parser.state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val schema : Synprs.schema_object t
val meta_type : Synprs.meta_thing t
val meta_object : Synprs.meta_thing t
val meta_pattern : Synprs.meta_thing t
val meta_context : Synprs.meta_context_object t
diff --git a/beluga/Beluga_parser/Harpoon_parser/Make/argument-3-Comp_parser/index.html b/beluga/Beluga_parser/Harpoon_parser/Make/argument-3-Comp_parser/index.html deleted file mode 100644 index a1679672f..000000000 --- a/beluga/Beluga_parser/Harpoon_parser/Make/argument-3-Comp_parser/index.html +++ /dev/null @@ -1,35 +0,0 @@ - -Comp_parser (beluga.Beluga_parser.Harpoon_parser.Make.Comp_parser)

Parameter Make.Comp_parser

include Common_parser.COMMON_PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
include Parser_combinator.PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
type token = Parser.token
type location = Parser.location
type state = Parser.state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val comp_kind : Synprs.comp_sort_object t
val comp_typ : Synprs.comp_sort_object t
val comp_pattern : Synprs.comp_pattern_object t
val comp_copattern : Synprs.comp_copattern_object t
val comp_expression : Synprs.comp_expression_object t
val comp_context : Synprs.comp_context_object t
diff --git a/beluga/Beluga_parser/Harpoon_parser/Make/index.html b/beluga/Beluga_parser/Harpoon_parser/Make/index.html deleted file mode 100644 index 95f5fd253..000000000 --- a/beluga/Beluga_parser/Harpoon_parser/Make/index.html +++ /dev/null @@ -1,46 +0,0 @@ - -Make (beluga.Beluga_parser.Harpoon_parser.Make)

Module Harpoon_parser.Make

Parameters

Signature

include Common_parser.COMMON_PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
include Parser_combinator.PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
type token = Parser.token
type location = Parser.location
type state = Parser.state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val harpoon_proof : Synprs.harpoon_proof t
val interactive_harpoon_command : Synprs.harpoon_repl_command t
diff --git a/beluga/Beluga_parser/Harpoon_parser/index.html b/beluga/Beluga_parser/Harpoon_parser/index.html deleted file mode 100644 index 228443902..000000000 --- a/beluga/Beluga_parser/Harpoon_parser/index.html +++ /dev/null @@ -1,20 +0,0 @@ - -Harpoon_parser (beluga.Beluga_parser.Harpoon_parser)

Module Beluga_parser.Harpoon_parser

module type HARPOON_PARSER = sig ... end
diff --git a/beluga/Beluga_parser/Harpoon_parser/module-type-HARPOON_PARSER/index.html b/beluga/Beluga_parser/Harpoon_parser/module-type-HARPOON_PARSER/index.html deleted file mode 100644 index 495f55755..000000000 --- a/beluga/Beluga_parser/Harpoon_parser/module-type-HARPOON_PARSER/index.html +++ /dev/null @@ -1,29 +0,0 @@ - -HARPOON_PARSER (beluga.Beluga_parser.Harpoon_parser.HARPOON_PARSER)

Module type Harpoon_parser.HARPOON_PARSER

include Common_parser.COMMON_PARSER
include Parser_combinator.PARSER
type token
type location
type state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val harpoon_proof : Synprs.harpoon_proof t
val interactive_harpoon_command : Synprs.harpoon_repl_command t
diff --git a/beluga/Beluga_parser/Lexer/index.html b/beluga/Beluga_parser/Lexer/index.html deleted file mode 100644 index 32623003c..000000000 --- a/beluga/Beluga_parser/Lexer/index.html +++ /dev/null @@ -1,8 +0,0 @@ - -Lexer (beluga.Beluga_parser.Lexer)

Module Beluga_parser.Lexer

Tokenization of UTF-8 text input.

val lex_string : - initial_location:Beluga_syntax.Location.t -> - string -> - Located_token.t Support.Seq.t

lex_string initial_location input is the persistent sequence of tokens lexed from the string input, with token locations starting at initial_location.

val lex_input_channel : - initial_location:Beluga_syntax.Location.t -> - Stdlib.in_channel -> - Located_token.t Support.Seq.t

lex_string initial_location input is the persistent sequence of tokens lexed from input channel input, with token locations starting at initial_location. You need to make sure to keep the input channel open throughout lexing, otherwise reading of subsequent tokens will fail.

diff --git a/beluga/Beluga_parser/Lf_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html b/beluga/Beluga_parser/Lf_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html deleted file mode 100644 index 8e6a6eda8..000000000 --- a/beluga/Beluga_parser/Lf_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga_parser.Lf_disambiguation.Make.Disambiguation_state.Entry)

Module Disambiguation_state.Entry

Recorded data on bindings in Beluga signatures.

type t

The type of entry.

val is_lf_variable : t -> Stdlib.Bool.t

is_lf_variable entry is true if and only if entry describes an LF variable.

val is_meta_variable : t -> Stdlib.Bool.t

is_meta_variable entry is true if entry describes a meta-variable or a contextual variable.

Contextual variables exist only because mlam-expressions ambiguously introduce either a meta-variable, a parameter variable, a substitution variable or a context variable.

val is_parameter_variable : t -> Stdlib.Bool.t

is_parameter_variable is like is_meta_variable, but for entries describing parameter variables.

val is_substitution_variable : t -> Stdlib.Bool.t

is_substitution_variable is like is_meta_variable, but for entries describing parameter variables.

val is_context_variable : t -> Stdlib.Bool.t

is_context_variable is like is_meta_variable, but for entries describing context variables.

val is_computation_variable : t -> Stdlib.Bool.t

is_computation_variable entry is true if and only if entry describes a computation-level variable.

val is_variable : t -> Stdlib.Bool.t

is_variable entry is true if and only if entry describes an LF variable, a meta-level variable, or a computation-level variable.

This is used to discern between the following two cases when disambiguating identifiers in patterns:

  • The case where an exception should be raised because the identifier is a bound variable of the wrong sort.
  • The case where the identifier should be a free variable shadowing a constant.
val is_lf_type_constant : t -> Stdlib.Bool.t

is_lf_type_constant entry is true if and only if entry describes an LF type-level constant.

val is_lf_term_constant : t -> Stdlib.Bool.t

is_lf_term_constant is like is_lf_type_constant, but for entries describing LF term-level constants.

val is_schema_constant : t -> Stdlib.Bool.t

is_schema_constant is like is_lf_type_constant, but for entries describing context schemas.

val is_computation_inductive_type_constant : t -> Stdlib.Bool.t

is_computation_inductive_type_constant is like is_lf_type_constant, but for entries describing inductive computation-level type constants.

val is_computation_stratified_type_constant : t -> Stdlib.Bool.t

is_computation_stratified_type_constant is like is_lf_type_constant, but for entries describing stratified computation-level type constants.

val is_computation_coinductive_type_constant : t -> Stdlib.Bool.t

is_computation_coinductive_type_constant is like is_lf_type_constant, but for entries describing coinductive computation-level type constants.

val is_computation_abbreviation_type_constant : t -> Stdlib.Bool.t

is_computation_abbreviation_type_constant is like is_lf_type_constant, but for entries describing computation-level type constant abbreviations (introduced by the Beluga keyword typedef).

val is_computation_term_constructor : t -> Stdlib.Bool.t

is_computation_term_constructor is like is_lf_type_constant, but for entries describing computation-level constructors.

val is_computation_term_destructor : t -> Stdlib.Bool.t

is_computation_term_destructor is like is_lf_type_constant, but for entries describing computation-level destructors.

val is_program_constant : t -> Stdlib.Bool.t

is_program_constant is like is_lf_type_constant, but for entries describing computation-level programs (introduced by the Beluga keyword rec or val).

val is_module : t -> Stdlib.Bool.t

is_module is like is_lf_type_constant, but for entries describing modules.

diff --git a/beluga/Beluga_parser/Lf_disambiguation/Make/argument-1-Disambiguation_state/index.html b/beluga/Beluga_parser/Lf_disambiguation/Make/argument-1-Disambiguation_state/index.html deleted file mode 100644 index b3abf4ee9..000000000 --- a/beluga/Beluga_parser/Lf_disambiguation/Make/argument-1-Disambiguation_state/index.html +++ /dev/null @@ -1,284 +0,0 @@ - -Disambiguation_state (beluga.Beluga_parser.Lf_disambiguation.Make.Disambiguation_state)

Parameter Make.Disambiguation_state

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
module Entry : Disambiguation_state.ENTRY

Recorded data on bindings in Beluga signatures.

Variables

val add_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_variable state ?location identifier adds identifier as a bound LF variable, with binding site location. If location = Option.None, then identifier's location is used instead.

This is mostly used for testing. For locally binding an LF variable, see with_bound_lf_variable.

val add_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_meta_variable is like add_lf_variable, but the identifier is added as a bound meta-variable.

val add_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_parameter_variable is like add_lf_variable, but the identifier is added as a bound parameter variable (those variables prefixed by '#' like "#p").

val add_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_substitution_variable is like add_lf_variable, but the identifier is added as a bound substitution variable (those variables prefixed by '$' like "$S").

val add_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_context_variable is like add_lf_variable, but the identifier is added as a bound context variable.

val add_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_contextual_variable is like add_lf_variable, but the identifier is added as a bound contextual variable, meaning that it is ambiguously bound as either a meta, parameter, substitution or context variable.

val add_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_variable is like add_lf_variable, but the identifier is added as a bound computation-level variable.

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state ?location identifier is add_lf_variable state ?location identifier, with the additional behaviour of adding identifier as an inner pattern bound identifier and as a free variable during pattern disambiguation. This means that identifier can subsequently be looked up as a bound LF variable during pattern disambiguation. This effectively allows free LF variables to appear multiple times (non-linearly) in patterns.

See with_free_variables_as_pattern_variables for the handler for converting free variables in patterns to binders for use as bound variables in expressions.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free meta-variable.

val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free parameter variable.

val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free substitution variable.

val add_free_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free context variable.

val add_free_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_computation_variable state ?location identifier adds identifier to state as a free variable during pattern disambiguation. This differs from add_free_lf_variable in that free computation-level variables in patterns do not have implicit binders (because they are not part of the meta-context), and hence must appear only once (linearly) in the overall pattern.

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state ?location identifier m is the result of running m in the local state derived from state having identifier as a bound LF variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

For example, the disambiguation of an LF term-level lambda-abstraction \x. m requires that the parameter x is locally added in scope when disambiguating the body m. This is achieved like this:

with_bound_lf_variable state x (fun state ->
-    disambiguate_lf_term state m)
val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_meta_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound meta-variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound contextual variable. This is different from with_bound_meta_variable, with_bound_parameter_variable, with_bound_substitution_variable and with_bound_context_variable in that it is unknown whether identifier should be a meta-variable, parameter variable, substitution variable or context variable. This is used in particular for mlam expressions.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_computation_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound computation-level variable.

val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_meta_variable state ?location identifier m is like with_bound_meta_variable state ?location identifier m except that identifier is also treated as a free variable so that in with_free_variables_as_pattern_variables it can be treated as a pattern variable usable in the expression.

This is used for meta-variables introduced in the meta-context of a pattern during case analysis. Those variables are considered bound in both the pattern and expression.

For example, B as below is one such bound pattern meta-variable, and appears in scope for ?.

case x of
-| { B : [g |- o] } [g |- impi \u. D] => ?
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_parameter_variable is like with_bound_pattern_meta_variable, but for a parameter variable introduced in the meta-context of a pattern.

val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_substitution_variable is like with_bound_pattern_meta_variable, but for a substitution variable introduced in the meta-context of a pattern.

val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_context_variable is like with_bound_pattern_meta_variable, but for a context variable introduced in the meta-context of a pattern.

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression state is the result of running expression with the free variables added in pattern as bound variables. This is used to disambiguate expression with bound variables arising from free variables in pattern.

  1. pattern is run with respect to state while keeping track of free variables. Variables bound outside the pattern are ignored in lookups.
  2. expression is run with respect to state with the addition of the tracked free variables from patterns as bound variables.

Lookups performed in pattern are more complex. The variables in state count as being unbound, but the variables with binders in the pattern count as bound. Binders in a pattern can be user-specified, or to be reconstructed during abstraction.

A variable is specifically inner bound if it is introduced explicitly by a lambda abstraction or the pattern meta-context, as an explicit or implicit parameter. Free meta-level variables are reconstructed inner bound. For instance, assuming s and ctx are constants:

  • In the pattern (x, x), both occurrences of x are pattern variables, and that pattern is not linear.
  • In the pattern {M : [ |- nat]} [ |- s M], M as introduced in the meta-context is a pattern variable, and M is an inner pattern-bound identifier in s M, so that pattern is linear.
  • In the pattern [ |- \x. s x], there are no pattern variables.
  • In the pattern ([g |- s M], [g |- s M]), g and M are pattern variables in the left projection of the tuple pattern, and inner pattern-bound in the right projection of the tuple pattern. This is because the pattern is reconstructed as {g : ctx} {M : [g |- nat]} ([g |- s M], [g |- s M]).
val with_scope : state -> (state -> 'a) -> 'a

with_scope state m runs m in a nested bindings scope that is discarded afterwards.

val with_parent_scope : state -> (state -> 'a) -> 'a

with_parent_scope state m runs m while ignoring the topmost scope.

This is used for the disambiguation of Harpoon proof scripts because Harpoon hypotheticals are already serialized with all the identifiers in the meta-level and computation-level contexts of the proof.

val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used for backtracking when disambiguating old-style LF type-level and term-level declarations (i.e., x : X where X may be an LF kind or an LF type).

This is also used in REPLs to safely run parsing functions and recover the state in case of a raised exception during disambiguation.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Constants

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_type_constant state ?location ?arity identifier adds identifier as a bound LF type-level constant.

In the disambiguation of a module's declaration, this also adds the constant as one of the module's declarations.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_term_constant is like add_lf_type_constant, but for LF term-level constants.

val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_schema_constant is like add_lf_type_constant, but for schema constants.

val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_inductive_computation_type_constant is like add_lf_type_constant, but for inductive computation-level type constants.

val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_stratified_computation_type_constant is like add_lf_type_constant, but for stratified computation-level type constants.

val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_coinductive_computation_type_constant is like add_lf_type_constant, but for coinductive computation-level type constants.

val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation_computation_type_constant is like add_lf_type_constant, but for computation-level abbreviation type constants.

val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_constructor is like add_lf_type_constant, but for computation-level term constructors.

val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_destructor is like add_lf_type_constant, but for computation-level term destructors.

val add_program_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_program_constant is like add_lf_type_constant, but for computation-level program constants.

val add_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

add_module state ?location identifier m is the result of running m in a module disambiguation state, whereby added constants are kept track of as declarations in the module having identifier.

Lookups

exception Unbound_identifier of Beluga_syntax.Syncom.Identifier.t

Unbound_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is caught whenever a variable lookup fails and identifier can be disambiguated as a free variable.

exception Unbound_qualified_identifier of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_qualified_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is unrecoverable, but is caught during disambiguation to provide better error messages.

exception Unbound_namespace of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_namespace namespace_identifier is raised if a qualified identifier could not be looked up in a disambiguation state because the namespace with identifier namespace_identifier is unbound.

val lookup_toplevel : state -> Beluga_syntax.Syncom.Identifier.t -> Entry.t

lookup_toplevel state identifier is entry if identifier resolves to entry in state. If identifier is unbound in state, then Unbound_identifier identifier is raised.

lookup state identifier is entry if identifier resolves to entry in state. Otherwise:

  • Unbound_identifier ident) is raised if the first segment ident in identifier is unbound.
  • Unbound_namespace namespace_identifier is raised if a segment in identifier other than the first or last is unbound.
  • Unbound_qualified_identifier identifier is raised if the last segment in identifier is unbound.
type maximum_lookup_result =
  1. | Unbound of {
    1. segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  2. | Partially_bound of {
    1. leading_segments : Beluga_syntax.Syncom.Identifier.t Support.List.t;
    2. segment : Beluga_syntax.Syncom.Identifier.t;
    3. entry : Entry.t;
    4. trailing_segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  3. | Bound of {
    1. entry : Entry.t;
    }

maximum_lookup state segments is either:

  • Unbound { segments } if the first segment in segments is unbound in state.
  • Partially_bound { leading_segments; segment; entry; trailing_segments } if the qualified identifier with namespaces leading_segments and name segment is bound to entry in state.
  • Bound { identifier; entry } if segments form a qualified identifier bound to entry in state.
val actual_binding_exn : - Beluga_syntax.Syncom.Qualified_identifier.t -> - Entry.t -> - exn

actual_binding_exn identifier entry is an exception reporting what sort of entry is bound at identifier. The exception is annotated with the entry's binding location.

Signature Operations

val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state module_identifier adds the exported constants from the module bound to module_identifier as toplevel entries in state. If module_identifier is unbound in state, then an exception is raised.

val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t

get_default_associativity state is the associativity to use for infix operators defined by the user using a pragma, without specifying the infix operator's associativity.

val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state default_associativity sets default_associativity as the associativity to return from get_default_associativity.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the precedence to use for operators defined by the user using a pragma, without specifying the operator's precedence.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state default_precedence sets default_precedence as the precedence to return from get_default_precedence.

val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence identifier adds a prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity identifier adds an infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence identifier adds a postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state identifier is Option.Some operator if identifier is bound to an operator with descriptor operator in state, and Option.None otherwise.

This is used to resolve operators in the disambiguation of applications, which are parsed as lists of expressions.

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_module_abbreviation state ?location module_identifier abbreviation adds the synonym abbreviation for the module bound to identifier in state.

An exception is raised if module_identifier is unbound in state, or if module_identifier is not bound to a module in state.

diff --git a/beluga/Beluga_parser/Lf_disambiguation/Make/index.html b/beluga/Beluga_parser/Lf_disambiguation/Make/index.html deleted file mode 100644 index 61bcfbc79..000000000 --- a/beluga/Beluga_parser/Lf_disambiguation/Make/index.html +++ /dev/null @@ -1,73 +0,0 @@ - -Make (beluga.Beluga_parser.Lf_disambiguation.Make)

Module Lf_disambiguation.Make

Functor building an instance of LF disambiguation.

Parameters

Signature

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Disambiguation_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_lf_kind : state -> Synprs.lf_object -> Synext.lf_kind

disambiguate_lf_kind state object_ is kind', the LF kind disambiguated from kind in the disambiguation state state.

val disambiguate_lf_typ : state -> Synprs.lf_object -> Synext.lf_typ

disambiguate_lf_typ state typ is typ', the LF type disambiguated from typ in the disambiguation state state.

val disambiguate_lf_term : state -> Synprs.lf_object -> Synext.lf_term

disambiguate_lf_term state term is term', the LF term disambiguated from term in the disambiguation state state.

diff --git a/beluga/Beluga_parser/Lf_disambiguation/index.html b/beluga/Beluga_parser/Lf_disambiguation/index.html deleted file mode 100644 index 4a29abdaa..000000000 --- a/beluga/Beluga_parser/Lf_disambiguation/index.html +++ /dev/null @@ -1,4 +0,0 @@ - -Lf_disambiguation (beluga.Beluga_parser.Lf_disambiguation)

Module Beluga_parser.Lf_disambiguation

module type LF_DISAMBIGUATION = sig ... end

Abstract definition of stateful disambiguation from the parser syntax to the external syntax for pure LF kinds, types and terms.

Functor building an instance of LF disambiguation.

diff --git a/beluga/Beluga_parser/Lf_disambiguation/module-type-LF_DISAMBIGUATION/index.html b/beluga/Beluga_parser/Lf_disambiguation/module-type-LF_DISAMBIGUATION/index.html deleted file mode 100644 index f862acc80..000000000 --- a/beluga/Beluga_parser/Lf_disambiguation/module-type-LF_DISAMBIGUATION/index.html +++ /dev/null @@ -1,72 +0,0 @@ - -LF_DISAMBIGUATION (beluga.Beluga_parser.Lf_disambiguation.LF_DISAMBIGUATION)

Module type Lf_disambiguation.LF_DISAMBIGUATION

Abstract definition of stateful disambiguation from the parser syntax to the external syntax for pure LF kinds, types and terms.

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_lf_kind : state -> Synprs.lf_object -> Synext.lf_kind

disambiguate_lf_kind state object_ is kind', the LF kind disambiguated from kind in the disambiguation state state.

val disambiguate_lf_typ : state -> Synprs.lf_object -> Synext.lf_typ

disambiguate_lf_typ state typ is typ', the LF type disambiguated from typ in the disambiguation state state.

val disambiguate_lf_term : state -> Synprs.lf_object -> Synext.lf_term

disambiguate_lf_term state term is term', the LF term disambiguated from term in the disambiguation state state.

diff --git a/beluga/Beluga_parser/Lf_parser/Make/argument-1-Parser/index.html b/beluga/Beluga_parser/Lf_parser/Make/argument-1-Parser/index.html deleted file mode 100644 index 18c99a84d..000000000 --- a/beluga/Beluga_parser/Lf_parser/Make/argument-1-Parser/index.html +++ /dev/null @@ -1,31 +0,0 @@ - -Parser (beluga.Beluga_parser.Lf_parser.Make.Parser)

Parameter Make.Parser

include Parser_combinator.PARSER - with type token = Located_token.t - with type location = Beluga_syntax.Location.t
type token = Located_token.t
type location = Beluga_syntax.Location.t
type state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

diff --git a/beluga/Beluga_parser/Lf_parser/Make/index.html b/beluga/Beluga_parser/Lf_parser/Make/index.html deleted file mode 100644 index a72a29187..000000000 --- a/beluga/Beluga_parser/Lf_parser/Make/index.html +++ /dev/null @@ -1,38 +0,0 @@ - -Make (beluga.Beluga_parser.Lf_parser.Make)

Module Lf_parser.Make

Parameters

Signature

include Common_parser.COMMON_PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
include Parser_combinator.PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
type token = Parser.token
type location = Parser.location
type state = Parser.state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val lf_kind : Synprs.lf_object t
val lf_typ : Synprs.lf_object t
val lf_term : Synprs.lf_object t
diff --git a/beluga/Beluga_parser/Lf_parser/index.html b/beluga/Beluga_parser/Lf_parser/index.html deleted file mode 100644 index 12e859cec..000000000 --- a/beluga/Beluga_parser/Lf_parser/index.html +++ /dev/null @@ -1,10 +0,0 @@ - -Lf_parser (beluga.Beluga_parser.Lf_parser)

Module Beluga_parser.Lf_parser

module type LF_PARSER = sig ... end
diff --git a/beluga/Beluga_parser/Lf_parser/module-type-LF_PARSER/index.html b/beluga/Beluga_parser/Lf_parser/module-type-LF_PARSER/index.html deleted file mode 100644 index 54b15fcca..000000000 --- a/beluga/Beluga_parser/Lf_parser/module-type-LF_PARSER/index.html +++ /dev/null @@ -1,29 +0,0 @@ - -LF_PARSER (beluga.Beluga_parser.Lf_parser.LF_PARSER)

Module type Lf_parser.LF_PARSER

include Common_parser.COMMON_PARSER
include Parser_combinator.PARSER
type token
type location
type state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val lf_kind : Synprs.lf_object t
val lf_typ : Synprs.lf_object t
val lf_term : Synprs.lf_object t
diff --git a/beluga/Beluga_parser/Located_token/index.html b/beluga/Beluga_parser/Located_token/index.html deleted file mode 100644 index ed89b6cb1..000000000 --- a/beluga/Beluga_parser/Located_token/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Located_token (beluga.Beluga_parser.Located_token)

Module Beluga_parser.Located_token

Lexer tokens annotated with locations.

type token = Token.t
type location = Beluga_syntax.Location.t
type t = private {
  1. location : location;
  2. token : token;
}

Constructors

val make : location:location -> token:token -> t

Destructors

val location : t -> location
val token : t -> token
diff --git a/beluga/Beluga_parser/Make/Disambiguation/Entry/index.html b/beluga/Beluga_parser/Make/Disambiguation/Entry/index.html deleted file mode 100644 index 470864377..000000000 --- a/beluga/Beluga_parser/Make/Disambiguation/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga_parser.Make.Disambiguation.Entry)

Module Disambiguation.Entry

val is_lf_variable : t -> Stdlib.Bool.t
val is_meta_variable : t -> Stdlib.Bool.t
val is_parameter_variable : t -> Stdlib.Bool.t
val is_substitution_variable : t -> Stdlib.Bool.t
val is_context_variable : t -> Stdlib.Bool.t
val is_computation_variable : t -> Stdlib.Bool.t
val is_variable : t -> Stdlib.Bool.t
val is_lf_type_constant : t -> Stdlib.Bool.t
val is_lf_term_constant : t -> Stdlib.Bool.t
val is_schema_constant : t -> Stdlib.Bool.t
val is_computation_inductive_type_constant : t -> Stdlib.Bool.t
val is_computation_stratified_type_constant : t -> Stdlib.Bool.t
val is_computation_coinductive_type_constant : t -> Stdlib.Bool.t
val is_computation_abbreviation_type_constant : t -> Stdlib.Bool.t
val is_computation_term_constructor : t -> Stdlib.Bool.t
val is_computation_term_destructor : t -> Stdlib.Bool.t
val is_program_constant : t -> Stdlib.Bool.t
val is_module : t -> Stdlib.Bool.t
diff --git a/beluga/Beluga_parser/Make/Disambiguation/index.html b/beluga/Beluga_parser/Make/Disambiguation/index.html deleted file mode 100644 index e46e48652..000000000 --- a/beluga/Beluga_parser/Make/Disambiguation/index.html +++ /dev/null @@ -1,374 +0,0 @@ - -Disambiguation (beluga.Beluga_parser.Make.Disambiguation)

Module Make.Disambiguation

module Entry : sig ... end
val add_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_free_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_free_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b
val with_scope : state -> (state -> 'a) -> 'a
val with_parent_scope : state -> (state -> 'a) -> 'a
val with_bindings_checkpoint : state -> (state -> 'a) -> 'a
val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_program_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
exception Unbound_identifier of Beluga_syntax.Syncom.Identifier.t
exception Unbound_qualified_identifier of Beluga_syntax.Syncom.Qualified_identifier.t
exception Unbound_namespace of Beluga_syntax.Syncom.Qualified_identifier.t
val lookup_toplevel : state -> Beluga_syntax.Syncom.Identifier.t -> Entry.t
type maximum_lookup_result = - Make_disambiguation(Disambiguation_state).maximum_lookup_result = -
  1. | Unbound of {
    1. segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  2. | Partially_bound of {
    1. leading_segments : Beluga_syntax.Syncom.Identifier.t Support.List.t;
    2. segment : Beluga_syntax.Syncom.Identifier.t;
    3. entry : Entry.t;
    4. trailing_segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  3. | Bound of {
    1. entry : Entry.t;
    }
val actual_binding_exn : - Beluga_syntax.Syncom.Qualified_identifier.t -> - Entry.t -> - exn
val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t
val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t
val get_default_precedence : state -> Support.Int.t
val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t
val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val apply_postponed_fixity_pragmas : state -> unit
val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val disambiguate_lf_kind : state -> Synprs.lf_object -> Synext.lf_kind
val disambiguate_lf_typ : state -> Synprs.lf_object -> Synext.lf_typ
val disambiguate_lf_term : state -> Synprs.lf_object -> Synext.lf_term
val disambiguate_clf_typ : state -> Synprs.clf_object -> Synext.clf_typ
val disambiguate_clf_term : state -> Synprs.clf_object -> Synext.clf_term
val disambiguate_clf_substitution : - state -> - Synprs.clf_context_object -> - Synext.clf_substitution
val with_disambiguated_clf_context : - state -> - Synprs.clf_context_object -> - (state -> Synext.clf_context -> 'a) -> - 'a
val disambiguate_clf_term_pattern : - state -> - Synprs.clf_object -> - Synext.clf_term_pattern
val disambiguate_clf_substitution_pattern : - state -> - Synprs.clf_context_object -> - Synext.clf_substitution_pattern
val with_disambiguated_clf_context_pattern : - state -> - Synprs.clf_context_object -> - (state -> Synext.clf_context_pattern -> 'a) -> - 'a
val disambiguate_clf_context_pattern : - state -> - Synprs.clf_context_object -> - Synext.clf_context_pattern
val disambiguate_meta_typ : state -> Synprs.meta_thing -> Synext.meta_typ
val disambiguate_meta_object : state -> Synprs.meta_thing -> Synext.meta_object
val disambiguate_meta_pattern : - state -> - Synprs.meta_thing -> - Beluga_syntax.Synext.Meta.Pattern.t
val disambiguate_schema : state -> Synprs.schema_object -> Synext.schema
val with_disambiguated_meta_context : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
val with_disambiguated_meta_context_pattern : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
val disambiguate_comp_kind : - state -> - Synprs.comp_sort_object -> - Synext.comp_kind
val disambiguate_comp_typ : state -> Synprs.comp_sort_object -> Synext.comp_typ
val disambiguate_comp_expression : - state -> - Synprs.comp_expression_object -> - Synext.comp_expression
val disambiguate_comp_pattern : - state -> - Synprs.comp_pattern_object -> - Synext.comp_pattern
val disambiguate_comp_copattern : - state -> - Synprs.comp_copattern_object Support.List1.t -> - Synext.comp_copattern
val with_disambiguated_comp_context : - state -> - Synprs.comp_context_object -> - (state -> Synext.comp_context -> 'a) -> - 'a
val disambiguate_harpoon_proof : - state -> - Synprs.harpoon_proof -> - Synext.harpoon_proof
val with_disambiguated_harpoon_command : - state -> - Synprs.harpoon_command -> - (state -> Synext.harpoon_command -> 'a) -> - 'a
val disambiguate_harpoon_directive : - state -> - Synprs.harpoon_directive -> - Synext.harpoon_directive
val disambiguate_harpoon_split_branch : - state -> - Synprs.harpoon_split_branch -> - Synext.harpoon_split_branch
val disambiguate_harpoon_suffices_branch : - state -> - Synprs.harpoon_suffices_branch -> - Synext.harpoon_suffices_branch
val disambiguate_harpoon_hypothetical : - state -> - Synprs.harpoon_hypothetical -> - Synext.harpoon_hypothetical
val disambiguate_harpoon_repl_command : - state -> - Synprs.harpoon_repl_command -> - Synext.harpoon_repl_command
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t
val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t
val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t
val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t
val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val disambiguate_pragma : - state -> - Synprs.signature_pragma -> - Synext.signature_pragma
val disambiguate_global_pragma : - state -> - Synprs.signature_global_pragma -> - Synext.signature_global_pragma
val disambiguate_totality_declaration : - state -> - Synprs.signature_totality_declaration -> - Synext.signature_totality_declaration
val disambiguate_declaration : - state -> - Synprs.signature_declaration -> - Synext.signature_declaration
val disambiguate_signature_file : - state -> - Synprs.signature_file -> - Synext.signature_file
val disambiguate_signature : state -> Synprs.signature -> Synext.signature
diff --git a/beluga/Beluga_parser/Make/Parsing/index.html b/beluga/Beluga_parser/Make/Parsing/index.html deleted file mode 100644 index 6f6487931..000000000 --- a/beluga/Beluga_parser/Make/Parsing/index.html +++ /dev/null @@ -1,125 +0,0 @@ - -Parsing (beluga.Beluga_parser.Make.Parsing)

Module Make.Parsing

type state = Parser_state.state
val get : state -> state * state
val put : state -> state -> state * unit
val modify : (state -> state) -> state -> state * unit
val eval : (state -> state * 'a) -> state -> 'a0
val exec : (state -> state * 'a) -> state -> state
val traverse_tuple2 : - ('a1 -> state -> state * 'b1) -> - ('a2 -> state -> state * 'b2) -> - ('a1 * 'a2) -> - state -> - state * ('b10 * 'b20)
val traverse_tuple3 : - ('a1 -> state -> state * 'b1) -> - ('a2 -> state -> state * 'b2) -> - ('a3 -> state -> state * 'b3) -> - ('a1 * 'a2 * 'a3) -> - state -> - state * ('b10 * 'b20 * 'b30)
val traverse_list : - ('a -> state -> state * 'b) -> - 'a Support.List.t -> - state -> - state * 'b0 Support.List.t
val traverse_list1 : - ('a -> state -> state * 'b) -> - 'a Support.List1.t -> - state -> - state * 'b0 Support.List1.t
val traverse_list2 : - ('a -> state -> state * 'b) -> - 'a Support.List2.t -> - state -> - state * 'b0 Support.List2.t
val traverse_list_void : - ('a -> state -> state * 'b) -> - 'a Support.List.t -> - state -> - state * Stdlib.Unit.t
val traverse_list1_void : - ('a -> state -> state * 'b) -> - 'a Support.List1.t -> - state -> - state * Stdlib.Unit.t
val traverse_list2_void : - ('a -> state -> state * 'b) -> - 'a Support.List2.t -> - state -> - state * Stdlib.Unit.t
val traverse_reverse_list : - ('a -> state -> state * 'b) -> - 'a Support.List.t -> - state -> - state * 'b0 Support.List.t
val traverse_reverse_list1 : - ('a -> state -> state * 'b) -> - 'a Support.List1.t -> - state -> - state * 'b0 Support.List1.t
val traverse_reverse_list2 : - ('a -> state -> state * 'b) -> - 'a Support.List2.t -> - state -> - state * 'b0 Support.List2.t
val traverse_reverse_list_void : - ('a -> state -> state * 'b) -> - 'a Support.List.t -> - state -> - state * Stdlib.Unit.t
val traverse_reverse_list1_void : - ('a -> state -> state * 'b) -> - 'a Support.List1.t -> - state -> - state * Stdlib.Unit.t
val traverse_reverse_list2_void : - ('a -> state -> state * 'b) -> - 'a Support.List2.t -> - state -> - state * Stdlib.Unit.t
val traverse_option : - ('a -> state -> state * 'b) -> - 'a Support.Option.t -> - state -> - state * 'b0 Support.Option.t
val traverse_option_void : - ('a -> state -> state * 'b) -> - 'a Support.Option.t -> - state -> - state * Stdlib.Unit.t
val seq_list : - (state -> state * 'a) Support.List.t -> - state -> - state * 'a0 Support.List.t
val seq_list1 : - (state -> state * 'a) Support.List1.t -> - state -> - state * 'a0 Support.List1.t
val seq_list_void : (state -> state * unit) list -> state -> state * unit
val peek : state -> state * Located_token.t option
val observe : state -> state * Located_token.t option
val accept : state -> state * unit
val insert : Located_token.t -> state -> state * unit
val next_location : state -> state * Beluga_syntax.Location.t option
val previous_location : state -> state * Beluga_syntax.Location.t option
val enable_backtracking : state -> state * unit
val disable_backtracking : state -> state * unit
val can_backtrack : state -> state * bool
val allow_backtracking_on_error : - (state -> state * ('a, 'e) Stdlib.result) -> - state -> - state * ('a, 'e) Stdlib.result
val with_checkpoint : - (state -> state * ('a, 'e) Stdlib.result) -> - state -> - state - * ('a, [> `Backtracked of 'e | `Did_not_backtrack of 'e ]) Stdlib.result
val lf_kind : state -> state * (Synprs.lf_object, exn) Stdlib.result
val lf_typ : state -> state * (Synprs.lf_object, exn) Stdlib.result
val lf_term : state -> state * (Synprs.lf_object, exn) Stdlib.result
val clf_typ : state -> state * (Synprs.clf_object, exn) Stdlib.result
val clf_term : state -> state * (Synprs.clf_object, exn) Stdlib.result
val clf_term_pattern : state -> state * (Synprs.clf_object, exn) Stdlib.result
val clf_context : - state -> - state * (Synprs.clf_context_object, exn) Stdlib.result
val clf_substitution : - state -> - state * (Synprs.clf_context_object, exn) Stdlib.result
val schema : state -> state * (Synprs.schema_object, exn) Stdlib.result
val meta_type : state -> state * (Synprs.meta_thing, exn) Stdlib.result
val meta_object : state -> state * (Synprs.meta_thing, exn) Stdlib.result
val meta_pattern : state -> state * (Synprs.meta_thing, exn) Stdlib.result
val meta_context : - state -> - state * (Synprs.meta_context_object, exn) Stdlib.result
val comp_kind : state -> state * (Synprs.comp_sort_object, exn) Stdlib.result
val comp_typ : state -> state * (Synprs.comp_sort_object, exn) Stdlib.result
val comp_pattern : - state -> - state * (Synprs.comp_pattern_object, exn) Stdlib.result
val comp_copattern : - state -> - state * (Synprs.comp_copattern_object, exn) Stdlib.result
val comp_expression : - state -> - state * (Synprs.comp_expression_object, exn) Stdlib.result
val comp_context : - state -> - state * (Synprs.comp_context_object, exn) Stdlib.result
val harpoon_proof : state -> state * (Synprs.harpoon_proof, exn) Stdlib.result
val interactive_harpoon_command : - state -> - state * (Synprs.harpoon_repl_command, exn) Stdlib.result
type token = Parser_state.token
type location = Parser_state.location
type !'a t = state -> state * ('a, exn) Stdlib.result
type !'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
val return : 'a -> 'a t
val bind : ('a -> 'b t) -> 'a t -> 'b t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t
val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t
val let* : 'a t -> ('a -> 'b t) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
val map : ('a -> 'b) -> 'a t -> 'b t
val ($>) : 'a t -> ('a -> 'b) -> 'b t
val let+ : 'a t -> ('a -> 'b) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val ap : 'a t -> ('a -> 'b) t -> 'b t
val (<&>) : ('a -> 'b) t -> 'a t -> 'b t
val ap_first : 'b t -> 'a t -> 'a t
val (<&) : 'a t -> 'b t -> 'a t
val ap_second : 'b t -> 'a t -> 'b t
val (&>) : 'a t -> 'b t -> 'b t
val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t
val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t
val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t
val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t
val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t
val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t
val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t
val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t
val replicate : int -> 'a t -> 'a list t
val run : 'a t -> state -> state * ('a, exn) Stdlib.result
val run_exn : 'a t -> state -> state * 'a
val eval_exn : 'a t -> state -> 'a
val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t
val fail : exn -> 'a t
val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t
val fail_at_next_location : exn -> 'a t
val fail_at_previous_location : exn -> 'a t
val labelled : string -> 'a t -> 'a t
val span : 'a t -> (location * 'a) t
val only : 'a t -> 'a t
val maybe : 'a t -> 'a option t
val void : 'a t -> unit t
val many : 'a t -> 'a list t
val some : 'a t -> 'a Support.List1.t t
val sep_by0 : sep:unit t -> 'a t -> 'a list t
val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t
val trying : 'a t -> 'a t
val choice : 'a t Support.List.t -> 'a t
val alt : 'a t -> 'a t -> 'a t
val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t
val eoi : unit t
val insert_token : token -> unit t
val keyword : string -> unit t
val integer : int t
val dot_integer : int t
val pragma : string -> unit t
val string_literal : string t
val dot : unit t
val dots : unit t
val comma : unit t
val colon : unit t
val semicolon : unit t
val slash : unit t
val equals : unit t
val lambda : unit t
val hat : unit t
val underscore : unit t
val pipe : unit t
val forward_arrow : unit t
val backward_arrow : unit t
val thick_forward_arrow : unit t
val plus : unit t
val star : unit t
val hash : unit t
val double_colon : unit t
val turnstile : unit t
val turnstile_hash : unit t
val left_parenthesis : unit t
val right_parenthesis : unit t
val left_brace : unit t
val right_brace : unit t
val left_brack : unit t
val right_brack : unit t
val left_angle : unit t
val right_angle : unit t
val parens : 'a t -> 'a t
val braces : 'a t -> 'a t
val bracks : 'a t -> 'a t
val angles : 'a t -> 'a t
val opt_parens : 'a t -> 'a t
val opt_braces : 'a t -> 'a t
val opt_bracks : 'a t -> 'a t
val opt_angles : 'a t -> 'a t
val hash_parens : 'a t -> 'a t
val dollar_parens : 'a t -> 'a t
val hash_bracks : 'a t -> 'a t
val dollar_bracks : 'a t -> 'a t
val identifier : Beluga_syntax.Identifier.t t
val dot_identifier : Beluga_syntax.Identifier.t t
val hash_identifier : Beluga_syntax.Identifier.t t
val dollar_identifier : Beluga_syntax.Identifier.t t
val omittable_identifier : Beluga_syntax.Identifier.t option t
val omittable_hash_identifier : Beluga_syntax.Identifier.t option t
val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t
val qualified_identifier : Beluga_syntax.Qualified_identifier.t t
val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t
val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t
val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t
val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t
val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser
val block_comment : (Beluga_syntax.Location.t * string) t
val signature_file : Synprs.signature_file t
val signature_global_pragma : Synprs.signature_global_pragma t
val signature_entry : Synprs.signature_entry t
val signature_declaration : Synprs.signature_declaration t
val trust_totality_declaration : Synprs.signature_totality_declaration t
val named_totality_declaration : Synprs.signature_totality_declaration t
val numeric_totality_declaration : Synprs.signature_totality_declaration t
val totality_declaration : Synprs.signature_totality_declaration t
diff --git a/beluga/Beluga_parser/Make/argument-1-Parser_state/index.html b/beluga/Beluga_parser/Make/argument-1-Parser_state/index.html deleted file mode 100644 index c693fdd41..000000000 --- a/beluga/Beluga_parser/Make/argument-1-Parser_state/index.html +++ /dev/null @@ -1,58 +0,0 @@ - -Parser_state (beluga.Beluga_parser.Make.Parser_state)

Parameter Make.Parser_state

include Support.State.STATE
type state

The type of states inside the monad.

type 'a t = state -> state * 'a
val get : state t

Return the state from the internals of the monad.

val put : state -> unit t

Replace the state inside the monad.

val modify : (state -> state) -> unit t

Modify the state inside the monad.

val run : 'a t -> state -> state * 'a

run a init runs a with initial state init, returning (final, v) where final is the final state and v is the output.

val eval : 'a t -> state -> 'a

eval a init is run a init = (final, v), but outputs only v.

val exec : 'a t -> state -> state

exec a init is run a init = (final, v), but outputs only final.

Traversals

val traverse_tuple2 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a1 * 'a2) -> - ('b1 * 'b2) t
val traverse_tuple3 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a3 -> 'b3 t) -> - ('a1 * 'a2 * 'a3) -> - ('b1 * 'b2 * 'b3) t
val traverse_list : ('a -> 'b t) -> 'a Support.List.t -> 'b Support.List.t t
val traverse_list1 : ('a -> 'b t) -> 'a Support.List1.t -> 'b Support.List1.t t
val traverse_list2 : ('a -> 'b t) -> 'a Support.List2.t -> 'b Support.List2.t t
val traverse_list_void : ('a -> _ t) -> 'a Support.List.t -> Stdlib.Unit.t t
val traverse_list1_void : ('a -> _ t) -> 'a Support.List1.t -> Stdlib.Unit.t t
val traverse_list2_void : ('a -> _ t) -> 'a Support.List2.t -> Stdlib.Unit.t t
val traverse_reverse_list : - ('a -> 'b t) -> - 'a Support.List.t -> - 'b Support.List.t t
val traverse_reverse_list1 : - ('a -> 'b t) -> - 'a Support.List1.t -> - 'b Support.List1.t t
val traverse_reverse_list2 : - ('a -> 'b t) -> - 'a Support.List2.t -> - 'b Support.List2.t t
val traverse_reverse_list_void : - ('a -> _ t) -> - 'a Support.List.t -> - Stdlib.Unit.t t
val traverse_reverse_list1_void : - ('a -> _ t) -> - 'a Support.List1.t -> - Stdlib.Unit.t t
val traverse_reverse_list2_void : - ('a -> _ t) -> - 'a Support.List2.t -> - Stdlib.Unit.t t
val traverse_option : - ('a -> 'b t) -> - 'a Support.Option.t -> - 'b Support.Option.t t
val traverse_option_void : - ('a -> _ t) -> - 'a Support.Option.t -> - Stdlib.Unit.t t
val seq_list : 'a t Support.List.t -> 'a Support.List.t t
val seq_list1 : 'a t Support.List1.t -> 'a Support.List1.t t
val seq_list_void : unit t list -> unit t

seq_list_void [x1; x2; ...; xn] performs x1, x2, ..., xn in order.

Instances

include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

Lexing

type token = Located_token.t

The type of token in the finite stream being parsed.

val peek : token option t

peek state is (state', token_opt) where token_opt is the next unconsumed token in state. If token_opt = Option.None, then the end of the input stream was reached. Otherwise, token_opt = Option.Some token. The token is not consumed, meaning that state' is not advanced to the next token in the stream.

val observe : token option t

observed state is like peek state, but the observed token is consumed.

val accept : unit t

accept state is (state', ()) where state' is derived from state by consuming the next token in the input stream. This effectively observes and discards the next token in state.

val insert : token -> unit t

insert token state is (state', ()) where state' is derived from state by inserting token at the beginning of the input stream. That is, token is the next token in state'.

Locations

type location = Beluga_syntax.Location.t

The type of locations with which input tokens are annotated.

val next_location : location option t

next_location state is (state', next_location_opt) where next_location_opt is the location of the next token in state. This does not advance the input stream. next_location_opt = Option.None at the end of the input stream.

val previous_location : location option t

previous_location state is (state', previous_location_opt) where previous_location_opt is the location of the last token in state to have been consumed. previous_location_opt = Option.None at the beginning of the input stream.

Backtracking

val enable_backtracking : unit t

enable_backtracking state is (state', ()) where state' has backtracking enabled.

val disable_backtracking : unit t

enable_backtracking state is (state', ()) where state' has backtracking disabled.

val can_backtrack : bool t

can_backtrack state is (state', flag) where flag = true indicates that state and state' allow backtracking out of an erroneous result, and flag = false otherwise.

val allow_backtracking_on_error : - ('a, 'e) Stdlib.result t -> - ('a, 'e) Stdlib.result t

allow_backtracking_on_error m is m' such that m' state is (state', x) with backtracking enabled in state' if x = Result.Error cause. That is, this combinator enables backtracking if m' produces an error. Backtracking then needs to be manually disabled afterwards.

val with_checkpoint : - ('a, 'e) Stdlib.result t -> - ('a, [> `Backtracked of 'e | `Did_not_backtrack of 'e ]) Stdlib.result t

with_checkpoint m is m' such that m' state marks the current state, performs m, then either

  • discards the marked state if m state = (state', Result.Ok x),
  • backtracks to the marked state if m state = (state', Result.Error cause).

The output error from m is additionally annotated with whether backtracking occurred.

In the case of a parser m, backtracking can occur if backtracking is enabled with allow_backtracking_on_error, or if m did not consume any input.

diff --git a/beluga/Beluga_parser/Make/argument-2-Disambiguation_state/Entry/index.html b/beluga/Beluga_parser/Make/argument-2-Disambiguation_state/Entry/index.html deleted file mode 100644 index 7b5948966..000000000 --- a/beluga/Beluga_parser/Make/argument-2-Disambiguation_state/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga_parser.Make.Disambiguation_state.Entry)

Module Disambiguation_state.Entry

Recorded data on bindings in Beluga signatures.

type t

The type of entry.

val is_lf_variable : t -> Stdlib.Bool.t

is_lf_variable entry is true if and only if entry describes an LF variable.

val is_meta_variable : t -> Stdlib.Bool.t

is_meta_variable entry is true if entry describes a meta-variable or a contextual variable.

Contextual variables exist only because mlam-expressions ambiguously introduce either a meta-variable, a parameter variable, a substitution variable or a context variable.

val is_parameter_variable : t -> Stdlib.Bool.t

is_parameter_variable is like is_meta_variable, but for entries describing parameter variables.

val is_substitution_variable : t -> Stdlib.Bool.t

is_substitution_variable is like is_meta_variable, but for entries describing parameter variables.

val is_context_variable : t -> Stdlib.Bool.t

is_context_variable is like is_meta_variable, but for entries describing context variables.

val is_computation_variable : t -> Stdlib.Bool.t

is_computation_variable entry is true if and only if entry describes a computation-level variable.

val is_variable : t -> Stdlib.Bool.t

is_variable entry is true if and only if entry describes an LF variable, a meta-level variable, or a computation-level variable.

This is used to discern between the following two cases when disambiguating identifiers in patterns:

  • The case where an exception should be raised because the identifier is a bound variable of the wrong sort.
  • The case where the identifier should be a free variable shadowing a constant.
val is_lf_type_constant : t -> Stdlib.Bool.t

is_lf_type_constant entry is true if and only if entry describes an LF type-level constant.

val is_lf_term_constant : t -> Stdlib.Bool.t

is_lf_term_constant is like is_lf_type_constant, but for entries describing LF term-level constants.

val is_schema_constant : t -> Stdlib.Bool.t

is_schema_constant is like is_lf_type_constant, but for entries describing context schemas.

val is_computation_inductive_type_constant : t -> Stdlib.Bool.t

is_computation_inductive_type_constant is like is_lf_type_constant, but for entries describing inductive computation-level type constants.

val is_computation_stratified_type_constant : t -> Stdlib.Bool.t

is_computation_stratified_type_constant is like is_lf_type_constant, but for entries describing stratified computation-level type constants.

val is_computation_coinductive_type_constant : t -> Stdlib.Bool.t

is_computation_coinductive_type_constant is like is_lf_type_constant, but for entries describing coinductive computation-level type constants.

val is_computation_abbreviation_type_constant : t -> Stdlib.Bool.t

is_computation_abbreviation_type_constant is like is_lf_type_constant, but for entries describing computation-level type constant abbreviations (introduced by the Beluga keyword typedef).

val is_computation_term_constructor : t -> Stdlib.Bool.t

is_computation_term_constructor is like is_lf_type_constant, but for entries describing computation-level constructors.

val is_computation_term_destructor : t -> Stdlib.Bool.t

is_computation_term_destructor is like is_lf_type_constant, but for entries describing computation-level destructors.

val is_program_constant : t -> Stdlib.Bool.t

is_program_constant is like is_lf_type_constant, but for entries describing computation-level programs (introduced by the Beluga keyword rec or val).

val is_module : t -> Stdlib.Bool.t

is_module is like is_lf_type_constant, but for entries describing modules.

diff --git a/beluga/Beluga_parser/Make/argument-2-Disambiguation_state/index.html b/beluga/Beluga_parser/Make/argument-2-Disambiguation_state/index.html deleted file mode 100644 index b8d3e896e..000000000 --- a/beluga/Beluga_parser/Make/argument-2-Disambiguation_state/index.html +++ /dev/null @@ -1,284 +0,0 @@ - -Disambiguation_state (beluga.Beluga_parser.Make.Disambiguation_state)

Parameter Make.Disambiguation_state

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
module Entry : Disambiguation_state.ENTRY

Recorded data on bindings in Beluga signatures.

Variables

val add_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_variable state ?location identifier adds identifier as a bound LF variable, with binding site location. If location = Option.None, then identifier's location is used instead.

This is mostly used for testing. For locally binding an LF variable, see with_bound_lf_variable.

val add_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_meta_variable is like add_lf_variable, but the identifier is added as a bound meta-variable.

val add_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_parameter_variable is like add_lf_variable, but the identifier is added as a bound parameter variable (those variables prefixed by '#' like "#p").

val add_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_substitution_variable is like add_lf_variable, but the identifier is added as a bound substitution variable (those variables prefixed by '$' like "$S").

val add_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_context_variable is like add_lf_variable, but the identifier is added as a bound context variable.

val add_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_contextual_variable is like add_lf_variable, but the identifier is added as a bound contextual variable, meaning that it is ambiguously bound as either a meta, parameter, substitution or context variable.

val add_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_variable is like add_lf_variable, but the identifier is added as a bound computation-level variable.

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state ?location identifier is add_lf_variable state ?location identifier, with the additional behaviour of adding identifier as an inner pattern bound identifier and as a free variable during pattern disambiguation. This means that identifier can subsequently be looked up as a bound LF variable during pattern disambiguation. This effectively allows free LF variables to appear multiple times (non-linearly) in patterns.

See with_free_variables_as_pattern_variables for the handler for converting free variables in patterns to binders for use as bound variables in expressions.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free meta-variable.

val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free parameter variable.

val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free substitution variable.

val add_free_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free context variable.

val add_free_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_computation_variable state ?location identifier adds identifier to state as a free variable during pattern disambiguation. This differs from add_free_lf_variable in that free computation-level variables in patterns do not have implicit binders (because they are not part of the meta-context), and hence must appear only once (linearly) in the overall pattern.

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state ?location identifier m is the result of running m in the local state derived from state having identifier as a bound LF variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

For example, the disambiguation of an LF term-level lambda-abstraction \x. m requires that the parameter x is locally added in scope when disambiguating the body m. This is achieved like this:

with_bound_lf_variable state x (fun state ->
-    disambiguate_lf_term state m)
val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_meta_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound meta-variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound contextual variable. This is different from with_bound_meta_variable, with_bound_parameter_variable, with_bound_substitution_variable and with_bound_context_variable in that it is unknown whether identifier should be a meta-variable, parameter variable, substitution variable or context variable. This is used in particular for mlam expressions.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_computation_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound computation-level variable.

val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_meta_variable state ?location identifier m is like with_bound_meta_variable state ?location identifier m except that identifier is also treated as a free variable so that in with_free_variables_as_pattern_variables it can be treated as a pattern variable usable in the expression.

This is used for meta-variables introduced in the meta-context of a pattern during case analysis. Those variables are considered bound in both the pattern and expression.

For example, B as below is one such bound pattern meta-variable, and appears in scope for ?.

case x of
-| { B : [g |- o] } [g |- impi \u. D] => ?
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_parameter_variable is like with_bound_pattern_meta_variable, but for a parameter variable introduced in the meta-context of a pattern.

val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_substitution_variable is like with_bound_pattern_meta_variable, but for a substitution variable introduced in the meta-context of a pattern.

val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_context_variable is like with_bound_pattern_meta_variable, but for a context variable introduced in the meta-context of a pattern.

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression state is the result of running expression with the free variables added in pattern as bound variables. This is used to disambiguate expression with bound variables arising from free variables in pattern.

  1. pattern is run with respect to state while keeping track of free variables. Variables bound outside the pattern are ignored in lookups.
  2. expression is run with respect to state with the addition of the tracked free variables from patterns as bound variables.

Lookups performed in pattern are more complex. The variables in state count as being unbound, but the variables with binders in the pattern count as bound. Binders in a pattern can be user-specified, or to be reconstructed during abstraction.

A variable is specifically inner bound if it is introduced explicitly by a lambda abstraction or the pattern meta-context, as an explicit or implicit parameter. Free meta-level variables are reconstructed inner bound. For instance, assuming s and ctx are constants:

  • In the pattern (x, x), both occurrences of x are pattern variables, and that pattern is not linear.
  • In the pattern {M : [ |- nat]} [ |- s M], M as introduced in the meta-context is a pattern variable, and M is an inner pattern-bound identifier in s M, so that pattern is linear.
  • In the pattern [ |- \x. s x], there are no pattern variables.
  • In the pattern ([g |- s M], [g |- s M]), g and M are pattern variables in the left projection of the tuple pattern, and inner pattern-bound in the right projection of the tuple pattern. This is because the pattern is reconstructed as {g : ctx} {M : [g |- nat]} ([g |- s M], [g |- s M]).
val with_scope : state -> (state -> 'a) -> 'a

with_scope state m runs m in a nested bindings scope that is discarded afterwards.

val with_parent_scope : state -> (state -> 'a) -> 'a

with_parent_scope state m runs m while ignoring the topmost scope.

This is used for the disambiguation of Harpoon proof scripts because Harpoon hypotheticals are already serialized with all the identifiers in the meta-level and computation-level contexts of the proof.

val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used for backtracking when disambiguating old-style LF type-level and term-level declarations (i.e., x : X where X may be an LF kind or an LF type).

This is also used in REPLs to safely run parsing functions and recover the state in case of a raised exception during disambiguation.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Constants

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_type_constant state ?location ?arity identifier adds identifier as a bound LF type-level constant.

In the disambiguation of a module's declaration, this also adds the constant as one of the module's declarations.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_term_constant is like add_lf_type_constant, but for LF term-level constants.

val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_schema_constant is like add_lf_type_constant, but for schema constants.

val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_inductive_computation_type_constant is like add_lf_type_constant, but for inductive computation-level type constants.

val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_stratified_computation_type_constant is like add_lf_type_constant, but for stratified computation-level type constants.

val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_coinductive_computation_type_constant is like add_lf_type_constant, but for coinductive computation-level type constants.

val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation_computation_type_constant is like add_lf_type_constant, but for computation-level abbreviation type constants.

val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_constructor is like add_lf_type_constant, but for computation-level term constructors.

val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_destructor is like add_lf_type_constant, but for computation-level term destructors.

val add_program_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_program_constant is like add_lf_type_constant, but for computation-level program constants.

val add_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

add_module state ?location identifier m is the result of running m in a module disambiguation state, whereby added constants are kept track of as declarations in the module having identifier.

Lookups

exception Unbound_identifier of Beluga_syntax.Syncom.Identifier.t

Unbound_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is caught whenever a variable lookup fails and identifier can be disambiguated as a free variable.

exception Unbound_qualified_identifier of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_qualified_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is unrecoverable, but is caught during disambiguation to provide better error messages.

exception Unbound_namespace of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_namespace namespace_identifier is raised if a qualified identifier could not be looked up in a disambiguation state because the namespace with identifier namespace_identifier is unbound.

val lookup_toplevel : state -> Beluga_syntax.Syncom.Identifier.t -> Entry.t

lookup_toplevel state identifier is entry if identifier resolves to entry in state. If identifier is unbound in state, then Unbound_identifier identifier is raised.

lookup state identifier is entry if identifier resolves to entry in state. Otherwise:

  • Unbound_identifier ident) is raised if the first segment ident in identifier is unbound.
  • Unbound_namespace namespace_identifier is raised if a segment in identifier other than the first or last is unbound.
  • Unbound_qualified_identifier identifier is raised if the last segment in identifier is unbound.
type maximum_lookup_result =
  1. | Unbound of {
    1. segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  2. | Partially_bound of {
    1. leading_segments : Beluga_syntax.Syncom.Identifier.t Support.List.t;
    2. segment : Beluga_syntax.Syncom.Identifier.t;
    3. entry : Entry.t;
    4. trailing_segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  3. | Bound of {
    1. entry : Entry.t;
    }

maximum_lookup state segments is either:

  • Unbound { segments } if the first segment in segments is unbound in state.
  • Partially_bound { leading_segments; segment; entry; trailing_segments } if the qualified identifier with namespaces leading_segments and name segment is bound to entry in state.
  • Bound { identifier; entry } if segments form a qualified identifier bound to entry in state.
val actual_binding_exn : - Beluga_syntax.Syncom.Qualified_identifier.t -> - Entry.t -> - exn

actual_binding_exn identifier entry is an exception reporting what sort of entry is bound at identifier. The exception is annotated with the entry's binding location.

Signature Operations

val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state module_identifier adds the exported constants from the module bound to module_identifier as toplevel entries in state. If module_identifier is unbound in state, then an exception is raised.

val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t

get_default_associativity state is the associativity to use for infix operators defined by the user using a pragma, without specifying the infix operator's associativity.

val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state default_associativity sets default_associativity as the associativity to return from get_default_associativity.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the precedence to use for operators defined by the user using a pragma, without specifying the operator's precedence.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state default_precedence sets default_precedence as the precedence to return from get_default_precedence.

val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence identifier adds a prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity identifier adds an infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence identifier adds a postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state identifier is Option.Some operator if identifier is bound to an operator with descriptor operator in state, and Option.None otherwise.

This is used to resolve operators in the disambiguation of applications, which are parsed as lists of expressions.

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_module_abbreviation state ?location module_identifier abbreviation adds the synonym abbreviation for the module bound to identifier in state.

An exception is raised if module_identifier is unbound in state, or if module_identifier is not bound to a module in state.

diff --git a/beluga/Beluga_parser/Make/index.html b/beluga/Beluga_parser/Make/index.html deleted file mode 100644 index d12f11fe3..000000000 --- a/beluga/Beluga_parser/Make/index.html +++ /dev/null @@ -1,63 +0,0 @@ - -Make (beluga.Beluga_parser.Make)

Module Beluga_parser.Make

Parameters

Signature

module Parsing : sig ... end
module Disambiguation : sig ... end
include Support.State.STATE
type state

The type of states inside the monad.

type 'a t = state -> state * 'a
val get : state t

Return the state from the internals of the monad.

val put : state -> unit t

Replace the state inside the monad.

val modify : (state -> state) -> unit t

Modify the state inside the monad.

val run : 'a t -> state -> state * 'a

run a init runs a with initial state init, returning (final, v) where final is the final state and v is the output.

val eval : 'a t -> state -> 'a

eval a init is run a init = (final, v), but outputs only v.

val exec : 'a t -> state -> state

exec a init is run a init = (final, v), but outputs only final.

Traversals

val traverse_tuple2 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a1 * 'a2) -> - ('b1 * 'b2) t
val traverse_tuple3 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a3 -> 'b3 t) -> - ('a1 * 'a2 * 'a3) -> - ('b1 * 'b2 * 'b3) t
val traverse_list : ('a -> 'b t) -> 'a Support.List.t -> 'b Support.List.t t
val traverse_list1 : ('a -> 'b t) -> 'a Support.List1.t -> 'b Support.List1.t t
val traverse_list2 : ('a -> 'b t) -> 'a Support.List2.t -> 'b Support.List2.t t
val traverse_list_void : ('a -> _ t) -> 'a Support.List.t -> Stdlib.Unit.t t
val traverse_list1_void : ('a -> _ t) -> 'a Support.List1.t -> Stdlib.Unit.t t
val traverse_list2_void : ('a -> _ t) -> 'a Support.List2.t -> Stdlib.Unit.t t
val traverse_reverse_list : - ('a -> 'b t) -> - 'a Support.List.t -> - 'b Support.List.t t
val traverse_reverse_list1 : - ('a -> 'b t) -> - 'a Support.List1.t -> - 'b Support.List1.t t
val traverse_reverse_list2 : - ('a -> 'b t) -> - 'a Support.List2.t -> - 'b Support.List2.t t
val traverse_reverse_list_void : - ('a -> _ t) -> - 'a Support.List.t -> - Stdlib.Unit.t t
val traverse_reverse_list1_void : - ('a -> _ t) -> - 'a Support.List1.t -> - Stdlib.Unit.t t
val traverse_reverse_list2_void : - ('a -> _ t) -> - 'a Support.List2.t -> - Stdlib.Unit.t t
val traverse_option : - ('a -> 'b t) -> - 'a Support.Option.t -> - 'b Support.Option.t t
val traverse_option_void : - ('a -> _ t) -> - 'a Support.Option.t -> - Stdlib.Unit.t t
val seq_list : 'a t Support.List.t -> 'a Support.List.t t
val seq_list1 : 'a t Support.List1.t -> 'a Support.List1.t t
val seq_list_void : unit t list -> unit t

seq_list_void [x1; x2; ...; xn] performs x1, x2, ..., xn in order.

Instances

include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val make_state : - parser_state:Parser_state.state -> - disambiguation_state:Disambiguation_state.state -> - state
val set_parser_state : Parser_state.state -> Stdlib.Unit.t t
val get_parser_state : Parser_state.state t
val set_disambiguation_state : Disambiguation_state.state -> Stdlib.Unit.t t
val get_disambiguation_state : Disambiguation_state.state t
val parse_and_disambiguate : - parser:'a Parsing.t -> - disambiguator:(Disambiguation.state -> 'a -> 'b) -> - 'b t
diff --git a/beluga/Beluga_parser/Make_disambiguation/Entry/index.html b/beluga/Beluga_parser/Make_disambiguation/Entry/index.html deleted file mode 100644 index 5b69cb46b..000000000 --- a/beluga/Beluga_parser/Make_disambiguation/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga_parser.Make_disambiguation.Entry)

Module Make_disambiguation.Entry

Recorded data on bindings in Beluga signatures.

type t

The type of entry.

val is_lf_variable : t -> Stdlib.Bool.t

is_lf_variable entry is true if and only if entry describes an LF variable.

val is_meta_variable : t -> Stdlib.Bool.t

is_meta_variable entry is true if entry describes a meta-variable or a contextual variable.

Contextual variables exist only because mlam-expressions ambiguously introduce either a meta-variable, a parameter variable, a substitution variable or a context variable.

val is_parameter_variable : t -> Stdlib.Bool.t

is_parameter_variable is like is_meta_variable, but for entries describing parameter variables.

val is_substitution_variable : t -> Stdlib.Bool.t

is_substitution_variable is like is_meta_variable, but for entries describing parameter variables.

val is_context_variable : t -> Stdlib.Bool.t

is_context_variable is like is_meta_variable, but for entries describing context variables.

val is_computation_variable : t -> Stdlib.Bool.t

is_computation_variable entry is true if and only if entry describes a computation-level variable.

val is_variable : t -> Stdlib.Bool.t

is_variable entry is true if and only if entry describes an LF variable, a meta-level variable, or a computation-level variable.

This is used to discern between the following two cases when disambiguating identifiers in patterns:

  • The case where an exception should be raised because the identifier is a bound variable of the wrong sort.
  • The case where the identifier should be a free variable shadowing a constant.
val is_lf_type_constant : t -> Stdlib.Bool.t

is_lf_type_constant entry is true if and only if entry describes an LF type-level constant.

val is_lf_term_constant : t -> Stdlib.Bool.t

is_lf_term_constant is like is_lf_type_constant, but for entries describing LF term-level constants.

val is_schema_constant : t -> Stdlib.Bool.t

is_schema_constant is like is_lf_type_constant, but for entries describing context schemas.

val is_computation_inductive_type_constant : t -> Stdlib.Bool.t

is_computation_inductive_type_constant is like is_lf_type_constant, but for entries describing inductive computation-level type constants.

val is_computation_stratified_type_constant : t -> Stdlib.Bool.t

is_computation_stratified_type_constant is like is_lf_type_constant, but for entries describing stratified computation-level type constants.

val is_computation_coinductive_type_constant : t -> Stdlib.Bool.t

is_computation_coinductive_type_constant is like is_lf_type_constant, but for entries describing coinductive computation-level type constants.

val is_computation_abbreviation_type_constant : t -> Stdlib.Bool.t

is_computation_abbreviation_type_constant is like is_lf_type_constant, but for entries describing computation-level type constant abbreviations (introduced by the Beluga keyword typedef).

val is_computation_term_constructor : t -> Stdlib.Bool.t

is_computation_term_constructor is like is_lf_type_constant, but for entries describing computation-level constructors.

val is_computation_term_destructor : t -> Stdlib.Bool.t

is_computation_term_destructor is like is_lf_type_constant, but for entries describing computation-level destructors.

val is_program_constant : t -> Stdlib.Bool.t

is_program_constant is like is_lf_type_constant, but for entries describing computation-level programs (introduced by the Beluga keyword rec or val).

val is_module : t -> Stdlib.Bool.t

is_module is like is_lf_type_constant, but for entries describing modules.

diff --git a/beluga/Beluga_parser/Make_disambiguation/argument-1-Disambiguation_state/Entry/index.html b/beluga/Beluga_parser/Make_disambiguation/argument-1-Disambiguation_state/Entry/index.html deleted file mode 100644 index ac93124b8..000000000 --- a/beluga/Beluga_parser/Make_disambiguation/argument-1-Disambiguation_state/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga_parser.Make_disambiguation.Disambiguation_state.Entry)

Module Disambiguation_state.Entry

Recorded data on bindings in Beluga signatures.

type t

The type of entry.

val is_lf_variable : t -> Stdlib.Bool.t

is_lf_variable entry is true if and only if entry describes an LF variable.

val is_meta_variable : t -> Stdlib.Bool.t

is_meta_variable entry is true if entry describes a meta-variable or a contextual variable.

Contextual variables exist only because mlam-expressions ambiguously introduce either a meta-variable, a parameter variable, a substitution variable or a context variable.

val is_parameter_variable : t -> Stdlib.Bool.t

is_parameter_variable is like is_meta_variable, but for entries describing parameter variables.

val is_substitution_variable : t -> Stdlib.Bool.t

is_substitution_variable is like is_meta_variable, but for entries describing parameter variables.

val is_context_variable : t -> Stdlib.Bool.t

is_context_variable is like is_meta_variable, but for entries describing context variables.

val is_computation_variable : t -> Stdlib.Bool.t

is_computation_variable entry is true if and only if entry describes a computation-level variable.

val is_variable : t -> Stdlib.Bool.t

is_variable entry is true if and only if entry describes an LF variable, a meta-level variable, or a computation-level variable.

This is used to discern between the following two cases when disambiguating identifiers in patterns:

  • The case where an exception should be raised because the identifier is a bound variable of the wrong sort.
  • The case where the identifier should be a free variable shadowing a constant.
val is_lf_type_constant : t -> Stdlib.Bool.t

is_lf_type_constant entry is true if and only if entry describes an LF type-level constant.

val is_lf_term_constant : t -> Stdlib.Bool.t

is_lf_term_constant is like is_lf_type_constant, but for entries describing LF term-level constants.

val is_schema_constant : t -> Stdlib.Bool.t

is_schema_constant is like is_lf_type_constant, but for entries describing context schemas.

val is_computation_inductive_type_constant : t -> Stdlib.Bool.t

is_computation_inductive_type_constant is like is_lf_type_constant, but for entries describing inductive computation-level type constants.

val is_computation_stratified_type_constant : t -> Stdlib.Bool.t

is_computation_stratified_type_constant is like is_lf_type_constant, but for entries describing stratified computation-level type constants.

val is_computation_coinductive_type_constant : t -> Stdlib.Bool.t

is_computation_coinductive_type_constant is like is_lf_type_constant, but for entries describing coinductive computation-level type constants.

val is_computation_abbreviation_type_constant : t -> Stdlib.Bool.t

is_computation_abbreviation_type_constant is like is_lf_type_constant, but for entries describing computation-level type constant abbreviations (introduced by the Beluga keyword typedef).

val is_computation_term_constructor : t -> Stdlib.Bool.t

is_computation_term_constructor is like is_lf_type_constant, but for entries describing computation-level constructors.

val is_computation_term_destructor : t -> Stdlib.Bool.t

is_computation_term_destructor is like is_lf_type_constant, but for entries describing computation-level destructors.

val is_program_constant : t -> Stdlib.Bool.t

is_program_constant is like is_lf_type_constant, but for entries describing computation-level programs (introduced by the Beluga keyword rec or val).

val is_module : t -> Stdlib.Bool.t

is_module is like is_lf_type_constant, but for entries describing modules.

diff --git a/beluga/Beluga_parser/Make_disambiguation/argument-1-Disambiguation_state/index.html b/beluga/Beluga_parser/Make_disambiguation/argument-1-Disambiguation_state/index.html deleted file mode 100644 index 59a3b8887..000000000 --- a/beluga/Beluga_parser/Make_disambiguation/argument-1-Disambiguation_state/index.html +++ /dev/null @@ -1,284 +0,0 @@ - -Disambiguation_state (beluga.Beluga_parser.Make_disambiguation.Disambiguation_state)

Parameter Make_disambiguation.Disambiguation_state

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
module Entry : Disambiguation_state.ENTRY

Recorded data on bindings in Beluga signatures.

Variables

val add_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_variable state ?location identifier adds identifier as a bound LF variable, with binding site location. If location = Option.None, then identifier's location is used instead.

This is mostly used for testing. For locally binding an LF variable, see with_bound_lf_variable.

val add_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_meta_variable is like add_lf_variable, but the identifier is added as a bound meta-variable.

val add_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_parameter_variable is like add_lf_variable, but the identifier is added as a bound parameter variable (those variables prefixed by '#' like "#p").

val add_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_substitution_variable is like add_lf_variable, but the identifier is added as a bound substitution variable (those variables prefixed by '$' like "$S").

val add_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_context_variable is like add_lf_variable, but the identifier is added as a bound context variable.

val add_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_contextual_variable is like add_lf_variable, but the identifier is added as a bound contextual variable, meaning that it is ambiguously bound as either a meta, parameter, substitution or context variable.

val add_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_variable is like add_lf_variable, but the identifier is added as a bound computation-level variable.

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state ?location identifier is add_lf_variable state ?location identifier, with the additional behaviour of adding identifier as an inner pattern bound identifier and as a free variable during pattern disambiguation. This means that identifier can subsequently be looked up as a bound LF variable during pattern disambiguation. This effectively allows free LF variables to appear multiple times (non-linearly) in patterns.

See with_free_variables_as_pattern_variables for the handler for converting free variables in patterns to binders for use as bound variables in expressions.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free meta-variable.

val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free parameter variable.

val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free substitution variable.

val add_free_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free context variable.

val add_free_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_computation_variable state ?location identifier adds identifier to state as a free variable during pattern disambiguation. This differs from add_free_lf_variable in that free computation-level variables in patterns do not have implicit binders (because they are not part of the meta-context), and hence must appear only once (linearly) in the overall pattern.

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state ?location identifier m is the result of running m in the local state derived from state having identifier as a bound LF variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

For example, the disambiguation of an LF term-level lambda-abstraction \x. m requires that the parameter x is locally added in scope when disambiguating the body m. This is achieved like this:

with_bound_lf_variable state x (fun state ->
-    disambiguate_lf_term state m)
val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_meta_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound meta-variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound contextual variable. This is different from with_bound_meta_variable, with_bound_parameter_variable, with_bound_substitution_variable and with_bound_context_variable in that it is unknown whether identifier should be a meta-variable, parameter variable, substitution variable or context variable. This is used in particular for mlam expressions.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_computation_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound computation-level variable.

val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_meta_variable state ?location identifier m is like with_bound_meta_variable state ?location identifier m except that identifier is also treated as a free variable so that in with_free_variables_as_pattern_variables it can be treated as a pattern variable usable in the expression.

This is used for meta-variables introduced in the meta-context of a pattern during case analysis. Those variables are considered bound in both the pattern and expression.

For example, B as below is one such bound pattern meta-variable, and appears in scope for ?.

case x of
-| { B : [g |- o] } [g |- impi \u. D] => ?
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_parameter_variable is like with_bound_pattern_meta_variable, but for a parameter variable introduced in the meta-context of a pattern.

val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_substitution_variable is like with_bound_pattern_meta_variable, but for a substitution variable introduced in the meta-context of a pattern.

val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_context_variable is like with_bound_pattern_meta_variable, but for a context variable introduced in the meta-context of a pattern.

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression state is the result of running expression with the free variables added in pattern as bound variables. This is used to disambiguate expression with bound variables arising from free variables in pattern.

  1. pattern is run with respect to state while keeping track of free variables. Variables bound outside the pattern are ignored in lookups.
  2. expression is run with respect to state with the addition of the tracked free variables from patterns as bound variables.

Lookups performed in pattern are more complex. The variables in state count as being unbound, but the variables with binders in the pattern count as bound. Binders in a pattern can be user-specified, or to be reconstructed during abstraction.

A variable is specifically inner bound if it is introduced explicitly by a lambda abstraction or the pattern meta-context, as an explicit or implicit parameter. Free meta-level variables are reconstructed inner bound. For instance, assuming s and ctx are constants:

  • In the pattern (x, x), both occurrences of x are pattern variables, and that pattern is not linear.
  • In the pattern {M : [ |- nat]} [ |- s M], M as introduced in the meta-context is a pattern variable, and M is an inner pattern-bound identifier in s M, so that pattern is linear.
  • In the pattern [ |- \x. s x], there are no pattern variables.
  • In the pattern ([g |- s M], [g |- s M]), g and M are pattern variables in the left projection of the tuple pattern, and inner pattern-bound in the right projection of the tuple pattern. This is because the pattern is reconstructed as {g : ctx} {M : [g |- nat]} ([g |- s M], [g |- s M]).
val with_scope : state -> (state -> 'a) -> 'a

with_scope state m runs m in a nested bindings scope that is discarded afterwards.

val with_parent_scope : state -> (state -> 'a) -> 'a

with_parent_scope state m runs m while ignoring the topmost scope.

This is used for the disambiguation of Harpoon proof scripts because Harpoon hypotheticals are already serialized with all the identifiers in the meta-level and computation-level contexts of the proof.

val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used for backtracking when disambiguating old-style LF type-level and term-level declarations (i.e., x : X where X may be an LF kind or an LF type).

This is also used in REPLs to safely run parsing functions and recover the state in case of a raised exception during disambiguation.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Constants

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_type_constant state ?location ?arity identifier adds identifier as a bound LF type-level constant.

In the disambiguation of a module's declaration, this also adds the constant as one of the module's declarations.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_term_constant is like add_lf_type_constant, but for LF term-level constants.

val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_schema_constant is like add_lf_type_constant, but for schema constants.

val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_inductive_computation_type_constant is like add_lf_type_constant, but for inductive computation-level type constants.

val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_stratified_computation_type_constant is like add_lf_type_constant, but for stratified computation-level type constants.

val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_coinductive_computation_type_constant is like add_lf_type_constant, but for coinductive computation-level type constants.

val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation_computation_type_constant is like add_lf_type_constant, but for computation-level abbreviation type constants.

val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_constructor is like add_lf_type_constant, but for computation-level term constructors.

val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_destructor is like add_lf_type_constant, but for computation-level term destructors.

val add_program_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_program_constant is like add_lf_type_constant, but for computation-level program constants.

val add_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

add_module state ?location identifier m is the result of running m in a module disambiguation state, whereby added constants are kept track of as declarations in the module having identifier.

Lookups

exception Unbound_identifier of Beluga_syntax.Syncom.Identifier.t

Unbound_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is caught whenever a variable lookup fails and identifier can be disambiguated as a free variable.

exception Unbound_qualified_identifier of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_qualified_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is unrecoverable, but is caught during disambiguation to provide better error messages.

exception Unbound_namespace of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_namespace namespace_identifier is raised if a qualified identifier could not be looked up in a disambiguation state because the namespace with identifier namespace_identifier is unbound.

val lookup_toplevel : state -> Beluga_syntax.Syncom.Identifier.t -> Entry.t

lookup_toplevel state identifier is entry if identifier resolves to entry in state. If identifier is unbound in state, then Unbound_identifier identifier is raised.

lookup state identifier is entry if identifier resolves to entry in state. Otherwise:

  • Unbound_identifier ident) is raised if the first segment ident in identifier is unbound.
  • Unbound_namespace namespace_identifier is raised if a segment in identifier other than the first or last is unbound.
  • Unbound_qualified_identifier identifier is raised if the last segment in identifier is unbound.
type maximum_lookup_result =
  1. | Unbound of {
    1. segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  2. | Partially_bound of {
    1. leading_segments : Beluga_syntax.Syncom.Identifier.t Support.List.t;
    2. segment : Beluga_syntax.Syncom.Identifier.t;
    3. entry : Entry.t;
    4. trailing_segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  3. | Bound of {
    1. entry : Entry.t;
    }

maximum_lookup state segments is either:

  • Unbound { segments } if the first segment in segments is unbound in state.
  • Partially_bound { leading_segments; segment; entry; trailing_segments } if the qualified identifier with namespaces leading_segments and name segment is bound to entry in state.
  • Bound { identifier; entry } if segments form a qualified identifier bound to entry in state.
val actual_binding_exn : - Beluga_syntax.Syncom.Qualified_identifier.t -> - Entry.t -> - exn

actual_binding_exn identifier entry is an exception reporting what sort of entry is bound at identifier. The exception is annotated with the entry's binding location.

Signature Operations

val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state module_identifier adds the exported constants from the module bound to module_identifier as toplevel entries in state. If module_identifier is unbound in state, then an exception is raised.

val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t

get_default_associativity state is the associativity to use for infix operators defined by the user using a pragma, without specifying the infix operator's associativity.

val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state default_associativity sets default_associativity as the associativity to return from get_default_associativity.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the precedence to use for operators defined by the user using a pragma, without specifying the operator's precedence.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state default_precedence sets default_precedence as the precedence to return from get_default_precedence.

val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence identifier adds a prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity identifier adds an infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence identifier adds a postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state identifier is Option.Some operator if identifier is bound to an operator with descriptor operator in state, and Option.None otherwise.

This is used to resolve operators in the disambiguation of applications, which are parsed as lists of expressions.

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_module_abbreviation state ?location module_identifier abbreviation adds the synonym abbreviation for the module bound to identifier in state.

An exception is raised if module_identifier is unbound in state, or if module_identifier is not bound to a module in state.

diff --git a/beluga/Beluga_parser/Make_disambiguation/index.html b/beluga/Beluga_parser/Make_disambiguation/index.html deleted file mode 100644 index de30efd14..000000000 --- a/beluga/Beluga_parser/Make_disambiguation/index.html +++ /dev/null @@ -1,376 +0,0 @@ - -Make_disambiguation (beluga.Beluga_parser.Make_disambiguation)

Module Beluga_parser.Make_disambiguation

Functor creating a Beluga disambiguator using the given implementation of state.

Parameters

Signature

include DISAMBIGUATION_STATE with type state = Disambiguation_state.state
module Entry : Disambiguation_state.ENTRY

Recorded data on bindings in Beluga signatures.

Variables

val add_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_variable state ?location identifier adds identifier as a bound LF variable, with binding site location. If location = Option.None, then identifier's location is used instead.

This is mostly used for testing. For locally binding an LF variable, see with_bound_lf_variable.

val add_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_meta_variable is like add_lf_variable, but the identifier is added as a bound meta-variable.

val add_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_parameter_variable is like add_lf_variable, but the identifier is added as a bound parameter variable (those variables prefixed by '#' like "#p").

val add_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_substitution_variable is like add_lf_variable, but the identifier is added as a bound substitution variable (those variables prefixed by '$' like "$S").

val add_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_context_variable is like add_lf_variable, but the identifier is added as a bound context variable.

val add_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_contextual_variable is like add_lf_variable, but the identifier is added as a bound contextual variable, meaning that it is ambiguously bound as either a meta, parameter, substitution or context variable.

val add_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_variable is like add_lf_variable, but the identifier is added as a bound computation-level variable.

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state ?location identifier is add_lf_variable state ?location identifier, with the additional behaviour of adding identifier as an inner pattern bound identifier and as a free variable during pattern disambiguation. This means that identifier can subsequently be looked up as a bound LF variable during pattern disambiguation. This effectively allows free LF variables to appear multiple times (non-linearly) in patterns.

See with_free_variables_as_pattern_variables for the handler for converting free variables in patterns to binders for use as bound variables in expressions.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free meta-variable.

val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free parameter variable.

val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free substitution variable.

val add_free_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free context variable.

val add_free_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_computation_variable state ?location identifier adds identifier to state as a free variable during pattern disambiguation. This differs from add_free_lf_variable in that free computation-level variables in patterns do not have implicit binders (because they are not part of the meta-context), and hence must appear only once (linearly) in the overall pattern.

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state ?location identifier m is the result of running m in the local state derived from state having identifier as a bound LF variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

For example, the disambiguation of an LF term-level lambda-abstraction \x. m requires that the parameter x is locally added in scope when disambiguating the body m. This is achieved like this:

with_bound_lf_variable state x (fun state ->
-    disambiguate_lf_term state m)
val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_meta_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound meta-variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound contextual variable. This is different from with_bound_meta_variable, with_bound_parameter_variable, with_bound_substitution_variable and with_bound_context_variable in that it is unknown whether identifier should be a meta-variable, parameter variable, substitution variable or context variable. This is used in particular for mlam expressions.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_computation_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound computation-level variable.

val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_meta_variable state ?location identifier m is like with_bound_meta_variable state ?location identifier m except that identifier is also treated as a free variable so that in with_free_variables_as_pattern_variables it can be treated as a pattern variable usable in the expression.

This is used for meta-variables introduced in the meta-context of a pattern during case analysis. Those variables are considered bound in both the pattern and expression.

For example, B as below is one such bound pattern meta-variable, and appears in scope for ?.

case x of
-| { B : [g |- o] } [g |- impi \u. D] => ?
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_parameter_variable is like with_bound_pattern_meta_variable, but for a parameter variable introduced in the meta-context of a pattern.

val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_substitution_variable is like with_bound_pattern_meta_variable, but for a substitution variable introduced in the meta-context of a pattern.

val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_context_variable is like with_bound_pattern_meta_variable, but for a context variable introduced in the meta-context of a pattern.

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression state is the result of running expression with the free variables added in pattern as bound variables. This is used to disambiguate expression with bound variables arising from free variables in pattern.

  1. pattern is run with respect to state while keeping track of free variables. Variables bound outside the pattern are ignored in lookups.
  2. expression is run with respect to state with the addition of the tracked free variables from patterns as bound variables.

Lookups performed in pattern are more complex. The variables in state count as being unbound, but the variables with binders in the pattern count as bound. Binders in a pattern can be user-specified, or to be reconstructed during abstraction.

A variable is specifically inner bound if it is introduced explicitly by a lambda abstraction or the pattern meta-context, as an explicit or implicit parameter. Free meta-level variables are reconstructed inner bound. For instance, assuming s and ctx are constants:

  • In the pattern (x, x), both occurrences of x are pattern variables, and that pattern is not linear.
  • In the pattern {M : [ |- nat]} [ |- s M], M as introduced in the meta-context is a pattern variable, and M is an inner pattern-bound identifier in s M, so that pattern is linear.
  • In the pattern [ |- \x. s x], there are no pattern variables.
  • In the pattern ([g |- s M], [g |- s M]), g and M are pattern variables in the left projection of the tuple pattern, and inner pattern-bound in the right projection of the tuple pattern. This is because the pattern is reconstructed as {g : ctx} {M : [g |- nat]} ([g |- s M], [g |- s M]).
val with_scope : state -> (state -> 'a) -> 'a

with_scope state m runs m in a nested bindings scope that is discarded afterwards.

val with_parent_scope : state -> (state -> 'a) -> 'a

with_parent_scope state m runs m while ignoring the topmost scope.

This is used for the disambiguation of Harpoon proof scripts because Harpoon hypotheticals are already serialized with all the identifiers in the meta-level and computation-level contexts of the proof.

val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used for backtracking when disambiguating old-style LF type-level and term-level declarations (i.e., x : X where X may be an LF kind or an LF type).

This is also used in REPLs to safely run parsing functions and recover the state in case of a raised exception during disambiguation.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Constants

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_type_constant state ?location ?arity identifier adds identifier as a bound LF type-level constant.

In the disambiguation of a module's declaration, this also adds the constant as one of the module's declarations.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_term_constant is like add_lf_type_constant, but for LF term-level constants.

val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_schema_constant is like add_lf_type_constant, but for schema constants.

val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_inductive_computation_type_constant is like add_lf_type_constant, but for inductive computation-level type constants.

val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_stratified_computation_type_constant is like add_lf_type_constant, but for stratified computation-level type constants.

val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_coinductive_computation_type_constant is like add_lf_type_constant, but for coinductive computation-level type constants.

val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation_computation_type_constant is like add_lf_type_constant, but for computation-level abbreviation type constants.

val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_constructor is like add_lf_type_constant, but for computation-level term constructors.

val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_destructor is like add_lf_type_constant, but for computation-level term destructors.

val add_program_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_program_constant is like add_lf_type_constant, but for computation-level program constants.

val add_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

add_module state ?location identifier m is the result of running m in a module disambiguation state, whereby added constants are kept track of as declarations in the module having identifier.

Lookups

exception Unbound_identifier of Beluga_syntax.Syncom.Identifier.t

Unbound_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is caught whenever a variable lookup fails and identifier can be disambiguated as a free variable.

exception Unbound_qualified_identifier of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_qualified_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is unrecoverable, but is caught during disambiguation to provide better error messages.

exception Unbound_namespace of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_namespace namespace_identifier is raised if a qualified identifier could not be looked up in a disambiguation state because the namespace with identifier namespace_identifier is unbound.

val lookup_toplevel : state -> Beluga_syntax.Syncom.Identifier.t -> Entry.t

lookup_toplevel state identifier is entry if identifier resolves to entry in state. If identifier is unbound in state, then Unbound_identifier identifier is raised.

lookup state identifier is entry if identifier resolves to entry in state. Otherwise:

  • Unbound_identifier ident) is raised if the first segment ident in identifier is unbound.
  • Unbound_namespace namespace_identifier is raised if a segment in identifier other than the first or last is unbound.
  • Unbound_qualified_identifier identifier is raised if the last segment in identifier is unbound.
type maximum_lookup_result =
  1. | Unbound of {
    1. segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  2. | Partially_bound of {
    1. leading_segments : Beluga_syntax.Syncom.Identifier.t Support.List.t;
    2. segment : Beluga_syntax.Syncom.Identifier.t;
    3. entry : Entry.t;
    4. trailing_segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  3. | Bound of {
    1. entry : Entry.t;
    }

maximum_lookup state segments is either:

  • Unbound { segments } if the first segment in segments is unbound in state.
  • Partially_bound { leading_segments; segment; entry; trailing_segments } if the qualified identifier with namespaces leading_segments and name segment is bound to entry in state.
  • Bound { identifier; entry } if segments form a qualified identifier bound to entry in state.
val actual_binding_exn : - Beluga_syntax.Syncom.Qualified_identifier.t -> - Entry.t -> - exn

actual_binding_exn identifier entry is an exception reporting what sort of entry is bound at identifier. The exception is annotated with the entry's binding location.

Signature Operations

val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state module_identifier adds the exported constants from the module bound to module_identifier as toplevel entries in state. If module_identifier is unbound in state, then an exception is raised.

val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t

get_default_associativity state is the associativity to use for infix operators defined by the user using a pragma, without specifying the infix operator's associativity.

val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state default_associativity sets default_associativity as the associativity to return from get_default_associativity.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the precedence to use for operators defined by the user using a pragma, without specifying the operator's precedence.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state default_precedence sets default_precedence as the precedence to return from get_default_precedence.

val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence identifier adds a prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity identifier adds an infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence identifier adds a postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state identifier is Option.Some operator if identifier is bound to an operator with descriptor operator in state, and Option.None otherwise.

This is used to resolve operators in the disambiguation of applications, which are parsed as lists of expressions.

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_module_abbreviation state ?location module_identifier abbreviation adds the synonym abbreviation for the module bound to identifier in state.

An exception is raised if module_identifier is unbound in state, or if module_identifier is not bound to a module in state.

include Lf_disambiguation.LF_DISAMBIGUATION with type state := state

Disambiguation

val disambiguate_lf_kind : state -> Synprs.lf_object -> Synext.lf_kind

disambiguate_lf_kind state object_ is kind', the LF kind disambiguated from kind in the disambiguation state state.

val disambiguate_lf_typ : state -> Synprs.lf_object -> Synext.lf_typ

disambiguate_lf_typ state typ is typ', the LF type disambiguated from typ in the disambiguation state state.

val disambiguate_lf_term : state -> Synprs.lf_object -> Synext.lf_term

disambiguate_lf_term state term is term', the LF term disambiguated from term in the disambiguation state state.

include Clf_disambiguation.CLF_DISAMBIGUATION with type state := state

Disambiguation

val disambiguate_clf_typ : state -> Synprs.clf_object -> Synext.clf_typ
val disambiguate_clf_term : state -> Synprs.clf_object -> Synext.clf_term
val disambiguate_clf_substitution : - state -> - Synprs.clf_context_object -> - Synext.clf_substitution
val with_disambiguated_clf_context : - state -> - Synprs.clf_context_object -> - (state -> Synext.clf_context -> 'a) -> - 'a
val disambiguate_clf_term_pattern : - state -> - Synprs.clf_object -> - Synext.clf_term_pattern
val disambiguate_clf_substitution_pattern : - state -> - Synprs.clf_context_object -> - Synext.clf_substitution_pattern
val with_disambiguated_clf_context_pattern : - state -> - Synprs.clf_context_object -> - (state -> Synext.clf_context_pattern -> 'a) -> - 'a
val disambiguate_clf_context_pattern : - state -> - Synprs.clf_context_object -> - Synext.clf_context_pattern
include Meta_disambiguation.META_DISAMBIGUATION with type state := state

Disambiguation

val disambiguate_meta_typ : state -> Synprs.meta_thing -> Synext.meta_typ
val disambiguate_meta_object : state -> Synprs.meta_thing -> Synext.meta_object
val disambiguate_meta_pattern : - state -> - Synprs.meta_thing -> - Beluga_syntax.Synext.Meta.Pattern.t
val disambiguate_schema : state -> Synprs.schema_object -> Synext.schema
val with_disambiguated_meta_context : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
val with_disambiguated_meta_context_pattern : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
include Comp_disambiguation.COMP_DISAMBIGUATION with type state := state

Disambiguation

val disambiguate_comp_kind : - state -> - Synprs.comp_sort_object -> - Synext.comp_kind
val disambiguate_comp_typ : state -> Synprs.comp_sort_object -> Synext.comp_typ
val disambiguate_comp_expression : - state -> - Synprs.comp_expression_object -> - Synext.comp_expression
val disambiguate_comp_pattern : - state -> - Synprs.comp_pattern_object -> - Synext.comp_pattern
val disambiguate_comp_copattern : - state -> - Synprs.comp_copattern_object Support.List1.t -> - Synext.comp_copattern
val with_disambiguated_comp_context : - state -> - Synprs.comp_context_object -> - (state -> Synext.comp_context -> 'a) -> - 'a
include Harpoon_disambiguation.HARPOON_DISAMBIGUATION with type state := state

Disambiguation

val disambiguate_harpoon_proof : - state -> - Synprs.harpoon_proof -> - Synext.harpoon_proof
val with_disambiguated_harpoon_command : - state -> - Synprs.harpoon_command -> - (state -> Synext.harpoon_command -> 'a) -> - 'a
val disambiguate_harpoon_directive : - state -> - Synprs.harpoon_directive -> - Synext.harpoon_directive
val disambiguate_harpoon_split_branch : - state -> - Synprs.harpoon_split_branch -> - Synext.harpoon_split_branch
val disambiguate_harpoon_suffices_branch : - state -> - Synprs.harpoon_suffices_branch -> - Synext.harpoon_suffices_branch
val disambiguate_harpoon_hypothetical : - state -> - Synprs.harpoon_hypothetical -> - Synext.harpoon_hypothetical
val disambiguate_harpoon_repl_command : - state -> - Synprs.harpoon_repl_command -> - Synext.harpoon_repl_command
include Signature_disambiguation.SIGNATURE_DISAMBIGUATION - with type state := state
include Support.Imperative_state.IMPERATIVE_STATE with type state := state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_pragma : - state -> - Synprs.signature_pragma -> - Synext.signature_pragma
val disambiguate_global_pragma : - state -> - Synprs.signature_global_pragma -> - Synext.signature_global_pragma
val disambiguate_totality_declaration : - state -> - Synprs.signature_totality_declaration -> - Synext.signature_totality_declaration
val disambiguate_declaration : - state -> - Synprs.signature_declaration -> - Synext.signature_declaration
val disambiguate_signature_file : - state -> - Synprs.signature_file -> - Synext.signature_file
val disambiguate_signature : state -> Synprs.signature -> Synext.signature
diff --git a/beluga/Beluga_parser/Make_parsing/argument-1-Parser_state/index.html b/beluga/Beluga_parser/Make_parsing/argument-1-Parser_state/index.html deleted file mode 100644 index bdc8b6f3f..000000000 --- a/beluga/Beluga_parser/Make_parsing/argument-1-Parser_state/index.html +++ /dev/null @@ -1,58 +0,0 @@ - -Parser_state (beluga.Beluga_parser.Make_parsing.Parser_state)

Parameter Make_parsing.Parser_state

include Support.State.STATE
type state

The type of states inside the monad.

type 'a t = state -> state * 'a
val get : state t

Return the state from the internals of the monad.

val put : state -> unit t

Replace the state inside the monad.

val modify : (state -> state) -> unit t

Modify the state inside the monad.

val run : 'a t -> state -> state * 'a

run a init runs a with initial state init, returning (final, v) where final is the final state and v is the output.

val eval : 'a t -> state -> 'a

eval a init is run a init = (final, v), but outputs only v.

val exec : 'a t -> state -> state

exec a init is run a init = (final, v), but outputs only final.

Traversals

val traverse_tuple2 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a1 * 'a2) -> - ('b1 * 'b2) t
val traverse_tuple3 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a3 -> 'b3 t) -> - ('a1 * 'a2 * 'a3) -> - ('b1 * 'b2 * 'b3) t
val traverse_list : ('a -> 'b t) -> 'a Support.List.t -> 'b Support.List.t t
val traverse_list1 : ('a -> 'b t) -> 'a Support.List1.t -> 'b Support.List1.t t
val traverse_list2 : ('a -> 'b t) -> 'a Support.List2.t -> 'b Support.List2.t t
val traverse_list_void : ('a -> _ t) -> 'a Support.List.t -> Stdlib.Unit.t t
val traverse_list1_void : ('a -> _ t) -> 'a Support.List1.t -> Stdlib.Unit.t t
val traverse_list2_void : ('a -> _ t) -> 'a Support.List2.t -> Stdlib.Unit.t t
val traverse_reverse_list : - ('a -> 'b t) -> - 'a Support.List.t -> - 'b Support.List.t t
val traverse_reverse_list1 : - ('a -> 'b t) -> - 'a Support.List1.t -> - 'b Support.List1.t t
val traverse_reverse_list2 : - ('a -> 'b t) -> - 'a Support.List2.t -> - 'b Support.List2.t t
val traverse_reverse_list_void : - ('a -> _ t) -> - 'a Support.List.t -> - Stdlib.Unit.t t
val traverse_reverse_list1_void : - ('a -> _ t) -> - 'a Support.List1.t -> - Stdlib.Unit.t t
val traverse_reverse_list2_void : - ('a -> _ t) -> - 'a Support.List2.t -> - Stdlib.Unit.t t
val traverse_option : - ('a -> 'b t) -> - 'a Support.Option.t -> - 'b Support.Option.t t
val traverse_option_void : - ('a -> _ t) -> - 'a Support.Option.t -> - Stdlib.Unit.t t
val seq_list : 'a t Support.List.t -> 'a Support.List.t t
val seq_list1 : 'a t Support.List1.t -> 'a Support.List1.t t
val seq_list_void : unit t list -> unit t

seq_list_void [x1; x2; ...; xn] performs x1, x2, ..., xn in order.

Instances

include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

Lexing

type token = Located_token.t

The type of token in the finite stream being parsed.

val peek : token option t

peek state is (state', token_opt) where token_opt is the next unconsumed token in state. If token_opt = Option.None, then the end of the input stream was reached. Otherwise, token_opt = Option.Some token. The token is not consumed, meaning that state' is not advanced to the next token in the stream.

val observe : token option t

observed state is like peek state, but the observed token is consumed.

val accept : unit t

accept state is (state', ()) where state' is derived from state by consuming the next token in the input stream. This effectively observes and discards the next token in state.

val insert : token -> unit t

insert token state is (state', ()) where state' is derived from state by inserting token at the beginning of the input stream. That is, token is the next token in state'.

Locations

type location = Beluga_syntax.Location.t

The type of locations with which input tokens are annotated.

val next_location : location option t

next_location state is (state', next_location_opt) where next_location_opt is the location of the next token in state. This does not advance the input stream. next_location_opt = Option.None at the end of the input stream.

val previous_location : location option t

previous_location state is (state', previous_location_opt) where previous_location_opt is the location of the last token in state to have been consumed. previous_location_opt = Option.None at the beginning of the input stream.

Backtracking

val enable_backtracking : unit t

enable_backtracking state is (state', ()) where state' has backtracking enabled.

val disable_backtracking : unit t

enable_backtracking state is (state', ()) where state' has backtracking disabled.

val can_backtrack : bool t

can_backtrack state is (state', flag) where flag = true indicates that state and state' allow backtracking out of an erroneous result, and flag = false otherwise.

val allow_backtracking_on_error : - ('a, 'e) Stdlib.result t -> - ('a, 'e) Stdlib.result t

allow_backtracking_on_error m is m' such that m' state is (state', x) with backtracking enabled in state' if x = Result.Error cause. That is, this combinator enables backtracking if m' produces an error. Backtracking then needs to be manually disabled afterwards.

val with_checkpoint : - ('a, 'e) Stdlib.result t -> - ('a, [> `Backtracked of 'e | `Did_not_backtrack of 'e ]) Stdlib.result t

with_checkpoint m is m' such that m' state marks the current state, performs m, then either

  • discards the marked state if m state = (state', Result.Ok x),
  • backtracks to the marked state if m state = (state', Result.Error cause).

The output error from m is additionally annotated with whether backtracking occurred.

In the case of a parser m, backtracking can occur if backtracking is enabled with allow_backtracking_on_error, or if m did not consume any input.

diff --git a/beluga/Beluga_parser/Make_parsing/index.html b/beluga/Beluga_parser/Make_parsing/index.html deleted file mode 100644 index 608b5afc9..000000000 --- a/beluga/Beluga_parser/Make_parsing/index.html +++ /dev/null @@ -1,152 +0,0 @@ - -Make_parsing (beluga.Beluga_parser.Make_parsing)

Module Beluga_parser.Make_parsing

Functor creating a Beluga parser using the given implementation of state.

Parameters

Signature

include PARSER_STATE - with type token = Located_token.t - and type location = Beluga_syntax.Location.t - with type state = Parser_state.state
include Support.State.STATE with type state = Parser_state.state
type state = Parser_state.state

The type of states inside the monad.

val get : state -> state * state

Return the state from the internals of the monad.

val put : state -> state -> state * unit

Replace the state inside the monad.

val modify : (state -> state) -> state -> state * unit

Modify the state inside the monad.

val eval : (state -> state * 'a) -> state -> 'a

eval a init is run a init = (final, v), but outputs only v.

val exec : (state -> state * 'a) -> state -> state

exec a init is run a init = (final, v), but outputs only final.

Traversals

val traverse_tuple2 : - ('a1 -> state -> state * 'b1) -> - ('a2 -> state -> state * 'b2) -> - ('a1 * 'a2) -> - state -> - state * ('b1 * 'b2)
val traverse_tuple3 : - ('a1 -> state -> state * 'b1) -> - ('a2 -> state -> state * 'b2) -> - ('a3 -> state -> state * 'b3) -> - ('a1 * 'a2 * 'a3) -> - state -> - state * ('b1 * 'b2 * 'b3)
val traverse_list : - ('a -> state -> state * 'b) -> - 'a Support.List.t -> - state -> - state * 'b Support.List.t
val traverse_list1 : - ('a -> state -> state * 'b) -> - 'a Support.List1.t -> - state -> - state * 'b Support.List1.t
val traverse_list2 : - ('a -> state -> state * 'b) -> - 'a Support.List2.t -> - state -> - state * 'b Support.List2.t
val traverse_list_void : - ('a -> state -> state * _) -> - 'a Support.List.t -> - state -> - state * Stdlib.Unit.t
val traverse_list1_void : - ('a -> state -> state * _) -> - 'a Support.List1.t -> - state -> - state * Stdlib.Unit.t
val traverse_list2_void : - ('a -> state -> state * _) -> - 'a Support.List2.t -> - state -> - state * Stdlib.Unit.t
val traverse_reverse_list : - ('a -> state -> state * 'b) -> - 'a Support.List.t -> - state -> - state * 'b Support.List.t
val traverse_reverse_list1 : - ('a -> state -> state * 'b) -> - 'a Support.List1.t -> - state -> - state * 'b Support.List1.t
val traverse_reverse_list2 : - ('a -> state -> state * 'b) -> - 'a Support.List2.t -> - state -> - state * 'b Support.List2.t
val traverse_reverse_list_void : - ('a -> state -> state * _) -> - 'a Support.List.t -> - state -> - state * Stdlib.Unit.t
val traverse_reverse_list1_void : - ('a -> state -> state * _) -> - 'a Support.List1.t -> - state -> - state * Stdlib.Unit.t
val traverse_reverse_list2_void : - ('a -> state -> state * _) -> - 'a Support.List2.t -> - state -> - state * Stdlib.Unit.t
val traverse_option : - ('a -> state -> state * 'b) -> - 'a Support.Option.t -> - state -> - state * 'b Support.Option.t
val traverse_option_void : - ('a -> state -> state * _) -> - 'a Support.Option.t -> - state -> - state * Stdlib.Unit.t
val seq_list : - (state -> state * 'a) Support.List.t -> - state -> - state * 'a Support.List.t
val seq_list1 : - (state -> state * 'a) Support.List1.t -> - state -> - state * 'a Support.List1.t
val seq_list_void : (state -> state * unit) list -> state -> state * unit

seq_list_void [x1; x2; ...; xn] performs x1, x2, ..., xn in order.

Instances

include Support.Monad.MONAD with type 'a t := state -> state * 'a
include Support.Functor.FUNCTOR with type 'a t := state -> state * 'a

Combinators

include Support.Apply.APPLY with type 'a t := state -> state * 'a

Combinators

Lexing

val peek : Located_token.t option {t}4788

peek state is (state', token_opt) where token_opt is the next unconsumed token in state. If token_opt = Option.None, then the end of the input stream was reached. Otherwise, token_opt = Option.Some token. The token is not consumed, meaning that state' is not advanced to the next token in the stream.

val observe : Located_token.t option {t}4788

observed state is like peek state, but the observed token is consumed.

val accept : unit {t}4788

accept state is (state', ()) where state' is derived from state by consuming the next token in the input stream. This effectively observes and discards the next token in state.

val insert : Located_token.t -> unit {t}4788

insert token state is (state', ()) where state' is derived from state by inserting token at the beginning of the input stream. That is, token is the next token in state'.

Locations

val next_location : Beluga_syntax.Location.t option {t}4788

next_location state is (state', next_location_opt) where next_location_opt is the location of the next token in state. This does not advance the input stream. next_location_opt = Option.None at the end of the input stream.

val previous_location : Beluga_syntax.Location.t option {t}4788

previous_location state is (state', previous_location_opt) where previous_location_opt is the location of the last token in state to have been consumed. previous_location_opt = Option.None at the beginning of the input stream.

Backtracking

val enable_backtracking : unit {t}4788

enable_backtracking state is (state', ()) where state' has backtracking enabled.

val disable_backtracking : unit {t}4788

enable_backtracking state is (state', ()) where state' has backtracking disabled.

val can_backtrack : bool {t}4788

can_backtrack state is (state', flag) where flag = true indicates that state and state' allow backtracking out of an erroneous result, and flag = false otherwise.

val allow_backtracking_on_error : - ('a, 'e) Stdlib.result {t}4788 -> - ('a, 'e) Stdlib.result {t}4788

allow_backtracking_on_error m is m' such that m' state is (state', x) with backtracking enabled in state' if x = Result.Error cause. That is, this combinator enables backtracking if m' produces an error. Backtracking then needs to be manually disabled afterwards.

val with_checkpoint : - ('a, 'e) Stdlib.result {t}4788 -> - ('a, [> `Backtracked of 'e | `Did_not_backtrack of 'e ]) Stdlib.result - {t}4788

with_checkpoint m is m' such that m' state marks the current state, performs m, then either

  • discards the marked state if m state = (state', Result.Ok x),
  • backtracks to the marked state if m state = (state', Result.Error cause).

The output error from m is additionally annotated with whether backtracking occurred.

In the case of a parser m, backtracking can occur if backtracking is enabled with allow_backtracking_on_error, or if m did not consume any input.

include Parser_combinator.PARSER - with type state := state - and type location := {location}30 - and type token := {token}29
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD - with type 'a t := state -> state * ('a, exn) Stdlib.result
include Support.Functor.FUNCTOR - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

include Support.Apply.APPLY - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

include Common_parser.COMMON_PARSER - with type state := state - and type location := {location}30 - and type token := {token}29
include Parser_combinator.PARSER - with type state := state - with type location := {location}30 - with type token := {token}29
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD - with type 'a t := state -> state * ('a, exn) Stdlib.result
include Support.Functor.FUNCTOR - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

include Support.Apply.APPLY - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

include Lf_parser.LF_PARSER with type state := state
include Common_parser.COMMON_PARSER with type state := state
include Parser_combinator.PARSER with type state := state
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD - with type 'a t := state -> state * ('a, exn) Stdlib.result
include Support.Functor.FUNCTOR - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

include Support.Apply.APPLY - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

val lf_kind : Synprs.lf_object {t}5141
val lf_typ : Synprs.lf_object {t}5141
val lf_term : Synprs.lf_object {t}5141
include Clf_parser.CLF_PARSER with type state := state
include Common_parser.COMMON_PARSER with type state := state
include Parser_combinator.PARSER with type state := state
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD - with type 'a t := state -> state * ('a, exn) Stdlib.result
include Support.Functor.FUNCTOR - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

include Support.Apply.APPLY - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

val clf_typ : Synprs.clf_object {t}5456
val clf_term : Synprs.clf_object {t}5456
val clf_term_pattern : Synprs.clf_object {t}5456
val clf_context : Synprs.clf_context_object {t}5456
val clf_substitution : Synprs.clf_context_object {t}5456
include Meta_parser.META_PARSER with type state := state
include Common_parser.COMMON_PARSER with type state := state
include Parser_combinator.PARSER with type state := state
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD - with type 'a t := state -> state * ('a, exn) Stdlib.result
include Support.Functor.FUNCTOR - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

include Support.Apply.APPLY - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

val schema : Synprs.schema_object {t}5771
val meta_type : Synprs.meta_thing {t}5771
val meta_object : Synprs.meta_thing {t}5771
val meta_pattern : Synprs.meta_thing {t}5771
val meta_context : Synprs.meta_context_object {t}5771
include Comp_parser.COMP_PARSER with type state := state
include Common_parser.COMMON_PARSER with type state := state
include Parser_combinator.PARSER with type state := state
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD - with type 'a t := state -> state * ('a, exn) Stdlib.result
include Support.Functor.FUNCTOR - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

include Support.Apply.APPLY - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

val comp_kind : Synprs.comp_sort_object {t}6086
val comp_typ : Synprs.comp_sort_object {t}6086
val comp_pattern : Synprs.comp_pattern_object {t}6086
val comp_copattern : Synprs.comp_copattern_object {t}6086
val comp_expression : Synprs.comp_expression_object {t}6086
val comp_context : Synprs.comp_context_object {t}6086
include Harpoon_parser.HARPOON_PARSER with type state := state
include Common_parser.COMMON_PARSER with type state := state
include Parser_combinator.PARSER with type state := state
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD - with type 'a t := state -> state * ('a, exn) Stdlib.result
include Support.Functor.FUNCTOR - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

include Support.Apply.APPLY - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

val harpoon_proof : Synprs.harpoon_proof {t}6401
val interactive_harpoon_command : Synprs.harpoon_repl_command {t}6401
include Signature_parser.SIGNATURE_PARSER - with type state := state - with type token = Parser_state.token - with type location = Parser_state.location
include Common_parser.COMMON_PARSER - with type state := state - with type token = Parser_state.token - with type location = Parser_state.location
include Parser_combinator.PARSER - with type state := state - with type token = Parser_state.token - with type location = Parser_state.location
type token = Parser_state.token
type location = Parser_state.location
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val signature_file : Synprs.signature_file t
val signature_global_pragma : Synprs.signature_global_pragma t
val signature_entry : Synprs.signature_entry t
val signature_declaration : Synprs.signature_declaration t
val trust_totality_declaration : Synprs.signature_totality_declaration t
val named_totality_declaration : Synprs.signature_totality_declaration t
val numeric_totality_declaration : Synprs.signature_totality_declaration t
val totality_declaration : Synprs.signature_totality_declaration t
diff --git a/beluga/Beluga_parser/Meta_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html b/beluga/Beluga_parser/Meta_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html deleted file mode 100644 index 1df6cee28..000000000 --- a/beluga/Beluga_parser/Meta_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga_parser.Meta_disambiguation.Make.Disambiguation_state.Entry)

Module Disambiguation_state.Entry

Recorded data on bindings in Beluga signatures.

type t

The type of entry.

val is_lf_variable : t -> Stdlib.Bool.t

is_lf_variable entry is true if and only if entry describes an LF variable.

val is_meta_variable : t -> Stdlib.Bool.t

is_meta_variable entry is true if entry describes a meta-variable or a contextual variable.

Contextual variables exist only because mlam-expressions ambiguously introduce either a meta-variable, a parameter variable, a substitution variable or a context variable.

val is_parameter_variable : t -> Stdlib.Bool.t

is_parameter_variable is like is_meta_variable, but for entries describing parameter variables.

val is_substitution_variable : t -> Stdlib.Bool.t

is_substitution_variable is like is_meta_variable, but for entries describing parameter variables.

val is_context_variable : t -> Stdlib.Bool.t

is_context_variable is like is_meta_variable, but for entries describing context variables.

val is_computation_variable : t -> Stdlib.Bool.t

is_computation_variable entry is true if and only if entry describes a computation-level variable.

val is_variable : t -> Stdlib.Bool.t

is_variable entry is true if and only if entry describes an LF variable, a meta-level variable, or a computation-level variable.

This is used to discern between the following two cases when disambiguating identifiers in patterns:

  • The case where an exception should be raised because the identifier is a bound variable of the wrong sort.
  • The case where the identifier should be a free variable shadowing a constant.
val is_lf_type_constant : t -> Stdlib.Bool.t

is_lf_type_constant entry is true if and only if entry describes an LF type-level constant.

val is_lf_term_constant : t -> Stdlib.Bool.t

is_lf_term_constant is like is_lf_type_constant, but for entries describing LF term-level constants.

val is_schema_constant : t -> Stdlib.Bool.t

is_schema_constant is like is_lf_type_constant, but for entries describing context schemas.

val is_computation_inductive_type_constant : t -> Stdlib.Bool.t

is_computation_inductive_type_constant is like is_lf_type_constant, but for entries describing inductive computation-level type constants.

val is_computation_stratified_type_constant : t -> Stdlib.Bool.t

is_computation_stratified_type_constant is like is_lf_type_constant, but for entries describing stratified computation-level type constants.

val is_computation_coinductive_type_constant : t -> Stdlib.Bool.t

is_computation_coinductive_type_constant is like is_lf_type_constant, but for entries describing coinductive computation-level type constants.

val is_computation_abbreviation_type_constant : t -> Stdlib.Bool.t

is_computation_abbreviation_type_constant is like is_lf_type_constant, but for entries describing computation-level type constant abbreviations (introduced by the Beluga keyword typedef).

val is_computation_term_constructor : t -> Stdlib.Bool.t

is_computation_term_constructor is like is_lf_type_constant, but for entries describing computation-level constructors.

val is_computation_term_destructor : t -> Stdlib.Bool.t

is_computation_term_destructor is like is_lf_type_constant, but for entries describing computation-level destructors.

val is_program_constant : t -> Stdlib.Bool.t

is_program_constant is like is_lf_type_constant, but for entries describing computation-level programs (introduced by the Beluga keyword rec or val).

val is_module : t -> Stdlib.Bool.t

is_module is like is_lf_type_constant, but for entries describing modules.

diff --git a/beluga/Beluga_parser/Meta_disambiguation/Make/argument-1-Disambiguation_state/index.html b/beluga/Beluga_parser/Meta_disambiguation/Make/argument-1-Disambiguation_state/index.html deleted file mode 100644 index fd1cb7f21..000000000 --- a/beluga/Beluga_parser/Meta_disambiguation/Make/argument-1-Disambiguation_state/index.html +++ /dev/null @@ -1,284 +0,0 @@ - -Disambiguation_state (beluga.Beluga_parser.Meta_disambiguation.Make.Disambiguation_state)

Parameter Make.Disambiguation_state

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
module Entry : Disambiguation_state.ENTRY

Recorded data on bindings in Beluga signatures.

Variables

val add_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_variable state ?location identifier adds identifier as a bound LF variable, with binding site location. If location = Option.None, then identifier's location is used instead.

This is mostly used for testing. For locally binding an LF variable, see with_bound_lf_variable.

val add_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_meta_variable is like add_lf_variable, but the identifier is added as a bound meta-variable.

val add_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_parameter_variable is like add_lf_variable, but the identifier is added as a bound parameter variable (those variables prefixed by '#' like "#p").

val add_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_substitution_variable is like add_lf_variable, but the identifier is added as a bound substitution variable (those variables prefixed by '$' like "$S").

val add_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_context_variable is like add_lf_variable, but the identifier is added as a bound context variable.

val add_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_contextual_variable is like add_lf_variable, but the identifier is added as a bound contextual variable, meaning that it is ambiguously bound as either a meta, parameter, substitution or context variable.

val add_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_variable is like add_lf_variable, but the identifier is added as a bound computation-level variable.

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state ?location identifier is add_lf_variable state ?location identifier, with the additional behaviour of adding identifier as an inner pattern bound identifier and as a free variable during pattern disambiguation. This means that identifier can subsequently be looked up as a bound LF variable during pattern disambiguation. This effectively allows free LF variables to appear multiple times (non-linearly) in patterns.

See with_free_variables_as_pattern_variables for the handler for converting free variables in patterns to binders for use as bound variables in expressions.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free meta-variable.

val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free parameter variable.

val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free substitution variable.

val add_free_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free context variable.

val add_free_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_computation_variable state ?location identifier adds identifier to state as a free variable during pattern disambiguation. This differs from add_free_lf_variable in that free computation-level variables in patterns do not have implicit binders (because they are not part of the meta-context), and hence must appear only once (linearly) in the overall pattern.

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state ?location identifier m is the result of running m in the local state derived from state having identifier as a bound LF variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

For example, the disambiguation of an LF term-level lambda-abstraction \x. m requires that the parameter x is locally added in scope when disambiguating the body m. This is achieved like this:

with_bound_lf_variable state x (fun state ->
-    disambiguate_lf_term state m)
val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_meta_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound meta-variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound contextual variable. This is different from with_bound_meta_variable, with_bound_parameter_variable, with_bound_substitution_variable and with_bound_context_variable in that it is unknown whether identifier should be a meta-variable, parameter variable, substitution variable or context variable. This is used in particular for mlam expressions.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_computation_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound computation-level variable.

val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_meta_variable state ?location identifier m is like with_bound_meta_variable state ?location identifier m except that identifier is also treated as a free variable so that in with_free_variables_as_pattern_variables it can be treated as a pattern variable usable in the expression.

This is used for meta-variables introduced in the meta-context of a pattern during case analysis. Those variables are considered bound in both the pattern and expression.

For example, B as below is one such bound pattern meta-variable, and appears in scope for ?.

case x of
-| { B : [g |- o] } [g |- impi \u. D] => ?
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_parameter_variable is like with_bound_pattern_meta_variable, but for a parameter variable introduced in the meta-context of a pattern.

val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_substitution_variable is like with_bound_pattern_meta_variable, but for a substitution variable introduced in the meta-context of a pattern.

val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_context_variable is like with_bound_pattern_meta_variable, but for a context variable introduced in the meta-context of a pattern.

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression state is the result of running expression with the free variables added in pattern as bound variables. This is used to disambiguate expression with bound variables arising from free variables in pattern.

  1. pattern is run with respect to state while keeping track of free variables. Variables bound outside the pattern are ignored in lookups.
  2. expression is run with respect to state with the addition of the tracked free variables from patterns as bound variables.

Lookups performed in pattern are more complex. The variables in state count as being unbound, but the variables with binders in the pattern count as bound. Binders in a pattern can be user-specified, or to be reconstructed during abstraction.

A variable is specifically inner bound if it is introduced explicitly by a lambda abstraction or the pattern meta-context, as an explicit or implicit parameter. Free meta-level variables are reconstructed inner bound. For instance, assuming s and ctx are constants:

  • In the pattern (x, x), both occurrences of x are pattern variables, and that pattern is not linear.
  • In the pattern {M : [ |- nat]} [ |- s M], M as introduced in the meta-context is a pattern variable, and M is an inner pattern-bound identifier in s M, so that pattern is linear.
  • In the pattern [ |- \x. s x], there are no pattern variables.
  • In the pattern ([g |- s M], [g |- s M]), g and M are pattern variables in the left projection of the tuple pattern, and inner pattern-bound in the right projection of the tuple pattern. This is because the pattern is reconstructed as {g : ctx} {M : [g |- nat]} ([g |- s M], [g |- s M]).
val with_scope : state -> (state -> 'a) -> 'a

with_scope state m runs m in a nested bindings scope that is discarded afterwards.

val with_parent_scope : state -> (state -> 'a) -> 'a

with_parent_scope state m runs m while ignoring the topmost scope.

This is used for the disambiguation of Harpoon proof scripts because Harpoon hypotheticals are already serialized with all the identifiers in the meta-level and computation-level contexts of the proof.

val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used for backtracking when disambiguating old-style LF type-level and term-level declarations (i.e., x : X where X may be an LF kind or an LF type).

This is also used in REPLs to safely run parsing functions and recover the state in case of a raised exception during disambiguation.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Constants

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_type_constant state ?location ?arity identifier adds identifier as a bound LF type-level constant.

In the disambiguation of a module's declaration, this also adds the constant as one of the module's declarations.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_term_constant is like add_lf_type_constant, but for LF term-level constants.

val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_schema_constant is like add_lf_type_constant, but for schema constants.

val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_inductive_computation_type_constant is like add_lf_type_constant, but for inductive computation-level type constants.

val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_stratified_computation_type_constant is like add_lf_type_constant, but for stratified computation-level type constants.

val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_coinductive_computation_type_constant is like add_lf_type_constant, but for coinductive computation-level type constants.

val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation_computation_type_constant is like add_lf_type_constant, but for computation-level abbreviation type constants.

val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_constructor is like add_lf_type_constant, but for computation-level term constructors.

val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_destructor is like add_lf_type_constant, but for computation-level term destructors.

val add_program_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_program_constant is like add_lf_type_constant, but for computation-level program constants.

val add_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

add_module state ?location identifier m is the result of running m in a module disambiguation state, whereby added constants are kept track of as declarations in the module having identifier.

Lookups

exception Unbound_identifier of Beluga_syntax.Syncom.Identifier.t

Unbound_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is caught whenever a variable lookup fails and identifier can be disambiguated as a free variable.

exception Unbound_qualified_identifier of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_qualified_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is unrecoverable, but is caught during disambiguation to provide better error messages.

exception Unbound_namespace of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_namespace namespace_identifier is raised if a qualified identifier could not be looked up in a disambiguation state because the namespace with identifier namespace_identifier is unbound.

val lookup_toplevel : state -> Beluga_syntax.Syncom.Identifier.t -> Entry.t

lookup_toplevel state identifier is entry if identifier resolves to entry in state. If identifier is unbound in state, then Unbound_identifier identifier is raised.

lookup state identifier is entry if identifier resolves to entry in state. Otherwise:

  • Unbound_identifier ident) is raised if the first segment ident in identifier is unbound.
  • Unbound_namespace namespace_identifier is raised if a segment in identifier other than the first or last is unbound.
  • Unbound_qualified_identifier identifier is raised if the last segment in identifier is unbound.
type maximum_lookup_result =
  1. | Unbound of {
    1. segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  2. | Partially_bound of {
    1. leading_segments : Beluga_syntax.Syncom.Identifier.t Support.List.t;
    2. segment : Beluga_syntax.Syncom.Identifier.t;
    3. entry : Entry.t;
    4. trailing_segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  3. | Bound of {
    1. entry : Entry.t;
    }

maximum_lookup state segments is either:

  • Unbound { segments } if the first segment in segments is unbound in state.
  • Partially_bound { leading_segments; segment; entry; trailing_segments } if the qualified identifier with namespaces leading_segments and name segment is bound to entry in state.
  • Bound { identifier; entry } if segments form a qualified identifier bound to entry in state.
val actual_binding_exn : - Beluga_syntax.Syncom.Qualified_identifier.t -> - Entry.t -> - exn

actual_binding_exn identifier entry is an exception reporting what sort of entry is bound at identifier. The exception is annotated with the entry's binding location.

Signature Operations

val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state module_identifier adds the exported constants from the module bound to module_identifier as toplevel entries in state. If module_identifier is unbound in state, then an exception is raised.

val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t

get_default_associativity state is the associativity to use for infix operators defined by the user using a pragma, without specifying the infix operator's associativity.

val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state default_associativity sets default_associativity as the associativity to return from get_default_associativity.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the precedence to use for operators defined by the user using a pragma, without specifying the operator's precedence.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state default_precedence sets default_precedence as the precedence to return from get_default_precedence.

val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence identifier adds a prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity identifier adds an infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence identifier adds a postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state identifier is Option.Some operator if identifier is bound to an operator with descriptor operator in state, and Option.None otherwise.

This is used to resolve operators in the disambiguation of applications, which are parsed as lists of expressions.

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_module_abbreviation state ?location module_identifier abbreviation adds the synonym abbreviation for the module bound to identifier in state.

An exception is raised if module_identifier is unbound in state, or if module_identifier is not bound to a module in state.

diff --git a/beluga/Beluga_parser/Meta_disambiguation/Make/argument-2-Lf_disambiguation/index.html b/beluga/Beluga_parser/Meta_disambiguation/Make/argument-2-Lf_disambiguation/index.html deleted file mode 100644 index 2fdf1afb0..000000000 --- a/beluga/Beluga_parser/Meta_disambiguation/Make/argument-2-Lf_disambiguation/index.html +++ /dev/null @@ -1,73 +0,0 @@ - -Lf_disambiguation (beluga.Beluga_parser.Meta_disambiguation.Make.Lf_disambiguation)

Parameter Make.Lf_disambiguation

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Disambiguation_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_lf_kind : state -> Synprs.lf_object -> Synext.lf_kind

disambiguate_lf_kind state object_ is kind', the LF kind disambiguated from kind in the disambiguation state state.

val disambiguate_lf_typ : state -> Synprs.lf_object -> Synext.lf_typ

disambiguate_lf_typ state typ is typ', the LF type disambiguated from typ in the disambiguation state state.

val disambiguate_lf_term : state -> Synprs.lf_object -> Synext.lf_term

disambiguate_lf_term state term is term', the LF term disambiguated from term in the disambiguation state state.

diff --git a/beluga/Beluga_parser/Meta_disambiguation/Make/argument-3-Clf_disambiguator/index.html b/beluga/Beluga_parser/Meta_disambiguation/Make/argument-3-Clf_disambiguator/index.html deleted file mode 100644 index 112cad04f..000000000 --- a/beluga/Beluga_parser/Meta_disambiguation/Make/argument-3-Clf_disambiguator/index.html +++ /dev/null @@ -1,93 +0,0 @@ - -Clf_disambiguator (beluga.Beluga_parser.Meta_disambiguation.Make.Clf_disambiguator)

Parameter Make.Clf_disambiguator

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Disambiguation_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_clf_typ : state -> Synprs.clf_object -> Synext.clf_typ
val disambiguate_clf_term : state -> Synprs.clf_object -> Synext.clf_term
val disambiguate_clf_substitution : - state -> - Synprs.clf_context_object -> - Synext.clf_substitution
val with_disambiguated_clf_context : - state -> - Synprs.clf_context_object -> - (state -> Synext.clf_context -> 'a) -> - 'a
val disambiguate_clf_term_pattern : - state -> - Synprs.clf_object -> - Synext.clf_term_pattern
val disambiguate_clf_substitution_pattern : - state -> - Synprs.clf_context_object -> - Synext.clf_substitution_pattern
val with_disambiguated_clf_context_pattern : - state -> - Synprs.clf_context_object -> - (state -> Synext.clf_context_pattern -> 'a) -> - 'a
val disambiguate_clf_context_pattern : - state -> - Synprs.clf_context_object -> - Synext.clf_context_pattern
diff --git a/beluga/Beluga_parser/Meta_disambiguation/Make/index.html b/beluga/Beluga_parser/Meta_disambiguation/Make/index.html deleted file mode 100644 index 9c790f743..000000000 --- a/beluga/Beluga_parser/Meta_disambiguation/Make/index.html +++ /dev/null @@ -1,88 +0,0 @@ - -Make (beluga.Beluga_parser.Meta_disambiguation.Make)

Module Meta_disambiguation.Make

Parameters

Signature

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Disambiguation_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_meta_typ : state -> Synprs.meta_thing -> Synext.meta_typ
val disambiguate_meta_object : state -> Synprs.meta_thing -> Synext.meta_object
val disambiguate_meta_pattern : - state -> - Synprs.meta_thing -> - Beluga_syntax.Synext.Meta.Pattern.t
val disambiguate_schema : state -> Synprs.schema_object -> Synext.schema
val with_disambiguated_meta_context : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
val with_disambiguated_meta_context_pattern : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
diff --git a/beluga/Beluga_parser/Meta_disambiguation/index.html b/beluga/Beluga_parser/Meta_disambiguation/index.html deleted file mode 100644 index 60fce87b8..000000000 --- a/beluga/Beluga_parser/Meta_disambiguation/index.html +++ /dev/null @@ -1,10 +0,0 @@ - -Meta_disambiguation (beluga.Beluga_parser.Meta_disambiguation)

Module Beluga_parser.Meta_disambiguation

module type META_DISAMBIGUATION = sig ... end
diff --git a/beluga/Beluga_parser/Meta_disambiguation/module-type-META_DISAMBIGUATION/index.html b/beluga/Beluga_parser/Meta_disambiguation/module-type-META_DISAMBIGUATION/index.html deleted file mode 100644 index a7a950147..000000000 --- a/beluga/Beluga_parser/Meta_disambiguation/module-type-META_DISAMBIGUATION/index.html +++ /dev/null @@ -1,83 +0,0 @@ - -META_DISAMBIGUATION (beluga.Beluga_parser.Meta_disambiguation.META_DISAMBIGUATION)

Module type Meta_disambiguation.META_DISAMBIGUATION

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_meta_typ : state -> Synprs.meta_thing -> Synext.meta_typ
val disambiguate_meta_object : state -> Synprs.meta_thing -> Synext.meta_object
val disambiguate_meta_pattern : - state -> - Synprs.meta_thing -> - Beluga_syntax.Synext.Meta.Pattern.t
val disambiguate_schema : state -> Synprs.schema_object -> Synext.schema
val with_disambiguated_meta_context : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
val with_disambiguated_meta_context_pattern : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
diff --git a/beluga/Beluga_parser/Meta_parser/Make/argument-1-Parser/index.html b/beluga/Beluga_parser/Meta_parser/Make/argument-1-Parser/index.html deleted file mode 100644 index d5ac7e6a3..000000000 --- a/beluga/Beluga_parser/Meta_parser/Make/argument-1-Parser/index.html +++ /dev/null @@ -1,31 +0,0 @@ - -Parser (beluga.Beluga_parser.Meta_parser.Make.Parser)

Parameter Make.Parser

include Parser_combinator.PARSER - with type token = Located_token.t - with type location = Beluga_syntax.Location.t
type token = Located_token.t
type location = Beluga_syntax.Location.t
type state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

diff --git a/beluga/Beluga_parser/Meta_parser/Make/argument-2-Lf_parser/index.html b/beluga/Beluga_parser/Meta_parser/Make/argument-2-Lf_parser/index.html deleted file mode 100644 index a14429232..000000000 --- a/beluga/Beluga_parser/Meta_parser/Make/argument-2-Lf_parser/index.html +++ /dev/null @@ -1,35 +0,0 @@ - -Lf_parser (beluga.Beluga_parser.Meta_parser.Make.Lf_parser)

Parameter Make.Lf_parser

include Common_parser.COMMON_PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
include Parser_combinator.PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
type token = Parser.token
type location = Parser.location
type state = Parser.state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val lf_kind : Synprs.lf_object t
val lf_typ : Synprs.lf_object t
val lf_term : Synprs.lf_object t
diff --git a/beluga/Beluga_parser/Meta_parser/Make/argument-3-Clf_parser/index.html b/beluga/Beluga_parser/Meta_parser/Make/argument-3-Clf_parser/index.html deleted file mode 100644 index fd924fd40..000000000 --- a/beluga/Beluga_parser/Meta_parser/Make/argument-3-Clf_parser/index.html +++ /dev/null @@ -1,35 +0,0 @@ - -Clf_parser (beluga.Beluga_parser.Meta_parser.Make.Clf_parser)

Parameter Make.Clf_parser

include Common_parser.COMMON_PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
include Parser_combinator.PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
type token = Parser.token
type location = Parser.location
type state = Parser.state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val clf_typ : Synprs.clf_object t
val clf_term : Synprs.clf_object t
val clf_term_pattern : Synprs.clf_object t
val clf_context : Synprs.clf_context_object t
val clf_substitution : Synprs.clf_context_object t
diff --git a/beluga/Beluga_parser/Meta_parser/Make/index.html b/beluga/Beluga_parser/Meta_parser/Make/index.html deleted file mode 100644 index 8486fb57f..000000000 --- a/beluga/Beluga_parser/Meta_parser/Make/index.html +++ /dev/null @@ -1,46 +0,0 @@ - -Make (beluga.Beluga_parser.Meta_parser.Make)

Module Meta_parser.Make

Parameters

module Lf_parser : - Lf_parser.LF_PARSER - with type state = Parser.state - and type token = Parser.token - and type location = Parser.location

Signature

include Common_parser.COMMON_PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
include Parser_combinator.PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
type token = Parser.token
type location = Parser.location
type state = Parser.state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val schema : Synprs.schema_object t
val meta_type : Synprs.meta_thing t
val meta_object : Synprs.meta_thing t
val meta_pattern : Synprs.meta_thing t
val meta_context : Synprs.meta_context_object t
diff --git a/beluga/Beluga_parser/Meta_parser/index.html b/beluga/Beluga_parser/Meta_parser/index.html deleted file mode 100644 index c03c5f319..000000000 --- a/beluga/Beluga_parser/Meta_parser/index.html +++ /dev/null @@ -1,20 +0,0 @@ - -Meta_parser (beluga.Beluga_parser.Meta_parser)

Module Beluga_parser.Meta_parser

module type META_PARSER = sig ... end
diff --git a/beluga/Beluga_parser/Meta_parser/module-type-META_PARSER/index.html b/beluga/Beluga_parser/Meta_parser/module-type-META_PARSER/index.html deleted file mode 100644 index c9cc82a4d..000000000 --- a/beluga/Beluga_parser/Meta_parser/module-type-META_PARSER/index.html +++ /dev/null @@ -1,29 +0,0 @@ - -META_PARSER (beluga.Beluga_parser.Meta_parser.META_PARSER)

Module type Meta_parser.META_PARSER

include Common_parser.COMMON_PARSER
include Parser_combinator.PARSER
type token
type location
type state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val schema : Synprs.schema_object t
val meta_type : Synprs.meta_thing t
val meta_object : Synprs.meta_thing t
val meta_pattern : Synprs.meta_thing t
val meta_context : Synprs.meta_context_object t
diff --git a/beluga/Beluga_parser/Parser/Disambiguation/Entry/index.html b/beluga/Beluga_parser/Parser/Disambiguation/Entry/index.html deleted file mode 100644 index 876ce0e6a..000000000 --- a/beluga/Beluga_parser/Parser/Disambiguation/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga_parser.Parser.Disambiguation.Entry)

Module Disambiguation.Entry

val is_lf_variable : t -> Stdlib.Bool.t
val is_meta_variable : t -> Stdlib.Bool.t
val is_parameter_variable : t -> Stdlib.Bool.t
val is_substitution_variable : t -> Stdlib.Bool.t
val is_context_variable : t -> Stdlib.Bool.t
val is_computation_variable : t -> Stdlib.Bool.t
val is_variable : t -> Stdlib.Bool.t
val is_lf_type_constant : t -> Stdlib.Bool.t
val is_lf_term_constant : t -> Stdlib.Bool.t
val is_schema_constant : t -> Stdlib.Bool.t
val is_computation_inductive_type_constant : t -> Stdlib.Bool.t
val is_computation_stratified_type_constant : t -> Stdlib.Bool.t
val is_computation_coinductive_type_constant : t -> Stdlib.Bool.t
val is_computation_abbreviation_type_constant : t -> Stdlib.Bool.t
val is_computation_term_constructor : t -> Stdlib.Bool.t
val is_computation_term_destructor : t -> Stdlib.Bool.t
val is_program_constant : t -> Stdlib.Bool.t
val is_module : t -> Stdlib.Bool.t
diff --git a/beluga/Beluga_parser/Parser/Disambiguation/index.html b/beluga/Beluga_parser/Parser/Disambiguation/index.html deleted file mode 100644 index ee596f4c9..000000000 --- a/beluga/Beluga_parser/Parser/Disambiguation/index.html +++ /dev/null @@ -1,374 +0,0 @@ - -Disambiguation (beluga.Beluga_parser.Parser.Disambiguation)

Module Parser.Disambiguation

module Entry : sig ... end
val add_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_free_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_free_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b
val with_scope : state -> (state -> 'a) -> 'a
val with_parent_scope : state -> (state -> 'a) -> 'a
val with_bindings_checkpoint : state -> (state -> 'a) -> 'a
val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_program_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val add_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
exception Unbound_identifier of Beluga_syntax.Syncom.Identifier.t
exception Unbound_qualified_identifier of Beluga_syntax.Syncom.Qualified_identifier.t
exception Unbound_namespace of Beluga_syntax.Syncom.Qualified_identifier.t
val lookup_toplevel : state -> Beluga_syntax.Syncom.Identifier.t -> Entry.t
type maximum_lookup_result = - Make_disambiguation(Disambiguation_state).maximum_lookup_result = -
  1. | Unbound of {
    1. segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  2. | Partially_bound of {
    1. leading_segments : Beluga_syntax.Syncom.Identifier.t Support.List.t;
    2. segment : Beluga_syntax.Syncom.Identifier.t;
    3. entry : Entry.t;
    4. trailing_segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  3. | Bound of {
    1. entry : Entry.t;
    }
val actual_binding_exn : - Beluga_syntax.Syncom.Qualified_identifier.t -> - Entry.t -> - exn
val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t
val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t
val get_default_precedence : state -> Support.Int.t
val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t
val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t
val apply_postponed_fixity_pragmas : state -> unit
val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t
val disambiguate_lf_kind : state -> Synprs.lf_object -> Synext.lf_kind
val disambiguate_lf_typ : state -> Synprs.lf_object -> Synext.lf_typ
val disambiguate_lf_term : state -> Synprs.lf_object -> Synext.lf_term
val disambiguate_clf_typ : state -> Synprs.clf_object -> Synext.clf_typ
val disambiguate_clf_term : state -> Synprs.clf_object -> Synext.clf_term
val disambiguate_clf_substitution : - state -> - Synprs.clf_context_object -> - Synext.clf_substitution
val with_disambiguated_clf_context : - state -> - Synprs.clf_context_object -> - (state -> Synext.clf_context -> 'a) -> - 'a
val disambiguate_clf_term_pattern : - state -> - Synprs.clf_object -> - Synext.clf_term_pattern
val disambiguate_clf_substitution_pattern : - state -> - Synprs.clf_context_object -> - Synext.clf_substitution_pattern
val with_disambiguated_clf_context_pattern : - state -> - Synprs.clf_context_object -> - (state -> Synext.clf_context_pattern -> 'a) -> - 'a
val disambiguate_clf_context_pattern : - state -> - Synprs.clf_context_object -> - Synext.clf_context_pattern
val disambiguate_meta_typ : state -> Synprs.meta_thing -> Synext.meta_typ
val disambiguate_meta_object : state -> Synprs.meta_thing -> Synext.meta_object
val disambiguate_meta_pattern : - state -> - Synprs.meta_thing -> - Beluga_syntax.Synext.Meta.Pattern.t
val disambiguate_schema : state -> Synprs.schema_object -> Synext.schema
val with_disambiguated_meta_context : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
val with_disambiguated_meta_context_pattern : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
val disambiguate_comp_kind : - state -> - Synprs.comp_sort_object -> - Synext.comp_kind
val disambiguate_comp_typ : state -> Synprs.comp_sort_object -> Synext.comp_typ
val disambiguate_comp_expression : - state -> - Synprs.comp_expression_object -> - Synext.comp_expression
val disambiguate_comp_pattern : - state -> - Synprs.comp_pattern_object -> - Synext.comp_pattern
val disambiguate_comp_copattern : - state -> - Synprs.comp_copattern_object Support.List1.t -> - Synext.comp_copattern
val with_disambiguated_comp_context : - state -> - Synprs.comp_context_object -> - (state -> Synext.comp_context -> 'a) -> - 'a
val disambiguate_harpoon_proof : - state -> - Synprs.harpoon_proof -> - Synext.harpoon_proof
val with_disambiguated_harpoon_command : - state -> - Synprs.harpoon_command -> - (state -> Synext.harpoon_command -> 'a) -> - 'a
val disambiguate_harpoon_directive : - state -> - Synprs.harpoon_directive -> - Synext.harpoon_directive
val disambiguate_harpoon_split_branch : - state -> - Synprs.harpoon_split_branch -> - Synext.harpoon_split_branch
val disambiguate_harpoon_suffices_branch : - state -> - Synprs.harpoon_suffices_branch -> - Synext.harpoon_suffices_branch
val disambiguate_harpoon_hypothetical : - state -> - Synprs.harpoon_hypothetical -> - Synext.harpoon_hypothetical
val disambiguate_harpoon_repl_command : - state -> - Synprs.harpoon_repl_command -> - Synext.harpoon_repl_command
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t
val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t
val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t
val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t
val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val disambiguate_pragma : - state -> - Synprs.signature_pragma -> - Synext.signature_pragma
val disambiguate_global_pragma : - state -> - Synprs.signature_global_pragma -> - Synext.signature_global_pragma
val disambiguate_totality_declaration : - state -> - Synprs.signature_totality_declaration -> - Synext.signature_totality_declaration
val disambiguate_declaration : - state -> - Synprs.signature_declaration -> - Synext.signature_declaration
val disambiguate_signature_file : - state -> - Synprs.signature_file -> - Synext.signature_file
val disambiguate_signature : state -> Synprs.signature -> Synext.signature
diff --git a/beluga/Beluga_parser/Parser/Parser_state/index.html b/beluga/Beluga_parser/Parser/Parser_state/index.html deleted file mode 100644 index a84a209dc..000000000 --- a/beluga/Beluga_parser/Parser/Parser_state/index.html +++ /dev/null @@ -1,58 +0,0 @@ - -Parser_state (beluga.Beluga_parser.Parser.Parser_state)

Module Parser.Parser_state

type state
type !'a t = state -> state * 'a
val get : state t
val put : state -> unit t
val modify : (state -> state) -> unit t
val run : 'a t -> state -> state * 'a
val eval : 'a t -> state -> 'a
val exec : 'a t -> state -> state
val traverse_tuple2 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a1 * 'a2) -> - ('b1 * 'b2) t
val traverse_tuple3 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a3 -> 'b3 t) -> - ('a1 * 'a2 * 'a3) -> - ('b1 * 'b2 * 'b3) t
val traverse_list : ('a -> 'b t) -> 'a Support.List.t -> 'b Support.List.t t
val traverse_list1 : ('a -> 'b t) -> 'a Support.List1.t -> 'b Support.List1.t t
val traverse_list2 : ('a -> 'b t) -> 'a Support.List2.t -> 'b Support.List2.t t
val traverse_list_void : ('a -> 'b t) -> 'a Support.List.t -> Stdlib.Unit.t t
val traverse_list1_void : ('a -> 'b t) -> 'a Support.List1.t -> Stdlib.Unit.t t
val traverse_list2_void : ('a -> 'b t) -> 'a Support.List2.t -> Stdlib.Unit.t t
val traverse_reverse_list : - ('a -> 'b t) -> - 'a Support.List.t -> - 'b Support.List.t t
val traverse_reverse_list1 : - ('a -> 'b t) -> - 'a Support.List1.t -> - 'b Support.List1.t t
val traverse_reverse_list2 : - ('a -> 'b t) -> - 'a Support.List2.t -> - 'b Support.List2.t t
val traverse_reverse_list_void : - ('a -> 'b t) -> - 'a Support.List.t -> - Stdlib.Unit.t t
val traverse_reverse_list1_void : - ('a -> 'b t) -> - 'a Support.List1.t -> - Stdlib.Unit.t t
val traverse_reverse_list2_void : - ('a -> 'b t) -> - 'a Support.List2.t -> - Stdlib.Unit.t t
val traverse_option : - ('a -> 'b t) -> - 'a Support.Option.t -> - 'b Support.Option.t t
val traverse_option_void : - ('a -> 'b t) -> - 'a Support.Option.t -> - Stdlib.Unit.t t
val seq_list : 'a t Support.List.t -> 'a Support.List.t t
val seq_list1 : 'a t Support.List1.t -> 'a Support.List1.t t
val seq_list_void : unit t list -> unit t
val return : 'a -> 'a t
val bind : ('a -> 'b t) -> 'a t -> 'b t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t
val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t
val let* : 'a t -> ('a -> 'b t) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
val map : ('a -> 'b) -> 'a t -> 'b t
val ($>) : 'a t -> ('a -> 'b) -> 'b t
val let+ : 'a t -> ('a -> 'b) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val ap : 'a t -> ('a -> 'b) t -> 'b t
val (<&>) : ('a -> 'b) t -> 'a t -> 'b t
val ap_first : 'b t -> 'a t -> 'a t
val (<&) : 'a t -> 'b t -> 'a t
val ap_second : 'b t -> 'a t -> 'b t
val (&>) : 'a t -> 'b t -> 'b t
val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t
val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t
val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t
val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t
val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t
val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t
val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t
val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t
val replicate : int -> 'a t -> 'a list t
type token = Located_token.t
val peek : token option t
val observe : token option t
val accept : unit t
val insert : token -> unit t
type location = Located_token.location
val next_location : location option t
val previous_location : location option t
val enable_backtracking : unit t
val disable_backtracking : unit t
val can_backtrack : bool t
val allow_backtracking_on_error : - ('a, 'e) Stdlib.result t -> - ('a, 'e) Stdlib.result t
val with_checkpoint : - ('a, 'e) Stdlib.result t -> - ('a, [> `Backtracked of 'e | `Did_not_backtrack of 'e ]) Stdlib.result t
val initial : ?initial_location:location -> token Support.Seq.t -> state
diff --git a/beluga/Beluga_parser/Parser/Parsing/index.html b/beluga/Beluga_parser/Parser/Parsing/index.html deleted file mode 100644 index 2e4f6cb9a..000000000 --- a/beluga/Beluga_parser/Parser/Parsing/index.html +++ /dev/null @@ -1,125 +0,0 @@ - -Parsing (beluga.Beluga_parser.Parser.Parsing)

Module Parser.Parsing

type state = Parser_state.state
val get : state -> state * state
val put : state -> state -> state * unit
val modify : (state -> state) -> state -> state * unit
val eval : (state -> state * 'a) -> state -> 'a0
val exec : (state -> state * 'a) -> state -> state
val traverse_tuple2 : - ('a1 -> state -> state * 'b1) -> - ('a2 -> state -> state * 'b2) -> - ('a1 * 'a2) -> - state -> - state * ('b10 * 'b20)
val traverse_tuple3 : - ('a1 -> state -> state * 'b1) -> - ('a2 -> state -> state * 'b2) -> - ('a3 -> state -> state * 'b3) -> - ('a1 * 'a2 * 'a3) -> - state -> - state * ('b10 * 'b20 * 'b30)
val traverse_list : - ('a -> state -> state * 'b) -> - 'a Support.List.t -> - state -> - state * 'b0 Support.List.t
val traverse_list1 : - ('a -> state -> state * 'b) -> - 'a Support.List1.t -> - state -> - state * 'b0 Support.List1.t
val traverse_list2 : - ('a -> state -> state * 'b) -> - 'a Support.List2.t -> - state -> - state * 'b0 Support.List2.t
val traverse_list_void : - ('a -> state -> state * 'b) -> - 'a Support.List.t -> - state -> - state * Stdlib.Unit.t
val traverse_list1_void : - ('a -> state -> state * 'b) -> - 'a Support.List1.t -> - state -> - state * Stdlib.Unit.t
val traverse_list2_void : - ('a -> state -> state * 'b) -> - 'a Support.List2.t -> - state -> - state * Stdlib.Unit.t
val traverse_reverse_list : - ('a -> state -> state * 'b) -> - 'a Support.List.t -> - state -> - state * 'b0 Support.List.t
val traverse_reverse_list1 : - ('a -> state -> state * 'b) -> - 'a Support.List1.t -> - state -> - state * 'b0 Support.List1.t
val traverse_reverse_list2 : - ('a -> state -> state * 'b) -> - 'a Support.List2.t -> - state -> - state * 'b0 Support.List2.t
val traverse_reverse_list_void : - ('a -> state -> state * 'b) -> - 'a Support.List.t -> - state -> - state * Stdlib.Unit.t
val traverse_reverse_list1_void : - ('a -> state -> state * 'b) -> - 'a Support.List1.t -> - state -> - state * Stdlib.Unit.t
val traverse_reverse_list2_void : - ('a -> state -> state * 'b) -> - 'a Support.List2.t -> - state -> - state * Stdlib.Unit.t
val traverse_option : - ('a -> state -> state * 'b) -> - 'a Support.Option.t -> - state -> - state * 'b0 Support.Option.t
val traverse_option_void : - ('a -> state -> state * 'b) -> - 'a Support.Option.t -> - state -> - state * Stdlib.Unit.t
val seq_list : - (state -> state * 'a) Support.List.t -> - state -> - state * 'a0 Support.List.t
val seq_list1 : - (state -> state * 'a) Support.List1.t -> - state -> - state * 'a0 Support.List1.t
val seq_list_void : (state -> state * unit) list -> state -> state * unit
val peek : state -> state * Located_token.t option
val observe : state -> state * Located_token.t option
val accept : state -> state * unit
val insert : Located_token.t -> state -> state * unit
val next_location : state -> state * Beluga_syntax.Location.t option
val previous_location : state -> state * Beluga_syntax.Location.t option
val enable_backtracking : state -> state * unit
val disable_backtracking : state -> state * unit
val can_backtrack : state -> state * bool
val allow_backtracking_on_error : - (state -> state * ('a, 'e) Stdlib.result) -> - state -> - state * ('a, 'e) Stdlib.result
val with_checkpoint : - (state -> state * ('a, 'e) Stdlib.result) -> - state -> - state - * ('a, [> `Backtracked of 'e | `Did_not_backtrack of 'e ]) Stdlib.result
val lf_kind : state -> state * (Synprs.lf_object, exn) Stdlib.result
val lf_typ : state -> state * (Synprs.lf_object, exn) Stdlib.result
val lf_term : state -> state * (Synprs.lf_object, exn) Stdlib.result
val clf_typ : state -> state * (Synprs.clf_object, exn) Stdlib.result
val clf_term : state -> state * (Synprs.clf_object, exn) Stdlib.result
val clf_term_pattern : state -> state * (Synprs.clf_object, exn) Stdlib.result
val clf_context : - state -> - state * (Synprs.clf_context_object, exn) Stdlib.result
val clf_substitution : - state -> - state * (Synprs.clf_context_object, exn) Stdlib.result
val schema : state -> state * (Synprs.schema_object, exn) Stdlib.result
val meta_type : state -> state * (Synprs.meta_thing, exn) Stdlib.result
val meta_object : state -> state * (Synprs.meta_thing, exn) Stdlib.result
val meta_pattern : state -> state * (Synprs.meta_thing, exn) Stdlib.result
val meta_context : - state -> - state * (Synprs.meta_context_object, exn) Stdlib.result
val comp_kind : state -> state * (Synprs.comp_sort_object, exn) Stdlib.result
val comp_typ : state -> state * (Synprs.comp_sort_object, exn) Stdlib.result
val comp_pattern : - state -> - state * (Synprs.comp_pattern_object, exn) Stdlib.result
val comp_copattern : - state -> - state * (Synprs.comp_copattern_object, exn) Stdlib.result
val comp_expression : - state -> - state * (Synprs.comp_expression_object, exn) Stdlib.result
val comp_context : - state -> - state * (Synprs.comp_context_object, exn) Stdlib.result
val harpoon_proof : state -> state * (Synprs.harpoon_proof, exn) Stdlib.result
val interactive_harpoon_command : - state -> - state * (Synprs.harpoon_repl_command, exn) Stdlib.result
type token = Parser_state.token
type location = Parser_state.location
type !'a t = state -> state * ('a, exn) Stdlib.result
type !'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
val return : 'a -> 'a t
val bind : ('a -> 'b t) -> 'a t -> 'b t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t
val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t
val let* : 'a t -> ('a -> 'b t) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
val map : ('a -> 'b) -> 'a t -> 'b t
val ($>) : 'a t -> ('a -> 'b) -> 'b t
val let+ : 'a t -> ('a -> 'b) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val ap : 'a t -> ('a -> 'b) t -> 'b t
val (<&>) : ('a -> 'b) t -> 'a t -> 'b t
val ap_first : 'b t -> 'a t -> 'a t
val (<&) : 'a t -> 'b t -> 'a t
val ap_second : 'b t -> 'a t -> 'b t
val (&>) : 'a t -> 'b t -> 'b t
val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t
val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t
val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t
val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t
val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t
val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t
val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t
val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t
val replicate : int -> 'a t -> 'a list t
val run : 'a t -> state -> state * ('a, exn) Stdlib.result
val run_exn : 'a t -> state -> state * 'a
val eval_exn : 'a t -> state -> 'a
val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t
val fail : exn -> 'a t
val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t
val fail_at_next_location : exn -> 'a t
val fail_at_previous_location : exn -> 'a t
val labelled : string -> 'a t -> 'a t
val span : 'a t -> (location * 'a) t
val only : 'a t -> 'a t
val maybe : 'a t -> 'a option t
val void : 'a t -> unit t
val many : 'a t -> 'a list t
val some : 'a t -> 'a Support.List1.t t
val sep_by0 : sep:unit t -> 'a t -> 'a list t
val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t
val trying : 'a t -> 'a t
val choice : 'a t Support.List.t -> 'a t
val alt : 'a t -> 'a t -> 'a t
val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t
val eoi : unit t
val insert_token : token -> unit t
val keyword : string -> unit t
val integer : int t
val dot_integer : int t
val pragma : string -> unit t
val string_literal : string t
val dot : unit t
val dots : unit t
val comma : unit t
val colon : unit t
val semicolon : unit t
val slash : unit t
val equals : unit t
val lambda : unit t
val hat : unit t
val underscore : unit t
val pipe : unit t
val forward_arrow : unit t
val backward_arrow : unit t
val thick_forward_arrow : unit t
val plus : unit t
val star : unit t
val hash : unit t
val double_colon : unit t
val turnstile : unit t
val turnstile_hash : unit t
val left_parenthesis : unit t
val right_parenthesis : unit t
val left_brace : unit t
val right_brace : unit t
val left_brack : unit t
val right_brack : unit t
val left_angle : unit t
val right_angle : unit t
val parens : 'a t -> 'a t
val braces : 'a t -> 'a t
val bracks : 'a t -> 'a t
val angles : 'a t -> 'a t
val opt_parens : 'a t -> 'a t
val opt_braces : 'a t -> 'a t
val opt_bracks : 'a t -> 'a t
val opt_angles : 'a t -> 'a t
val hash_parens : 'a t -> 'a t
val dollar_parens : 'a t -> 'a t
val hash_bracks : 'a t -> 'a t
val dollar_bracks : 'a t -> 'a t
val identifier : Beluga_syntax.Identifier.t t
val dot_identifier : Beluga_syntax.Identifier.t t
val hash_identifier : Beluga_syntax.Identifier.t t
val dollar_identifier : Beluga_syntax.Identifier.t t
val omittable_identifier : Beluga_syntax.Identifier.t option t
val omittable_hash_identifier : Beluga_syntax.Identifier.t option t
val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t
val qualified_identifier : Beluga_syntax.Qualified_identifier.t t
val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t
val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t
val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t
val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t
val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser
val block_comment : (Beluga_syntax.Location.t * string) t
val signature_file : Synprs.signature_file t
val signature_global_pragma : Synprs.signature_global_pragma t
val signature_entry : Synprs.signature_entry t
val signature_declaration : Synprs.signature_declaration t
val trust_totality_declaration : Synprs.signature_totality_declaration t
val named_totality_declaration : Synprs.signature_totality_declaration t
val numeric_totality_declaration : Synprs.signature_totality_declaration t
val totality_declaration : Synprs.signature_totality_declaration t
diff --git a/beluga/Beluga_parser/Parser/index.html b/beluga/Beluga_parser/Parser/index.html deleted file mode 100644 index b3d1777d5..000000000 --- a/beluga/Beluga_parser/Parser/index.html +++ /dev/null @@ -1,74 +0,0 @@ - -Parser (beluga.Beluga_parser.Parser)

Module Beluga_parser.Parser

module Parser_state : sig ... end
module Disambiguation_state = Disambiguation_state.Disambiguation_state
include sig ... end
module Parsing : sig ... end
module Disambiguation : sig ... end
type !'a t = state -> state * 'a
val get : state t
val put : state -> unit t
val modify : (state -> state) -> unit t
val run : 'a t -> state -> state * 'a
val eval : 'a t -> state -> 'a
val exec : 'a t -> state -> state
val traverse_tuple2 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a1 * 'a2) -> - ('b1 * 'b2) t
val traverse_tuple3 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a3 -> 'b3 t) -> - ('a1 * 'a2 * 'a3) -> - ('b1 * 'b2 * 'b3) t
val traverse_list : ('a -> 'b t) -> 'a Support.List.t -> 'b Support.List.t t
val traverse_list1 : ('a -> 'b t) -> 'a Support.List1.t -> 'b Support.List1.t t
val traverse_list2 : ('a -> 'b t) -> 'a Support.List2.t -> 'b Support.List2.t t
val traverse_list_void : ('a -> 'b t) -> 'a Support.List.t -> Stdlib.Unit.t t
val traverse_list1_void : ('a -> 'b t) -> 'a Support.List1.t -> Stdlib.Unit.t t
val traverse_list2_void : ('a -> 'b t) -> 'a Support.List2.t -> Stdlib.Unit.t t
val traverse_reverse_list : - ('a -> 'b t) -> - 'a Support.List.t -> - 'b Support.List.t t
val traverse_reverse_list1 : - ('a -> 'b t) -> - 'a Support.List1.t -> - 'b Support.List1.t t
val traverse_reverse_list2 : - ('a -> 'b t) -> - 'a Support.List2.t -> - 'b Support.List2.t t
val traverse_reverse_list_void : - ('a -> 'b t) -> - 'a Support.List.t -> - Stdlib.Unit.t t
val traverse_reverse_list1_void : - ('a -> 'b t) -> - 'a Support.List1.t -> - Stdlib.Unit.t t
val traverse_reverse_list2_void : - ('a -> 'b t) -> - 'a Support.List2.t -> - Stdlib.Unit.t t
val traverse_option : - ('a -> 'b t) -> - 'a Support.Option.t -> - 'b Support.Option.t t
val traverse_option_void : - ('a -> 'b t) -> - 'a Support.Option.t -> - Stdlib.Unit.t t
val seq_list : 'a t Support.List.t -> 'a Support.List.t t
val seq_list1 : 'a t Support.List1.t -> 'a Support.List1.t t
val seq_list_void : unit t list -> unit t
val return : 'a -> 'a t
val bind : ('a -> 'b t) -> 'a t -> 'b t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t
val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t
val let* : 'a t -> ('a -> 'b t) -> 'b t
val and* : 'a t -> 'b t -> ('a * 'b) t
val map : ('a -> 'b) -> 'a t -> 'b t
val ($>) : 'a t -> ('a -> 'b) -> 'b t
val let+ : 'a t -> ('a -> 'b) -> 'b t
val and+ : 'a t -> 'b t -> ('a * 'b) t
val ap : 'a t -> ('a -> 'b) t -> 'b t
val (<&>) : ('a -> 'b) t -> 'a t -> 'b t
val ap_first : 'b t -> 'a t -> 'a t
val (<&) : 'a t -> 'b t -> 'a t
val ap_second : 'b t -> 'a t -> 'b t
val (&>) : 'a t -> 'b t -> 'b t
val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t
val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t
val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t
val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t
val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t
val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t
val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t
val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t
val replicate : int -> 'a t -> 'a list t
val make_state : - parser_state:Parser_state.state -> - disambiguation_state:Disambiguation_state.state -> - state
val set_parser_state : Parser_state.state -> Stdlib.Unit.t t
val get_parser_state : Parser_state.state t
val set_disambiguation_state : Disambiguation_state.state -> Stdlib.Unit.t t
val get_disambiguation_state : Disambiguation_state.state t
val parse_and_disambiguate : - parser:'a Parsing.t -> - disambiguator:(Disambiguation.state -> 'a -> 'b) -> - 'b t
val make_initial_parser_state_from_channel : - initial_location:Beluga_syntax.Location.t -> - Stdlib.in_channel -> - Parser_state.state
val make_initial_parser_state_from_string : - initial_location:Beluga_syntax.Location.t -> - string -> - Parser_state.state
val make_initial_state_from_channel : - disambiguation_state:Disambiguation_state.state -> - initial_location:Beluga_syntax.Location.t -> - channel:Stdlib.in_channel -> - state
val make_initial_state_from_string : - disambiguation_state:Disambiguation_state.state -> - initial_location:Beluga_syntax.Location.t -> - input:string -> - state
val read_multi_file_signature : string Support.List1.t -> Synext.signature
diff --git a/beluga/Beluga_parser/Parser_combinator/Make/argument-1-State/index.html b/beluga/Beluga_parser/Parser_combinator/Make/argument-1-State/index.html deleted file mode 100644 index 791e3c366..000000000 --- a/beluga/Beluga_parser/Parser_combinator/Make/argument-1-State/index.html +++ /dev/null @@ -1,58 +0,0 @@ - -State (beluga.Beluga_parser.Parser_combinator.Make.State)

Parameter Make.State

include Support.State.STATE
type state

The type of states inside the monad.

type 'a t = state -> state * 'a
val get : state t

Return the state from the internals of the monad.

val put : state -> unit t

Replace the state inside the monad.

val modify : (state -> state) -> unit t

Modify the state inside the monad.

val run : 'a t -> state -> state * 'a

run a init runs a with initial state init, returning (final, v) where final is the final state and v is the output.

val eval : 'a t -> state -> 'a

eval a init is run a init = (final, v), but outputs only v.

val exec : 'a t -> state -> state

exec a init is run a init = (final, v), but outputs only final.

Traversals

val traverse_tuple2 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a1 * 'a2) -> - ('b1 * 'b2) t
val traverse_tuple3 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a3 -> 'b3 t) -> - ('a1 * 'a2 * 'a3) -> - ('b1 * 'b2 * 'b3) t
val traverse_list : ('a -> 'b t) -> 'a Support.List.t -> 'b Support.List.t t
val traverse_list1 : ('a -> 'b t) -> 'a Support.List1.t -> 'b Support.List1.t t
val traverse_list2 : ('a -> 'b t) -> 'a Support.List2.t -> 'b Support.List2.t t
val traverse_list_void : ('a -> _ t) -> 'a Support.List.t -> Stdlib.Unit.t t
val traverse_list1_void : ('a -> _ t) -> 'a Support.List1.t -> Stdlib.Unit.t t
val traverse_list2_void : ('a -> _ t) -> 'a Support.List2.t -> Stdlib.Unit.t t
val traverse_reverse_list : - ('a -> 'b t) -> - 'a Support.List.t -> - 'b Support.List.t t
val traverse_reverse_list1 : - ('a -> 'b t) -> - 'a Support.List1.t -> - 'b Support.List1.t t
val traverse_reverse_list2 : - ('a -> 'b t) -> - 'a Support.List2.t -> - 'b Support.List2.t t
val traverse_reverse_list_void : - ('a -> _ t) -> - 'a Support.List.t -> - Stdlib.Unit.t t
val traverse_reverse_list1_void : - ('a -> _ t) -> - 'a Support.List1.t -> - Stdlib.Unit.t t
val traverse_reverse_list2_void : - ('a -> _ t) -> - 'a Support.List2.t -> - Stdlib.Unit.t t
val traverse_option : - ('a -> 'b t) -> - 'a Support.Option.t -> - 'b Support.Option.t t
val traverse_option_void : - ('a -> _ t) -> - 'a Support.Option.t -> - Stdlib.Unit.t t
val seq_list : 'a t Support.List.t -> 'a Support.List.t t
val seq_list1 : 'a t Support.List1.t -> 'a Support.List1.t t
val seq_list_void : unit t list -> unit t

seq_list_void [x1; x2; ...; xn] performs x1, x2, ..., xn in order.

Instances

include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

Lexing

type token

The type of token in the finite stream being parsed.

val peek : token option t

peek state is (state', token_opt) where token_opt is the next unconsumed token in state. If token_opt = Option.None, then the end of the input stream was reached. Otherwise, token_opt = Option.Some token. The token is not consumed, meaning that state' is not advanced to the next token in the stream.

val observe : token option t

observed state is like peek state, but the observed token is consumed.

val accept : unit t

accept state is (state', ()) where state' is derived from state by consuming the next token in the input stream. This effectively observes and discards the next token in state.

val insert : token -> unit t

insert token state is (state', ()) where state' is derived from state by inserting token at the beginning of the input stream. That is, token is the next token in state'.

Locations

type location = Beluga_syntax.Location.t

The type of locations with which input tokens are annotated.

val next_location : location option t

next_location state is (state', next_location_opt) where next_location_opt is the location of the next token in state. This does not advance the input stream. next_location_opt = Option.None at the end of the input stream.

val previous_location : location option t

previous_location state is (state', previous_location_opt) where previous_location_opt is the location of the last token in state to have been consumed. previous_location_opt = Option.None at the beginning of the input stream.

Backtracking

val enable_backtracking : unit t

enable_backtracking state is (state', ()) where state' has backtracking enabled.

val disable_backtracking : unit t

enable_backtracking state is (state', ()) where state' has backtracking disabled.

val can_backtrack : bool t

can_backtrack state is (state', flag) where flag = true indicates that state and state' allow backtracking out of an erroneous result, and flag = false otherwise.

val allow_backtracking_on_error : - ('a, 'e) Stdlib.result t -> - ('a, 'e) Stdlib.result t

allow_backtracking_on_error m is m' such that m' state is (state', x) with backtracking enabled in state' if x = Result.Error cause. That is, this combinator enables backtracking if m' produces an error. Backtracking then needs to be manually disabled afterwards.

val with_checkpoint : - ('a, 'e) Stdlib.result t -> - ('a, [> `Backtracked of 'e | `Did_not_backtrack of 'e ]) Stdlib.result t

with_checkpoint m is m' such that m' state marks the current state, performs m, then either

  • discards the marked state if m state = (state', Result.Ok x),
  • backtracks to the marked state if m state = (state', Result.Error cause).

The output error from m is additionally annotated with whether backtracking occurred.

In the case of a parser m, backtracking can occur if backtracking is enabled with allow_backtracking_on_error, or if m did not consume any input.

diff --git a/beluga/Beluga_parser/Parser_combinator/Make/index.html b/beluga/Beluga_parser/Parser_combinator/Make/index.html deleted file mode 100644 index 7058106f4..000000000 --- a/beluga/Beluga_parser/Parser_combinator/Make/index.html +++ /dev/null @@ -1,24 +0,0 @@ - -Make (beluga.Beluga_parser.Parser_combinator.Make)

Module Parser_combinator.Make

Parameters

Signature

type token = State.token
type location = State.location
type state = State.state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

diff --git a/beluga/Beluga_parser/Parser_combinator/Make_persistent_state/argument-1-Token/index.html b/beluga/Beluga_parser/Parser_combinator/Make_persistent_state/argument-1-Token/index.html deleted file mode 100644 index 210babb00..000000000 --- a/beluga/Beluga_parser/Parser_combinator/Make_persistent_state/argument-1-Token/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Token (beluga.Beluga_parser.Parser_combinator.Make_persistent_state.Token)

Parameter Make_persistent_state.Token

type t

The type of element annotated with a location.

type location

The type of location annotation.

val location : t -> location

location e is the location of e.

diff --git a/beluga/Beluga_parser/Parser_combinator/Make_persistent_state/index.html b/beluga/Beluga_parser/Parser_combinator/Make_persistent_state/index.html deleted file mode 100644 index 86bb21ff4..000000000 --- a/beluga/Beluga_parser/Parser_combinator/Make_persistent_state/index.html +++ /dev/null @@ -1,60 +0,0 @@ - -Make_persistent_state (beluga.Beluga_parser.Parser_combinator.Make_persistent_state)

Module Parser_combinator.Make_persistent_state

Functor creating an instance of PARSER_STATE backed by an immutable data structure.

Parameters

module Token : LOCATED

Signature

include PARSER_STATE - with type token = Token.t - and type location = Token.location
include Support.State.STATE
type state

The type of states inside the monad.

type 'a t = state -> state * 'a
val get : state t

Return the state from the internals of the monad.

val put : state -> unit t

Replace the state inside the monad.

val modify : (state -> state) -> unit t

Modify the state inside the monad.

val run : 'a t -> state -> state * 'a

run a init runs a with initial state init, returning (final, v) where final is the final state and v is the output.

val eval : 'a t -> state -> 'a

eval a init is run a init = (final, v), but outputs only v.

val exec : 'a t -> state -> state

exec a init is run a init = (final, v), but outputs only final.

Traversals

val traverse_tuple2 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a1 * 'a2) -> - ('b1 * 'b2) t
val traverse_tuple3 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a3 -> 'b3 t) -> - ('a1 * 'a2 * 'a3) -> - ('b1 * 'b2 * 'b3) t
val traverse_list : ('a -> 'b t) -> 'a Support.List.t -> 'b Support.List.t t
val traverse_list1 : ('a -> 'b t) -> 'a Support.List1.t -> 'b Support.List1.t t
val traverse_list2 : ('a -> 'b t) -> 'a Support.List2.t -> 'b Support.List2.t t
val traverse_list_void : ('a -> _ t) -> 'a Support.List.t -> Stdlib.Unit.t t
val traverse_list1_void : ('a -> _ t) -> 'a Support.List1.t -> Stdlib.Unit.t t
val traverse_list2_void : ('a -> _ t) -> 'a Support.List2.t -> Stdlib.Unit.t t
val traverse_reverse_list : - ('a -> 'b t) -> - 'a Support.List.t -> - 'b Support.List.t t
val traverse_reverse_list1 : - ('a -> 'b t) -> - 'a Support.List1.t -> - 'b Support.List1.t t
val traverse_reverse_list2 : - ('a -> 'b t) -> - 'a Support.List2.t -> - 'b Support.List2.t t
val traverse_reverse_list_void : - ('a -> _ t) -> - 'a Support.List.t -> - Stdlib.Unit.t t
val traverse_reverse_list1_void : - ('a -> _ t) -> - 'a Support.List1.t -> - Stdlib.Unit.t t
val traverse_reverse_list2_void : - ('a -> _ t) -> - 'a Support.List2.t -> - Stdlib.Unit.t t
val traverse_option : - ('a -> 'b t) -> - 'a Support.Option.t -> - 'b Support.Option.t t
val traverse_option_void : - ('a -> _ t) -> - 'a Support.Option.t -> - Stdlib.Unit.t t
val seq_list : 'a t Support.List.t -> 'a Support.List.t t
val seq_list1 : 'a t Support.List1.t -> 'a Support.List1.t t
val seq_list_void : unit t list -> unit t

seq_list_void [x1; x2; ...; xn] performs x1, x2, ..., xn in order.

Instances

include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

Lexing

type token = Token.t

The type of token in the finite stream being parsed.

val peek : token option t

peek state is (state', token_opt) where token_opt is the next unconsumed token in state. If token_opt = Option.None, then the end of the input stream was reached. Otherwise, token_opt = Option.Some token. The token is not consumed, meaning that state' is not advanced to the next token in the stream.

val observe : token option t

observed state is like peek state, but the observed token is consumed.

val accept : unit t

accept state is (state', ()) where state' is derived from state by consuming the next token in the input stream. This effectively observes and discards the next token in state.

val insert : token -> unit t

insert token state is (state', ()) where state' is derived from state by inserting token at the beginning of the input stream. That is, token is the next token in state'.

Locations

type location = Token.location

The type of locations with which input tokens are annotated.

val next_location : location option t

next_location state is (state', next_location_opt) where next_location_opt is the location of the next token in state. This does not advance the input stream. next_location_opt = Option.None at the end of the input stream.

val previous_location : location option t

previous_location state is (state', previous_location_opt) where previous_location_opt is the location of the last token in state to have been consumed. previous_location_opt = Option.None at the beginning of the input stream.

Backtracking

val enable_backtracking : unit t

enable_backtracking state is (state', ()) where state' has backtracking enabled.

val disable_backtracking : unit t

enable_backtracking state is (state', ()) where state' has backtracking disabled.

val can_backtrack : bool t

can_backtrack state is (state', flag) where flag = true indicates that state and state' allow backtracking out of an erroneous result, and flag = false otherwise.

val allow_backtracking_on_error : - ('a, 'e) Stdlib.result t -> - ('a, 'e) Stdlib.result t

allow_backtracking_on_error m is m' such that m' state is (state', x) with backtracking enabled in state' if x = Result.Error cause. That is, this combinator enables backtracking if m' produces an error. Backtracking then needs to be manually disabled afterwards.

val with_checkpoint : - ('a, 'e) Stdlib.result t -> - ('a, [> `Backtracked of 'e | `Did_not_backtrack of 'e ]) Stdlib.result t

with_checkpoint m is m' such that m' state marks the current state, performs m, then either

  • discards the marked state if m state = (state', Result.Ok x),
  • backtracks to the marked state if m state = (state', Result.Error cause).

The output error from m is additionally annotated with whether backtracking occurred.

In the case of a parser m, backtracking can occur if backtracking is enabled with allow_backtracking_on_error, or if m did not consume any input.

val initial : ?initial_location:location -> token Support.Seq.t -> state

initial ?initial_location token_sequence is the persistent parsing state with token_sequence as input, and ?initial_location as the starting location for the first token in token_sequence. It is assumed that token_sequence is a persistent sequence. To construct a persistent sequence, see Seq.memoize.

diff --git a/beluga/Beluga_parser/Parser_combinator/index.html b/beluga/Beluga_parser/Parser_combinator/index.html deleted file mode 100644 index 95909adea..000000000 --- a/beluga/Beluga_parser/Parser_combinator/index.html +++ /dev/null @@ -1,7 +0,0 @@ - -Parser_combinator (beluga.Beluga_parser.Parser_combinator)

Module Beluga_parser.Parser_combinator

General purpose parser combinator library.

Introduction to Parser Combinators

This is a hand-made parser combinator system, inspired by Haskell's parsec library. The basic idea in parser combinators is to use higher-order functions to manipulate parsing functions to build up more complex parsers. The most basic type we can give for a parsing function would be something like:

type 'a parser = char list -> char list * 'a option

char list represents the input stream. We must return a new stream, perhaps with some characters removed since we parsed them. The result of the parse is parametric. Since parsing may fail, we use a type constructor to represent this, namely option.

However this design has many shortcomings.

  1. Representing the input as a char list requires the entire input to be buffered in memory. This is wasteful. Instead, we should progressively read input as we need it. Therefore in our implementation we use a lazily-evaluated persistent sequence.
  2. Using option to represent failure doesn't give us a means to specify what the error is. Instead we use ('a, exn) result in order to also return some information in case of failure.
  3. Finally, in order to control backtracking and other parsing features, we will need to not only pass around and transform the input, but a more general parser state.

So our parsing function type now looks like:

type 'a parser = state -> state * ('a, exn) result

where state contains a Located_token.t Seq.t for the input as well as extra stuff for handling backtracking. This is an instance of the state monad as defined in Support.State.STATE.

Backtracking

The naive implementation of the alt alternation combinator is to say that alt p1 p2 first runs p1, and if it fails, runs p2. This implementation has the major drawback of allowing unlimited backtracking. This is undesirable because it results in terrible error messages. What we would like is a way to control the backtracking behaviour of parsers on a more fine-grained level.

Instead, the library below is non-backtracking, so it introduces the trying combinator to selectively enable backtracking. trying p runs p, and if p fails having even consumed input, then trying p can still be backtracked out of. The alt combinator is implemented like this:

The rationale for this is that it allows the parser writer to commit to a parse tree once certain conditions have been met. For example, in Beluga, after a case keyword, we know for sure that we're parsing a case expression. Therefore, if we fail afterwards to parse the scrutinee of the case (a synthesizable expression), we should not backtrack out of the parser for case expressions.

Language Design Considerations

This parser combinator library is only suited for top-down data-independent parsing. That is, tokens are parsed sequentially from left to right, and no auxiliary data is accumulated during parsing. This means that left-recursive grammars and data-dependent grammars are not supported without either rewriting the grammar, or disambiguating and rewriting parsed ASTs at a later stage.

It is best to implement a parser with a pre-defined context-free grammar in a language specification document. This grammar may need rewriting to eliminate left recursion, assign precedences and associativities using recursive descent parsing.

Parser State

module type PARSER_STATE = sig ... end

Abstract parser state definition.

module type LOCATED = sig ... end

Module type definition for elements having location annotations.

Constructors

module Make_persistent_state (Token : LOCATED) : sig ... end

Functor creating an instance of PARSER_STATE backed by an immutable data structure.

Parsers

module type PARSER = sig ... end

Constructors

module Make - (State : PARSER_STATE with type location = Beluga_syntax.Location.t) : - PARSER - with type state = State.state - and type token = State.token - and type location = State.location
diff --git a/beluga/Beluga_parser/Parser_combinator/module-type-LOCATED/index.html b/beluga/Beluga_parser/Parser_combinator/module-type-LOCATED/index.html deleted file mode 100644 index 08a62d627..000000000 --- a/beluga/Beluga_parser/Parser_combinator/module-type-LOCATED/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -LOCATED (beluga.Beluga_parser.Parser_combinator.LOCATED)

Module type Parser_combinator.LOCATED

Module type definition for elements having location annotations.

type t

The type of element annotated with a location.

type location

The type of location annotation.

val location : t -> location

location e is the location of e.

diff --git a/beluga/Beluga_parser/Parser_combinator/module-type-PARSER/index.html b/beluga/Beluga_parser/Parser_combinator/module-type-PARSER/index.html deleted file mode 100644 index 53d9cdb17..000000000 --- a/beluga/Beluga_parser/Parser_combinator/module-type-PARSER/index.html +++ /dev/null @@ -1,24 +0,0 @@ - -PARSER (beluga.Beluga_parser.Parser_combinator.PARSER)

Module type Parser_combinator.PARSER

type token
type location
type state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

diff --git a/beluga/Beluga_parser/Parser_combinator/module-type-PARSER_STATE/index.html b/beluga/Beluga_parser/Parser_combinator/module-type-PARSER_STATE/index.html deleted file mode 100644 index 7b7e36044..000000000 --- a/beluga/Beluga_parser/Parser_combinator/module-type-PARSER_STATE/index.html +++ /dev/null @@ -1,58 +0,0 @@ - -PARSER_STATE (beluga.Beluga_parser.Parser_combinator.PARSER_STATE)

Module type Parser_combinator.PARSER_STATE

Abstract parser state definition.

include Support.State.STATE
type state

The type of states inside the monad.

type 'a t = state -> state * 'a
val get : state t

Return the state from the internals of the monad.

val put : state -> unit t

Replace the state inside the monad.

val modify : (state -> state) -> unit t

Modify the state inside the monad.

val run : 'a t -> state -> state * 'a

run a init runs a with initial state init, returning (final, v) where final is the final state and v is the output.

val eval : 'a t -> state -> 'a

eval a init is run a init = (final, v), but outputs only v.

val exec : 'a t -> state -> state

exec a init is run a init = (final, v), but outputs only final.

Traversals

val traverse_tuple2 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a1 * 'a2) -> - ('b1 * 'b2) t
val traverse_tuple3 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a3 -> 'b3 t) -> - ('a1 * 'a2 * 'a3) -> - ('b1 * 'b2 * 'b3) t
val traverse_list : ('a -> 'b t) -> 'a Support.List.t -> 'b Support.List.t t
val traverse_list1 : ('a -> 'b t) -> 'a Support.List1.t -> 'b Support.List1.t t
val traverse_list2 : ('a -> 'b t) -> 'a Support.List2.t -> 'b Support.List2.t t
val traverse_list_void : ('a -> _ t) -> 'a Support.List.t -> Stdlib.Unit.t t
val traverse_list1_void : ('a -> _ t) -> 'a Support.List1.t -> Stdlib.Unit.t t
val traverse_list2_void : ('a -> _ t) -> 'a Support.List2.t -> Stdlib.Unit.t t
val traverse_reverse_list : - ('a -> 'b t) -> - 'a Support.List.t -> - 'b Support.List.t t
val traverse_reverse_list1 : - ('a -> 'b t) -> - 'a Support.List1.t -> - 'b Support.List1.t t
val traverse_reverse_list2 : - ('a -> 'b t) -> - 'a Support.List2.t -> - 'b Support.List2.t t
val traverse_reverse_list_void : - ('a -> _ t) -> - 'a Support.List.t -> - Stdlib.Unit.t t
val traverse_reverse_list1_void : - ('a -> _ t) -> - 'a Support.List1.t -> - Stdlib.Unit.t t
val traverse_reverse_list2_void : - ('a -> _ t) -> - 'a Support.List2.t -> - Stdlib.Unit.t t
val traverse_option : - ('a -> 'b t) -> - 'a Support.Option.t -> - 'b Support.Option.t t
val traverse_option_void : - ('a -> _ t) -> - 'a Support.Option.t -> - Stdlib.Unit.t t
val seq_list : 'a t Support.List.t -> 'a Support.List.t t
val seq_list1 : 'a t Support.List1.t -> 'a Support.List1.t t
val seq_list_void : unit t list -> unit t

seq_list_void [x1; x2; ...; xn] performs x1, x2, ..., xn in order.

Instances

include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

Lexing

type token

The type of token in the finite stream being parsed.

val peek : token option t

peek state is (state', token_opt) where token_opt is the next unconsumed token in state. If token_opt = Option.None, then the end of the input stream was reached. Otherwise, token_opt = Option.Some token. The token is not consumed, meaning that state' is not advanced to the next token in the stream.

val observe : token option t

observed state is like peek state, but the observed token is consumed.

val accept : unit t

accept state is (state', ()) where state' is derived from state by consuming the next token in the input stream. This effectively observes and discards the next token in state.

val insert : token -> unit t

insert token state is (state', ()) where state' is derived from state by inserting token at the beginning of the input stream. That is, token is the next token in state'.

Locations

type location

The type of locations with which input tokens are annotated.

val next_location : location option t

next_location state is (state', next_location_opt) where next_location_opt is the location of the next token in state. This does not advance the input stream. next_location_opt = Option.None at the end of the input stream.

val previous_location : location option t

previous_location state is (state', previous_location_opt) where previous_location_opt is the location of the last token in state to have been consumed. previous_location_opt = Option.None at the beginning of the input stream.

Backtracking

val enable_backtracking : unit t

enable_backtracking state is (state', ()) where state' has backtracking enabled.

val disable_backtracking : unit t

enable_backtracking state is (state', ()) where state' has backtracking disabled.

val can_backtrack : bool t

can_backtrack state is (state', flag) where flag = true indicates that state and state' allow backtracking out of an erroneous result, and flag = false otherwise.

val allow_backtracking_on_error : - ('a, 'e) Stdlib.result t -> - ('a, 'e) Stdlib.result t

allow_backtracking_on_error m is m' such that m' state is (state', x) with backtracking enabled in state' if x = Result.Error cause. That is, this combinator enables backtracking if m' produces an error. Backtracking then needs to be manually disabled afterwards.

val with_checkpoint : - ('a, 'e) Stdlib.result t -> - ('a, [> `Backtracked of 'e | `Did_not_backtrack of 'e ]) Stdlib.result t

with_checkpoint m is m' such that m' state marks the current state, performs m, then either

  • discards the marked state if m state = (state', Result.Ok x),
  • backtracks to the marked state if m state = (state', Result.Error cause).

The output error from m is additionally annotated with whether backtracking occurred.

In the case of a parser m, backtracking can occur if backtracking is enabled with allow_backtracking_on_error, or if m did not consume any input.

diff --git a/beluga/Beluga_parser/Signature_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html b/beluga/Beluga_parser/Signature_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html deleted file mode 100644 index 7e1e7e24c..000000000 --- a/beluga/Beluga_parser/Signature_disambiguation/Make/argument-1-Disambiguation_state/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga_parser.Signature_disambiguation.Make.Disambiguation_state.Entry)

Module Disambiguation_state.Entry

Recorded data on bindings in Beluga signatures.

type t

The type of entry.

val is_lf_variable : t -> Stdlib.Bool.t

is_lf_variable entry is true if and only if entry describes an LF variable.

val is_meta_variable : t -> Stdlib.Bool.t

is_meta_variable entry is true if entry describes a meta-variable or a contextual variable.

Contextual variables exist only because mlam-expressions ambiguously introduce either a meta-variable, a parameter variable, a substitution variable or a context variable.

val is_parameter_variable : t -> Stdlib.Bool.t

is_parameter_variable is like is_meta_variable, but for entries describing parameter variables.

val is_substitution_variable : t -> Stdlib.Bool.t

is_substitution_variable is like is_meta_variable, but for entries describing parameter variables.

val is_context_variable : t -> Stdlib.Bool.t

is_context_variable is like is_meta_variable, but for entries describing context variables.

val is_computation_variable : t -> Stdlib.Bool.t

is_computation_variable entry is true if and only if entry describes a computation-level variable.

val is_variable : t -> Stdlib.Bool.t

is_variable entry is true if and only if entry describes an LF variable, a meta-level variable, or a computation-level variable.

This is used to discern between the following two cases when disambiguating identifiers in patterns:

  • The case where an exception should be raised because the identifier is a bound variable of the wrong sort.
  • The case where the identifier should be a free variable shadowing a constant.
val is_lf_type_constant : t -> Stdlib.Bool.t

is_lf_type_constant entry is true if and only if entry describes an LF type-level constant.

val is_lf_term_constant : t -> Stdlib.Bool.t

is_lf_term_constant is like is_lf_type_constant, but for entries describing LF term-level constants.

val is_schema_constant : t -> Stdlib.Bool.t

is_schema_constant is like is_lf_type_constant, but for entries describing context schemas.

val is_computation_inductive_type_constant : t -> Stdlib.Bool.t

is_computation_inductive_type_constant is like is_lf_type_constant, but for entries describing inductive computation-level type constants.

val is_computation_stratified_type_constant : t -> Stdlib.Bool.t

is_computation_stratified_type_constant is like is_lf_type_constant, but for entries describing stratified computation-level type constants.

val is_computation_coinductive_type_constant : t -> Stdlib.Bool.t

is_computation_coinductive_type_constant is like is_lf_type_constant, but for entries describing coinductive computation-level type constants.

val is_computation_abbreviation_type_constant : t -> Stdlib.Bool.t

is_computation_abbreviation_type_constant is like is_lf_type_constant, but for entries describing computation-level type constant abbreviations (introduced by the Beluga keyword typedef).

val is_computation_term_constructor : t -> Stdlib.Bool.t

is_computation_term_constructor is like is_lf_type_constant, but for entries describing computation-level constructors.

val is_computation_term_destructor : t -> Stdlib.Bool.t

is_computation_term_destructor is like is_lf_type_constant, but for entries describing computation-level destructors.

val is_program_constant : t -> Stdlib.Bool.t

is_program_constant is like is_lf_type_constant, but for entries describing computation-level programs (introduced by the Beluga keyword rec or val).

val is_module : t -> Stdlib.Bool.t

is_module is like is_lf_type_constant, but for entries describing modules.

diff --git a/beluga/Beluga_parser/Signature_disambiguation/Make/argument-1-Disambiguation_state/index.html b/beluga/Beluga_parser/Signature_disambiguation/Make/argument-1-Disambiguation_state/index.html deleted file mode 100644 index 47d44f39d..000000000 --- a/beluga/Beluga_parser/Signature_disambiguation/Make/argument-1-Disambiguation_state/index.html +++ /dev/null @@ -1,284 +0,0 @@ - -Disambiguation_state (beluga.Beluga_parser.Signature_disambiguation.Make.Disambiguation_state)

Parameter Make.Disambiguation_state

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
module Entry : Disambiguation_state.ENTRY

Recorded data on bindings in Beluga signatures.

Variables

val add_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_variable state ?location identifier adds identifier as a bound LF variable, with binding site location. If location = Option.None, then identifier's location is used instead.

This is mostly used for testing. For locally binding an LF variable, see with_bound_lf_variable.

val add_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_meta_variable is like add_lf_variable, but the identifier is added as a bound meta-variable.

val add_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_parameter_variable is like add_lf_variable, but the identifier is added as a bound parameter variable (those variables prefixed by '#' like "#p").

val add_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_substitution_variable is like add_lf_variable, but the identifier is added as a bound substitution variable (those variables prefixed by '$' like "$S").

val add_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_context_variable is like add_lf_variable, but the identifier is added as a bound context variable.

val add_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_contextual_variable is like add_lf_variable, but the identifier is added as a bound contextual variable, meaning that it is ambiguously bound as either a meta, parameter, substitution or context variable.

val add_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_variable is like add_lf_variable, but the identifier is added as a bound computation-level variable.

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state ?location identifier is add_lf_variable state ?location identifier, with the additional behaviour of adding identifier as an inner pattern bound identifier and as a free variable during pattern disambiguation. This means that identifier can subsequently be looked up as a bound LF variable during pattern disambiguation. This effectively allows free LF variables to appear multiple times (non-linearly) in patterns.

See with_free_variables_as_pattern_variables for the handler for converting free variables in patterns to binders for use as bound variables in expressions.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free meta-variable.

val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free parameter variable.

val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free substitution variable.

val add_free_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free context variable.

val add_free_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_computation_variable state ?location identifier adds identifier to state as a free variable during pattern disambiguation. This differs from add_free_lf_variable in that free computation-level variables in patterns do not have implicit binders (because they are not part of the meta-context), and hence must appear only once (linearly) in the overall pattern.

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state ?location identifier m is the result of running m in the local state derived from state having identifier as a bound LF variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

For example, the disambiguation of an LF term-level lambda-abstraction \x. m requires that the parameter x is locally added in scope when disambiguating the body m. This is achieved like this:

with_bound_lf_variable state x (fun state ->
-    disambiguate_lf_term state m)
val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_meta_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound meta-variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound contextual variable. This is different from with_bound_meta_variable, with_bound_parameter_variable, with_bound_substitution_variable and with_bound_context_variable in that it is unknown whether identifier should be a meta-variable, parameter variable, substitution variable or context variable. This is used in particular for mlam expressions.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_computation_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound computation-level variable.

val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_meta_variable state ?location identifier m is like with_bound_meta_variable state ?location identifier m except that identifier is also treated as a free variable so that in with_free_variables_as_pattern_variables it can be treated as a pattern variable usable in the expression.

This is used for meta-variables introduced in the meta-context of a pattern during case analysis. Those variables are considered bound in both the pattern and expression.

For example, B as below is one such bound pattern meta-variable, and appears in scope for ?.

case x of
-| { B : [g |- o] } [g |- impi \u. D] => ?
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_parameter_variable is like with_bound_pattern_meta_variable, but for a parameter variable introduced in the meta-context of a pattern.

val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_substitution_variable is like with_bound_pattern_meta_variable, but for a substitution variable introduced in the meta-context of a pattern.

val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_context_variable is like with_bound_pattern_meta_variable, but for a context variable introduced in the meta-context of a pattern.

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression state is the result of running expression with the free variables added in pattern as bound variables. This is used to disambiguate expression with bound variables arising from free variables in pattern.

  1. pattern is run with respect to state while keeping track of free variables. Variables bound outside the pattern are ignored in lookups.
  2. expression is run with respect to state with the addition of the tracked free variables from patterns as bound variables.

Lookups performed in pattern are more complex. The variables in state count as being unbound, but the variables with binders in the pattern count as bound. Binders in a pattern can be user-specified, or to be reconstructed during abstraction.

A variable is specifically inner bound if it is introduced explicitly by a lambda abstraction or the pattern meta-context, as an explicit or implicit parameter. Free meta-level variables are reconstructed inner bound. For instance, assuming s and ctx are constants:

  • In the pattern (x, x), both occurrences of x are pattern variables, and that pattern is not linear.
  • In the pattern {M : [ |- nat]} [ |- s M], M as introduced in the meta-context is a pattern variable, and M is an inner pattern-bound identifier in s M, so that pattern is linear.
  • In the pattern [ |- \x. s x], there are no pattern variables.
  • In the pattern ([g |- s M], [g |- s M]), g and M are pattern variables in the left projection of the tuple pattern, and inner pattern-bound in the right projection of the tuple pattern. This is because the pattern is reconstructed as {g : ctx} {M : [g |- nat]} ([g |- s M], [g |- s M]).
val with_scope : state -> (state -> 'a) -> 'a

with_scope state m runs m in a nested bindings scope that is discarded afterwards.

val with_parent_scope : state -> (state -> 'a) -> 'a

with_parent_scope state m runs m while ignoring the topmost scope.

This is used for the disambiguation of Harpoon proof scripts because Harpoon hypotheticals are already serialized with all the identifiers in the meta-level and computation-level contexts of the proof.

val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used for backtracking when disambiguating old-style LF type-level and term-level declarations (i.e., x : X where X may be an LF kind or an LF type).

This is also used in REPLs to safely run parsing functions and recover the state in case of a raised exception during disambiguation.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Constants

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_type_constant state ?location ?arity identifier adds identifier as a bound LF type-level constant.

In the disambiguation of a module's declaration, this also adds the constant as one of the module's declarations.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_term_constant is like add_lf_type_constant, but for LF term-level constants.

val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_schema_constant is like add_lf_type_constant, but for schema constants.

val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_inductive_computation_type_constant is like add_lf_type_constant, but for inductive computation-level type constants.

val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_stratified_computation_type_constant is like add_lf_type_constant, but for stratified computation-level type constants.

val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_coinductive_computation_type_constant is like add_lf_type_constant, but for coinductive computation-level type constants.

val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation_computation_type_constant is like add_lf_type_constant, but for computation-level abbreviation type constants.

val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_constructor is like add_lf_type_constant, but for computation-level term constructors.

val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_destructor is like add_lf_type_constant, but for computation-level term destructors.

val add_program_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_program_constant is like add_lf_type_constant, but for computation-level program constants.

val add_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

add_module state ?location identifier m is the result of running m in a module disambiguation state, whereby added constants are kept track of as declarations in the module having identifier.

Lookups

exception Unbound_identifier of Beluga_syntax.Syncom.Identifier.t

Unbound_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is caught whenever a variable lookup fails and identifier can be disambiguated as a free variable.

exception Unbound_qualified_identifier of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_qualified_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is unrecoverable, but is caught during disambiguation to provide better error messages.

exception Unbound_namespace of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_namespace namespace_identifier is raised if a qualified identifier could not be looked up in a disambiguation state because the namespace with identifier namespace_identifier is unbound.

val lookup_toplevel : state -> Beluga_syntax.Syncom.Identifier.t -> Entry.t

lookup_toplevel state identifier is entry if identifier resolves to entry in state. If identifier is unbound in state, then Unbound_identifier identifier is raised.

lookup state identifier is entry if identifier resolves to entry in state. Otherwise:

  • Unbound_identifier ident) is raised if the first segment ident in identifier is unbound.
  • Unbound_namespace namespace_identifier is raised if a segment in identifier other than the first or last is unbound.
  • Unbound_qualified_identifier identifier is raised if the last segment in identifier is unbound.
type maximum_lookup_result =
  1. | Unbound of {
    1. segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  2. | Partially_bound of {
    1. leading_segments : Beluga_syntax.Syncom.Identifier.t Support.List.t;
    2. segment : Beluga_syntax.Syncom.Identifier.t;
    3. entry : Entry.t;
    4. trailing_segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  3. | Bound of {
    1. entry : Entry.t;
    }

maximum_lookup state segments is either:

  • Unbound { segments } if the first segment in segments is unbound in state.
  • Partially_bound { leading_segments; segment; entry; trailing_segments } if the qualified identifier with namespaces leading_segments and name segment is bound to entry in state.
  • Bound { identifier; entry } if segments form a qualified identifier bound to entry in state.
val actual_binding_exn : - Beluga_syntax.Syncom.Qualified_identifier.t -> - Entry.t -> - exn

actual_binding_exn identifier entry is an exception reporting what sort of entry is bound at identifier. The exception is annotated with the entry's binding location.

Signature Operations

val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state module_identifier adds the exported constants from the module bound to module_identifier as toplevel entries in state. If module_identifier is unbound in state, then an exception is raised.

val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t

get_default_associativity state is the associativity to use for infix operators defined by the user using a pragma, without specifying the infix operator's associativity.

val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state default_associativity sets default_associativity as the associativity to return from get_default_associativity.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the precedence to use for operators defined by the user using a pragma, without specifying the operator's precedence.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state default_precedence sets default_precedence as the precedence to return from get_default_precedence.

val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence identifier adds a prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity identifier adds an infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence identifier adds a postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state identifier is Option.Some operator if identifier is bound to an operator with descriptor operator in state, and Option.None otherwise.

This is used to resolve operators in the disambiguation of applications, which are parsed as lists of expressions.

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_module_abbreviation state ?location module_identifier abbreviation adds the synonym abbreviation for the module bound to identifier in state.

An exception is raised if module_identifier is unbound in state, or if module_identifier is not bound to a module in state.

diff --git a/beluga/Beluga_parser/Signature_disambiguation/Make/argument-2-Lf_disambiguation/index.html b/beluga/Beluga_parser/Signature_disambiguation/Make/argument-2-Lf_disambiguation/index.html deleted file mode 100644 index 27c4be879..000000000 --- a/beluga/Beluga_parser/Signature_disambiguation/Make/argument-2-Lf_disambiguation/index.html +++ /dev/null @@ -1,73 +0,0 @@ - -Lf_disambiguation (beluga.Beluga_parser.Signature_disambiguation.Make.Lf_disambiguation)

Parameter Make.Lf_disambiguation

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Disambiguation_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_lf_kind : state -> Synprs.lf_object -> Synext.lf_kind

disambiguate_lf_kind state object_ is kind', the LF kind disambiguated from kind in the disambiguation state state.

val disambiguate_lf_typ : state -> Synprs.lf_object -> Synext.lf_typ

disambiguate_lf_typ state typ is typ', the LF type disambiguated from typ in the disambiguation state state.

val disambiguate_lf_term : state -> Synprs.lf_object -> Synext.lf_term

disambiguate_lf_term state term is term', the LF term disambiguated from term in the disambiguation state state.

diff --git a/beluga/Beluga_parser/Signature_disambiguation/Make/argument-3-Clf_disambiguation/index.html b/beluga/Beluga_parser/Signature_disambiguation/Make/argument-3-Clf_disambiguation/index.html deleted file mode 100644 index f4971d2a3..000000000 --- a/beluga/Beluga_parser/Signature_disambiguation/Make/argument-3-Clf_disambiguation/index.html +++ /dev/null @@ -1,93 +0,0 @@ - -Clf_disambiguation (beluga.Beluga_parser.Signature_disambiguation.Make.Clf_disambiguation)

Parameter Make.Clf_disambiguation

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Disambiguation_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_clf_typ : state -> Synprs.clf_object -> Synext.clf_typ
val disambiguate_clf_term : state -> Synprs.clf_object -> Synext.clf_term
val disambiguate_clf_substitution : - state -> - Synprs.clf_context_object -> - Synext.clf_substitution
val with_disambiguated_clf_context : - state -> - Synprs.clf_context_object -> - (state -> Synext.clf_context -> 'a) -> - 'a
val disambiguate_clf_term_pattern : - state -> - Synprs.clf_object -> - Synext.clf_term_pattern
val disambiguate_clf_substitution_pattern : - state -> - Synprs.clf_context_object -> - Synext.clf_substitution_pattern
val with_disambiguated_clf_context_pattern : - state -> - Synprs.clf_context_object -> - (state -> Synext.clf_context_pattern -> 'a) -> - 'a
val disambiguate_clf_context_pattern : - state -> - Synprs.clf_context_object -> - Synext.clf_context_pattern
diff --git a/beluga/Beluga_parser/Signature_disambiguation/Make/argument-4-Meta_disambiguation/index.html b/beluga/Beluga_parser/Signature_disambiguation/Make/argument-4-Meta_disambiguation/index.html deleted file mode 100644 index bae3717bc..000000000 --- a/beluga/Beluga_parser/Signature_disambiguation/Make/argument-4-Meta_disambiguation/index.html +++ /dev/null @@ -1,84 +0,0 @@ - -Meta_disambiguation (beluga.Beluga_parser.Signature_disambiguation.Make.Meta_disambiguation)

Parameter Make.Meta_disambiguation

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Disambiguation_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_meta_typ : state -> Synprs.meta_thing -> Synext.meta_typ
val disambiguate_meta_object : state -> Synprs.meta_thing -> Synext.meta_object
val disambiguate_meta_pattern : - state -> - Synprs.meta_thing -> - Beluga_syntax.Synext.Meta.Pattern.t
val disambiguate_schema : state -> Synprs.schema_object -> Synext.schema
val with_disambiguated_meta_context : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
val with_disambiguated_meta_context_pattern : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
diff --git a/beluga/Beluga_parser/Signature_disambiguation/Make/argument-5-Comp_disambiguation/index.html b/beluga/Beluga_parser/Signature_disambiguation/Make/argument-5-Comp_disambiguation/index.html deleted file mode 100644 index fe404e979..000000000 --- a/beluga/Beluga_parser/Signature_disambiguation/Make/argument-5-Comp_disambiguation/index.html +++ /dev/null @@ -1,89 +0,0 @@ - -Comp_disambiguation (beluga.Beluga_parser.Signature_disambiguation.Make.Comp_disambiguation)

Parameter Make.Comp_disambiguation

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Disambiguation_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_comp_kind : - state -> - Synprs.comp_sort_object -> - Synext.comp_kind
val disambiguate_comp_typ : state -> Synprs.comp_sort_object -> Synext.comp_typ
val disambiguate_comp_expression : - state -> - Synprs.comp_expression_object -> - Synext.comp_expression
val disambiguate_comp_pattern : - state -> - Synprs.comp_pattern_object -> - Synext.comp_pattern
val disambiguate_comp_copattern : - state -> - Synprs.comp_copattern_object Support.List1.t -> - Synext.comp_copattern
val with_disambiguated_comp_context : - state -> - Synprs.comp_context_object -> - (state -> Synext.comp_context -> 'a) -> - 'a
diff --git a/beluga/Beluga_parser/Signature_disambiguation/Make/argument-6-Harpoon_disambiguation/index.html b/beluga/Beluga_parser/Signature_disambiguation/Make/argument-6-Harpoon_disambiguation/index.html deleted file mode 100644 index 91eeeedcf..000000000 --- a/beluga/Beluga_parser/Signature_disambiguation/Make/argument-6-Harpoon_disambiguation/index.html +++ /dev/null @@ -1,95 +0,0 @@ - -Harpoon_disambiguation (beluga.Beluga_parser.Signature_disambiguation.Make.Harpoon_disambiguation)

Parameter Make.Harpoon_disambiguation

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Disambiguation_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_harpoon_proof : - state -> - Synprs.harpoon_proof -> - Synext.harpoon_proof
val with_disambiguated_harpoon_command : - state -> - Synprs.harpoon_command -> - (state -> Synext.harpoon_command -> 'a) -> - 'a
val disambiguate_harpoon_directive : - state -> - Synprs.harpoon_directive -> - Synext.harpoon_directive
val disambiguate_harpoon_split_branch : - state -> - Synprs.harpoon_split_branch -> - Synext.harpoon_split_branch
val disambiguate_harpoon_suffices_branch : - state -> - Synprs.harpoon_suffices_branch -> - Synext.harpoon_suffices_branch
val disambiguate_harpoon_hypothetical : - state -> - Synprs.harpoon_hypothetical -> - Synext.harpoon_hypothetical
val disambiguate_harpoon_repl_command : - state -> - Synprs.harpoon_repl_command -> - Synext.harpoon_repl_command
diff --git a/beluga/Beluga_parser/Signature_disambiguation/Make/index.html b/beluga/Beluga_parser/Signature_disambiguation/Make/index.html deleted file mode 100644 index 4e12a984a..000000000 --- a/beluga/Beluga_parser/Signature_disambiguation/Make/index.html +++ /dev/null @@ -1,104 +0,0 @@ - -Make (beluga.Beluga_parser.Signature_disambiguation.Make)

Module Signature_disambiguation.Make

Parameters

Signature

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Disambiguation_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_pragma : - state -> - Synprs.signature_pragma -> - Synext.signature_pragma
val disambiguate_global_pragma : - state -> - Synprs.signature_global_pragma -> - Synext.signature_global_pragma
val disambiguate_totality_declaration : - state -> - Synprs.signature_totality_declaration -> - Synext.signature_totality_declaration
val disambiguate_declaration : - state -> - Synprs.signature_declaration -> - Synext.signature_declaration
val disambiguate_signature_file : - state -> - Synprs.signature_file -> - Synext.signature_file
val disambiguate_signature : state -> Synprs.signature -> Synext.signature
diff --git a/beluga/Beluga_parser/Signature_disambiguation/index.html b/beluga/Beluga_parser/Signature_disambiguation/index.html deleted file mode 100644 index 62cbf0cbe..000000000 --- a/beluga/Beluga_parser/Signature_disambiguation/index.html +++ /dev/null @@ -1,19 +0,0 @@ - -Signature_disambiguation (beluga.Beluga_parser.Signature_disambiguation)

Module Beluga_parser.Signature_disambiguation

module type SIGNATURE_DISAMBIGUATION = sig ... end
diff --git a/beluga/Beluga_parser/Signature_disambiguation/module-type-SIGNATURE_DISAMBIGUATION/index.html b/beluga/Beluga_parser/Signature_disambiguation/module-type-SIGNATURE_DISAMBIGUATION/index.html deleted file mode 100644 index 1cdd87a2e..000000000 --- a/beluga/Beluga_parser/Signature_disambiguation/module-type-SIGNATURE_DISAMBIGUATION/index.html +++ /dev/null @@ -1,93 +0,0 @@ - -SIGNATURE_DISAMBIGUATION (beluga.Beluga_parser.Signature_disambiguation.SIGNATURE_DISAMBIGUATION)

Module type Signature_disambiguation.SIGNATURE_DISAMBIGUATION

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_pragma : - state -> - Synprs.signature_pragma -> - Synext.signature_pragma
val disambiguate_global_pragma : - state -> - Synprs.signature_global_pragma -> - Synext.signature_global_pragma
val disambiguate_totality_declaration : - state -> - Synprs.signature_totality_declaration -> - Synext.signature_totality_declaration
val disambiguate_declaration : - state -> - Synprs.signature_declaration -> - Synext.signature_declaration
val disambiguate_signature_file : - state -> - Synprs.signature_file -> - Synext.signature_file
val disambiguate_signature : state -> Synprs.signature -> Synext.signature
diff --git a/beluga/Beluga_parser/Signature_parser/Make/argument-1-Parser/index.html b/beluga/Beluga_parser/Signature_parser/Make/argument-1-Parser/index.html deleted file mode 100644 index c51ce555e..000000000 --- a/beluga/Beluga_parser/Signature_parser/Make/argument-1-Parser/index.html +++ /dev/null @@ -1,31 +0,0 @@ - -Parser (beluga.Beluga_parser.Signature_parser.Make.Parser)

Parameter Make.Parser

include Parser_combinator.PARSER - with type token = Located_token.t - with type location = Beluga_syntax.Location.t
type token = Located_token.t
type location = Beluga_syntax.Location.t
type state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

diff --git a/beluga/Beluga_parser/Signature_parser/Make/argument-2-Lf_parser/index.html b/beluga/Beluga_parser/Signature_parser/Make/argument-2-Lf_parser/index.html deleted file mode 100644 index 112d15186..000000000 --- a/beluga/Beluga_parser/Signature_parser/Make/argument-2-Lf_parser/index.html +++ /dev/null @@ -1,35 +0,0 @@ - -Lf_parser (beluga.Beluga_parser.Signature_parser.Make.Lf_parser)

Parameter Make.Lf_parser

include Common_parser.COMMON_PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
include Parser_combinator.PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
type token = Parser.token
type location = Parser.location
type state = Parser.state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val lf_kind : Synprs.lf_object t
val lf_typ : Synprs.lf_object t
val lf_term : Synprs.lf_object t
diff --git a/beluga/Beluga_parser/Signature_parser/Make/argument-3-Clf_parser/index.html b/beluga/Beluga_parser/Signature_parser/Make/argument-3-Clf_parser/index.html deleted file mode 100644 index 9d707bd3c..000000000 --- a/beluga/Beluga_parser/Signature_parser/Make/argument-3-Clf_parser/index.html +++ /dev/null @@ -1,35 +0,0 @@ - -Clf_parser (beluga.Beluga_parser.Signature_parser.Make.Clf_parser)

Parameter Make.Clf_parser

include Common_parser.COMMON_PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
include Parser_combinator.PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
type token = Parser.token
type location = Parser.location
type state = Parser.state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val clf_typ : Synprs.clf_object t
val clf_term : Synprs.clf_object t
val clf_term_pattern : Synprs.clf_object t
val clf_context : Synprs.clf_context_object t
val clf_substitution : Synprs.clf_context_object t
diff --git a/beluga/Beluga_parser/Signature_parser/Make/argument-4-Meta_parser/index.html b/beluga/Beluga_parser/Signature_parser/Make/argument-4-Meta_parser/index.html deleted file mode 100644 index a5e73636e..000000000 --- a/beluga/Beluga_parser/Signature_parser/Make/argument-4-Meta_parser/index.html +++ /dev/null @@ -1,35 +0,0 @@ - -Meta_parser (beluga.Beluga_parser.Signature_parser.Make.Meta_parser)

Parameter Make.Meta_parser

include Common_parser.COMMON_PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
include Parser_combinator.PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
type token = Parser.token
type location = Parser.location
type state = Parser.state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val schema : Synprs.schema_object t
val meta_type : Synprs.meta_thing t
val meta_object : Synprs.meta_thing t
val meta_pattern : Synprs.meta_thing t
val meta_context : Synprs.meta_context_object t
diff --git a/beluga/Beluga_parser/Signature_parser/Make/argument-5-Comp_parser/index.html b/beluga/Beluga_parser/Signature_parser/Make/argument-5-Comp_parser/index.html deleted file mode 100644 index 7f709b619..000000000 --- a/beluga/Beluga_parser/Signature_parser/Make/argument-5-Comp_parser/index.html +++ /dev/null @@ -1,35 +0,0 @@ - -Comp_parser (beluga.Beluga_parser.Signature_parser.Make.Comp_parser)

Parameter Make.Comp_parser

include Common_parser.COMMON_PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
include Parser_combinator.PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
type token = Parser.token
type location = Parser.location
type state = Parser.state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val comp_kind : Synprs.comp_sort_object t
val comp_typ : Synprs.comp_sort_object t
val comp_pattern : Synprs.comp_pattern_object t
val comp_copattern : Synprs.comp_copattern_object t
val comp_expression : Synprs.comp_expression_object t
val comp_context : Synprs.comp_context_object t
diff --git a/beluga/Beluga_parser/Signature_parser/Make/argument-6-Harpoon_parser/index.html b/beluga/Beluga_parser/Signature_parser/Make/argument-6-Harpoon_parser/index.html deleted file mode 100644 index f85cf40ea..000000000 --- a/beluga/Beluga_parser/Signature_parser/Make/argument-6-Harpoon_parser/index.html +++ /dev/null @@ -1,35 +0,0 @@ - -Harpoon_parser (beluga.Beluga_parser.Signature_parser.Make.Harpoon_parser)

Parameter Make.Harpoon_parser

include Common_parser.COMMON_PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
include Parser_combinator.PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
type token = Parser.token
type location = Parser.location
type state = Parser.state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val harpoon_proof : Synprs.harpoon_proof t
val interactive_harpoon_command : Synprs.harpoon_repl_command t
diff --git a/beluga/Beluga_parser/Signature_parser/Make/index.html b/beluga/Beluga_parser/Signature_parser/Make/index.html deleted file mode 100644 index c1386075f..000000000 --- a/beluga/Beluga_parser/Signature_parser/Make/index.html +++ /dev/null @@ -1,58 +0,0 @@ - -Make (beluga.Beluga_parser.Signature_parser.Make)

Module Signature_parser.Make

Parameters

module Lf_parser : - Lf_parser.LF_PARSER - with type state = Parser.state - and type token = Parser.token - and type location = Parser.location

Signature

include Common_parser.COMMON_PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
include Parser_combinator.PARSER - with type state = Parser.state - with type token = Parser.token - with type location = Parser.location
type token = Parser.token
type location = Parser.location
type state = Parser.state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val signature_file : Synprs.signature_file t
val signature_global_pragma : Synprs.signature_global_pragma t
val signature_entry : Synprs.signature_entry t
val signature_declaration : Synprs.signature_declaration t
val trust_totality_declaration : Synprs.signature_totality_declaration t
val named_totality_declaration : Synprs.signature_totality_declaration t
val numeric_totality_declaration : Synprs.signature_totality_declaration t
val totality_declaration : Synprs.signature_totality_declaration t
diff --git a/beluga/Beluga_parser/Signature_parser/index.html b/beluga/Beluga_parser/Signature_parser/index.html deleted file mode 100644 index d6527ff7b..000000000 --- a/beluga/Beluga_parser/Signature_parser/index.html +++ /dev/null @@ -1,35 +0,0 @@ - -Signature_parser (beluga.Beluga_parser.Signature_parser)

Module Beluga_parser.Signature_parser

module type SIGNATURE_PARSER = sig ... end
diff --git a/beluga/Beluga_parser/Signature_parser/module-type-SIGNATURE_PARSER/index.html b/beluga/Beluga_parser/Signature_parser/module-type-SIGNATURE_PARSER/index.html deleted file mode 100644 index 27007dec3..000000000 --- a/beluga/Beluga_parser/Signature_parser/module-type-SIGNATURE_PARSER/index.html +++ /dev/null @@ -1,29 +0,0 @@ - -SIGNATURE_PARSER (beluga.Beluga_parser.Signature_parser.SIGNATURE_PARSER)

Module type Signature_parser.SIGNATURE_PARSER

include Common_parser.COMMON_PARSER
include Parser_combinator.PARSER
type token
type location
type state
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val signature_file : Synprs.signature_file t
val signature_global_pragma : Synprs.signature_global_pragma t
val signature_entry : Synprs.signature_entry t
val signature_declaration : Synprs.signature_declaration t
val trust_totality_declaration : Synprs.signature_totality_declaration t
val named_totality_declaration : Synprs.signature_totality_declaration t
val numeric_totality_declaration : Synprs.signature_totality_declaration t
val totality_declaration : Synprs.signature_totality_declaration t
diff --git a/beluga/Beluga_parser/Token/index.html b/beluga/Beluga_parser/Token/index.html deleted file mode 100644 index 85bb32de5..000000000 --- a/beluga/Beluga_parser/Token/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Token (beluga.Beluga_parser.Token)

Module Beluga_parser.Token

Token definition for lexing.

type t =
  1. | LPAREN
    (*

    (

    *)
  2. | HASH_LPAREN
    (*

    #(

    *)
  3. | DOLLAR_LPAREN
    (*

    $(

    *)
  4. | RPAREN
    (*

    )

    *)
  5. | LBRACK
    (*

    [

    *)
  6. | HASH_LBRACK
    (*

    #[

    *)
  7. | DOLLAR_LBRACK
    (*

    $[

    *)
  8. | RBRACK
    (*

    ]

    *)
  9. | LBRACE
    (*

    {

    *)
  10. | RBRACE
    (*

    }

    *)
  11. | LANGLE
    (*

    <

    *)
  12. | RANGLE
    (*

    >

    *)
  13. | COMMA
    (*

    ,

    *)
  14. | DOUBLE_COLON
    (*

    ::

    *)
  15. | COLON
    (*

    :

    *)
  16. | SEMICOLON
    (*

    ;

    *)
  17. | PIPE
    (*

    |

    *)
  18. | TURNSTILE
    (*

    |-

    *)
  19. | TURNSTILE_HASH
    (*

    |-#

    *)
  20. | DOTS
    (*

    ..

    *)
  21. | BACKARROW
    (*

    <-

    *)
  22. | ARROW
    (*

    ->

    *)
  23. | THICK_ARROW
    (*

    =>

    *)
  24. | HAT
    (*

    ^

    *)
  25. | DOT
    (*

    .

    *)
  26. | LAMBDA
    (*

    \

    *)
  27. | STAR
    (*

    *

    *)
  28. | EQUALS
    (*

    =

    *)
  29. | SLASH
    (*

    /

    *)
  30. | UNDERSCORE
    (*

    _

    *)
  31. | HASH
    (*

    #

    *)
  32. | DOLLAR
    (*

    $

    *)
  33. | PLUS
    (*

    +

    *)
  34. | KW_AND
    (*

    and

    *)
  35. | KW_BLOCK
    (*

    block

    *)
  36. | KW_CASE
    (*

    case

    *)
  37. | KW_IF
    (*

    if

    *)
  38. | KW_THEN
    (*

    then

    *)
  39. | KW_ELSE
    (*

    else

    *)
  40. | KW_IMPOSSIBLE
    (*

    impossible

    *)
  41. | KW_LET
    (*

    let

    *)
  42. | KW_IN
    (*

    in

    *)
  43. | KW_OF
    (*

    of

    *)
  44. | KW_REC
    (*

    rec

    *)
  45. | KW_SCHEMA
    (*

    schema

    *)
  46. | KW_SOME
    (*

    some

    *)
  47. | KW_FN
    (*

    fn

    *)
  48. | KW_MLAM
    (*

    mlam

    *)
  49. | KW_MODULE
    (*

    module

    *)
  50. | KW_STRUCT
    (*

    struct

    *)
  51. | KW_END
    (*

    end

    *)
  52. | KW_TOTAL
    (*

    total

    *)
  53. | KW_TRUST
    (*

    trust

    *)
  54. | KW_TYPE
    (*

    type

    *)
  55. | KW_CTYPE
    (*

    ctype

    *)
  56. | KW_PROP
    (*

    prop

    *)
  57. | KW_INDUCTIVE
    (*

    inductive

    *)
  58. | KW_COINDUCTIVE
    (*

    coinductive

    *)
  59. | KW_STRATIFIED
    (*

    stratified

    *)
  60. | KW_LF
    (*

    LF

    *)
  61. | KW_FUN
    (*

    fun

    *)
  62. | KW_TYPEDEF
    (*

    typedef

    *)
  63. | KW_PROOF
    (*

    proof

    *)
  64. | KW_BY
    (*

    by

    *)
  65. | KW_AS
    (*

    as

    *)
  66. | KW_SUFFICES
    (*

    suffices

    *)
  67. | KW_TOSHOW
    (*

    toshow

    *)
  68. | STRING of string
    (*

    STRING s is a string literal "\"" ^ String.escaped s ^ "\"".

    *)
  69. | IDENT of string
    (*

    IDENT x is an identifier x that may represent an operator, a variable, etc..

    *)
  70. | PRAGMA of string
    (*

    PRAGMA p is --p.

    *)
  71. | DOT_IDENT of string
    (*

    DOT_IDENT x is a dot followed by x.

    *)
  72. | DOT_INTLIT of int
    (*

    DOT_INTLIT n is a dot followed by n.

    *)
  73. | HASH_IDENT of string
    (*

    HASH_IDENT x is x where x starts with #.

    *)
  74. | DOLLAR_IDENT of string
    (*

    DOLLAR_IDENT x is x where x starts with $.

    *)
  75. | HASH_BLANK
    (*

    #_

    *)
  76. | DOLLAR_BLANK
    (*

    $_

    *)
  77. | HOLE of string option
    (*

    HOLE x is ?x.

    *)
  78. | INTLIT of int
    (*

    INTLIT i is the integer literal i.

    *)
  79. | BLOCK_COMMENT of string
    (*

    A block comment of the form %{{ ... }}%

    *)

Tokens

Instances

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Support.Show.SHOW with type t := t
val pp : Support.Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Beluga_parser/module-type-DISAMBIGUATION/Entry/index.html b/beluga/Beluga_parser/module-type-DISAMBIGUATION/Entry/index.html deleted file mode 100644 index c20543f1c..000000000 --- a/beluga/Beluga_parser/module-type-DISAMBIGUATION/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Beluga_parser.DISAMBIGUATION.Entry)

Module DISAMBIGUATION.Entry

Recorded data on bindings in Beluga signatures.

type t

The type of entry.

val is_lf_variable : t -> Stdlib.Bool.t

is_lf_variable entry is true if and only if entry describes an LF variable.

val is_meta_variable : t -> Stdlib.Bool.t

is_meta_variable entry is true if entry describes a meta-variable or a contextual variable.

Contextual variables exist only because mlam-expressions ambiguously introduce either a meta-variable, a parameter variable, a substitution variable or a context variable.

val is_parameter_variable : t -> Stdlib.Bool.t

is_parameter_variable is like is_meta_variable, but for entries describing parameter variables.

val is_substitution_variable : t -> Stdlib.Bool.t

is_substitution_variable is like is_meta_variable, but for entries describing parameter variables.

val is_context_variable : t -> Stdlib.Bool.t

is_context_variable is like is_meta_variable, but for entries describing context variables.

val is_computation_variable : t -> Stdlib.Bool.t

is_computation_variable entry is true if and only if entry describes a computation-level variable.

val is_variable : t -> Stdlib.Bool.t

is_variable entry is true if and only if entry describes an LF variable, a meta-level variable, or a computation-level variable.

This is used to discern between the following two cases when disambiguating identifiers in patterns:

  • The case where an exception should be raised because the identifier is a bound variable of the wrong sort.
  • The case where the identifier should be a free variable shadowing a constant.
val is_lf_type_constant : t -> Stdlib.Bool.t

is_lf_type_constant entry is true if and only if entry describes an LF type-level constant.

val is_lf_term_constant : t -> Stdlib.Bool.t

is_lf_term_constant is like is_lf_type_constant, but for entries describing LF term-level constants.

val is_schema_constant : t -> Stdlib.Bool.t

is_schema_constant is like is_lf_type_constant, but for entries describing context schemas.

val is_computation_inductive_type_constant : t -> Stdlib.Bool.t

is_computation_inductive_type_constant is like is_lf_type_constant, but for entries describing inductive computation-level type constants.

val is_computation_stratified_type_constant : t -> Stdlib.Bool.t

is_computation_stratified_type_constant is like is_lf_type_constant, but for entries describing stratified computation-level type constants.

val is_computation_coinductive_type_constant : t -> Stdlib.Bool.t

is_computation_coinductive_type_constant is like is_lf_type_constant, but for entries describing coinductive computation-level type constants.

val is_computation_abbreviation_type_constant : t -> Stdlib.Bool.t

is_computation_abbreviation_type_constant is like is_lf_type_constant, but for entries describing computation-level type constant abbreviations (introduced by the Beluga keyword typedef).

val is_computation_term_constructor : t -> Stdlib.Bool.t

is_computation_term_constructor is like is_lf_type_constant, but for entries describing computation-level constructors.

val is_computation_term_destructor : t -> Stdlib.Bool.t

is_computation_term_destructor is like is_lf_type_constant, but for entries describing computation-level destructors.

val is_program_constant : t -> Stdlib.Bool.t

is_program_constant is like is_lf_type_constant, but for entries describing computation-level programs (introduced by the Beluga keyword rec or val).

val is_module : t -> Stdlib.Bool.t

is_module is like is_lf_type_constant, but for entries describing modules.

diff --git a/beluga/Beluga_parser/module-type-DISAMBIGUATION/index.html b/beluga/Beluga_parser/module-type-DISAMBIGUATION/index.html deleted file mode 100644 index 01044ed00..000000000 --- a/beluga/Beluga_parser/module-type-DISAMBIGUATION/index.html +++ /dev/null @@ -1,375 +0,0 @@ - -DISAMBIGUATION (beluga.Beluga_parser.DISAMBIGUATION)

Module type Beluga_parser.DISAMBIGUATION

Abstract definition of disambiguation for Beluga.

This is a union of the disambiguation module types for Beluga.

include DISAMBIGUATION_STATE
module Entry : Disambiguation_state.ENTRY

Recorded data on bindings in Beluga signatures.

Variables

val add_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_variable state ?location identifier adds identifier as a bound LF variable, with binding site location. If location = Option.None, then identifier's location is used instead.

This is mostly used for testing. For locally binding an LF variable, see with_bound_lf_variable.

val add_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_meta_variable is like add_lf_variable, but the identifier is added as a bound meta-variable.

val add_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_parameter_variable is like add_lf_variable, but the identifier is added as a bound parameter variable (those variables prefixed by '#' like "#p").

val add_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_substitution_variable is like add_lf_variable, but the identifier is added as a bound substitution variable (those variables prefixed by '$' like "$S").

val add_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_context_variable is like add_lf_variable, but the identifier is added as a bound context variable.

val add_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_contextual_variable is like add_lf_variable, but the identifier is added as a bound contextual variable, meaning that it is ambiguously bound as either a meta, parameter, substitution or context variable.

val add_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_variable is like add_lf_variable, but the identifier is added as a bound computation-level variable.

val add_free_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_lf_variable state ?location identifier is add_lf_variable state ?location identifier, with the additional behaviour of adding identifier as an inner pattern bound identifier and as a free variable during pattern disambiguation. This means that identifier can subsequently be looked up as a bound LF variable during pattern disambiguation. This effectively allows free LF variables to appear multiple times (non-linearly) in patterns.

See with_free_variables_as_pattern_variables for the handler for converting free variables in patterns to binders for use as bound variables in expressions.

val add_free_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free meta-variable.

val add_free_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free parameter variable.

val add_free_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free substitution variable.

val add_free_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_meta_variable is like add_free_lf_variable, but the identifier is added as a free context variable.

val add_free_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_free_computation_variable state ?location identifier adds identifier to state as a free variable during pattern disambiguation. This differs from add_free_lf_variable in that free computation-level variables in patterns do not have implicit binders (because they are not part of the meta-context), and hence must appear only once (linearly) in the overall pattern.

val with_bound_lf_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_lf_variable state ?location identifier m is the result of running m in the local state derived from state having identifier as a bound LF variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

For example, the disambiguation of an LF term-level lambda-abstraction \x. m requires that the parameter x is locally added in scope when disambiguating the body m. This is achieved like this:

with_bound_lf_variable state x (fun state ->
-    disambiguate_lf_term state m)
val with_bound_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_meta_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound meta-variable.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a
val with_bound_contextual_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_contextual_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound contextual variable. This is different from with_bound_meta_variable, with_bound_parameter_variable, with_bound_substitution_variable and with_bound_context_variable in that it is unknown whether identifier should be a meta-variable, parameter variable, substitution variable or context variable. This is used in particular for mlam expressions.

When disambiguating a pattern, identifier is also added as an inner pattern binding.

val with_bound_computation_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_computation_variable state ?location identifier m is like with_bound_lf_variable, except that identifier is added to the state as a bound computation-level variable.

val with_bound_pattern_meta_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_meta_variable state ?location identifier m is like with_bound_meta_variable state ?location identifier m except that identifier is also treated as a free variable so that in with_free_variables_as_pattern_variables it can be treated as a pattern variable usable in the expression.

This is used for meta-variables introduced in the meta-context of a pattern during case analysis. Those variables are considered bound in both the pattern and expression.

For example, B as below is one such bound pattern meta-variable, and appears in scope for ?.

case x of
-| { B : [g |- o] } [g |- impi \u. D] => ?
val with_bound_pattern_parameter_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_parameter_variable is like with_bound_pattern_meta_variable, but for a parameter variable introduced in the meta-context of a pattern.

val with_bound_pattern_substitution_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_substitution_variable is like with_bound_pattern_meta_variable, but for a substitution variable introduced in the meta-context of a pattern.

val with_bound_pattern_context_variable : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

with_bound_pattern_context_variable is like with_bound_pattern_meta_variable, but for a context variable introduced in the meta-context of a pattern.

val with_free_variables_as_pattern_variables : - state -> - pattern:(state -> 'a) -> - expression:(state -> 'a -> 'b) -> - 'b

with_free_variables_as_pattern_variables state ~pattern ~expression state is the result of running expression with the free variables added in pattern as bound variables. This is used to disambiguate expression with bound variables arising from free variables in pattern.

  1. pattern is run with respect to state while keeping track of free variables. Variables bound outside the pattern are ignored in lookups.
  2. expression is run with respect to state with the addition of the tracked free variables from patterns as bound variables.

Lookups performed in pattern are more complex. The variables in state count as being unbound, but the variables with binders in the pattern count as bound. Binders in a pattern can be user-specified, or to be reconstructed during abstraction.

A variable is specifically inner bound if it is introduced explicitly by a lambda abstraction or the pattern meta-context, as an explicit or implicit parameter. Free meta-level variables are reconstructed inner bound. For instance, assuming s and ctx are constants:

  • In the pattern (x, x), both occurrences of x are pattern variables, and that pattern is not linear.
  • In the pattern {M : [ |- nat]} [ |- s M], M as introduced in the meta-context is a pattern variable, and M is an inner pattern-bound identifier in s M, so that pattern is linear.
  • In the pattern [ |- \x. s x], there are no pattern variables.
  • In the pattern ([g |- s M], [g |- s M]), g and M are pattern variables in the left projection of the tuple pattern, and inner pattern-bound in the right projection of the tuple pattern. This is because the pattern is reconstructed as {g : ctx} {M : [g |- nat]} ([g |- s M], [g |- s M]).
val with_scope : state -> (state -> 'a) -> 'a

with_scope state m runs m in a nested bindings scope that is discarded afterwards.

val with_parent_scope : state -> (state -> 'a) -> 'a

with_parent_scope state m runs m while ignoring the topmost scope.

This is used for the disambiguation of Harpoon proof scripts because Harpoon hypotheticals are already serialized with all the identifiers in the meta-level and computation-level contexts of the proof.

val with_bindings_checkpoint : state -> (state -> 'a) -> 'a

with_bindings_checkpoint state m runs m with a checkpoint on the bindings' state to backtrack to in case m raises an exception.

This is used for backtracking when disambiguating old-style LF type-level and term-level declarations (i.e., x : X where X may be an LF kind or an LF type).

This is also used in REPLs to safely run parsing functions and recover the state in case of a raised exception during disambiguation.

This checkpoint mechanism does not perform a copy or snapshot of the referencing environment. You need to make sure that m does not pop too many scopes.

Constants

val add_lf_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_type_constant state ?location ?arity identifier adds identifier as a bound LF type-level constant.

In the disambiguation of a module's declaration, this also adds the constant as one of the module's declarations.

val add_lf_term_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_lf_term_constant is like add_lf_type_constant, but for LF term-level constants.

val add_schema_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_schema_constant is like add_lf_type_constant, but for schema constants.

val add_inductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_inductive_computation_type_constant is like add_lf_type_constant, but for inductive computation-level type constants.

val add_stratified_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_stratified_computation_type_constant is like add_lf_type_constant, but for stratified computation-level type constants.

val add_coinductive_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_coinductive_computation_type_constant is like add_lf_type_constant, but for coinductive computation-level type constants.

val add_abbreviation_computation_type_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation_computation_type_constant is like add_lf_type_constant, but for computation-level abbreviation type constants.

val add_computation_term_constructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_constructor is like add_lf_type_constant, but for computation-level term constructors.

val add_computation_term_destructor : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_computation_term_destructor is like add_lf_type_constant, but for computation-level term destructors.

val add_program_constant : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - ?arity:Support.Int.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_program_constant is like add_lf_type_constant, but for computation-level program constants.

val add_module : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Identifier.t -> - (state -> 'a) -> - 'a

add_module state ?location identifier m is the result of running m in a module disambiguation state, whereby added constants are kept track of as declarations in the module having identifier.

Lookups

exception Unbound_identifier of Beluga_syntax.Syncom.Identifier.t

Unbound_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is caught whenever a variable lookup fails and identifier can be disambiguated as a free variable.

exception Unbound_qualified_identifier of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_qualified_identifier identifier is raised if identifier cannot be found in a disambiguation state when it is looked up.

This exception is unrecoverable, but is caught during disambiguation to provide better error messages.

exception Unbound_namespace of Beluga_syntax.Syncom.Qualified_identifier.t

Unbound_namespace namespace_identifier is raised if a qualified identifier could not be looked up in a disambiguation state because the namespace with identifier namespace_identifier is unbound.

val lookup_toplevel : state -> Beluga_syntax.Syncom.Identifier.t -> Entry.t

lookup_toplevel state identifier is entry if identifier resolves to entry in state. If identifier is unbound in state, then Unbound_identifier identifier is raised.

lookup state identifier is entry if identifier resolves to entry in state. Otherwise:

  • Unbound_identifier ident) is raised if the first segment ident in identifier is unbound.
  • Unbound_namespace namespace_identifier is raised if a segment in identifier other than the first or last is unbound.
  • Unbound_qualified_identifier identifier is raised if the last segment in identifier is unbound.
type maximum_lookup_result =
  1. | Unbound of {
    1. segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  2. | Partially_bound of {
    1. leading_segments : Beluga_syntax.Syncom.Identifier.t Support.List.t;
    2. segment : Beluga_syntax.Syncom.Identifier.t;
    3. entry : Entry.t;
    4. trailing_segments : Beluga_syntax.Syncom.Identifier.t Support.List1.t;
    }
  3. | Bound of {
    1. entry : Entry.t;
    }

maximum_lookup state segments is either:

  • Unbound { segments } if the first segment in segments is unbound in state.
  • Partially_bound { leading_segments; segment; entry; trailing_segments } if the qualified identifier with namespaces leading_segments and name segment is bound to entry in state.
  • Bound { identifier; entry } if segments form a qualified identifier bound to entry in state.
val actual_binding_exn : - Beluga_syntax.Syncom.Qualified_identifier.t -> - Entry.t -> - exn

actual_binding_exn identifier entry is an exception reporting what sort of entry is bound at identifier. The exception is annotated with the entry's binding location.

Signature Operations

val open_module : - state -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

open_module state module_identifier adds the exported constants from the module bound to module_identifier as toplevel entries in state. If module_identifier is unbound in state, then an exception is raised.

val get_default_associativity : state -> Beluga_syntax.Syncom.Associativity.t

get_default_associativity state is the associativity to use for infix operators defined by the user using a pragma, without specifying the infix operator's associativity.

val set_default_associativity : - state -> - Beluga_syntax.Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state default_associativity sets default_associativity as the associativity to return from get_default_associativity.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the precedence to use for operators defined by the user using a pragma, without specifying the operator's precedence.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state default_precedence sets default_precedence as the precedence to return from get_default_precedence.

val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence identifier adds a prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity identifier adds an infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence identifier adds a postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

An exception is raised if identifier is unbound in state, not bound to a constant, or bound to a constant of an unknown or invalid arity.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Beluga_syntax.Syncom.Associativity.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state identifier is Option.Some operator if identifier is bound to an operator with descriptor operator in state, and Option.None otherwise.

This is used to resolve operators in the disambiguation of applications, which are parsed as lists of expressions.

val add_module_abbreviation : - state -> - ?location:Beluga_syntax.Syncom.Location.t -> - Beluga_syntax.Syncom.Qualified_identifier.t -> - Beluga_syntax.Syncom.Identifier.t -> - Stdlib.Unit.t

add_module_abbreviation state ?location module_identifier abbreviation adds the synonym abbreviation for the module bound to identifier in state.

An exception is raised if module_identifier is unbound in state, or if module_identifier is not bound to a module in state.

include Lf_disambiguation.LF_DISAMBIGUATION with type state := state

Disambiguation

val disambiguate_lf_kind : state -> Synprs.lf_object -> Synext.lf_kind

disambiguate_lf_kind state object_ is kind', the LF kind disambiguated from kind in the disambiguation state state.

val disambiguate_lf_typ : state -> Synprs.lf_object -> Synext.lf_typ

disambiguate_lf_typ state typ is typ', the LF type disambiguated from typ in the disambiguation state state.

val disambiguate_lf_term : state -> Synprs.lf_object -> Synext.lf_term

disambiguate_lf_term state term is term', the LF term disambiguated from term in the disambiguation state state.

include Clf_disambiguation.CLF_DISAMBIGUATION with type state := state

Disambiguation

val disambiguate_clf_typ : state -> Synprs.clf_object -> Synext.clf_typ
val disambiguate_clf_term : state -> Synprs.clf_object -> Synext.clf_term
val disambiguate_clf_substitution : - state -> - Synprs.clf_context_object -> - Synext.clf_substitution
val with_disambiguated_clf_context : - state -> - Synprs.clf_context_object -> - (state -> Synext.clf_context -> 'a) -> - 'a
val disambiguate_clf_term_pattern : - state -> - Synprs.clf_object -> - Synext.clf_term_pattern
val disambiguate_clf_substitution_pattern : - state -> - Synprs.clf_context_object -> - Synext.clf_substitution_pattern
val with_disambiguated_clf_context_pattern : - state -> - Synprs.clf_context_object -> - (state -> Synext.clf_context_pattern -> 'a) -> - 'a
val disambiguate_clf_context_pattern : - state -> - Synprs.clf_context_object -> - Synext.clf_context_pattern
include Meta_disambiguation.META_DISAMBIGUATION with type state := state

Disambiguation

val disambiguate_meta_typ : state -> Synprs.meta_thing -> Synext.meta_typ
val disambiguate_meta_object : state -> Synprs.meta_thing -> Synext.meta_object
val disambiguate_meta_pattern : - state -> - Synprs.meta_thing -> - Beluga_syntax.Synext.Meta.Pattern.t
val disambiguate_schema : state -> Synprs.schema_object -> Synext.schema
val with_disambiguated_meta_context : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
val with_disambiguated_meta_context_pattern : - state -> - Synprs.meta_context_object -> - (state -> Synext.meta_context -> 'a) -> - 'a
include Comp_disambiguation.COMP_DISAMBIGUATION with type state := state

Disambiguation

val disambiguate_comp_kind : - state -> - Synprs.comp_sort_object -> - Synext.comp_kind
val disambiguate_comp_typ : state -> Synprs.comp_sort_object -> Synext.comp_typ
val disambiguate_comp_expression : - state -> - Synprs.comp_expression_object -> - Synext.comp_expression
val disambiguate_comp_pattern : - state -> - Synprs.comp_pattern_object -> - Synext.comp_pattern
val disambiguate_comp_copattern : - state -> - Synprs.comp_copattern_object Support.List1.t -> - Synext.comp_copattern
val with_disambiguated_comp_context : - state -> - Synprs.comp_context_object -> - (state -> Synext.comp_context -> 'a) -> - 'a
include Harpoon_disambiguation.HARPOON_DISAMBIGUATION with type state := state

Disambiguation

val disambiguate_harpoon_proof : - state -> - Synprs.harpoon_proof -> - Synext.harpoon_proof
val with_disambiguated_harpoon_command : - state -> - Synprs.harpoon_command -> - (state -> Synext.harpoon_command -> 'a) -> - 'a
val disambiguate_harpoon_directive : - state -> - Synprs.harpoon_directive -> - Synext.harpoon_directive
val disambiguate_harpoon_split_branch : - state -> - Synprs.harpoon_split_branch -> - Synext.harpoon_split_branch
val disambiguate_harpoon_suffices_branch : - state -> - Synprs.harpoon_suffices_branch -> - Synext.harpoon_suffices_branch
val disambiguate_harpoon_hypothetical : - state -> - Synprs.harpoon_hypothetical -> - Synext.harpoon_hypothetical
val disambiguate_harpoon_repl_command : - state -> - Synprs.harpoon_repl_command -> - Synext.harpoon_repl_command
include Signature_disambiguation.SIGNATURE_DISAMBIGUATION - with type state := state
include Support.Imperative_state.IMPERATIVE_STATE with type state := state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Disambiguation

val disambiguate_pragma : - state -> - Synprs.signature_pragma -> - Synext.signature_pragma
val disambiguate_global_pragma : - state -> - Synprs.signature_global_pragma -> - Synext.signature_global_pragma
val disambiguate_totality_declaration : - state -> - Synprs.signature_totality_declaration -> - Synext.signature_totality_declaration
val disambiguate_declaration : - state -> - Synprs.signature_declaration -> - Synext.signature_declaration
val disambiguate_signature_file : - state -> - Synprs.signature_file -> - Synext.signature_file
val disambiguate_signature : state -> Synprs.signature -> Synext.signature
diff --git a/beluga/Beluga_parser/module-type-PARSING/index.html b/beluga/Beluga_parser/module-type-PARSING/index.html deleted file mode 100644 index 95d8f2f05..000000000 --- a/beluga/Beluga_parser/module-type-PARSING/index.html +++ /dev/null @@ -1,139 +0,0 @@ - -PARSING (beluga.Beluga_parser.PARSING)

Module type Beluga_parser.PARSING

Abstract definition of parsing for Beluga.

This is a union of the parser module types for Beluga.

include PARSER_STATE - with type token = Located_token.t - and type location = Beluga_syntax.Location.t
include Support.State.STATE
type state

The type of states inside the monad.

val get : state -> state * state

Return the state from the internals of the monad.

val put : state -> state -> state * unit

Replace the state inside the monad.

val modify : (state -> state) -> state -> state * unit

Modify the state inside the monad.

val eval : (state -> state * 'a) -> state -> 'a

eval a init is run a init = (final, v), but outputs only v.

val exec : (state -> state * 'a) -> state -> state

exec a init is run a init = (final, v), but outputs only final.

Traversals

val traverse_tuple2 : - ('a1 -> state -> state * 'b1) -> - ('a2 -> state -> state * 'b2) -> - ('a1 * 'a2) -> - state -> - state * ('b1 * 'b2)
val traverse_tuple3 : - ('a1 -> state -> state * 'b1) -> - ('a2 -> state -> state * 'b2) -> - ('a3 -> state -> state * 'b3) -> - ('a1 * 'a2 * 'a3) -> - state -> - state * ('b1 * 'b2 * 'b3)
val traverse_list : - ('a -> state -> state * 'b) -> - 'a Support.List.t -> - state -> - state * 'b Support.List.t
val traverse_list1 : - ('a -> state -> state * 'b) -> - 'a Support.List1.t -> - state -> - state * 'b Support.List1.t
val traverse_list2 : - ('a -> state -> state * 'b) -> - 'a Support.List2.t -> - state -> - state * 'b Support.List2.t
val traverse_list_void : - ('a -> state -> state * _) -> - 'a Support.List.t -> - state -> - state * Stdlib.Unit.t
val traverse_list1_void : - ('a -> state -> state * _) -> - 'a Support.List1.t -> - state -> - state * Stdlib.Unit.t
val traverse_list2_void : - ('a -> state -> state * _) -> - 'a Support.List2.t -> - state -> - state * Stdlib.Unit.t
val traverse_reverse_list : - ('a -> state -> state * 'b) -> - 'a Support.List.t -> - state -> - state * 'b Support.List.t
val traverse_reverse_list1 : - ('a -> state -> state * 'b) -> - 'a Support.List1.t -> - state -> - state * 'b Support.List1.t
val traverse_reverse_list2 : - ('a -> state -> state * 'b) -> - 'a Support.List2.t -> - state -> - state * 'b Support.List2.t
val traverse_reverse_list_void : - ('a -> state -> state * _) -> - 'a Support.List.t -> - state -> - state * Stdlib.Unit.t
val traverse_reverse_list1_void : - ('a -> state -> state * _) -> - 'a Support.List1.t -> - state -> - state * Stdlib.Unit.t
val traverse_reverse_list2_void : - ('a -> state -> state * _) -> - 'a Support.List2.t -> - state -> - state * Stdlib.Unit.t
val traverse_option : - ('a -> state -> state * 'b) -> - 'a Support.Option.t -> - state -> - state * 'b Support.Option.t
val traverse_option_void : - ('a -> state -> state * _) -> - 'a Support.Option.t -> - state -> - state * Stdlib.Unit.t
val seq_list : - (state -> state * 'a) Support.List.t -> - state -> - state * 'a Support.List.t
val seq_list1 : - (state -> state * 'a) Support.List1.t -> - state -> - state * 'a Support.List1.t
val seq_list_void : (state -> state * unit) list -> state -> state * unit

seq_list_void [x1; x2; ...; xn] performs x1, x2, ..., xn in order.

Instances

include Support.Monad.MONAD with type 'a t := state -> state * 'a
include Support.Functor.FUNCTOR with type 'a t := state -> state * 'a

Combinators

include Support.Apply.APPLY with type 'a t := state -> state * 'a

Combinators

Lexing

val peek : Located_token.t option {t}2792

peek state is (state', token_opt) where token_opt is the next unconsumed token in state. If token_opt = Option.None, then the end of the input stream was reached. Otherwise, token_opt = Option.Some token. The token is not consumed, meaning that state' is not advanced to the next token in the stream.

val observe : Located_token.t option {t}2792

observed state is like peek state, but the observed token is consumed.

val accept : unit {t}2792

accept state is (state', ()) where state' is derived from state by consuming the next token in the input stream. This effectively observes and discards the next token in state.

val insert : Located_token.t -> unit {t}2792

insert token state is (state', ()) where state' is derived from state by inserting token at the beginning of the input stream. That is, token is the next token in state'.

Locations

val next_location : Beluga_syntax.Location.t option {t}2792

next_location state is (state', next_location_opt) where next_location_opt is the location of the next token in state. This does not advance the input stream. next_location_opt = Option.None at the end of the input stream.

val previous_location : Beluga_syntax.Location.t option {t}2792

previous_location state is (state', previous_location_opt) where previous_location_opt is the location of the last token in state to have been consumed. previous_location_opt = Option.None at the beginning of the input stream.

Backtracking

val enable_backtracking : unit {t}2792

enable_backtracking state is (state', ()) where state' has backtracking enabled.

val disable_backtracking : unit {t}2792

enable_backtracking state is (state', ()) where state' has backtracking disabled.

val can_backtrack : bool {t}2792

can_backtrack state is (state', flag) where flag = true indicates that state and state' allow backtracking out of an erroneous result, and flag = false otherwise.

val allow_backtracking_on_error : - ('a, 'e) Stdlib.result {t}2792 -> - ('a, 'e) Stdlib.result {t}2792

allow_backtracking_on_error m is m' such that m' state is (state', x) with backtracking enabled in state' if x = Result.Error cause. That is, this combinator enables backtracking if m' produces an error. Backtracking then needs to be manually disabled afterwards.

val with_checkpoint : - ('a, 'e) Stdlib.result {t}2792 -> - ('a, [> `Backtracked of 'e | `Did_not_backtrack of 'e ]) Stdlib.result - {t}2792

with_checkpoint m is m' such that m' state marks the current state, performs m, then either

  • discards the marked state if m state = (state', Result.Ok x),
  • backtracks to the marked state if m state = (state', Result.Error cause).

The output error from m is additionally annotated with whether backtracking occurred.

In the case of a parser m, backtracking can occur if backtracking is enabled with allow_backtracking_on_error, or if m did not consume any input.

include Parser_combinator.PARSER - with type state := state - and type location := {location}30 - and type token := {token}29
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD - with type 'a t := state -> state * ('a, exn) Stdlib.result
include Support.Functor.FUNCTOR - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

include Support.Apply.APPLY - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

include Common_parser.COMMON_PARSER - with type state := state - and type location := {location}30 - and type token := {token}29
include Parser_combinator.PARSER - with type state := state - with type location := {location}30 - with type token := {token}29
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD - with type 'a t := state -> state * ('a, exn) Stdlib.result
include Support.Functor.FUNCTOR - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

include Support.Apply.APPLY - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

include Lf_parser.LF_PARSER with type state := state
include Common_parser.COMMON_PARSER with type state := state
include Parser_combinator.PARSER with type state := state
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD - with type 'a t := state -> state * ('a, exn) Stdlib.result
include Support.Functor.FUNCTOR - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

include Support.Apply.APPLY - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

val lf_kind : Synprs.lf_object {t}3145
val lf_typ : Synprs.lf_object {t}3145
val lf_term : Synprs.lf_object {t}3145
include Clf_parser.CLF_PARSER with type state := state
include Common_parser.COMMON_PARSER with type state := state
include Parser_combinator.PARSER with type state := state
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD - with type 'a t := state -> state * ('a, exn) Stdlib.result
include Support.Functor.FUNCTOR - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

include Support.Apply.APPLY - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

val clf_typ : Synprs.clf_object {t}3460
val clf_term : Synprs.clf_object {t}3460
val clf_term_pattern : Synprs.clf_object {t}3460
val clf_context : Synprs.clf_context_object {t}3460
val clf_substitution : Synprs.clf_context_object {t}3460
include Meta_parser.META_PARSER with type state := state
include Common_parser.COMMON_PARSER with type state := state
include Parser_combinator.PARSER with type state := state
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD - with type 'a t := state -> state * ('a, exn) Stdlib.result
include Support.Functor.FUNCTOR - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

include Support.Apply.APPLY - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

val schema : Synprs.schema_object {t}3775
val meta_type : Synprs.meta_thing {t}3775
val meta_object : Synprs.meta_thing {t}3775
val meta_pattern : Synprs.meta_thing {t}3775
val meta_context : Synprs.meta_context_object {t}3775
include Comp_parser.COMP_PARSER with type state := state
include Common_parser.COMMON_PARSER with type state := state
include Parser_combinator.PARSER with type state := state
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD - with type 'a t := state -> state * ('a, exn) Stdlib.result
include Support.Functor.FUNCTOR - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

include Support.Apply.APPLY - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

val comp_kind : Synprs.comp_sort_object {t}4090
val comp_typ : Synprs.comp_sort_object {t}4090
val comp_pattern : Synprs.comp_pattern_object {t}4090
val comp_copattern : Synprs.comp_copattern_object {t}4090
val comp_expression : Synprs.comp_expression_object {t}4090
val comp_context : Synprs.comp_context_object {t}4090
include Harpoon_parser.HARPOON_PARSER with type state := state
include Common_parser.COMMON_PARSER with type state := state
include Parser_combinator.PARSER with type state := state
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD - with type 'a t := state -> state * ('a, exn) Stdlib.result
include Support.Functor.FUNCTOR - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

include Support.Apply.APPLY - with type 'a t := state -> state * ('a, exn) Stdlib.result

Combinators

val harpoon_proof : Synprs.harpoon_proof {t}4405
val interactive_harpoon_command : Synprs.harpoon_repl_command {t}4405
include Signature_parser.SIGNATURE_PARSER with type state := state
include Common_parser.COMMON_PARSER with type state := state
include Parser_combinator.PARSER with type state := state
type token
type location
type 'a t = state -> state * ('a, exn) Stdlib.result
type 'a parser = 'a t
exception Parser_error of exn
exception Labelled_exception of {
  1. label : string;
  2. cause : exn;
}
exception No_more_choices of exn list
exception Expected_end_of_input
include Support.Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Support.Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Support.Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

val run : 'a t -> state -> state * ('a, exn) Stdlib.result

run p state is (state', result) where result is the output of parsing p using state.

This is only meant to be used internally, or when defining new parser combinators, since it does not prune the parser exception when result = Result.Error exn.

The end user of a parser should use run_exn.

val run_exn : 'a t -> state -> state * 'a

run_exn p state is (state', parsed) where parsed is the object parsed from state using p. A pruned exception is raised if p fails.

val eval_exn : 'a t -> state -> 'a

eval_exn p state runs p on state like run_exn, and discards the output parser state. This is used whenever we do not resume parsing from the final parser state, particularly when using the only combinator since we expect the end of the input stream to be reached.

val catch : - 'a t -> - ((state * ('a, exn) Stdlib.result) -> state * ('b, exn) Stdlib.result) -> - 'b t

catch p runs p and invokes the given handler to modify the outcome. Despite being called "catch", this parser is actually a kind of map, and is used to implement "low-level" parser transformations.

val fail : exn -> 'a t

fail exn is the parser that always fails with exn.

val fail_at_location : Beluga_syntax.Location.t -> exn -> 'a t

fail_at_location location exn is the parser that always fails with exn annotated with location.

val fail_at_next_location : exn -> 'a t

fail_at_next_location exn is the parser that always fails with exn annotated with the next location in the input stream.

val fail_at_previous_location : exn -> 'a t

fail_at_previous_location exn is the parser that always fails with exn annotated with the previous location in the input stream.

val labelled : string -> 'a t -> 'a t

labelled label p is p' such that when p fails, p' annotates the exception with a label for error-reporting.

val span : 'a t -> (location * 'a) t

span p is the parser p' that additionally returns the source file location that spans the tokens consumed by p.

val only : 'a t -> 'a t

only p is the parser p' that expects p to succeed, then the end of input to be reached immediately after.

val maybe : 'a t -> 'a option t

maybe p is the parser p' that may fail, in which case it returns Option.none.

val void : 'a t -> unit t

void p is the parser p' that discards the result of p.

val many : 'a t -> 'a list t

many p is the parser p' that parses tokens following the EBNF grammar p*, meaning that it parses 0 or more occurrences of p.

val some : 'a t -> 'a Support.List1.t t

some p is the parser p' that parses tokens following the EBNF grammar p+, meaning that it parses 1 or more occurrences of p.

val sep_by0 : sep:unit t -> 'a t -> 'a list t

sep_by0 ~sep p is the parser p' that parses tokens following the EBNF grammar [p (sep p)*], meaning that it parses 0 or more occurrences of p separated by sep.

val sep_by1 : sep:unit t -> 'a t -> 'a Support.List1.t t

sep_by1 ~sep p is the parser p' that parses tokens following the EBNF grammar p (sep p)+, meaning that it parses 1 or more occurrences of p separated by sep.

val trying : 'a t -> 'a t

trying p is the parser p' that enables backtracking in the parser state if p fails, which signals that the erroneous state can be backtracked out of irrespective of the number of consumed tokens.

val choice : 'a t Support.List.t -> 'a t

choice ps is the parser p that sequentially tries the parsers in p.

For instance, choice [p1; p2] first runs p1. If it fails, p2 is run if one of the following is true.

  • p1 failed without consuming any input.
  • p1 failed with backtracking enabled. Backtracking is enabled by the trying combinator.
val alt : 'a t -> 'a t -> 'a t

alt p1 p2 is choice [p1; p2].

val satisfy : (token option -> ('a, exn) Stdlib.result) -> 'a t

satisfy f is the basic parser p that performs an action based on whether the next token in the stream satisfies the predicate f. The parser is advanced only if the next token satisfies f. If the next token does not satisfy the predicate, then the error is annotated with the next token's location.

val eoi : unit t

eoi is the parser that expects the end of input to be reached. This is either the end of the input string, token stream, or file input channel.

val insert_token : token -> unit t

insert_token token is the parser that inserts token as the next token to be read from the input stream.

val keyword : string -> unit t

keyword s parses the string s either as a keyword token, or an identifier matching s.

val integer : int t

integer parses an integer.

val dot_integer : int t

dot_integer parses a dot followed by an integer.

val pragma : string -> unit t

pragma s parses --s.

val string_literal : string t

string_literal parses an escaped string literal between double quotes.

val dot : unit t

dot parses `.'.

val dots : unit t

dots parses `..'.

val comma : unit t

comma parses `,'.

val colon : unit t

colon parses `:'.

val semicolon : unit t

semicolon parses `;'.

val slash : unit t

slash pases `/'.

val equals : unit t

equals parses `='.

val lambda : unit t

lambda parses `\'.

val hat : unit t

hat parses `^'.

val underscore : unit t

underscore parses `_'.

val pipe : unit t

pipe parses `|'.

val forward_arrow : unit t

forward_arrow parses `->'.

val backward_arrow : unit t

backward_arrow parses `<-'.

val thick_forward_arrow : unit t

thick_forward_arrow parses `=>'.

val plus : unit t

plus parses `+'.

val star : unit t

star parses `*'.

val hash : unit t

hash parses `#'. For identifiers prefixed by a hash symbol, see hash_identifier and omittable_hash_identifier.

val double_colon : unit t

double_colon parses `::'.

val turnstile : unit t

turnstile parses `|-'.

val turnstile_hash : unit t

turnstile_hash parses `|-#'.

val left_parenthesis : unit t

left_parenthesis parses `('.

val right_parenthesis : unit t

right_parenthesis parses `)'.

val left_brace : unit t

left_brace parses `{'.

val right_brace : unit t

right_brace parses `}'.

val left_brack : unit t

left_brack parses `['.

val right_brack : unit t

right_brack parses `]'.

val left_angle : unit t

left_angle parses `<'.

val right_angle : unit t

right_angle parses `>'.

val parens : 'a t -> 'a t

parens p parses `(' p `)'.

val braces : 'a t -> 'a t

braces p parses `{' p `}'.

val bracks : 'a t -> 'a t

bracks p parses `[' p `]'.

val angles : 'a t -> 'a t

angles p parses `<' p `>'.

val opt_parens : 'a t -> 'a t

opt_parens p parses `(' p `)' | p.

val opt_braces : 'a t -> 'a t

opt_braces p parses `{' p `}' | p.

val opt_bracks : 'a t -> 'a t

opt_bracks p parses `[' p `]' | p.

val opt_angles : 'a t -> 'a t

opt_angles p parses `<' p `>' | p.

val hash_parens : 'a t -> 'a t

hash_parens p parses `#(' p `)'.

val dollar_parens : 'a t -> 'a t

dollar_parens p parses `$(' p `)'.

val hash_bracks : 'a t -> 'a t

hash_bracks p parses `#[' p `]'.

val dollar_bracks : 'a t -> 'a t

dollar_bracks p parses `$[' p `]'.

val identifier : Beluga_syntax.Identifier.t t

identifier parses a plain identifier.

val dot_identifier : Beluga_syntax.Identifier.t t

dot_identifier parses a dot followed by an identifier.

val hash_identifier : Beluga_syntax.Identifier.t t

hash_identifier parses an identifier starting with `#'. The prefix `#' is included in the identifier.

val dollar_identifier : Beluga_syntax.Identifier.t t

dollar_identifier parses an identifier starting with `$'. The prefix `$' is included in the identifier.

val omittable_identifier : Beluga_syntax.Identifier.t option t

omittable_identifier parses `_' | <identifier>.

val omittable_hash_identifier : Beluga_syntax.Identifier.t option t

omittable_hash_identifier parses `#_' | <hash-identifier>.

val omittable_dollar_identifier : Beluga_syntax.Identifier.t option t

omittable_dollar_identifier parses `$_' | <dollar-identifier>.

val qualified_identifier : Beluga_syntax.Qualified_identifier.t t

qualified_identifier parses <identifier> (<dot-identifier>)*.

val dot_qualified_identifier : Beluga_syntax.Qualified_identifier.t t

dot_qualified_identifier parses a dot followed by a qualified identifier.

val qualified_or_plain_identifier : - [> `Plain of Beluga_syntax.Identifier.t - | `Qualified of Beluga_syntax.Qualified_identifier.t ] - t

qualified_or_plain_identifier parses a plain identifier or a qualified identifier, whichever is the longest parse. That is, if qualified_or_plain_identifier parses a qualified identifier, then it has at least one namespace.

val omittable_meta_object_identifier : - (Beluga_syntax.Identifier.t option * [> `Dollar | `Hash | `Plain ]) t

omittable_meta_object_identifier parses `_' | `#_' | `$_' | <identifier> | <hash-identifier> | <dollar-identifier>.

val meta_object_identifier : - (Beluga_syntax.Identifier.t * [> `Dollar | `Hash | `Plain ]) t

meta_object_identifier parses <identifier> | <hash-identifier> | <dollar-identifier>.

val hole : [> `Labelled of Beluga_syntax.Identifier.t | `Unlabelled ] parser

hole parses `?' | `?'<identifier>.

val block_comment : (Beluga_syntax.Location.t * string) t

block_comment parses %{{ c }}%.

val signature_file : Synprs.signature_file t
val signature_global_pragma : Synprs.signature_global_pragma t
val signature_entry : Synprs.signature_entry t
val signature_declaration : Synprs.signature_declaration t
val trust_totality_declaration : Synprs.signature_totality_declaration t
val named_totality_declaration : Synprs.signature_totality_declaration t
val numeric_totality_declaration : Synprs.signature_totality_declaration t
val totality_declaration : Synprs.signature_totality_declaration t
diff --git a/beluga/Harpoon/Automation/State/index.html b/beluga/Harpoon/Automation/State/index.html deleted file mode 100644 index 9b78bcbe4..000000000 --- a/beluga/Harpoon/Automation/State/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -State (beluga.Harpoon.Automation.State)

Module Automation.State

type t
val make : unit -> t
val serialize : Stdlib.Format.formatter -> t -> unit
diff --git a/beluga/Harpoon/Automation/index.html b/beluga/Harpoon/Automation/index.html deleted file mode 100644 index 90f7de99c..000000000 --- a/beluga/Harpoon/Automation/index.html +++ /dev/null @@ -1,6 +0,0 @@ - -Automation (beluga.Harpoon.Automation)

Module Harpoon.Automation

module Command = Beluga_syntax.Ext.Harpoon
type t = Theorem.t -> Comp.proof_state -> bool
module State : sig ... end
val toggle : - State.t -> - [ `auto_intros | `auto_solve_trivial ] -> - [ `on | `off | `toggle ] -> - unit
val execute : State.t -> t
diff --git a/beluga/Harpoon/CidProgRewrite/index.html b/beluga/Harpoon/CidProgRewrite/index.html deleted file mode 100644 index 38702e13f..000000000 --- a/beluga/Harpoon/CidProgRewrite/index.html +++ /dev/null @@ -1,5 +0,0 @@ - -CidProgRewrite (beluga.Harpoon.CidProgRewrite)

Module Harpoon.CidProgRewrite

Contains a family a functions for rewriting references to program functions.

This is used after translation to replace all references for recursive calls with calls to the translated functions.

diff --git a/beluga/Harpoon/HarpoonState/index.html b/beluga/Harpoon/HarpoonState/index.html deleted file mode 100644 index 4c6f035df..000000000 --- a/beluga/Harpoon/HarpoonState/index.html +++ /dev/null @@ -1,13 +0,0 @@ - -HarpoonState (beluga.Harpoon.HarpoonState)

Module Harpoon.HarpoonState

module Indexing_state = Beluga.Index_state.Indexing_state
type t
type substate = {
  1. session : Session.t;
  2. theorem : Theorem.t;
  3. proof_state : Beluga_syntax.Synint.Comp.proof_state;
}
exception No_session
exception No_theorem of Session.t
exception No_subgoal of {
  1. session : Session.t;
  2. theorem : Theorem.t;
}
val with_io : t -> (Io.t -> 'a) -> 'a
val printf : t -> ('a, Support.Format.formatter, unit) Stdlib.format -> 'a

Prints a message to the user.

val session_list : t -> Session.t list

Gets a list of all sessions in the prover.

val defer_session : t -> unit

Moves the current session to the bottom of the session stack, selecting the next one.

val session_configuration_wizard : t -> bool

Configures a new session interactively and adds it to the state. Returns whether the new session was indeed added. A session is not added when the user aborts the configuration process.

val select_theorem : t -> Beluga_syntax.Name.t -> bool
val automation_state : t -> Automation.State.t
val interaction_mode : t -> Options.interaction_mode

Gets the interaction mode of the prover.

val next_substate : t -> substate
val is_complete : t -> bool

Decides whether there are any sessions in the theorem.

val on_session_completed : t -> Session.t -> unit

To be called by the REPL when a session is completed. This function analyzes the current save_mode and proceeds accordingly.

val serialize : t -> substate -> unit

Serializes the current state back to the loaded signature, preserving prover focus on the given state substate.

val fmt_ppr_session_list : Support.Format.formatter -> t -> unit

Prints a vertical, enumerated list of all sessions in this state, together with every theorem within each session.

diff --git a/beluga/Harpoon/InputPrompt/index.html b/beluga/Harpoon/InputPrompt/index.html deleted file mode 100644 index bbd9c5081..000000000 --- a/beluga/Harpoon/InputPrompt/index.html +++ /dev/null @@ -1,6 +0,0 @@ - -InputPrompt (beluga.Harpoon.InputPrompt)

Module Harpoon.InputPrompt

type t
val make : Options.test_file option -> int option -> t
val next_line_opt : - t -> - msg:string -> - history_file:string option -> - string option
diff --git a/beluga/Harpoon/Io/index.html b/beluga/Harpoon/Io/index.html deleted file mode 100644 index 7b4d69b51..000000000 --- a/beluga/Harpoon/Io/index.html +++ /dev/null @@ -1,13 +0,0 @@ - -Io (beluga.Harpoon.Io)

Module Harpoon.Io

Centralizes high-level Harpoon input-output capabilities.

exception Io_error of exn
type t

Type of IO capabilities. Includes:

  • prompting the user for input,
  • displaying a message to the user.

When a function needs user interactivity, pass this object to it. If it only needs an output capability, see Format.formatter.

val make : InputPrompt.t -> Stdlib.Format.formatter -> t

Constructs an IO capability.

val formatter : t -> Stdlib.Format.formatter

Extracts the formatter from an IO capability.

val prompt_number : t -> int

Gets the number of the last prompt that was shown.

val printf : t -> ('a, Stdlib.Format.formatter, unit) Stdlib.format -> 'a

Displays a formatted message.

val default_prompt_source : string

Default value used for the filename when displaying parse errors.

val read_line : - ?source:string -> - t -> - msg:string -> - history_file:string option -> - Beluga_syntax.Location.t * string

read_line ?source io ~msg ~history_file prompts the user for input by displaying the given message. The input line is output. The returned location is an empty location having source as filename and the number of lines input so far as the line number.

The default value of ?source is default_source_prompt.

An exception is raised if there are no more lines in the input.

val prompt_input : - ?source:string -> - t -> - msg:string -> - history_file:string option -> - (Beluga_syntax.Location.t -> string -> 'a) -> - 'a

prompt_input ?source io ~msg ~history_file f repeatedly prompts the user for an input to pass to f until a call to f does not throw. That is, it calls read_line ?source io ~msg ~history_file, then passes the result to f. If f raises an exception, then it is caught, printed, and prompt_input is called once more.

Make sure that f can fail gracefully (by cleaning up in case of a raised exception) because any exception from f will be suppressed.

diff --git a/beluga/Harpoon/Options/index.html b/beluga/Harpoon/Options/index.html deleted file mode 100644 index 1ce79741b..000000000 --- a/beluga/Harpoon/Options/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Options (beluga.Harpoon.Options)

Module Harpoon.Options

type interaction_mode = [
  1. | `stop
  2. | `go_on
]

The `stop and `go_on flags control what happens in the presence of errors. In particular, the `stop flag will cause Harpoon to exit as soon as an error in encountered instead of continuing to process commands which may not make sense anymore. This is especially important when running tests.

type save_mode = [
  1. | `save_back
  2. | `no_save_back
]

Controls the behaviour of saving sessions back to the signature when they are completed.

type test_kind = [
  1. | `incomplete
  2. | `complete
]
type test_file = private {
  1. filename : string;
  2. kind : test_kind;
}
type t = private {
  1. path : string;
    (*

    The path of the signature file to load. It is expected to be either a ".bel" or a ".cfg" file.

    *)
  2. test_file : test_file option;
    (*

    The Harpoon test file to load.

    *)
  3. test_start : int option;
    (*

    The first line from which the Harpoon test file is considered as input.

    *)
  4. test_stop : interaction_mode;
    (*

    Whether to stop a test if there's an error.

    *)
  5. load_holes : bool;
    (*

    Whether to begin immediately from holes in the file.

    *)
  6. save_back : save_mode;
    (*

    Whether to save finished theorems back to the file.

    *)
}

The command-line options specified to Harpoon.

val parse_arguments : string list -> t
diff --git a/beluga/Harpoon/Prover/index.html b/beluga/Harpoon/Prover/index.html deleted file mode 100644 index e54be6a54..000000000 --- a/beluga/Harpoon/Prover/index.html +++ /dev/null @@ -1,9 +0,0 @@ - -Prover (beluga.Harpoon.Prover)

Module Harpoon.Prover

exception Prover_error of exn

Executes a single Harpoon interactive command on the given state. May raise a Prover_error.

diff --git a/beluga/Harpoon/Repl/index.html b/beluga/Harpoon/Repl/index.html deleted file mode 100644 index 4e004e409..000000000 --- a/beluga/Harpoon/Repl/index.html +++ /dev/null @@ -1,13 +0,0 @@ - -Repl (beluga.Harpoon.Repl)

Module Harpoon.Repl

Main Harpoon REPL module.

module Indexing_state = Beluga.Index_state.Indexing_state

The input prompt for the Harpoon toplevel. See main.ml and linenoise library document for details.

diff --git a/beluga/Harpoon/Revisit/index.html b/beluga/Harpoon/Revisit/index.html deleted file mode 100644 index 453efbb34..000000000 --- a/beluga/Harpoon/Revisit/index.html +++ /dev/null @@ -1,9 +0,0 @@ - -Revisit (beluga.Harpoon.Revisit)

Module Harpoon.Revisit

revisit_disambiguation sgn is a lookup table for the disambiguation state at each Harpoon proof in sgn, and a snapshot of the disambiguation state at the end of sgn. These disambiguation states are snapshots, and should be used with a checkpoint to disambiguate new parsemes.

revisit_indexing sgn is a lookup table for the indexing state at each Harpoon proof in sgn, and a snapshot of the indexing state at the end of sgn. These indexing states are snapshots, and should be used with a checkpoint to index new ASTs.

diff --git a/beluga/Harpoon/Serialization/index.html b/beluga/Harpoon/Serialization/index.html deleted file mode 100644 index b66ef143b..000000000 --- a/beluga/Harpoon/Serialization/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Serialization (beluga.Harpoon.Serialization)

Module Harpoon.Serialization

Module for dealing with Harpoon proof serialization.

val append_sessions : string -> Theorem.t list list -> unit

Appends mutual groups of theorems to the end of the file at the given path. Each `Theorem.t list` represents one session. They are appended in order.

val update_existing_holes : Beluga_syntax.Int.Comp.open_subgoal list -> unit
diff --git a/beluga/Harpoon/Session/index.html b/beluga/Harpoon/Session/index.html deleted file mode 100644 index d7b00a843..000000000 --- a/beluga/Harpoon/Session/index.html +++ /dev/null @@ -1,13 +0,0 @@ - -Session (beluga.Harpoon.Session)

Module Harpoon.Session

A Harpoon session represents a set of mutually proven theorems.

module Indexing_state = Beluga.Index_state.Indexing_state
type t

Construct a new session representing the given mutual group.

Requirement: the mutual group identified by the given cid must indeed contain every given theorem.

val with_disambiguation_state : t -> (Disambiguation_state.state -> 'a) -> 'a
val with_indexing_state : t -> (Indexing_state.state -> 'a) -> 'a
val get_mutual_decs : t -> Synint.Comp.total_dec list

Retrieves the mutual declarations associated to this session's mutual group.

val lookup_theorem : t -> Beluga_syntax.Syncom.Name.t -> Theorem.t option

Looks up an incomplete theorem by name in the session.

val full_theorem_list : t -> Theorem.t list

Gets the list of all complete and incomplete theorems in this session.

val mark_current_theorem_as_proven : t -> Synint.Comp.exp option -> unit

Moves the current theorem from the incomplete theorem stack to the finished theorem stack, and associates it to the given checkable term that is its translation.

val defer_theorem : t -> unit

Moves the current theorem to the bottom of the incomplete theorem stack, selecting the next one.

val next_theorem : t -> Theorem.t option

Gets the currently focused theorem, if any. This returns None when all theorems in the session are complete.

val infer_invocation_kind : t -> Synint.Comp.exp -> Synint.Comp.invoke_kind

Decides what kind of invocation the given synthesizable expression represents. The implementation is quite naive about detecting recursive calls, and will only find one in an application head position.

val select_theorem : t -> Beluga_syntax.Syncom.Name.t -> bool

Selects a given theorem by name in the session, moving it to the top of the incomplete theorem stack. Returns whether the selection succeeded. Selection fails only when there is no incomplete theorem by the given name.

val get_session_kind : t -> [ `introduced | `loaded ]

Decides what kind of session this is. `introduced: this session was created within Harpoon, via the session configuration wizard. `loaded: this session was recovered from a signature.

type translation_check_result = [
  1. | `some_translations_failed
    (*

    Returned when some theorems could not be translated. The user should already have seen an error indicating the failure.

    *)
  2. | `check_error of exn
    (*

    Returned when a translated theorem fails to typecheck.

    *)
  3. | `ok
    (*

    Returned on successful typechecking.

    *)
]

Represents the result of trying to typecheck the translated proofs.

val check_translated_proofs : t -> translation_check_result

Typechecks all translated proofs in the session. Proofs are translated as soon as they are completed, and they are recorded inside the session. Once all proofs are completed, this function should be called to verify that the translation was correct. In principle, any proof that successfully completes should pass translation, and any translated proof should pass typechecking, so it is never a user-error if translation fails or if typechecking a translated proof fails.

val configuration_wizard : - Disambiguation_state.state -> - Indexing_state.state -> - Io.t -> - (Theorem.t -> Theorem.subgoal_hook) list -> - t option

Performs a series of prompts to interactively construct a new session. Returns None if the user aborts the session configuration. Otherwise, returns the newly defined session.

val fmt_ppr_theorem_list : Stdlib.Format.formatter -> t -> unit

Prints a vertical, enumerated list of all theorems in this session.

diff --git a/beluga/Harpoon/Tactic/index.html b/beluga/Harpoon/Tactic/index.html deleted file mode 100644 index cfa059815..000000000 --- a/beluga/Harpoon/Tactic/index.html +++ /dev/null @@ -1,33 +0,0 @@ - -Tactic (beluga.Harpoon.Tactic)

Module Harpoon.Tactic

All the high-level proof tactics. * In general, a tactic has inputs * 1. Some tactic-specific parameters * 2. A `proof_state` to act on * * Tactics are parameterized by a TacticContext that gives them * certain capabilities, such as manipulating the subgoal list or * showing messages to the user. * * Tactics are not obligated to solve the current subgoal!

module Command = Beluga_syntax.Ext.Harpoon
module Total = Beluga.Total

Tactics operate on an incomplete proof in a tactic context. They may choose to solve the goal by removing it or add new subgoals, or both.

val solve : ?action_name:string -> Beluga_syntax.Synint.Comp.proof -> t

Solves the subgoal with the given proof.

val intros : string list option -> t

Introduces the arguments to a function type, with the given names, if any.

type intros'_failure =
  1. | DuplicateName of Beluga_syntax.Synint.LF.mctx - * Beluga_syntax.Synint.Comp.gctx - * Beluga_syntax.Synint.Comp.ctyp_decl
  2. | NothingToIntro

Introduces the arguments to a function type, with the given names, if any.

val split : - [ `split | `invert | `impossible ] -> - Beluga_syntax.Synint.Comp.exp -> - Beluga_syntax.Synint.Comp.typ -> - Beluga_syntax.Synint.Comp.total_dec list -> - t

Performs a case analysis on the given synthesizable expression of the given type. The split_kind is used to perform an additional check on the split, regarding the number of branches. In particular, this is used to implement variants of splitting, e.g. inversion and impossible.

Performs unboxing of the given synthesizable expression of the given type. The tactic will itself verify that the type is a box-type.

It is verified that the given expression is an application. The result of the invocation is assigned to the variable of the given name, in cG, in case the given boxity is (the default) `boxed. Otherwise, with `unboxed, the name is a new variable declaration in cD.

Solves the current goal with an implication whose conclusion is compatible with the goal type. Subgoals are generated for each premise of the implication.

The user needs to decide upfront what the types of all the premises are, and these given types must unify with the corresponding premise types. Furthermore, this unification must pin down all universally quantified variables, as there is no way to construct them using Harpoon. (Harpoon can only construct computational objects, not LF objects.)

Another restriction is that *all* universally quantified variables must appear at the beginning. That is, the type `tau` must be of the form

tau = Pi X_1:U_1. ... Pi X_n:U_n. tau_1 -> ... -> tau_k -> tau'

(This is most common form of type for a Beluga function.)

Subject to the following requirements:

  • cD; cG |- i ==> tau
  • tau' unifies with the current goal type.
  • each tau_i unifies with the corresponding type in the args list.

After all these unifications, there must be no remaining universally quantified variables. (Such a type would be very strange, so this requirement is quite weak.)

The concrete syntax of this command piggybacks off the syntax of `by` is

by <lemma/ih> i suffices tau_1, ..., tau_k

diff --git a/beluga/Harpoon/Theorem/Action/index.html b/beluga/Harpoon/Theorem/Action/index.html deleted file mode 100644 index 3922cdd7b..000000000 --- a/beluga/Harpoon/Theorem/Action/index.html +++ /dev/null @@ -1,7 +0,0 @@ - -Action (beluga.Harpoon.Theorem.Action)

Module Theorem.Action

type t

Abstract actions that can be executed forwards and backwards on a theorem.

val make : - string -> - Synint.Comp.proof_state -> - Synint.Comp.proof_state list -> - Synint.Comp.proof -> - t

An action describes a diff on the subgoals of the theorem.

  • In the forward direction, it assigns the solution to the target subgoal, removes the target, and adds all child subgoals.
  • In the backward direction, it removes all child subgoals, adds the target, and clears the solution of the target.
val name_of_action : t -> string
diff --git a/beluga/Harpoon/Theorem/Conf/index.html b/beluga/Harpoon/Theorem/Conf/index.html deleted file mode 100644 index 0ac25b73c..000000000 --- a/beluga/Harpoon/Theorem/Conf/index.html +++ /dev/null @@ -1,7 +0,0 @@ - -Conf (beluga.Harpoon.Theorem.Conf)

Module Theorem.Conf

type t
diff --git a/beluga/Harpoon/Theorem/index.html b/beluga/Harpoon/Theorem/index.html deleted file mode 100644 index daf3dd4a4..000000000 --- a/beluga/Harpoon/Theorem/index.html +++ /dev/null @@ -1,29 +0,0 @@ - -Theorem (beluga.Harpoon.Theorem)

Module Harpoon.Theorem

module Conf : sig ... end
module Action : sig ... end
type t
type theorem = t
type subgoal_hook = Synint.Comp.proof_state -> unit
val printf : t -> ('a, Support.Format.formatter, unit) Stdlib.format -> 'a

TODO hide this from outside of this module

Gets the cid and Store entry for this theorem.

val get_history_names : t -> string list * string list

get_history_names t = (as1, as2) where as1 are the past history items and as2 are the future history items.

Gets the cid for this theorem.

val get_entry : t -> Beluga.Store.Cid.Comp.Entry.t

Gets the Store entry for this theorem.

val get_name : t -> Beluga_syntax.Syncom.Name.t
val has_name_of : t -> Beluga_syntax.Syncom.Name.t -> bool

Checks if the theorem's name is equal to the given name.

val has_cid_of : t -> Beluga_syntax.Syncom.Id.cid_prog -> bool

Checks if the theorem's cid is equal to the given cid.

val get_statement : t -> Synint.Comp.tclo

Gets the type of the initial subgoal of this theorem. Note that this is the statement of the theorem _including_ inductive stars. To get the statement without stars, retrieve the type of the theorem in the store via its cid.

val serialize : Support.Format.formatter -> t -> unit
val next_subgoal : t -> Synint.Comp.proof_state option
val select_subgoal_satisfying : - t -> - (Synint.Comp.proof_state -> bool) -> - Synint.Comp.proof_state option
val dump_proof : Support.Format.formatter -> t -> unit
val show_proof : t -> unit
val show_subgoals : t -> unit
val defer_subgoal : t -> unit
val subgoals : t -> Synint.Comp.proof_state list
val count_subgoals : t -> int
val apply : t -> Action.t -> unit

Executes the given action on this theorem, and records the action to the theorem's history.

val history_step_forward : t -> bool

history_step_forward theorem_state steps forward in the theorem state's action history, redoing the latest undone action. Returns false if no action was redone.

val history_step_backward : t -> bool

history_step_backward theorem_state steps backward in the theorem state's action history, undoing the latest done action. Returns false if no action was undone.

val apply_subgoal_replacement : - t -> - string -> - Synint.Comp.proof_state -> - (Synint.Comp.proof -> Synint.Comp.proof) -> - Synint.Comp.proof_state -> - unit

Replaces the subgoal with another, solving it by transforming an incomplete proof for the new subgoal. Interally this uses `apply` and so records theorem history, using the given action name.

val rename_variable : - Beluga_syntax.Syncom.Name.t -> - Beluga_syntax.Syncom.Name.t -> - [ `comp | `meta ] -> - t -> - Synint.Comp.proof_state -> - bool

Renames the given variable at the given level. Returns true iff such a variable could be renamed. Else, there was no such variable.

val configure_set : - Support.Format.formatter -> - (t -> subgoal_hook) list -> - Conf.t list -> - Beluga_syntax.Syncom.Id.cid_mutual_group * t list
val is_complete : t -> bool
diff --git a/beluga/Harpoon/Translate/index.html b/beluga/Harpoon/Translate/index.html deleted file mode 100644 index 08b1dd5c6..000000000 --- a/beluga/Harpoon/Translate/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Translate (beluga.Harpoon.Translate)

Module Harpoon.Translate

type error =
  1. | IncompleteProof
exception Error of error
val entry : Beluga.Store.Cid.Comp.Entry.t -> result

Translates a theorem given by a Store entry.

Translates a theorem. Theorems proven already by a program are returned as-is, but theorems proven with a Harpoon proof are translated.

val trap : (unit -> 'a) -> (error, 'a) Support.Either.t

Traps exceptions raised by this module.

val fmt_ppr_error : Support.Format.formatter -> error -> unit

Formats an error.

val fmt_ppr_result : Support.Format.formatter -> result -> unit

Formats a translation result.

diff --git a/beluga/Optparser/Error/Argument/index.html b/beluga/Optparser/Error/Argument/index.html deleted file mode 100644 index 3e1a7337b..000000000 --- a/beluga/Optparser/Error/Argument/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Argument (beluga.Optparser.Error.Argument)

Module Error.Argument

type invalid_arguments_length_error = {
  1. option_name : string;
  2. expected_argument_count : int;
  3. actual_argument_count : int;
}
diff --git a/beluga/Optparser/Error/Option/index.html b/beluga/Optparser/Error/Option/index.html deleted file mode 100644 index 5fea6103b..000000000 --- a/beluga/Optparser/Error/Option/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Option (beluga.Optparser.Error.Option)

Module Error.Option

type option_error = {
  1. option_name : string;
}
diff --git a/beluga/Optparser/Error/index.html b/beluga/Optparser/Error/index.html deleted file mode 100644 index e32b1cea8..000000000 --- a/beluga/Optparser/Error/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Error (beluga.Optparser.Error)

Module Optparser.Error

Option parser errors.

module Option : sig ... end
module Argument : sig ... end
type t = [
  1. | `Missing_mandatory_option of Option.option_error
    (*

    Missing mandatory option for invoking the CLI command

    *)
  2. | `Invalid_arguments_length of Argument.invalid_arguments_length_error
    (*

    Mismatched number of arguments to an option

    *)
  3. | `Argument_reader_failure of Option.option_error
    (*

    Failure to read an argument to an option from a string

    *)
  4. | `Not_an_option of Option.option_error
    (*

    Unrecognized option provided

    *)
]

The type of CLI arguments parsing errors.

diff --git a/beluga/Support/Alternative/index.html b/beluga/Support/Alternative/index.html deleted file mode 100644 index f6e040db5..000000000 --- a/beluga/Support/Alternative/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Alternative (beluga.Support.Alternative)

Module Support.Alternative

module type ALTERNATIVE = sig ... end

Module type for abstract datatypes with an associative operator and a left and right identity element for choosing between values.

diff --git a/beluga/Support/Alternative/module-type-ALTERNATIVE/index.html b/beluga/Support/Alternative/module-type-ALTERNATIVE/index.html deleted file mode 100644 index b90cb9f49..000000000 --- a/beluga/Support/Alternative/module-type-ALTERNATIVE/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -ALTERNATIVE (beluga.Support.Alternative.ALTERNATIVE)

Module type Alternative.ALTERNATIVE

Module type for abstract datatypes with an associative operator and a left and right identity element for choosing between values.

type 'a t
val empty : 'a t

The identity element of (<|>).

val alt : 'a t -> 'a t -> 'a t

alt a1 a2 is a1 if it is not empty, and a2 otherwise.

val (<|>) : 'a t -> 'a t -> 'a t

Infix synonym of alt.

diff --git a/beluga/Support/Apply/Make/argument-1-M/index.html b/beluga/Support/Apply/Make/argument-1-M/index.html deleted file mode 100644 index f9b9d75c8..000000000 --- a/beluga/Support/Apply/Make/argument-1-M/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -M (beluga.Support.Apply.Make.M)

Parameter Make.M

type +'a t

The type of actions in the monad.

val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

diff --git a/beluga/Support/Apply/Make/index.html b/beluga/Support/Apply/Make/index.html deleted file mode 100644 index e90de36b4..000000000 --- a/beluga/Support/Apply/Make/index.html +++ /dev/null @@ -1,21 +0,0 @@ - -Make (beluga.Support.Apply.Make)

Module Apply.Make

Functor building an implementation of APPLY over a monad.

Parameters

module M : Monad.MONAD

Signature

type 'a t = 'a M.t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

diff --git a/beluga/Support/Apply/index.html b/beluga/Support/Apply/index.html deleted file mode 100644 index 5304f1d0a..000000000 --- a/beluga/Support/Apply/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Apply (beluga.Support.Apply)

Module Support.Apply

module type APPLY = sig ... end

Module type for abstract datatypes with applicable actions and sequential applications.

module Make (M : Monad.MONAD) : APPLY with type 'a t = 'a M.t

Functor building an implementation of APPLY over a monad.

diff --git a/beluga/Support/Apply/module-type-APPLY/index.html b/beluga/Support/Apply/module-type-APPLY/index.html deleted file mode 100644 index 349577ed5..000000000 --- a/beluga/Support/Apply/module-type-APPLY/index.html +++ /dev/null @@ -1,21 +0,0 @@ - -APPLY (beluga.Support.Apply.APPLY)

Module type Apply.APPLY

Module type for abstract datatypes with applicable actions and sequential applications.

type 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

diff --git a/beluga/Support/Debug/Fmt/index.html b/beluga/Support/Debug/Fmt/index.html deleted file mode 100644 index e28456c56..000000000 --- a/beluga/Support/Debug/Fmt/index.html +++ /dev/null @@ -1,6 +0,0 @@ - -Fmt (beluga.Support.Debug.Fmt)

Module Debug.Fmt

This submodule defines a record containing a higher-rank polymorphic function. We need this record type so that we can pass a partially-applied Format.fprintf function to client modules. We introduce the submodule so that client modules can selectively open it if they want to use the format-string support provided by Debug; this will bring into scope only the fmt type and the fmt projection for the record.

Clients can then write:

let dprintf, _, _ = Debug.makeFunctions (Debug.toFlags [ 11 ])
-
-open Debug.Fmt
-
-let _ = dprintf (fun p -> p.fmt "%s %d" "hello" 4)
type fmt = {
  1. fmt : 'a. ('a, Format.formatter, unit) Stdlib.format -> 'a;
}
diff --git a/beluga/Support/Debug/index.html b/beluga/Support/Debug/index.html deleted file mode 100644 index 921e6868b..000000000 --- a/beluga/Support/Debug/index.html +++ /dev/null @@ -1,4 +0,0 @@ - -Debug (beluga.Support.Debug)

Module Support.Debug

Debug-print library with up to 31 separate categories of information.

Usage:

let (dprint, dprnt) = Debug.makeFunctions (Debug.toFlags [...])
-
-let (dprintf, dprint, dprnt) = Debug.makeFunctions' (Debug.toFlags [...])

where `...' is the category (or categories) specific to the module.

Then,

If debugging is turned off, print is more efficient whenever computing the string is at all nontrivial. This actually matters; running the test suite with debug mode enabled takes several times longer.

All functions will add a newline after printing your text.

type flags
val enable : unit -> unit
val is_enabled : unit -> bool
val init : string option -> unit
val makeFunctions : flags -> ((unit -> string) -> unit) * (string -> unit)
module Fmt : sig ... end

This submodule defines a record containing a higher-rank polymorphic function. We need this record type so that we can pass a partially-applied Format.fprintf function to client modules. We introduce the submodule so that client modules can selectively open it if they want to use the format-string support provided by Debug; this will bring into scope only the fmt type and the fmt projection for the record.

type 'a io = 'a -> unit
val makeFunctions' : flags -> Fmt.fmt io io * (unit -> string) io * string io
val toFlags : int list -> flags
val flag : int -> bool

Tests if a given flag is set.

val indented : Fmt.fmt io io -> int -> (unit -> 'a) -> 'a

Runs the given function with debug printing indented by the given number of spaces. Pass in dprintf obtained by calling makeFunctions'.

Note that the vbox introduced to indent will NOT be closed if the given function raises an exception. This is a trade-off since the alternative would be to reraise the exception, which sadly destroys the backtrace.

val printf : Fmt.fmt io -> unit
diff --git a/beluga/Support/DynArray/index.html b/beluga/Support/DynArray/index.html deleted file mode 100644 index f4718219b..000000000 --- a/beluga/Support/DynArray/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -DynArray (beluga.Support.DynArray)

Module Support.DynArray

include module type of DynArray
type 'a t
exception Invalid_arg of int * string * string
val create : unit -> 'a t
val make : int -> 'a t
val init : int -> (int -> 'a) -> 'a t
val empty : 'a t -> bool
val length : 'a t -> int
val get : 'a t -> int -> 'a
val last : 'a t -> 'a
val set : 'a t -> int -> 'a -> unit
val insert : 'a t -> int -> 'a -> unit
val add : 'a t -> 'a -> unit
val append : 'a t -> 'a t -> unit
val delete : 'a t -> int -> unit
val delete_last : 'a t -> unit
val delete_range : 'a t -> int -> int -> unit
val clear : 'a t -> unit
val blit : 'a t -> int -> 'a t -> int -> int -> unit
val compact : 'a t -> unit
val to_list : 'a t -> 'a list
val to_array : 'a t -> 'a array
val enum : 'a t -> 'a Enum.t
val of_list : 'a list -> 'a t
val of_array : 'a array -> 'a t
val of_enum : 'a Enum.t -> 'a t
val copy : 'a t -> 'a t
val sub : 'a t -> int -> int -> 'a t
val iter : ('a -> unit) -> 'a t -> unit
val iteri : (int -> 'a -> unit) -> 'a t -> unit
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t
val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a
val fold_right : ('a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val index_of : ('a -> bool) -> 'a t -> int
val filter : ('a -> bool) -> 'a t -> unit
type resizer_t = currslots:int -> oldlength:int -> newlength:int -> int
val set_resizer : 'a t -> resizer_t -> unit
val get_resizer : 'a t -> resizer_t
val default_resizer : resizer_t
val exponential_resizer : resizer_t
val step_resizer : int -> resizer_t
val conservative_exponential_resizer : resizer_t
val unsafe_get : 'a t -> int -> 'a
val unsafe_set : 'a t -> int -> 'a -> unit
val append_list : 'a t -> 'a list -> unit

append_list dst l effectfully appends all the elements of l to dst.

val head : 'a t -> 'a option

head d is Some h with h being the first element of d if d is non-empty, and None otherwise.

val get_opt : 'a t -> int -> 'a option

get_opt d i is Some (get d i) if d has an element at index i, and None otherwise.

val rfind_opt_idx : 'a t -> ('a -> bool) -> (int * 'a) option

rfind_opt_idx d p is Some (i, l) where l is the last element in d that satisfies p and i is the index of l in d, and None otherwise.

diff --git a/beluga/Support/Either/index.html b/beluga/Support/Either/index.html deleted file mode 100644 index 41765950a..000000000 --- a/beluga/Support/Either/index.html +++ /dev/null @@ -1,20 +0,0 @@ - -Either (beluga.Support.Either)

Module Support.Either

Ad hoc disjoint unions of two types.

include module type of Stdlib.Either
type (!'a, !'b) t = ('a, 'b) Stdlib__Either.t =
  1. | Left of 'a
  2. | Right of 'b
val left : 'a -> ('a, 'b) t
val right : 'b -> ('a, 'b) t
val is_left : ('a, 'b) t -> bool
val is_right : ('a, 'b) t -> bool
val find_left : ('a, 'b) t -> 'a option
val find_right : ('a, 'b) t -> 'b option
val map_left : ('a1 -> 'a2) -> ('a1, 'b) t -> ('a2, 'b) t
val map_right : ('b1 -> 'b2) -> ('a, 'b1) t -> ('a, 'b2) t
val map : - left:('a1 -> 'a2) -> - right:('b1 -> 'b2) -> - ('a1, 'b1) t -> - ('a2, 'b2) t
val fold : left:('a -> 'c) -> right:('b -> 'c) -> ('a, 'b) t -> 'c
val iter : left:('a -> unit) -> right:('b -> unit) -> ('a, 'b) t -> unit
val for_all : left:('a -> bool) -> right:('b -> bool) -> ('a, 'b) t -> bool
val equal : - left:('a -> 'a -> bool) -> - right:('b -> 'b -> bool) -> - ('a, 'b) t -> - ('a, 'b) t -> - bool
val compare : - left:('a -> 'a -> int) -> - right:('b -> 'b -> int) -> - ('a, 'b) t -> - ('a, 'b) t -> - int
val eliminate : ('e -> 'c) -> ('a -> 'c) -> ('e, 'a) t -> 'c

Eliminator for disjoint unions.

val bimap : ('e1 -> 'e2) -> ('a -> 'b) -> ('e1, 'a) t -> ('e2, 'b) t

Transforms both sides of the union.

val void_right : ('e, 'a) t -> ('e, unit) t

Forgets the right-hand side of the union.

val void_left : ('e, 'a) t -> (unit, 'a) t

Forgets the left-hand side of the union.

val void : ('e, 'a) t -> (unit, unit) t

Forgets both sides of the union.

val bind : ('a -> ('e, 'b) t) -> ('e, 'a) t -> ('e, 'b) t

Promotes a function that constructs a union into a function that transforms a union.

Either.bind and Either.right witness that Either.t is a monad if the left-hand type is fixed.

val forget : ('e, 'a) t -> 'a option

Eliminates the union into a Stdlib.option, forgetting the value in the left-hand side.

val of_option : 'a option -> (unit, 'a) t

Converts a Stdlib.option into a union with a unit left-hand side.

val of_option' : (unit -> 'e) -> 'a option -> ('e, 'a) t

Converts a Stdlib.option into a union with a left-hand side constructed from a thunk in case the Stdlib.option contained Option.t.None.

val to_option : ('e, 'a) t -> 'a option

Converts a union into an option, forgetting the left side, if any.

val (>>=) : ('e, 'a) t -> ('a -> ('e, 'b) t) -> ('e, 'b) t

Infix form of Either.bind.

val ($>) : ('e, 'a) t -> ('a -> 'b) -> ('e, 'b) t

Infix form of Either.map_right.

val trap : (unit -> 'a) -> (exn, 'a) t

Traps exceptions thrown by evaluating a function into a union. You can delay handling the exceptions until the union is eliminated by using the following trick. Suppose e : (exn, a) t. Then,

eliminate
-  (fun ex ->
-    try raise ex with
-    | Whatever -> do_something_to_handle_Whatever)
-  (fun x -> success x)

The benefit of using trap is that you can be selective about which code gets its exceptions caught.

diff --git a/beluga/Support/Eq/Make/argument-1-T/index.html b/beluga/Support/Eq/Make/argument-1-T/index.html deleted file mode 100644 index cc8ceb472..000000000 --- a/beluga/Support/Eq/Make/argument-1-T/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -T (beluga.Support.Eq.Make.T)

Parameter Make.T

type t

See EQ.t.

val equal : t -> t -> bool
diff --git a/beluga/Support/Eq/Make/index.html b/beluga/Support/Eq/Make/index.html deleted file mode 100644 index 357a19f3e..000000000 --- a/beluga/Support/Eq/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (beluga.Support.Eq.Make)

Module Eq.Make

Functor building an implementation of EQ given a type with a structural equality function.

Parameters

module T : sig ... end

Signature

type t = T.t

The type of elements to check for equality.

val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/Eq/index.html b/beluga/Support/Eq/index.html deleted file mode 100644 index bdc367119..000000000 --- a/beluga/Support/Eq/index.html +++ /dev/null @@ -1,12 +0,0 @@ - -Eq (beluga.Support.Eq)

Module Support.Eq

Types having an equality operator.

module type EQ = sig ... end

Module type for types with an equality predicate and operators.

module Make (T : sig ... end) : EQ with type t = T.t

Functor building an implementation of EQ given a type with a structural equality function.

val make : ('t -> 't -> bool) -> (module EQ with type t = 't)

make equal is equivalent to the functor Make (T) with T.equal = equal.

val contramap : - (module EQ with type t = 's) -> - ('t -> 's) -> - (module EQ - with type t = 't)

If val f : 't -> 's, then contramap eq f is an instance of EQ for values of type 't by the EQ instance eq for values of type 's.

val conjunction : - (module EQ with type t = 's1) -> - (module EQ with type t = 's2) -> - ('t -> 's1) -> - ('t -> 's2) -> - (module EQ - with type t = 't)

If val f1 : 't -> 's1 and val f2 : 't -> 's2, then conjunction eq1 eq2 f1 f2 is an instance of EQ for values of type 't that first checks equality by contramapping by eq1 and f1, and if that check was true then checks equality by contramapping by eq2 and f2.

diff --git a/beluga/Support/Eq/module-type-EQ/index.html b/beluga/Support/Eq/module-type-EQ/index.html deleted file mode 100644 index cd72644fb..000000000 --- a/beluga/Support/Eq/module-type-EQ/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -EQ (beluga.Support.Eq.EQ)

Module type Eq.EQ

Module type for types with an equality predicate and operators.

type t

The type of elements to check for equality.

val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/Equality/index.html b/beluga/Support/Equality/index.html deleted file mode 100644 index 9d8b9e62b..000000000 --- a/beluga/Support/Equality/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Equality (beluga.Support.Equality)

Module Support.Equality

val (=) : int -> int -> bool

A restricted form of the equality operator that works only for integers.

Fully polymorphic equality is dangerous and limits refactorability of the code, so every module should open this one to avoid using polymorphic equality.

diff --git a/beluga/Support/Files/index.html b/beluga/Support/Files/index.html deleted file mode 100644 index 278249426..000000000 --- a/beluga/Support/Files/index.html +++ /dev/null @@ -1,6 +0,0 @@ - -Files (beluga.Support.Files)

Module Support.Files

File-handling utilities

val with_temp_file : - string -> - string -> - (string -> Stdlib.out_channel -> 'a) -> - 'a

with_temp_file temp_dir basename f opens a temporary file basename in directory temp_dir and runs f with the path and output channel to that file. This function guarantees that even in case of exception, the output channel is closed and the temporary file is unlinked.

val with_pp_to_file : string -> (Format.formatter -> 'a) -> 'a

with_pp_to_file filename handler calls handler with a pretty-printer to the file at filename. The contents of the file are replaced by the outputs printed to it.

val copy_file : source:string -> destination:string -> unit

copy_file ~source ~destination copies the contents of file ~source to the file ~destination.

diff --git a/beluga/Support/Format/index.html b/beluga/Support/Format/index.html deleted file mode 100644 index ddf523910..000000000 --- a/beluga/Support/Format/index.html +++ /dev/null @@ -1,119 +0,0 @@ - -Format (beluga.Support.Format)

Module Support.Format

include module type of Stdlib.Format
type formatter = Stdlib__Format.formatter
val pp_open_box : formatter -> int -> unit
val open_box : int -> unit
val pp_close_box : formatter -> unit -> unit
val close_box : unit -> unit
val pp_open_hbox : formatter -> unit -> unit
val open_hbox : unit -> unit
val pp_open_vbox : formatter -> int -> unit
val open_vbox : int -> unit
val pp_open_hvbox : formatter -> int -> unit
val open_hvbox : int -> unit
val pp_open_hovbox : formatter -> int -> unit
val open_hovbox : int -> unit
val pp_print_string : formatter -> string -> unit
val print_string : string -> unit
val pp_print_bytes : formatter -> bytes -> unit
val print_bytes : bytes -> unit
val pp_print_as : formatter -> int -> string -> unit
val print_as : int -> string -> unit
val pp_print_int : formatter -> int -> unit
val print_int : int -> unit
val pp_print_float : formatter -> float -> unit
val print_float : float -> unit
val pp_print_char : formatter -> char -> unit
val print_char : char -> unit
val pp_print_bool : formatter -> bool -> unit
val print_bool : bool -> unit
val pp_print_space : formatter -> unit -> unit
val print_space : unit -> unit
val pp_print_cut : formatter -> unit -> unit
val print_cut : unit -> unit
val pp_print_break : formatter -> int -> int -> unit
val print_break : int -> int -> unit
val pp_print_custom_break : - formatter -> - fits:(string * int * string) -> - breaks:(string * int * string) -> - unit
val pp_force_newline : formatter -> unit -> unit
val force_newline : unit -> unit
val pp_print_if_newline : formatter -> unit -> unit
val print_if_newline : unit -> unit
val pp_print_flush : formatter -> unit -> unit
val print_flush : unit -> unit
val pp_print_newline : formatter -> unit -> unit
val print_newline : unit -> unit
val pp_set_margin : formatter -> int -> unit
val set_margin : int -> unit
val pp_get_margin : formatter -> unit -> int
val get_margin : unit -> int
val pp_set_max_indent : formatter -> int -> unit
val set_max_indent : int -> unit
val pp_get_max_indent : formatter -> unit -> int
val get_max_indent : unit -> int
type geometry = Stdlib__Format.geometry = {
  1. max_indent : int;
  2. margin : int;
}
val check_geometry : geometry -> bool
val pp_set_geometry : formatter -> max_indent:int -> margin:int -> unit
val set_geometry : max_indent:int -> margin:int -> unit
val pp_safe_set_geometry : formatter -> max_indent:int -> margin:int -> unit
val safe_set_geometry : max_indent:int -> margin:int -> unit
val pp_update_geometry : formatter -> (geometry -> geometry) -> unit
val update_geometry : (geometry -> geometry) -> unit
val pp_get_geometry : formatter -> unit -> geometry
val get_geometry : unit -> geometry
val pp_set_max_boxes : formatter -> int -> unit
val set_max_boxes : int -> unit
val pp_get_max_boxes : formatter -> unit -> int
val get_max_boxes : unit -> int
val pp_over_max_boxes : formatter -> unit -> bool
val over_max_boxes : unit -> bool
val pp_open_tbox : formatter -> unit -> unit
val open_tbox : unit -> unit
val pp_close_tbox : formatter -> unit -> unit
val close_tbox : unit -> unit
val pp_set_tab : formatter -> unit -> unit
val set_tab : unit -> unit
val pp_print_tab : formatter -> unit -> unit
val print_tab : unit -> unit
val pp_print_tbreak : formatter -> int -> int -> unit
val print_tbreak : int -> int -> unit
val pp_set_ellipsis_text : formatter -> string -> unit
val set_ellipsis_text : string -> unit
val pp_get_ellipsis_text : formatter -> unit -> string
val get_ellipsis_text : unit -> string
type stag = Stdlib__Format.stag = ..
type tag = string
type stag +=
  1. | String_tag of tag
val pp_open_stag : formatter -> stag -> unit
val open_stag : stag -> unit
val pp_close_stag : formatter -> unit -> unit
val close_stag : unit -> unit
val pp_set_tags : formatter -> bool -> unit
val set_tags : bool -> unit
val pp_set_print_tags : formatter -> bool -> unit
val set_print_tags : bool -> unit
val pp_set_mark_tags : formatter -> bool -> unit
val set_mark_tags : bool -> unit
val pp_get_print_tags : formatter -> unit -> bool
val get_print_tags : unit -> bool
val pp_get_mark_tags : formatter -> unit -> bool
val get_mark_tags : unit -> bool
val pp_set_formatter_out_channel : formatter -> Stdlib.out_channel -> unit
val set_formatter_out_channel : Stdlib.out_channel -> unit
val pp_set_formatter_output_functions : - formatter -> - (string -> int -> int -> unit) -> - (unit -> unit) -> - unit
val set_formatter_output_functions : - (string -> int -> int -> unit) -> - (unit -> unit) -> - unit
val pp_get_formatter_output_functions : - formatter -> - unit -> - (string -> int -> int -> unit) * (unit -> unit)
val get_formatter_output_functions : - unit -> - (string -> int -> int -> unit) * (unit -> unit)
type formatter_out_functions = Stdlib__Format.formatter_out_functions = {
  1. out_string : string -> int -> int -> unit;
  2. out_flush : unit -> unit;
  3. out_newline : unit -> unit;
  4. out_spaces : int -> unit;
  5. out_indent : int -> unit;
}
val pp_set_formatter_out_functions : - formatter -> - formatter_out_functions -> - unit
val set_formatter_out_functions : formatter_out_functions -> unit
val pp_get_formatter_out_functions : - formatter -> - unit -> - formatter_out_functions
val get_formatter_out_functions : unit -> formatter_out_functions
type formatter_stag_functions = Stdlib__Format.formatter_stag_functions = {
  1. mark_open_stag : stag -> string;
  2. mark_close_stag : stag -> string;
  3. print_open_stag : stag -> unit;
  4. print_close_stag : stag -> unit;
}
val pp_set_formatter_stag_functions : - formatter -> - formatter_stag_functions -> - unit
val set_formatter_stag_functions : formatter_stag_functions -> unit
val pp_get_formatter_stag_functions : - formatter -> - unit -> - formatter_stag_functions
val get_formatter_stag_functions : unit -> formatter_stag_functions
val formatter_of_out_channel : Stdlib.out_channel -> formatter
val std_formatter : formatter
val err_formatter : formatter
val formatter_of_buffer : Stdlib.Buffer.t -> formatter
val stdbuf : Stdlib.Buffer.t
val str_formatter : formatter
val flush_str_formatter : unit -> string
val make_formatter : - (string -> int -> int -> unit) -> - (unit -> unit) -> - formatter
val formatter_of_out_functions : formatter_out_functions -> formatter
type symbolic_output_item = Stdlib__Format.symbolic_output_item =
  1. | Output_flush
  2. | Output_newline
  3. | Output_string of string
  4. | Output_spaces of int
  5. | Output_indent of int
type symbolic_output_buffer = Stdlib__Format.symbolic_output_buffer
val make_symbolic_output_buffer : unit -> symbolic_output_buffer
val clear_symbolic_output_buffer : symbolic_output_buffer -> unit
val get_symbolic_output_buffer : - symbolic_output_buffer -> - symbolic_output_item list
val flush_symbolic_output_buffer : - symbolic_output_buffer -> - symbolic_output_item list
val add_symbolic_output_item : - symbolic_output_buffer -> - symbolic_output_item -> - unit
val formatter_of_symbolic_output_buffer : symbolic_output_buffer -> formatter
val pp_print_list : - ?pp_sep:(formatter -> unit -> unit) -> - (formatter -> 'a -> unit) -> - formatter -> - 'a list -> - unit
val pp_print_seq : - ?pp_sep:(formatter -> unit -> unit) -> - (formatter -> 'a -> unit) -> - formatter -> - 'a Stdlib.Seq.t -> - unit
val pp_print_text : formatter -> string -> unit
val pp_print_option : - ?none:(formatter -> unit -> unit) -> - (formatter -> 'a -> unit) -> - formatter -> - 'a option -> - unit
val pp_print_result : - ok:(formatter -> 'a -> unit) -> - error:(formatter -> 'e -> unit) -> - formatter -> - ('a, 'e) Stdlib.result -> - unit
val pp_print_either : - left:(formatter -> 'a -> unit) -> - right:(formatter -> 'b -> unit) -> - formatter -> - ('a, 'b) Stdlib.Either.t -> - unit
val fprintf : formatter -> ('a, formatter, unit) Stdlib.format -> 'a
val printf : ('a, formatter, unit) Stdlib.format -> 'a
val eprintf : ('a, formatter, unit) Stdlib.format -> 'a
val sprintf : ('a, unit, string) Stdlib.format -> 'a
val asprintf : ('a, formatter, unit, string) Stdlib.format4 -> 'a
val dprintf : ('a, formatter, unit, formatter -> unit) Stdlib.format4 -> 'a
val ifprintf : formatter -> ('a, formatter, unit) Stdlib.format -> 'a
val kfprintf : - (formatter -> 'a) -> - formatter -> - ('b, formatter, unit, 'a) Stdlib.format4 -> - 'b
val kdprintf : - ((formatter -> unit) -> 'a) -> - ('b, formatter, unit, 'a) Stdlib.format4 -> - 'b
val ikfprintf : - (formatter -> 'a) -> - formatter -> - ('b, formatter, unit, 'a) Stdlib.format4 -> - 'b
val ksprintf : (string -> 'a) -> ('b, unit, string, 'a) Stdlib.format4 -> 'b
val kasprintf : - (string -> 'a) -> - ('b, formatter, unit, 'a) Stdlib.format4 -> - 'b
val bprintf : Stdlib.Buffer.t -> ('a, formatter, unit) Stdlib.format -> 'a
  • deprecated
val kprintf : (string -> 'a) -> ('b, unit, string, 'a) Stdlib.format4 -> 'b
  • deprecated Use Format.ksprintf instead.
val set_all_formatter_output_functions : - out:(string -> int -> int -> unit) -> - flush:(unit -> unit) -> - newline:(unit -> unit) -> - spaces:(int -> unit) -> - unit
  • deprecated Use Format.set_formatter_out_functions instead.
val get_all_formatter_output_functions : - unit -> - (string -> - int -> - int -> - unit) - * (unit -> - unit) - * (unit -> - unit) - * (int -> - unit)
  • deprecated Use Format.get_formatter_out_functions instead.
val pp_set_all_formatter_output_functions : - formatter -> - out:(string -> int -> int -> unit) -> - flush:(unit -> unit) -> - newline:(unit -> unit) -> - spaces:(int -> unit) -> - unit
  • deprecated Use Format.pp_set_formatter_out_functions instead.
val pp_get_all_formatter_output_functions : - formatter -> - unit -> - (string -> - int -> - int -> - unit) - * (unit -> - unit) - * (unit -> - unit) - * (int -> - unit)
  • deprecated Use Format.pp_get_formatter_out_functions instead.
val pp_open_tag : formatter -> tag -> unit
  • deprecated Use Format.pp_open_stag.
val open_tag : tag -> unit
  • deprecated Use Format.open_stag.
val pp_close_tag : formatter -> unit -> unit
  • deprecated Use Format.pp_close_stag.
val close_tag : unit -> unit
  • deprecated Use Format.close_stag.
type formatter_tag_functions = Stdlib__Format.formatter_tag_functions = {
  1. mark_open_tag : tag -> string;
  2. mark_close_tag : tag -> string;
  3. print_open_tag : tag -> unit;
  4. print_close_tag : tag -> unit;
}
  • deprecated Use formatter_stag_functions.
val pp_set_formatter_tag_functions : - formatter -> - formatter_tag_functions -> - unit
  • deprecated This function will erase non-string tag formatting functions. Use Format.pp_set_formatter_stag_functions.
val set_formatter_tag_functions : formatter_tag_functions -> unit
  • deprecated Use Format.set_formatter_stag_functions.
val pp_get_formatter_tag_functions : - formatter -> - unit -> - formatter_tag_functions
  • deprecated Use Format.pp_get_formatter_stag_functions.
val get_formatter_tag_functions : unit -> formatter_tag_functions
  • deprecated Use Format.get_formatter_stag_functions.
type fmt = {
  1. fmt : 'a. ('a, formatter, unit) Stdlib.format -> 'a;
}
val stringify : (formatter -> 'a -> unit) -> 'a -> string
val punctuation : string -> formatter -> unit -> unit
val semicolon : formatter -> unit -> unit
val comma : formatter -> unit -> unit
val pp_utf_8 : formatter -> string -> unit

pp_utf_8 ppf s prints in state ppf the UTF-8 encoded string s with correct handling of codepoint lengths. For instance, if s = "→", then pp_print_string ppf s prints s as a string of length 3, whereas pp_utf_8 ppf s prints s as a string of length 1.

val pp_utf_8_text : formatter -> string -> unit

pp_utf_8_text ppf s is analogous to pp_print_text for a UTF-8 encoded string s with correct handling of codepoint lengths.

diff --git a/beluga/Support/Format_state/Make/argument-1-State/index.html b/beluga/Support/Format_state/Make/argument-1-State/index.html deleted file mode 100644 index 6fa3896aa..000000000 --- a/beluga/Support/Format_state/Make/argument-1-State/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -State (beluga.Support.Format_state.Make.State)

Parameter Make.State

type state
val get_formatter : state -> Format.formatter
diff --git a/beluga/Support/Format_state/Make/index.html b/beluga/Support/Format_state/Make/index.html deleted file mode 100644 index 836241878..000000000 --- a/beluga/Support/Format_state/Make/index.html +++ /dev/null @@ -1,93 +0,0 @@ - -Make (beluga.Support.Format_state.Make)

Module Format_state.Make

Functor constructing a concrete instance of a formatter.

Parameters

module State : sig ... end

Signature

include Imperative_state.IMPERATIVE_STATE with type state = State.state
type state = State.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : state -> (state -> 'a -> 'b) -> 'a List.t -> 'b List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : state -> (state -> 'a -> 'b) -> 'a List1.t -> 'b List1.t
val traverse_list2 : state -> (state -> 'a -> 'b) -> 'a List2.t -> 'b List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a List.t -> - 'b List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a List1.t -> - 'b List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a List2.t -> - 'b List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Option.t -> - 'b Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) List.t -> 'a List.t
val seq_list1 : state -> (state -> 'a) List1.t -> 'a List1.t
val iter_seq : state -> (state -> Stdlib.Unit.t) List.t -> Stdlib.Unit.t
val pp_flush : state -> Stdlib.Unit.t

pp_flush state is analogous to Format.pp_print_flush.

val pp_newline : state -> Stdlib.Unit.t

pp_newline state is analogous to Format.pp_print_newline.

val pp_nop : state -> Stdlib.Unit.t

pp_nop state is (). This is useful to signal that nothing should be printed for some execution branch.

val pp_cut : state -> Stdlib.Unit.t

pp_cut state is analogous to Format.pp_print_cut.

val pp_space : state -> Stdlib.Unit.t

pp_space state is analogous to Format.pp_print_space. Note that this is a possibly breaking space, meaning that a newline may be printed at this point.

val pp_non_breaking_space : state -> Stdlib.Unit.t

pp_non_breaking_space state pretty-prints a non-breaking space, meaning that the printer does not insert break directives to that space.

val pp_break : state -> Int.t -> Int.t -> Stdlib.Unit.t

pp_break state width offset is analogous to Format.pp_print_break.

val pp_as : state -> Int.t -> String.t -> Stdlib.Unit.t

pp_as state size is analogous to Format.pp_print_as to pretty-print a string as if it were of length size. This is useful to pretty-print UTF-8 encoded strings of known codepoint count, or to print a string as if it isn't there, like for HTML tags or ASCII escape sequences.

val pp_box : - state -> - ?indent:Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_box state ?(indent = 0) f evaluates f state in a compacting pretty-printing box wth offset indent in the formatter (see Format.pp_open_box). The box is opened before f state, and closed afterwards.

val pp_hbox : state -> (state -> Stdlib.Unit.t) -> Stdlib.Unit.t

pp_hbox state f evaluates f state in a horizontal pretty-printing box (see Format.pp_open_hbox). The box is opened before f state, and closed afterwards.

val pp_vbox : - state -> - ?indent:Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_vbox state ?(indent = 0) f evaluates f state in a vertical pretty-printing box with offset indent (see Format.pp_open_vbox). The box is opened before f state, and closed afterwards.

val pp_hvbox : - state -> - ?indent:Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_hovbox : - state -> - ?indent:Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_bool : state -> Stdlib.Bool.t -> Stdlib.Unit.t
val pp_int : state -> Int.t -> Stdlib.Unit.t
val pp_float : state -> Stdlib.Float.t -> Stdlib.Unit.t
val pp_char : state -> Stdlib.Char.t -> Stdlib.Unit.t
val pp_string : state -> String.t -> Stdlib.Unit.t
val pp_option : - state -> - ?none:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Option.t -> - Stdlib.Unit.t
val pp_list : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List.t -> - Stdlib.Unit.t
val pp_list1 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List1.t -> - Stdlib.Unit.t
val pp_list2 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List2.t -> - Stdlib.Unit.t
val pp_text : state -> String.t -> Stdlib.Unit.t
val pp_utf_8 : state -> String.t -> Stdlib.Unit.t
val pp_utf_8_text : state -> String.t -> Stdlib.Unit.t
diff --git a/beluga/Support/Format_state/index.html b/beluga/Support/Format_state/index.html deleted file mode 100644 index 745720dfd..000000000 --- a/beluga/Support/Format_state/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Format_state (beluga.Support.Format_state)

Module Support.Format_state

Format combinators using the Format module, but using a state having a Format.formatter state.

This is used to faciliate pretty-printing using a custom definition of state. In particular, pretty-printing of the external syntax requires keeping track of constant declarations and notation pragmas while a Beluga signature is being pretty-printed.

module type S = sig ... end

Abstract definition of a formatter.

module Make (State : sig ... end) : S with type state = State.state

Functor constructing a concrete instance of a formatter.

diff --git a/beluga/Support/Format_state/module-type-S/index.html b/beluga/Support/Format_state/module-type-S/index.html deleted file mode 100644 index 85ed9d5b9..000000000 --- a/beluga/Support/Format_state/module-type-S/index.html +++ /dev/null @@ -1,93 +0,0 @@ - -S (beluga.Support.Format_state.S)

Module type Format_state.S

Abstract definition of a formatter.

include Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : state -> (state -> 'a -> 'b) -> 'a List.t -> 'b List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : state -> (state -> 'a -> 'b) -> 'a List1.t -> 'b List1.t
val traverse_list2 : state -> (state -> 'a -> 'b) -> 'a List2.t -> 'b List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a List.t -> - 'b List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a List1.t -> - 'b List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a List2.t -> - 'b List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Option.t -> - 'b Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) List.t -> 'a List.t
val seq_list1 : state -> (state -> 'a) List1.t -> 'a List1.t
val iter_seq : state -> (state -> Stdlib.Unit.t) List.t -> Stdlib.Unit.t
val pp_flush : state -> Stdlib.Unit.t

pp_flush state is analogous to Format.pp_print_flush.

val pp_newline : state -> Stdlib.Unit.t

pp_newline state is analogous to Format.pp_print_newline.

val pp_nop : state -> Stdlib.Unit.t

pp_nop state is (). This is useful to signal that nothing should be printed for some execution branch.

val pp_cut : state -> Stdlib.Unit.t

pp_cut state is analogous to Format.pp_print_cut.

val pp_space : state -> Stdlib.Unit.t

pp_space state is analogous to Format.pp_print_space. Note that this is a possibly breaking space, meaning that a newline may be printed at this point.

val pp_non_breaking_space : state -> Stdlib.Unit.t

pp_non_breaking_space state pretty-prints a non-breaking space, meaning that the printer does not insert break directives to that space.

val pp_break : state -> Int.t -> Int.t -> Stdlib.Unit.t

pp_break state width offset is analogous to Format.pp_print_break.

val pp_as : state -> Int.t -> String.t -> Stdlib.Unit.t

pp_as state size is analogous to Format.pp_print_as to pretty-print a string as if it were of length size. This is useful to pretty-print UTF-8 encoded strings of known codepoint count, or to print a string as if it isn't there, like for HTML tags or ASCII escape sequences.

val pp_box : - state -> - ?indent:Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_box state ?(indent = 0) f evaluates f state in a compacting pretty-printing box wth offset indent in the formatter (see Format.pp_open_box). The box is opened before f state, and closed afterwards.

val pp_hbox : state -> (state -> Stdlib.Unit.t) -> Stdlib.Unit.t

pp_hbox state f evaluates f state in a horizontal pretty-printing box (see Format.pp_open_hbox). The box is opened before f state, and closed afterwards.

val pp_vbox : - state -> - ?indent:Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_vbox state ?(indent = 0) f evaluates f state in a vertical pretty-printing box with offset indent (see Format.pp_open_vbox). The box is opened before f state, and closed afterwards.

val pp_hvbox : - state -> - ?indent:Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_hovbox : - state -> - ?indent:Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_bool : state -> Stdlib.Bool.t -> Stdlib.Unit.t
val pp_int : state -> Int.t -> Stdlib.Unit.t
val pp_float : state -> Stdlib.Float.t -> Stdlib.Unit.t
val pp_char : state -> Stdlib.Char.t -> Stdlib.Unit.t
val pp_string : state -> String.t -> Stdlib.Unit.t
val pp_option : - state -> - ?none:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Option.t -> - Stdlib.Unit.t
val pp_list : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List.t -> - Stdlib.Unit.t
val pp_list1 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List1.t -> - Stdlib.Unit.t
val pp_list2 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List2.t -> - Stdlib.Unit.t
val pp_text : state -> String.t -> Stdlib.Unit.t
val pp_utf_8 : state -> String.t -> Stdlib.Unit.t
val pp_utf_8_text : state -> String.t -> Stdlib.Unit.t
diff --git a/beluga/Support/Fun/index.html b/beluga/Support/Fun/index.html deleted file mode 100644 index c849640f7..000000000 --- a/beluga/Support/Fun/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Fun (beluga.Support.Fun)

Module Support.Fun

include module type of Stdlib.Fun
val id : 'a -> 'a
val const : 'a -> 'b -> 'a
val negate : ('a -> bool) -> 'a -> bool
val protect : finally:(unit -> unit) -> (unit -> 'a) -> 'a
exception Finally_raised of exn
val (++) : ('b -> 'c) -> ('a -> 'b) -> 'a -> 'c

f ++ g is the function composition of f and g, such that (f ++ g) x is f (g x).

val (>>) : ('a -> 'b) -> ('b -> 'c) -> 'a -> 'c

f >> g is the function composition of f and g, such that x |> (f >> g) is g (f x).

val apply : 'a -> ('a -> 'b) -> 'b

apply x f is f x. This is useful when a function pipeline ends in a call to the generated function.

val flip : ('a -> 'b -> 'c) -> 'b -> 'a -> 'c

flip f x y is f y x.

val until : (unit -> bool) -> unit

until f repeatedly calls the effectful function f until f () is false. If f always returns true, then until f does not terminate.

val through : ('a -> unit) -> 'a -> 'a

through f x applies the effectful function f on x and returns x. For instance:

... |> through (fun x -> print_string x) |> ...
val after : (unit -> unit) -> 'a -> 'a

after f x calls the effectful function f and returns x. This effectively calls f after executing a function pipeline.

For instance:

... |> through (fun x -> print_string "Success") |> ...
val curry : (('a * 'b) -> 'c) -> 'a -> 'b -> 'c

Converts an uncurried function to a curried function.

val uncurry : ('a -> 'b -> 'c) -> ('a * 'b) -> 'c

Converts a curried function to a function on pairs.

val fix : (('a -> 'b) -> 'a -> 'b) -> 'a -> 'b

The fixpoint combinator.

val repeat : int -> (unit -> unit) -> unit

repeat n f calls f repeatedly n times. It is assumed that n >= 0.

diff --git a/beluga/Support/Functor/Make/argument-1-M/index.html b/beluga/Support/Functor/Make/argument-1-M/index.html deleted file mode 100644 index f0d14b0ad..000000000 --- a/beluga/Support/Functor/Make/argument-1-M/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -M (beluga.Support.Functor.Make.M)

Parameter Make.M

type +'a t

The type of actions in the monad.

val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

diff --git a/beluga/Support/Functor/Make/index.html b/beluga/Support/Functor/Make/index.html deleted file mode 100644 index 4552ca270..000000000 --- a/beluga/Support/Functor/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (beluga.Support.Functor.Make)

Module Functor.Make

Functor building an implementation of FUNCTOR over a monad.

Parameters

module M : Monad.MONAD

Signature

type 'a t = 'a M.t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

diff --git a/beluga/Support/Functor/index.html b/beluga/Support/Functor/index.html deleted file mode 100644 index f181c386c..000000000 --- a/beluga/Support/Functor/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Functor (beluga.Support.Functor)

Module Support.Functor

module type FUNCTOR = sig ... end

Module type for abstract datatypes with a mapping function.

module Make (M : Monad.MONAD) : FUNCTOR with type 'a t = 'a M.t

Functor building an implementation of FUNCTOR over a monad.

diff --git a/beluga/Support/Functor/module-type-FUNCTOR/index.html b/beluga/Support/Functor/module-type-FUNCTOR/index.html deleted file mode 100644 index 75d7295db..000000000 --- a/beluga/Support/Functor/module-type-FUNCTOR/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -FUNCTOR (beluga.Support.Functor.FUNCTOR)

Module type Functor.FUNCTOR

Module type for abstract datatypes with a mapping function.

type 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

diff --git a/beluga/Support/Gen/IO/index.html b/beluga/Support/Gen/IO/index.html deleted file mode 100644 index a1c82464e..000000000 --- a/beluga/Support/Gen/IO/index.html +++ /dev/null @@ -1,28 +0,0 @@ - -IO (beluga.Support.Gen.IO)

Module Gen.IO

val with_in : - ?mode:int -> - ?flags:Stdlib.open_flag list -> - string -> - (char t -> 'a) -> - 'a
val with_lines : - ?mode:int -> - ?flags:Stdlib.open_flag list -> - string -> - (string t -> 'a) -> - 'a
val write_str : - ?mode:int -> - ?flags:Stdlib.open_flag list -> - ?sep:string -> - string -> - string t -> - unit
val write : - ?mode:int -> - ?flags:Stdlib.open_flag list -> - string -> - char t -> - unit
val write_lines : - ?mode:int -> - ?flags:Stdlib.open_flag list -> - string -> - string t -> - unit
diff --git a/beluga/Support/Gen/Infix/index.html b/beluga/Support/Gen/Infix/index.html deleted file mode 100644 index 22183aef3..000000000 --- a/beluga/Support/Gen/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (beluga.Support.Gen.Infix)

Module Gen.Infix

val (--) : int -> int -> int gen
val (>>=) : 'a gen -> ('a -> 'b Gen_intf.gen) -> 'b gen
val (>>|) : 'a gen -> ('a -> 'b) -> 'b gen
val (>|=) : 'a gen -> ('a -> 'b) -> 'b gen
diff --git a/beluga/Support/Gen/Restart/Infix/index.html b/beluga/Support/Gen/Restart/Infix/index.html deleted file mode 100644 index 7ec070543..000000000 --- a/beluga/Support/Gen/Restart/Infix/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Infix (beluga.Support.Gen.Restart.Infix)

Module Restart.Infix

val (--) : int -> int -> int restartable
val (>>=) : 'a restartable -> ('a -> 'b Gen_intf.gen) -> 'b restartable
val (>>|) : 'a restartable -> ('a -> 'b) -> 'b restartable
val (>|=) : 'a restartable -> ('a -> 'b) -> 'b restartable
diff --git a/beluga/Support/Gen/Restart/index.html b/beluga/Support/Gen/Restart/index.html deleted file mode 100644 index 91c696b6b..000000000 --- a/beluga/Support/Gen/Restart/index.html +++ /dev/null @@ -1,45 +0,0 @@ - -Restart (beluga.Support.Gen.Restart)

Module Gen.Restart

type !'a t = unit -> 'a gen
type !'a restartable = 'a t
val empty : 'a restartable
val singleton : 'a -> 'a restartable
val return : 'a -> 'a restartable
val repeat : 'a -> 'a restartable
val iterate : 'a -> ('a -> 'a) -> 'a restartable
val unfold : ('b -> ('a * 'b) option) -> 'b -> 'a restartable
val init : ?limit:int -> (int -> 'a) -> 'a restartable
val is_empty : 'a restartable -> bool
val fold : ('b -> 'a -> 'b) -> 'b -> 'a restartable -> 'b
val reduce : ('a -> 'a -> 'a) -> 'a restartable -> 'a
val scan : ('b -> 'a -> 'b) -> 'b -> 'a restartable -> 'b restartable
val unfold_scan : - ('b -> 'a -> 'b * 'c) -> - 'b -> - 'a restartable -> - 'c restartable
val iter : ('a -> unit) -> 'a restartable -> unit
val iteri : (int -> 'a -> unit) -> 'a restartable -> unit
val length : 'a restartable -> int
val map : ('a -> 'b) -> 'a restartable -> 'b restartable
val mapi : (int -> 'a -> 'b) -> 'a restartable -> 'b restartable
val fold_map : ('b -> 'a -> 'b) -> 'b -> 'a restartable -> 'b restartable
val append : 'a restartable -> 'a restartable -> 'a restartable
val flatten : 'a Gen_intf.gen restartable -> 'a restartable
val flat_map : ('a -> 'b Gen_intf.gen) -> 'a restartable -> 'b restartable
val mem : ?eq:('a -> 'a -> bool) -> 'a -> 'a restartable -> bool
val take : int -> 'a restartable -> 'a restartable
val drop : int -> 'a restartable -> 'a restartable
val nth : int -> 'a restartable -> 'a
val take_nth : int -> 'a restartable -> 'a restartable
val filter : ('a -> bool) -> 'a restartable -> 'a restartable
val take_while : ('a -> bool) -> 'a restartable -> 'a restartable
val fold_while : - ('a -> 'b -> 'a * [ `Continue | `Stop ]) -> - 'a -> - 'b restartable -> - 'a
val drop_while : ('a -> bool) -> 'a restartable -> 'a restartable
val filter_map : ('a -> 'b option) -> 'a restartable -> 'b restartable
val zip_index : 'a restartable -> (int * 'a) restartable
val unzip : ('a * 'b) restartable -> 'a restartable * 'b restartable
val partition : - ('a -> bool) -> - 'a restartable -> - 'a restartable * 'a restartable
val for_all : ('a -> bool) -> 'a restartable -> bool
val exists : ('a -> bool) -> 'a restartable -> bool
val min : ?lt:('a -> 'a -> bool) -> 'a restartable -> 'a
val max : ?lt:('a -> 'a -> bool) -> 'a restartable -> 'a
val eq : ?eq:('a -> 'a -> bool) -> 'a restartable -> 'a restartable -> bool
val lexico : ?cmp:('a -> 'a -> int) -> 'a restartable -> 'a restartable -> int
val compare : ?cmp:('a -> 'a -> int) -> 'a restartable -> 'a restartable -> int
val find : ('a -> bool) -> 'a restartable -> 'a option
val sum : int restartable -> int
val map2 : - ('a -> 'b -> 'c) -> - 'a restartable -> - 'b restartable -> - 'c restartable
val iter2 : ('a -> 'b -> unit) -> 'a restartable -> 'b restartable -> unit
val fold2 : - ('acc -> 'a -> 'b -> 'acc) -> - 'acc -> - 'a restartable -> - 'b restartable -> - 'acc
val for_all2 : ('a -> 'b -> bool) -> 'a restartable -> 'b restartable -> bool
val exists2 : ('a -> 'b -> bool) -> 'a restartable -> 'b restartable -> bool
val zip_with : - ('a -> 'b -> 'c) -> - 'a restartable -> - 'b restartable -> - 'c restartable
val zip : 'a restartable -> 'b restartable -> ('a * 'b) restartable
val merge : 'a Gen_intf.gen restartable -> 'a restartable
val intersection : - ?cmp:('a -> 'a -> int) -> - 'a restartable -> - 'a restartable -> - 'a restartable
val sorted_merge : - ?cmp:('a -> 'a -> int) -> - 'a restartable -> - 'a restartable -> - 'a restartable
val sorted_merge_n : - ?cmp:('a -> 'a -> int) -> - 'a restartable list -> - 'a restartable
val tee : ?n:int -> 'a restartable -> 'a Gen_intf.gen list
val round_robin : ?n:int -> 'a restartable -> 'a Gen_intf.gen list
val interleave : 'a restartable -> 'a restartable -> 'a restartable
val intersperse : 'a -> 'a restartable -> 'a restartable
val product : 'a restartable -> 'b restartable -> ('a * 'b) restartable
val group : ?eq:('a -> 'a -> bool) -> 'a restartable -> 'a list restartable
val uniq : ?eq:('a -> 'a -> bool) -> 'a restartable -> 'a restartable
val sort : ?cmp:('a -> 'a -> int) -> 'a restartable -> 'a restartable
val sort_uniq : ?cmp:('a -> 'a -> int) -> 'a restartable -> 'a restartable
val chunks : int -> 'a restartable -> 'a array restartable
val permutations : 'a restartable -> 'a list restartable
val permutations_heap : 'a restartable -> 'a array restartable
val combinations : int -> 'a restartable -> 'a list restartable
val power_set : 'a restartable -> 'a list restartable
val of_list : 'a list -> 'a restartable
val to_list : 'a restartable -> 'a list
val to_rev_list : 'a restartable -> 'a list
val to_array : 'a restartable -> 'a array
val of_array : ?start:int -> ?len:int -> 'a array -> 'a restartable
val of_string : ?start:int -> ?len:int -> string -> char restartable
val to_string : char restartable -> string
val to_buffer : Stdlib.Buffer.t -> char restartable -> unit
val rand_int : int -> int restartable
val int_range : ?step:int -> int -> int -> int restartable
val lines : char restartable -> string restartable
val unlines : string restartable -> char restartable
module Infix : sig ... end
val (--) : int -> int -> int restartable
val (>>=) : 'a restartable -> ('a -> 'b Gen_intf.gen) -> 'b restartable
val (>>|) : 'a restartable -> ('a -> 'b) -> 'b restartable
val (>|=) : 'a restartable -> ('a -> 'b) -> 'b restartable
val pp : - ?start:string -> - ?stop:string -> - ?sep:string -> - ?horizontal:bool -> - (Stdlib.Format.formatter -> 'a -> unit) -> - Stdlib.Format.formatter -> - 'a restartable -> - unit
val of_seq : 'a Stdlib.Seq.t -> 'a restartable
val to_iter : 'a restartable -> 'a Gen_intf.iter
val cycle : 'a t -> 'a t
val lift : ('a gen -> 'b) -> 'a t -> 'b
val lift2 : ('a gen -> 'b gen -> 'c) -> 'a t -> 'b t -> 'c
val of_gen : ?caching:bool -> ?max_chunk_size:int -> 'a gen -> 'a t
diff --git a/beluga/Support/Gen/index.html b/beluga/Support/Gen/index.html deleted file mode 100644 index 55f21e1f3..000000000 --- a/beluga/Support/Gen/index.html +++ /dev/null @@ -1,18 +0,0 @@ - -Gen (beluga.Support.Gen)

Module Support.Gen

include module type of Gen
type !'a t = unit -> 'a option
type !'a gen = 'a t
module type S = Gen_intf.S
val get : 'a t -> 'a option
val next : 'a t -> 'a option
val get_exn : 'a t -> 'a
val junk : 'a t -> unit
val repeatedly : (unit -> 'a) -> 'a t
val empty : 'a gen
val singleton : 'a -> 'a gen
val return : 'a -> 'a gen
val repeat : 'a -> 'a gen
val iterate : 'a -> ('a -> 'a) -> 'a gen
val unfold : ('b -> ('a * 'b) option) -> 'b -> 'a gen
val init : ?limit:int -> (int -> 'a) -> 'a gen
val is_empty : 'a gen -> bool
val fold : ('b -> 'a -> 'b) -> 'b -> 'a gen -> 'b
val reduce : ('a -> 'a -> 'a) -> 'a gen -> 'a
val scan : ('b -> 'a -> 'b) -> 'b -> 'a gen -> 'b gen
val unfold_scan : ('b -> 'a -> 'b * 'c) -> 'b -> 'a gen -> 'c gen
val iter : ('a -> unit) -> 'a gen -> unit
val iteri : (int -> 'a -> unit) -> 'a gen -> unit
val length : 'a gen -> int
val map : ('a -> 'b) -> 'a gen -> 'b gen
val mapi : (int -> 'a -> 'b) -> 'a gen -> 'b gen
val fold_map : ('b -> 'a -> 'b) -> 'b -> 'a gen -> 'b gen
val append : 'a gen -> 'a gen -> 'a gen
val flatten : 'a Gen_intf.gen gen -> 'a gen
val flat_map : ('a -> 'b Gen_intf.gen) -> 'a gen -> 'b gen
val mem : ?eq:('a -> 'a -> bool) -> 'a -> 'a gen -> bool
val take : int -> 'a gen -> 'a gen
val drop : int -> 'a gen -> 'a gen
val nth : int -> 'a gen -> 'a
val take_nth : int -> 'a gen -> 'a gen
val filter : ('a -> bool) -> 'a gen -> 'a gen
val take_while : ('a -> bool) -> 'a gen -> 'a gen
val fold_while : ('a -> 'b -> 'a * [ `Continue | `Stop ]) -> 'a -> 'b gen -> 'a
val drop_while : ('a -> bool) -> 'a gen -> 'a gen
val filter_map : ('a -> 'b option) -> 'a gen -> 'b gen
val zip_index : 'a gen -> (int * 'a) gen
val unzip : ('a * 'b) gen -> 'a gen * 'b gen
val partition : ('a -> bool) -> 'a gen -> 'a gen * 'a gen
val for_all : ('a -> bool) -> 'a gen -> bool
val exists : ('a -> bool) -> 'a gen -> bool
val min : ?lt:('a -> 'a -> bool) -> 'a gen -> 'a
val max : ?lt:('a -> 'a -> bool) -> 'a gen -> 'a
val eq : ?eq:('a -> 'a -> bool) -> 'a gen -> 'a gen -> bool
val lexico : ?cmp:('a -> 'a -> int) -> 'a gen -> 'a gen -> int
val compare : ?cmp:('a -> 'a -> int) -> 'a gen -> 'a gen -> int
val find : ('a -> bool) -> 'a gen -> 'a option
val sum : int gen -> int
val map2 : ('a -> 'b -> 'c) -> 'a gen -> 'b gen -> 'c gen
val iter2 : ('a -> 'b -> unit) -> 'a gen -> 'b gen -> unit
val fold2 : ('acc -> 'a -> 'b -> 'acc) -> 'acc -> 'a gen -> 'b gen -> 'acc
val for_all2 : ('a -> 'b -> bool) -> 'a gen -> 'b gen -> bool
val exists2 : ('a -> 'b -> bool) -> 'a gen -> 'b gen -> bool
val zip_with : ('a -> 'b -> 'c) -> 'a gen -> 'b gen -> 'c gen
val zip : 'a gen -> 'b gen -> ('a * 'b) gen
val merge : 'a Gen_intf.gen gen -> 'a gen
val intersection : ?cmp:('a -> 'a -> int) -> 'a gen -> 'a gen -> 'a gen
val sorted_merge : ?cmp:('a -> 'a -> int) -> 'a gen -> 'a gen -> 'a gen
val sorted_merge_n : ?cmp:('a -> 'a -> int) -> 'a gen list -> 'a gen
val tee : ?n:int -> 'a gen -> 'a Gen_intf.gen list
val round_robin : ?n:int -> 'a gen -> 'a Gen_intf.gen list
val interleave : 'a gen -> 'a gen -> 'a gen
val intersperse : 'a -> 'a gen -> 'a gen
val product : 'a gen -> 'b gen -> ('a * 'b) gen
val group : ?eq:('a -> 'a -> bool) -> 'a gen -> 'a list gen
val uniq : ?eq:('a -> 'a -> bool) -> 'a gen -> 'a gen
val sort : ?cmp:('a -> 'a -> int) -> 'a gen -> 'a gen
val sort_uniq : ?cmp:('a -> 'a -> int) -> 'a gen -> 'a gen
val chunks : int -> 'a gen -> 'a array gen
val permutations : 'a gen -> 'a list gen
val permutations_heap : 'a gen -> 'a array gen
val combinations : int -> 'a gen -> 'a list gen
val power_set : 'a gen -> 'a list gen
val of_list : 'a list -> 'a gen
val to_list : 'a gen -> 'a list
val to_rev_list : 'a gen -> 'a list
val to_array : 'a gen -> 'a array
val of_array : ?start:int -> ?len:int -> 'a array -> 'a gen
val to_string : char gen -> string
val to_buffer : Stdlib.Buffer.t -> char gen -> unit
val rand_int : int -> int gen
val int_range : ?step:int -> int -> int -> int gen
val lines : char gen -> string gen
val unlines : string gen -> char gen
module Infix : sig ... end
val (--) : int -> int -> int gen
val (>>=) : 'a gen -> ('a -> 'b Gen_intf.gen) -> 'b gen
val (>>|) : 'a gen -> ('a -> 'b) -> 'b gen
val (>|=) : 'a gen -> ('a -> 'b) -> 'b gen
val pp : - ?start:string -> - ?stop:string -> - ?sep:string -> - ?horizontal:bool -> - (Stdlib.Format.formatter -> 'a -> unit) -> - Stdlib.Format.formatter -> - 'a gen -> - unit
val of_seq : 'a Stdlib.Seq.t -> 'a gen
val to_iter : 'a gen -> 'a Gen_intf.iter
module Restart : sig ... end
val persistent : 'a t -> 'a Restart.t
val persistent_lazy : - ?caching:bool -> - ?max_chunk_size:int -> - 'a t -> - 'a Restart.t
val persistent_to_seq : 'a t -> 'a Stdlib.Seq.t
val persistent_lazy_to_seq : - ?caching:bool -> - ?max_chunk_size:int -> - 'a t -> - 'a Stdlib.Seq.t
val peek : 'a t -> ('a * 'a option) t
val peek_n : int -> 'a t -> ('a * 'a array) t
val start : 'a Restart.t -> 'a t
module IO : sig ... end
val of_string : string -> char Gen.t

Converts a string into a generator yielding individual characters.

val of_in_channel_lines : Stdlib.in_channel -> string Gen.t

Constructs a generator yielding successive lines from an input channel until it encounters an error.

val drop_lines : 'a Gen.t -> int -> unit

drop_lines g ln drops the first ln elements from the generator g.

val line_generator : ?buffer_size:int -> char Gen.t -> string Gen.t

Transform a character generator into a line generator. This function assumes unix line endings, so it is not portable.

This function also imposes a maximum line length specified via the buffer_size optional argument. (So that it uses constant memory.)

val sequence : 'a Gen.t list -> 'a Gen.t

Sequence a list of generators into one generator. Of course, if any generator in the sequence is infinite, subsequent generators will never be pulled from.

val iter_through : ('a -> unit) -> 'a Gen.t -> 'a Gen.t

iter_through f g is a generator that will execute f on each element of g before yielding it.

diff --git a/beluga/Support/Hash/Make/argument-1-T/index.html b/beluga/Support/Hash/Make/argument-1-T/index.html deleted file mode 100644 index 58153e72a..000000000 --- a/beluga/Support/Hash/Make/argument-1-T/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -T (beluga.Support.Hash.Make.T)

Parameter Make.T

type t
diff --git a/beluga/Support/Hash/Make/index.html b/beluga/Support/Hash/Make/index.html deleted file mode 100644 index 5f9b9701c..000000000 --- a/beluga/Support/Hash/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (beluga.Support.Hash.Make)

Module Hash.Make

Parameters

module T : sig ... end

Signature

type t = T.t
val hash : t -> int

hash e is the hash code computed for e.

If e1 and e2 as equal, then hash e1 and hash e2 must be equal.

diff --git a/beluga/Support/Hash/index.html b/beluga/Support/Hash/index.html deleted file mode 100644 index d7a7d901f..000000000 --- a/beluga/Support/Hash/index.html +++ /dev/null @@ -1,6 +0,0 @@ - -Hash (beluga.Support.Hash)

Module Support.Hash

Hashable types.

module type HASH = sig ... end

Module type for hashable types.

module Make (T : sig ... end) : HASH with type t = T.t
val contramap : - (module HASH with type t = 's) -> - ('t -> 's) -> - (module HASH - with type t = 't)

If val f : 't -> 's, then contramap hash f is an instance of HASH for values of type 't by the HASH instance hash for values of type 's.

diff --git a/beluga/Support/Hash/module-type-HASH/index.html b/beluga/Support/Hash/module-type-HASH/index.html deleted file mode 100644 index a4ed0b35d..000000000 --- a/beluga/Support/Hash/module-type-HASH/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -HASH (beluga.Support.Hash.HASH)

Module type Hash.HASH

Module type for hashable types.

Hashable types may be used as keys for Hashtbl.Make.

type t
val hash : t -> int

hash e is the hash code computed for e.

If e1 and e2 as equal, then hash e1 and hash e2 must be equal.

diff --git a/beluga/Support/Hashtbl/Make/argument-1-H/index.html b/beluga/Support/Hashtbl/Make/argument-1-H/index.html deleted file mode 100644 index 7cb57661a..000000000 --- a/beluga/Support/Hashtbl/Make/argument-1-H/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -H (beluga.Support.Hashtbl.Make.H)

Parameter Make.H

type t
val equal : t -> t -> bool
val hash : t -> int
diff --git a/beluga/Support/Hashtbl/Make/index.html b/beluga/Support/Hashtbl/Make/index.html deleted file mode 100644 index 4dd7db313..000000000 --- a/beluga/Support/Hashtbl/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (beluga.Support.Hashtbl.Make)

Module Hashtbl.Make

Parameters

module H : HashedType

Signature

type key = H.t
type !'a t = 'a Stdlib__Hashtbl.Make(H).t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Support/Hashtbl/MakeSeeded/argument-1-H/index.html b/beluga/Support/Hashtbl/MakeSeeded/argument-1-H/index.html deleted file mode 100644 index 82f86c11a..000000000 --- a/beluga/Support/Hashtbl/MakeSeeded/argument-1-H/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -H (beluga.Support.Hashtbl.MakeSeeded.H)

Parameter MakeSeeded.H

type t
val equal : t -> t -> bool
val hash : int -> t -> int
diff --git a/beluga/Support/Hashtbl/MakeSeeded/index.html b/beluga/Support/Hashtbl/MakeSeeded/index.html deleted file mode 100644 index fd59ef1da..000000000 --- a/beluga/Support/Hashtbl/MakeSeeded/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MakeSeeded (beluga.Support.Hashtbl.MakeSeeded)

Module Hashtbl.MakeSeeded

Parameters

Signature

type key = H.t
type !'a t = 'a Stdlib__Hashtbl.MakeSeeded(H).t
val create : ?random:bool -> int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Support/Hashtbl/index.html b/beluga/Support/Hashtbl/index.html deleted file mode 100644 index 2b431f92f..000000000 --- a/beluga/Support/Hashtbl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hashtbl (beluga.Support.Hashtbl)

Module Support.Hashtbl

include module type of Stdlib.Hashtbl
type (!'a, !'b) t = ('a, 'b) Stdlib__Hashtbl.t
val create : ?random:bool -> int -> ('a, 'b) t
val clear : ('a, 'b) t -> unit
val reset : ('a, 'b) t -> unit
val copy : ('a, 'b) t -> ('a, 'b) t
val add : ('a, 'b) t -> 'a -> 'b -> unit
val find : ('a, 'b) t -> 'a -> 'b
val find_opt : ('a, 'b) t -> 'a -> 'b option
val find_all : ('a, 'b) t -> 'a -> 'b list
val mem : ('a, 'b) t -> 'a -> bool
val remove : ('a, 'b) t -> 'a -> unit
val replace : ('a, 'b) t -> 'a -> 'b -> unit
val iter : ('a -> 'b -> unit) -> ('a, 'b) t -> unit
val filter_map_inplace : ('a -> 'b -> 'b option) -> ('a, 'b) t -> unit
val fold : ('a -> 'b -> 'c -> 'c) -> ('a, 'b) t -> 'c -> 'c
val length : ('a, 'b) t -> int
val randomize : unit -> unit
val is_randomized : unit -> bool
val rebuild : ?random:bool -> ('a, 'b) t -> ('a, 'b) t
type statistics = Stdlib__Hashtbl.statistics = {
  1. num_bindings : int;
  2. num_buckets : int;
  3. max_bucket_length : int;
  4. bucket_histogram : int array;
}
val stats : ('a, 'b) t -> statistics
val to_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.t
val to_seq_keys : ('a, 'b) t -> 'a Stdlib.Seq.t
val to_seq_values : ('a, 'b) t -> 'b Stdlib.Seq.t
val add_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.t -> unit
val replace_seq : ('a, 'b) t -> ('a * 'b) Stdlib.Seq.t -> unit
val of_seq : ('a * 'b) Stdlib.Seq.t -> ('a, 'b) t
module type HashedType = sig ... end
module type S = sig ... end
module Make (H : HashedType) : sig ... end
module type SeededHashedType = sig ... end
module type SeededS = sig ... end
module MakeSeeded (H : SeededHashedType) : sig ... end
val hash : 'a -> int
val seeded_hash : int -> 'a -> int
val hash_param : int -> int -> 'a -> int
val seeded_hash_param : int -> int -> int -> 'a -> int
val map : ('a -> 'b) -> ('k, 'a) t -> ('k, 'b) t

map f m maps the values in m by f. This involves converting m to a Seq, mapping the values by m, then constructing the new hashtable from the resulting sequence.

val group_by : ('a -> 'k) -> 'a list -> ('k, 'a list) t

group_by k l groups the values in l by the keys assigned by k into a hashtable.

diff --git a/beluga/Support/Hashtbl/module-type-HashedType/index.html b/beluga/Support/Hashtbl/module-type-HashedType/index.html deleted file mode 100644 index 12f25048c..000000000 --- a/beluga/Support/Hashtbl/module-type-HashedType/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -HashedType (beluga.Support.Hashtbl.HashedType)

Module type Hashtbl.HashedType

type t
val equal : t -> t -> bool
val hash : t -> int
diff --git a/beluga/Support/Hashtbl/module-type-S/index.html b/beluga/Support/Hashtbl/module-type-S/index.html deleted file mode 100644 index df17ee09b..000000000 --- a/beluga/Support/Hashtbl/module-type-S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (beluga.Support.Hashtbl.S)

Module type Hashtbl.S

type key
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Support/Hashtbl/module-type-SeededHashedType/index.html b/beluga/Support/Hashtbl/module-type-SeededHashedType/index.html deleted file mode 100644 index 7ff6998d3..000000000 --- a/beluga/Support/Hashtbl/module-type-SeededHashedType/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -SeededHashedType (beluga.Support.Hashtbl.SeededHashedType)

Module type Hashtbl.SeededHashedType

type t
val equal : t -> t -> bool
val hash : int -> t -> int
diff --git a/beluga/Support/Hashtbl/module-type-SeededS/index.html b/beluga/Support/Hashtbl/module-type-SeededS/index.html deleted file mode 100644 index 98b8ffda7..000000000 --- a/beluga/Support/Hashtbl/module-type-SeededS/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -SeededS (beluga.Support.Hashtbl.SeededS)

Module type Hashtbl.SeededS

type key
type !'a t
val create : ?random:bool -> int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Support/History/index.html b/beluga/Support/History/index.html deleted file mode 100644 index c025aa1ac..000000000 --- a/beluga/Support/History/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -History (beluga.Support.History)

Module Support.History

type 'a t

A history of items.

A history is a mutable data structure that keeps track of its "past" and "future". The history's state maintains its position in this sequence. A history supports moving back in time and forwards again as inverse operations.

Histories support appending new items. Doing so when having shifted into the past creates a new "timeline", dropping the old future.

val create : unit -> 'a t

Creates an empty history.

val add : 'a t -> 'a -> unit

Records a new entry in the history. If the history is in the past, then the future items are deleted by this action, thus creating a new "timeline".

val step_forward : 'a t -> 'a option

step_forward history steps the history forward, and yields history's future if it exists.

val step_backward : 'a t -> 'a option

step_backward history steps the history backward, and yields history's past if it exists.

val to_lists : 'a t -> 'a list * 'a list

Converts the history to a pair of lists. The first list represents the past items. The second list represents the future items. Both lists have the most recent item first.

diff --git a/beluga/Support/Imperative_state/Make/argument-1-State/index.html b/beluga/Support/Imperative_state/Make/argument-1-State/index.html deleted file mode 100644 index d96c8eabf..000000000 --- a/beluga/Support/Imperative_state/Make/argument-1-State/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -State (beluga.Support.Imperative_state.Make.State)

Parameter Make.State

type state
diff --git a/beluga/Support/Imperative_state/Make/index.html b/beluga/Support/Imperative_state/Make/index.html deleted file mode 100644 index d80c0794d..000000000 --- a/beluga/Support/Imperative_state/Make/index.html +++ /dev/null @@ -1,57 +0,0 @@ - -Make (beluga.Support.Imperative_state.Make)

Module Imperative_state.Make

Functor building an implementation of IMPERATIVE_STATE for a given type of states.

Parameters

module State : sig ... end

Signature

type state = State.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : state -> (state -> 'a -> 'b) -> 'a List.t -> 'b List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : state -> (state -> 'a -> 'b) -> 'a List1.t -> 'b List1.t
val traverse_list2 : state -> (state -> 'a -> 'b) -> 'a List2.t -> 'b List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a List.t -> - 'b List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a List1.t -> - 'b List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a List2.t -> - 'b List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Option.t -> - 'b Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) List.t -> 'a List.t
val seq_list1 : state -> (state -> 'a) List1.t -> 'a List1.t
val iter_seq : state -> (state -> Stdlib.Unit.t) List.t -> Stdlib.Unit.t
diff --git a/beluga/Support/Imperative_state/index.html b/beluga/Support/Imperative_state/index.html deleted file mode 100644 index 3f0dfa4ed..000000000 --- a/beluga/Support/Imperative_state/index.html +++ /dev/null @@ -1,4 +0,0 @@ - -Imperative_state (beluga.Support.Imperative_state)

Module Support.Imperative_state

Mutable state helper definitions.

This is analogous to the state monad defined in State, but the imperative state type assumes that the state is mutable.

module type IMPERATIVE_STATE = sig ... end

Abstract definition of helpers for stateful operations using a strictly mutable state.

module Make - (State : sig ... end) : - IMPERATIVE_STATE with type state = State.state

Functor building an implementation of IMPERATIVE_STATE for a given type of states.

diff --git a/beluga/Support/Imperative_state/module-type-IMPERATIVE_STATE/index.html b/beluga/Support/Imperative_state/module-type-IMPERATIVE_STATE/index.html deleted file mode 100644 index a20d9c85d..000000000 --- a/beluga/Support/Imperative_state/module-type-IMPERATIVE_STATE/index.html +++ /dev/null @@ -1,57 +0,0 @@ - -IMPERATIVE_STATE (beluga.Support.Imperative_state.IMPERATIVE_STATE)

Module type Imperative_state.IMPERATIVE_STATE

Abstract definition of helpers for stateful operations using a strictly mutable state.

type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : state -> (state -> 'a -> 'b) -> 'a List.t -> 'b List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : state -> (state -> 'a -> 'b) -> 'a List1.t -> 'b List1.t
val traverse_list2 : state -> (state -> 'a -> 'b) -> 'a List2.t -> 'b List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a List.t -> - 'b List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a List1.t -> - 'b List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a List2.t -> - 'b List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Option.t -> - 'b Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) List.t -> 'a List.t
val seq_list1 : state -> (state -> 'a) List1.t -> 'a List1.t
val iter_seq : state -> (state -> Stdlib.Unit.t) List.t -> Stdlib.Unit.t
diff --git a/beluga/Support/Int/Hashtbl/index.html b/beluga/Support/Int/Hashtbl/index.html deleted file mode 100644 index a39ebf256..000000000 --- a/beluga/Support/Int/Hashtbl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hashtbl (beluga.Support.Int.Hashtbl)

Module Int.Hashtbl

type key = t
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Support/Int/index.html b/beluga/Support/Int/index.html deleted file mode 100644 index abfa04fc2..000000000 --- a/beluga/Support/Int/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Int (beluga.Support.Int)

Module Support.Int

include module type of Stdlib.Int
type t = int
val zero : int
val one : int
val minus_one : int
val neg : int -> int
val add : int -> int -> int
val sub : int -> int -> int
val mul : int -> int -> int
val div : int -> int -> int
val rem : int -> int -> int
val succ : int -> int
val pred : int -> int
val abs : int -> int
val max_int : int
val min_int : int
val logand : int -> int -> int
val logor : int -> int -> int
val logxor : int -> int -> int
val lognot : int -> int
val shift_left : int -> int -> int
val shift_right : int -> int -> int
val shift_right_logical : int -> int -> int
val to_float : int -> float
val of_float : float -> int
val to_string : int -> string

Constructors

val of_string : string -> t

Alias of Stdlib.int_of_string.

val of_string_opt : string -> t option

Alias of Stdlib.int_of_string_opt.

Collections

module Set : Stdlib.Set.S with type elt = t
module Map : Stdlib.Map.S with type key = t
module Hashtbl : Hashtbl.S with type key = t

Instances

include Eq.EQ with type t := t
include Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Hash.HASH with type t := t
val hash : t -> int

hash e is the hash code computed for e.

If e1 and e2 as equal, then hash e1 and hash e2 must be equal.

include Show.SHOW with type t := t
val pp : Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Support/List/MakeEq/argument-1-E/index.html b/beluga/Support/List/MakeEq/argument-1-E/index.html deleted file mode 100644 index fdd3348d4..000000000 --- a/beluga/Support/List/MakeEq/argument-1-E/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -E (beluga.Support.List.MakeEq.E)

Parameter MakeEq.E

type t

The type of elements to check for equality.

val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/List/MakeEq/index.html b/beluga/Support/List/MakeEq/index.html deleted file mode 100644 index e9cf15fde..000000000 --- a/beluga/Support/List/MakeEq/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MakeEq (beluga.Support.List.MakeEq)

Module List.MakeEq

Parameters

module E : Eq.EQ

Signature

type t = E.t t

The type of elements to check for equality.

val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/List/MakeOrd/argument-1-O/index.html b/beluga/Support/List/MakeOrd/argument-1-O/index.html deleted file mode 100644 index 3a4aaf047..000000000 --- a/beluga/Support/List/MakeOrd/argument-1-O/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -O (beluga.Support.List.MakeOrd.O)

Parameter MakeOrd.O

type t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/List/MakeOrd/index.html b/beluga/Support/List/MakeOrd/index.html deleted file mode 100644 index 1274d1d61..000000000 --- a/beluga/Support/List/MakeOrd/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MakeOrd (beluga.Support.List.MakeOrd)

Module List.MakeOrd

Functor building an implementation of Ord given a totally ordered type. The ordering between two lists of totally ordered types is as follows with respect to compare l r:

Parameters

module O : Ord.ORD

Signature

type t = O.t t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/List/MakeShow/argument-1-S/index.html b/beluga/Support/List/MakeShow/argument-1-S/index.html deleted file mode 100644 index 118079a93..000000000 --- a/beluga/Support/List/MakeShow/argument-1-S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (beluga.Support.List.MakeShow.S)

Parameter MakeShow.S

type t
val pp : Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Support/List/MakeShow/index.html b/beluga/Support/List/MakeShow/index.html deleted file mode 100644 index cca737e4a..000000000 --- a/beluga/Support/List/MakeShow/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MakeShow (beluga.Support.List.MakeShow)

Module List.MakeShow

Parameters

module S : Show.SHOW

Signature

type t = S.t t
val pp : Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Support/List/index.html b/beluga/Support/List/index.html deleted file mode 100644 index 5309d2e3e..000000000 --- a/beluga/Support/List/index.html +++ /dev/null @@ -1,27 +0,0 @@ - -List (beluga.Support.List)

Module Support.List

include module type of Stdlib.List
type !'a t = 'a list =
  1. | []
  2. | :: of 'a * 'a list
val length : 'a list -> int
val compare_lengths : 'a list -> 'b list -> int
val compare_length_with : 'a list -> int -> int
val cons : 'a -> 'a list -> 'a list
val hd : 'a list -> 'a
val tl : 'a list -> 'a list
val nth : 'a list -> int -> 'a
val nth_opt : 'a list -> int -> 'a option
val rev : 'a list -> 'a list
val init : int -> (int -> 'a) -> 'a list
val append : 'a list -> 'a list -> 'a list
val rev_append : 'a list -> 'a list -> 'a list
val concat : 'a list list -> 'a list
val flatten : 'a list list -> 'a list
val iter : ('a -> unit) -> 'a list -> unit
val iteri : (int -> 'a -> unit) -> 'a list -> unit
val map : ('a -> 'b) -> 'a list -> 'b list
val mapi : (int -> 'a -> 'b) -> 'a list -> 'b list
val rev_map : ('a -> 'b) -> 'a list -> 'b list
val filter_map : ('a -> 'b option) -> 'a list -> 'b list
val concat_map : ('a -> 'b list) -> 'a list -> 'b list
val fold_left_map : ('a -> 'b -> 'a * 'c) -> 'a -> 'b list -> 'a * 'c list
val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b list -> 'a
val fold_right : ('a -> 'b -> 'b) -> 'a list -> 'b -> 'b
val iter2 : ('a -> 'b -> unit) -> 'a list -> 'b list -> unit
val map2 : ('a -> 'b -> 'c) -> 'a list -> 'b list -> 'c list
val rev_map2 : ('a -> 'b -> 'c) -> 'a list -> 'b list -> 'c list
val fold_left2 : ('a -> 'b -> 'c -> 'a) -> 'a -> 'b list -> 'c list -> 'a
val fold_right2 : ('a -> 'b -> 'c -> 'c) -> 'a list -> 'b list -> 'c -> 'c
val for_all : ('a -> bool) -> 'a list -> bool
val exists : ('a -> bool) -> 'a list -> bool
val for_all2 : ('a -> 'b -> bool) -> 'a list -> 'b list -> bool
val exists2 : ('a -> 'b -> bool) -> 'a list -> 'b list -> bool
val mem : 'a -> 'a list -> bool
val memq : 'a -> 'a list -> bool
val find : ('a -> bool) -> 'a list -> 'a
val find_opt : ('a -> bool) -> 'a list -> 'a option
val filter : ('a -> bool) -> 'a list -> 'a list
val find_all : ('a -> bool) -> 'a list -> 'a list
val filteri : (int -> 'a -> bool) -> 'a list -> 'a list
val partition : ('a -> bool) -> 'a list -> 'a list * 'a list
val partition_map : - ('a -> ('b, 'c) Stdlib.Either.t) -> - 'a list -> - 'b list * 'c list
val assoc : 'a -> ('a * 'b) list -> 'b
val assoc_opt : 'a -> ('a * 'b) list -> 'b option
val assq : 'a -> ('a * 'b) list -> 'b
val assq_opt : 'a -> ('a * 'b) list -> 'b option
val mem_assoc : 'a -> ('a * 'b) list -> bool
val mem_assq : 'a -> ('a * 'b) list -> bool
val remove_assoc : 'a -> ('a * 'b) list -> ('a * 'b) list
val remove_assq : 'a -> ('a * 'b) list -> ('a * 'b) list
val sort : ('a -> 'a -> int) -> 'a list -> 'a list
val stable_sort : ('a -> 'a -> int) -> 'a list -> 'a list
val fast_sort : ('a -> 'a -> int) -> 'a list -> 'a list
val sort_uniq : ('a -> 'a -> int) -> 'a list -> 'a list
val merge : ('a -> 'a -> int) -> 'a list -> 'a list -> 'a list
val to_seq : 'a list -> 'a Stdlib.Seq.t
val of_seq : 'a Stdlib.Seq.t -> 'a list
val last : 'a t -> 'a

last l is the last element in the list.

  • raises Invalid_argument

    if the list is empty.

val pairs : 'a t -> ('a * 'a) t

pairs [x_1; x_2; ...; x_n] is [(x_1, x_2); (x_2, x_3); ...; (x_n-1, x_n)], the list of all successive pairs in [x_1; x_2; ...; x_n]. The output list has one element less than the input list.

val null : 'a t -> bool

null l is true if and only if l = [].

val nonempty : 'a t -> bool

nonempty l is true if and only if l <> [].

val traverse : ('a -> 'b option) -> 'a t -> 'b t option

Maps a function that may fail over a list, and eagerly fails as soon as any individual call fails. Elements beyond the first failing one will not be processed.

val traverse_ : ('a -> unit option) -> 'a t -> unit option

Maps a function that may fail over a list, and eagerly fails as soon as an individual call fails. The functions themselves may not compute interesting results.

val fold_left_opt : ('b -> 'a -> 'b option) -> 'b -> 'a t -> 'b option

Folds a list with a function that may fail, eagerly failing. Note that elements beyond the first failing one will not be processed.

val filter_rev : ('a -> bool) -> 'a t -> 'a t

filter_rev p l returns all the elements of the list l that satisfy the predicate f. The order of the elements in the input list is reversed.

val find_map : ('a -> 'b option) -> 'a t -> 'b option

find_map f l applies f to the elements of l in order, and returns the first result of the form Option.Some v, or Option.None if none exist.

val find_apply : ('a -> 'b option) t -> 'a -> 'b option

find_apply fs a applies a to the functions in fs in order until one of them returns Option.Some v for some v. Otherwise, Option.None is returned.

val uncons : 'a t -> ('a * 'a t) option

uncons l is Option.Some (hd l, tl l) if l <> [] and Option.None otherwise.

val concat_mapi : (int -> 'a -> 'b t) -> 'a t -> 'b t

concat_mapi f [x0; x1; ...; xn] is f 0 x0 @ f 1 x1 @ ... @ f n xn.

val index_of : ('a -> bool) -> 'a t -> int option

index_of p l is the index of the first element in l that satisfies the predicate p. Returns Option.None if no such element was found.

val equal : ('a -> 'a -> bool) -> 'a list -> 'a list -> bool

equal eq [a1; ...; an] [b1; ..; bm] holds when the two input lists have the same length, and for each pair of elements ai, bi at the same position we have eq ai bi. Note: the eq function may be called even if the lists have different lengths. If you know your equality function is costly, you may want to check compare_lengths first.

val hd_opt : 'a t -> 'a option

hd_opt l is Option.Some (hd l) if l <> [] and Option.None otherwise.

val index : 'a t -> (int * 'a) t

index [x0; x1; ...; xn] is [(0, x0); (1, x1); ...; (n, xn)].

val fold_left3 : - ('b -> 'a1 -> 'a2 -> 'a3 -> 'b) -> - 'b -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'b

Same as fold_left2 but for three lists.

val fold_left4 : - ('b -> 'a1 -> 'a2 -> 'a3 -> 'a4 -> 'b) -> - 'b -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'b

Same as fold_left3 but for four lists.

val mapi2 : (int -> 'a -> 'b -> 'c) -> 'a list -> 'b list -> 'c list

mapi2 f [x0; x1; ...; xn] [y0; y1; ...; yn] is [f 0 x0 y0; f 1 x1 y1; ...; f n xn yn].

  • raises Invalid_argument

    if the two lists are determined to not have the same length.

val drop : int -> 'a t -> 'a t

drop k l is l without its first k elements. If l has fewer than k elements, then [] is returned.

val ap : 'a t -> ('a -> 'b) t -> 'b t

ap [x1; x2; ...; xn] [f1; f2; ...; fn] is [f1 x1; f2 x2; ...; fn xn].

  • raises Invalid_argument

    if the two lists are determined to have different lengths.

val flap : 'a -> ('a -> 'b) t -> 'b t

flap x [f1; f2; ...; fn] is [f1 x; f2 x; ...; fn x].

val split : ('a * 'b) t -> 'a t * 'b t

Transform a list of pairs into a pair of lists: split [(a1, b1); ...; (an, bn)] is ([a1; ...; an], [b1; ...; bn]).

val combine : 'a t -> 'b t -> ('a * 'b) t

Transform a pair of lists into a list of pairs: combine [a1; ...; an] [b1; ...; bn] is [(a1, b1); ...; (an, bn)].

  • raises Invalid_argument

    if the two lists have different lengths.

val take : int -> 'a t -> 'a t * 'a t

take k [x1; x2; ...; xn] is ([x1; x2; ...; xk], [x(k+1); x(k+2); ...; xn]).

  • If k <= 0, then take k [x1; x2; ...; xn] is ([], [x1; x2; ...; xn]).
  • If k >= n, then take k [x1; x2; ...; xn] is ([x1; x2; ...; xn], []).
val take_opt : int -> 'a t -> ('a t * 'a t) option

take_opt k [x1; x2; ...; xn] is Option.Some ([x1; x2; ...; xk], [x(k+1); x(k+2); ...; xn]) if 0 <= k <= n, and Option.None otherwise.

  • raises Invalid_argument

    if k < 0.

val take_while : ('a -> bool) -> 'a t -> 'a t * 'a t

take_while p [x1; x2; ...; xn] is ([x1; x2; ...; x(k-1)], [xk; x(k+1); ...; xn]), where x1, x2, ..., x(k-1) all satisfy p, and xk does not satisfy p.

val take_while_map : ('a -> 'b option) -> 'a t -> 'b t * 'a t

take_while_map p [x1; x2; ...; xn] is ([y1; y2; ...; y(k-1)], [xk; x(k+1); ...; xn]), where y1, y2, ..., y(k-1) are such that p xi = Option.Some yi, and xk is the first element such that p xk = Option.None.

val iter_rev : ('a -> unit) -> 'a t -> unit

iter_rev f [x1; x2; ...; xn] is f xn; ...; f x2; f x1.

val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int

compare cmp [a1; ...; an] [b1; ...; bm] performs a lexicographic comparison of the two input lists, using the same 'a -> 'a -> int interface as Stdlib.compare:

  • a1 :: l1 is smaller than a2 :: l2 (negative result) if a1 is smaller than a2, or if they are equal (0 result) and l1 is smaller than l2
  • the empty list [] is strictly smaller than non-empty lists Note: the cmp function will be called even if the lists have different lengths.

Printing

val pp : - ?pp_sep:(Format.formatter -> unit -> unit) -> - (Format.formatter -> 'a -> unit) -> - Format.formatter -> - 'a t -> - unit

pp ?pp_sep pp_v ppf l prints the items of the list l using pp_v to print each item and calling pp_sep between items on the formatter ppf.

val show : - ?pp_sep:(Format.formatter -> unit -> unit) -> - (Format.formatter -> 'a -> unit) -> - 'a t -> - string

show ?pp_sep pp_v l shows as a string the items of the list l using pp_v to show each item and calling pp_sep between items.

Instances

module MakeEq (E : Eq.EQ) : Eq.EQ with type t = E.t t
module MakeOrd (O : Ord.ORD) : Ord.ORD with type t = O.t t

Functor building an implementation of Ord given a totally ordered type. The ordering between two lists of totally ordered types is as follows with respect to compare l r:

module MakeShow (S : Show.SHOW) : Show.SHOW with type t = S.t t
diff --git a/beluga/Support/List1/MakeEq/argument-1-E/index.html b/beluga/Support/List1/MakeEq/argument-1-E/index.html deleted file mode 100644 index 6d507ac0d..000000000 --- a/beluga/Support/List1/MakeEq/argument-1-E/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -E (beluga.Support.List1.MakeEq.E)

Parameter MakeEq.E

type t

The type of elements to check for equality.

val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/List1/MakeEq/index.html b/beluga/Support/List1/MakeEq/index.html deleted file mode 100644 index d94a40629..000000000 --- a/beluga/Support/List1/MakeEq/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MakeEq (beluga.Support.List1.MakeEq)

Module List1.MakeEq

Parameters

module E : Eq.EQ

Signature

type t = E.t t

The type of elements to check for equality.

val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/List1/MakeOrd/argument-1-O/index.html b/beluga/Support/List1/MakeOrd/argument-1-O/index.html deleted file mode 100644 index db614e289..000000000 --- a/beluga/Support/List1/MakeOrd/argument-1-O/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -O (beluga.Support.List1.MakeOrd.O)

Parameter MakeOrd.O

type t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/List1/MakeOrd/index.html b/beluga/Support/List1/MakeOrd/index.html deleted file mode 100644 index 7a1b448b7..000000000 --- a/beluga/Support/List1/MakeOrd/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MakeOrd (beluga.Support.List1.MakeOrd)

Module List1.MakeOrd

Parameters

module O : Ord.ORD

Signature

type t = O.t t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/List1/MakeShow/argument-1-S/index.html b/beluga/Support/List1/MakeShow/argument-1-S/index.html deleted file mode 100644 index 7d37883c7..000000000 --- a/beluga/Support/List1/MakeShow/argument-1-S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (beluga.Support.List1.MakeShow.S)

Parameter MakeShow.S

type t
val pp : Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Support/List1/MakeShow/index.html b/beluga/Support/List1/MakeShow/index.html deleted file mode 100644 index 7dce09420..000000000 --- a/beluga/Support/List1/MakeShow/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MakeShow (beluga.Support.List1.MakeShow)

Module List1.MakeShow

Parameters

module S : Show.SHOW

Signature

type t = S.t t
val pp : Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Support/List1/index.html b/beluga/Support/List1/index.html deleted file mode 100644 index 4a149a729..000000000 --- a/beluga/Support/List1/index.html +++ /dev/null @@ -1,14 +0,0 @@ - -List1 (beluga.Support.List1)

Module Support.List1

type +'a t = private
  1. | T of 'a * 'a list

The type of lists of length at least 1.

Constructors

val from : 'a -> 'a list -> 'a t

from h t is the non-empty list obtained by prepending h onto the list t.

val singleton : 'a -> 'a t

singleton e is the non-empty list with the single element e in it.

val cons : 'a -> 'a t -> 'a t

cons e l is the non-empty list obtained by prepending e onto l.

val rev : 'a t -> 'a t

rev l is l in reverse order.

val replace_first : ('a -> 'a) -> 'a t -> 'a t

replace_first f (a1, [a2; a3; ...; an]) is (f a1, [a2; a3; ...; an]).

Destructors

val uncons : 'a t -> 'a * 'a list

uncons l is (head l, tail l).

val head : 'a t -> 'a

head l is the first element in l.

val tail : 'a t -> 'a list

tail l is the list of elements that succeed the head of l.

val unsnoc : 'a t -> 'a list * 'a

unsnoc (a_1, [a_2; ...; a_(n-1); a_n]) is ([a_1; a_2; ...; a_(n-1)], a_n), with a_n being the last element in the non-empty list, and [a_1; a_2; ...; a_(n-1)] being the list of elements that precede a_n in order.

val last : 'a t -> 'a

last l is the last element in l.

val length : 'a t -> int

length l the number of elements in l.

val append : 'a t -> 'a t -> 'a t

append l1 l2 is the concatenation of l1 and l2.

val append_list : 'a list -> 'a t -> 'a t

append_list l1 l2 is the concatenation of l1 and l2.

val flatten : 'a t t -> 'a t

flatten l is the concatenation of the lists in l.

Comparison

val compare_lengths : 'a t -> 'b t -> int

compare l1 l2 is equivalent to compare (length l1) (length l2), except that the computation stops after reaching the end of the shortest list.

val compare_length_with : 'a t -> int -> int

compare_length_with l n is equivalent to compare (length l) n, except that the computation stops after at most n iterations on l.

val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool

equal eq (a1, [a2; ...; an]) (b1, [b2; ...; bm]) holds when the two input lists have the same length, and for each pair of elements ai, bi at the same position we have eq ai bi.

Note: the eq function may be called even if the lists have different lengths. If you know your equality function is costly, you may want to check List1.compare_lengths first.

val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int

compare cmp (a1, [a2; ...; an]) (b1, [b2; ...; bm]) performs a lexicographic comparison of the two input lists, using the same 'a -> 'a -> int interface as Stdlib.compare:

  • cons a1 l1 is smaller than cons a2 l2 (negative result) if a1 is smaller than a2, or if they are equal (0 result) and l1 is smaller than l2
  • singleton a is smaller than singleton b if a is smaller than b

Note: the cmp function will be called even if the lists have different lengths.

Iterators

val iter : ('a -> unit) -> 'a t -> unit

iter f (a1, [a2; ...; an]) applies function f in turn to [a1; ...; an]. It is equivalent to begin f a1; f a2; ...; f an; () end.

val map : ('a -> 'b) -> 'a t -> 'b t

map f (a1, [a2; ...; an]) is (f a1, [f a2; ...; f an]).

val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t

Same as List.map, but the function is applied to the index of the element as first argument (counting from 0), and the element itself as second argument.

val index : 'a t -> (int * 'a) t

index (x0, [x1; x2; ...; xn]) is ((0, x0), [(1, x1); (2, x2); ...; (n, xn)]).

val fold_right : ('a -> 'b) -> ('a -> 'b -> 'b) -> 'a t -> 'b

fold_right sing cons (a1, [a2; ...; an]) is cons a1 (cons a2 (... (sing an) ...)).

val fold_left : ('a -> 'b) -> ('b -> 'a -> 'b) -> 'a t -> 'b

fold_left sing cons (a1, [a2; ...; an]) is cons (... (cons (sing a1) a2) ....) an.

val filter_map : ('a -> 'b option) -> 'a t -> 'b list

filter_map f l applies f to every element of l, filters out the Option.None elements and returns the list of the arguments of the Option.Some elements.

val concat_map : ('a -> 'b t) -> 'a t -> 'b t

concat_map f l is concat (map f l).

val all_equal : 'a t -> 'a option

Collapses a non-empty sequence to a single element, provided all elements are (structurally) equal.

val traverse : ('a -> 'b option) -> 'a t -> 'b t option

Maps a function that may fail over a non-empty list, and eagerly fails as soon as any individual call fails. Note that elements beyond the first failing one will not be processed.

Iterators on two lists

val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t

map2 f (a1, [a2; ...; an]) (b1, [b2; ...; bn]) is (f a1 b1, [f a2 b2; ...; f an bn]).

  • raises Invalid_argument

    if the two lists are determined to have different lengths.

List scanning

val for_all : ('a -> bool) -> 'a t -> bool

for_all p (a1, [a2; ...; an]) checks if all elements of the non-empty list satisfy the predicate p. That is, it returns (p a1) && (p a2) && ... && (p an).

val exists : ('a -> bool) -> 'a t -> bool

exists p (a1, [a2; ...; an]) checks if any element of the non-empty list satisfies the predicate p. That is, it returns (p a1) || (p a2) || ... || (p an).

List searching

val find_opt : ('a -> bool) -> 'a t -> 'a option

find_opt p l is the first element in l satisfying the predicate p. Returns Option.None if there is no such element.

val find_map : ('a -> 'b option) -> 'a t -> 'b option

find_map f l applies f to the elements of l in order, and returns the first result of the form Option.Some v, or Option.None if none exist.

val minimum_by : ('a -> 'a -> bool) -> 'a t -> 'a

Finds the leftmost minimal element of the sequence according to the given decision procedure for the strict less-than relation on 'a.

val maximum_by : ('a -> 'a -> bool) -> 'a t -> 'a

Finds the leftmost maximal element of the sequence according to the given decision procedure for the strict greater-than relation on 'a.

val minimum : 'a t -> 'a

Finds the leftmost minimal element of the sequence according to the default ordering for the type 'a.

val maximum : 'a t -> 'a

Finds the leftmost maximal element of the sequence according to the default ordering for the type 'a.

val partition : ('a -> bool) -> 'a t -> 'a list * 'a list

partition f l returns a pair of lists (l1, l2), where l1 is the list of all the elements of l that satisfy the predicate f, and l2 is the list of all the elements of l that do not satisfy f. The order of elements in the input list is preserved. At least one of l1 and l2 is non-empty.

val partition_map : - ('a -> ('l, 'r) Stdlib.Either.t) -> - 'a t -> - ('l t * 'r list, 'l list * 'r t) Stdlib.Either.t

partition_map f l returns a pair of lists (l1, l2) such that, for each element x of the input list l:

  • if f x is Left y1, then y1 is in l1, and
  • if f x is Right y2, then y2 is in l2.

In order to preserve the guarantee that the output lists l1 and l2 combined have at least one element, an Stdlib.Either.t is returned.

val group_by : ('a -> 'key) -> 'a list -> ('key * 'a t) list

Groups elements of a list according to a key computed from the element. The input list need not be sorted. (The algorithm inserts every element of the list into a hashtable in order to construct the grouping.) Each group is guaranteed to be non-empty.

Non-empty lists of pairs

val split : ('a * 'b) t -> 'a t * 'b t

Transform a non-empty list of pairs into a pair of non-empty lists: split ((a1, b1), [(a2, b2); ...; (an, bn)]) is (a1, [a2; ...; an]), (b1, [b2; ...; bn]).

val combine : 'a t -> 'b t -> ('a * 'b) t

Transform a pair of lists into a list of pairs: combine (a1, [a2; ...; an]) (b1, [b2; ...; bn]) is ((a1, b1), [(a2, b2); ...; (an, bn)]).

  • raises Invalid_argument

    if the two lists have different lengths.

Apply

val ap : 'a t -> ('a -> 'b) t -> 'b t

ap (x1, [x2; ...; xn]) (f1, [f2; ...; fn]) is (f1 x1, [f2 x2; ...; fn xn]).

  • raises Invalid_argument

    if the two lists are determined to have different lengths.

val flap : 'a -> ('a -> 'b) t -> 'b t

flap x (f1, [f2; ...; fn]) is (f1 x, [f2 x; ...; fn x]).

Printing

val pp : - ?pp_sep:(Format.formatter -> unit -> unit) -> - (Format.formatter -> 'a -> unit) -> - Format.formatter -> - 'a t -> - unit

pp ?pp_sep pp_v ppf l prints the items of the non-empty list l using pp_v to print each item and calling pp_sep between items on the formatter ppf.

val show : - ?pp_sep:(Format.formatter -> unit -> unit) -> - (Format.formatter -> 'a -> unit) -> - 'a t -> - string

show ?pp_sep pp_v l shows as a string the items of the non-empty list l using pp_v to show each item and calling pp_sep between items.

Interoperability

val of_list : 'a list -> 'a t option

Converts a list to a non-empty list.

val unsafe_of_list : 'a list -> 'a t

Converts the list to a nonempty list. Raises the exception Empty if the list was empty.

val to_list : 'a t -> 'a list

Converts a non-empty list to a list.

Instances

module MakeEq (E : Eq.EQ) : Eq.EQ with type t = E.t t
module MakeOrd (O : Ord.ORD) : Ord.ORD with type t = O.t t
module MakeShow (S : Show.SHOW) : Show.SHOW with type t = S.t t
diff --git a/beluga/Support/List2/MakeEq/argument-1-E/index.html b/beluga/Support/List2/MakeEq/argument-1-E/index.html deleted file mode 100644 index 74669ef99..000000000 --- a/beluga/Support/List2/MakeEq/argument-1-E/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -E (beluga.Support.List2.MakeEq.E)

Parameter MakeEq.E

type t

The type of elements to check for equality.

val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/List2/MakeEq/index.html b/beluga/Support/List2/MakeEq/index.html deleted file mode 100644 index fd9842f21..000000000 --- a/beluga/Support/List2/MakeEq/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MakeEq (beluga.Support.List2.MakeEq)

Module List2.MakeEq

Parameters

module E : Eq.EQ

Signature

type t = E.t t

The type of elements to check for equality.

val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/List2/MakeOrd/argument-1-O/index.html b/beluga/Support/List2/MakeOrd/argument-1-O/index.html deleted file mode 100644 index 7677aae95..000000000 --- a/beluga/Support/List2/MakeOrd/argument-1-O/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -O (beluga.Support.List2.MakeOrd.O)

Parameter MakeOrd.O

type t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/List2/MakeOrd/index.html b/beluga/Support/List2/MakeOrd/index.html deleted file mode 100644 index 9b733bb8a..000000000 --- a/beluga/Support/List2/MakeOrd/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MakeOrd (beluga.Support.List2.MakeOrd)

Module List2.MakeOrd

Parameters

module O : Ord.ORD

Signature

type t = O.t t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/List2/MakeShow/argument-1-S/index.html b/beluga/Support/List2/MakeShow/argument-1-S/index.html deleted file mode 100644 index df7cd5eb4..000000000 --- a/beluga/Support/List2/MakeShow/argument-1-S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (beluga.Support.List2.MakeShow.S)

Parameter MakeShow.S

type t
val pp : Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Support/List2/MakeShow/index.html b/beluga/Support/List2/MakeShow/index.html deleted file mode 100644 index 5547f3b99..000000000 --- a/beluga/Support/List2/MakeShow/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MakeShow (beluga.Support.List2.MakeShow)

Module List2.MakeShow

Parameters

module S : Show.SHOW

Signature

type t = S.t t
val pp : Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Support/List2/index.html b/beluga/Support/List2/index.html deleted file mode 100644 index f68fa2ab4..000000000 --- a/beluga/Support/List2/index.html +++ /dev/null @@ -1,42 +0,0 @@ - -List2 (beluga.Support.List2)

Module Support.List2

type 'a t = private
  1. | T of 'a * 'a * 'a list

The type of lists of length at least 2.

Constructors

val from : 'a -> 'a -> 'a list -> 'a t

from x1 x2 xs is the list obtained by prepending x2, then x1 onto the list xs.

val from1 : 'a -> 'a List1.t -> 'a t

from1 x xs is the list obtained by prepending x onto the list xs.

val pair : 'a -> 'a -> 'a t

pair x1 x2 is the list with the elements x1 and x2 in it.

val cons : 'a -> 'a t -> 'a t

cons x xs is the list obtained by prepending x onto xs.

val rev : 'a t -> 'a t

rev l is l in reverse order.

Destructors

val first : 'a t -> 'a

first (x1, x2, xs) is x1.

val second : 'a t -> 'a

second (x1, x2, xs) is x2.

val tail : 'a t -> 'a list

tail (x1, x2, xs) is xs.

val last : 'a t -> 'a

last l is the last element in l.

val length : 'a t -> int

length l the number of elements in l.

Comparison

val compare_lengths : 'a t -> 'b t -> int

compare l1 l2 is equivalent to compare (length l1) (length l2), except that the computation stops after reaching the end of the shortest list.

val equal : ('a -> 'a -> bool) -> 'a t -> 'a t -> bool

equal eq (a1, a2, [a3; ...; an]) (b1, b2, [b3; ...; bm]) holds when the two input lists have the same length, and for each pair of elements ai, bi at the same position we have eq ai bi.

Note: the eq function may be called even if the lists have different lengths. If you know your equality function is costly, you may want to check List2.compare_lengths first.

val compare : ('a -> 'a -> int) -> 'a t -> 'a t -> int

compare cmp (a1, a2, [a3; ...; an]) (b1, b2, [b3; ...; bm]) performs a lexicographic comparison of the two input lists, using the same 'a -> 'a -> int interface as Stdlib.compare:

  • cons a1 l1 is smaller than cons a2 l2 (negative result) if a1 is smaller than a2, or if they are equal (0 result) and l1 is smaller than l2
  • pair a1 a2 is smaller than pair b1 b2 if a1 is smaller than b1, or if a1 = b1 and a2 is smaller than b2

Note: the cmp function will be called even if the lists have different lengths.

Iterators

val iter : ('a -> unit) -> 'a t -> unit

iter f (a1, a2, [a3; ...; an]) applies function f in turn to [a1; ...; an]. It is equivalent to begin f a1; f a2; ...; f an; () end.

val iter2 : ('a -> 'b -> unit) -> 'a t -> 'b t -> unit

iter2 f (a1, a2, [a3; ...; an]) (b1, b2, [b3; ...; bn]) applies function f in turn, pairwise, to [a1; ...; an] and [b1; ...; bn]. It is equivalent to begin f a1 b1; f a2 b2; ...; f an bn; () end.

  • raises Invalid_argument

    if the two lists are determined to have different lengths.

val map : ('a -> 'b) -> 'a t -> 'b t

map f (a1, a2, [a3; ...; an]) is (f a1, f a2, [f a3; ...; f an]).

val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t

mapi f (a0, a1, [a2; ...; an]) is (f 0 a0, f 1 a1, [f 2 a2; ...; f n an]).

val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t

map2 f (a1, a2, [a3; ...; an]) (b1, b2, [b3; ...; bn]) is (f a1 b1, f a2 b2, [f a3 b3; ...; f an bn]).

  • raises Invalid_argument

    if the two lists are determined to have different lengths.

val mapi2 : (int -> 'a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t

mapi2 f (a0, a1, [a2; ...; an]) (b0, b1, [b2; ...; bn]) is (f 0 a0 b0, f 1 a1 b1, [f 2 a2 b2; ...; f n an bn]).

  • raises Invalid_argument

    if the two lists are determined to have different lengths.

val fold_right : - ('a -> 'b) -> - ('a -> 'b -> 'c) -> - ('a -> 'c -> 'c) -> - 'a t -> - 'c

fold_right fst snd cons (a1, a2, [a3; ...; an]) is cons a1 (cons a2 (... (snd a(n-1) (fst an)) ...)).

val fold_left : - ('a -> 'b) -> - ('b -> 'a -> 'c) -> - ('c -> 'a -> 'c) -> - 'a t -> - 'c

fold_left fst snd cons (a1, a2, [a3; ...; an]) is cons (... (cons (snd (fst a1) a2) a3) ....) an.

val fold_left2 : - ('a -> 'b -> 'c) -> - ('c -> 'a -> 'b -> 'd) -> - ('d -> 'a -> 'b -> 'd) -> - 'a t -> - 'b t -> - 'd

fold_left2 fst snd cons (a1, a2, [a3; ...; an]) (b1, b2, [b3; ...; bn]) is cons (... (cons (snd (fst a1 b1) a2 b2) a3 b3) ....) an bn.

  • raises Invalid_argument

    if the two lists are determined to have different lengths.

val fold_left3 : - ('a1 -> 'a2 -> 'a3 -> 'b) -> - ('b -> 'a1 -> 'a2 -> 'a3 -> 'c) -> - ('c -> 'a1 -> 'a2 -> 'a3 -> 'c) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'c

Same as fold_left2 but for three lists.

val fold_left4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'b) -> - ('b -> 'a1 -> 'a2 -> 'a3 -> 'a4 -> 'c) -> - ('c -> 'a1 -> 'a2 -> 'a3 -> 'a4 -> 'c) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'c

Same as fold_left3 but for four lists.

val filter_map : ('a -> 'b option) -> 'a t -> 'b list

filter_map f l applies f to every element of l, filters out the Option.None elements and returns the list of the arguments of the Option.Some elements.

val traverse : ('a -> 'b option) -> 'a t -> 'b t option

Maps a function that may fail over a list, and eagerly fails as soon as any individual call fails. Note that elements beyond the first failing one will not be processed.

List scanning

val for_all : ('a -> bool) -> 'a t -> bool

for_all p (a1, a2, [a3; ...; an]) checks if all elements of the list satisfy the predicate p. That is, it returns (p a1) && (p a2) && ... && (p an).

val for_all2 : ('a -> 'b -> bool) -> 'a t -> 'b t -> bool

for_all2 p (a1, a2, [a3; ...; an]) (b1, b2, [b3; ...; bn]) checks if, pairwise, all elements of the lists satisfy the predicate p. That is, it returns (p a1 b1) && (p a2 b2) && ... && (p an bn).

  • raises Invalid_argument

    if the two lists are determined to have different lengths.

val exists : ('a -> bool) -> 'a t -> bool

exists p (a1, a2, [a3; ...; an]) checks if any element of the list satisfies the predicate p. That is, it returns (p a1) || (p a2) || ... || (p an).

List searching

val find_opt : ('a -> bool) -> 'a t -> 'a option

find_opt p l is the first element in l satisfying the predicate p. Returns Option.None if there is no such element.

val find_map : ('a -> 'b option) -> 'a t -> 'b option

find_map f l applies f to the elements of l in order, and returns the first result of the form Option.Some v, or Option.None if none exist.

val partition : ('a -> bool) -> 'a t -> 'a list * 'a list

partition f l returns a pair of lists (l1, l2), where l1 is the list of all the elements of l that satisfy the predicate f, and l2 is the list of all the elements of l that do not satisfy f. The order of elements in the input list is preserved. At least one of l1 and l2 is non-empty.

Lists of pairs

val split : ('a * 'b) t -> 'a t * 'b t

Transform a list of pairs into a pair of lists: split ((a1, b1), (a2, b2), [(a3, b3); ...; (an, bn)]) is (a1, a2, [a3; ...; an]), (b1, b2, [b3; ...; bn]).

val combine : 'a t -> 'b t -> ('a * 'b) t

Transform a pair of lists into a list of pairs: combine (a1, a2, [a3; ...; an]) (b1, b2, [b3; ...; bn]) is ((a1, b1), (a2, b2), [(a3, b3); ...; (an, bn)]).

  • raises Invalid_argument

    if the two lists have different lengths.

Apply

val ap : 'a t -> ('a -> 'b) t -> 'b t

ap (x1, x2, [x3; ...; xn]) (f1, f2, [f3; ...; fn]) is (f1 x1, f2 x2, [f3 x3; ...; fn xn]).

  • raises Invalid_argument

    if the two lists are determined to have different lengths.

val flap : 'a -> ('a -> 'b) t -> 'b t

flap x (f1, f2, [f3; ...; fn]) is (f1 x, f2 x, [f3 x; ...; fn x]).

Printing

val pp : - ?pp_sep:(Format.formatter -> unit -> unit) -> - (Format.formatter -> 'a -> unit) -> - Format.formatter -> - 'a t -> - unit

pp ?pp_sep pp_v ppf l prints the items of the list l using pp_v to print each item and calling pp_sep between items on the formatter ppf.

val show : - ?pp_sep:(Format.formatter -> unit -> unit) -> - (Format.formatter -> 'a -> unit) -> - 'a t -> - string

show ?pp_sep pp_v l shows as a string the items of the list l using pp_v to show each item and calling pp_sep between items.

Interoperability

val of_list : 'a list -> 'a t option

Converts a list to a T.

val to_list : 'a t -> 'a list

Converts a T to a list.

val of_list1 : 'a List1.t -> 'a t option

Converts a List1.T to a T.

val to_list1 : 'a t -> 'a List1.t

Converts a T to a List1.T.

Instances

module MakeEq (E : Eq.EQ) : Eq.EQ with type t = E.t t
module MakeOrd (O : Ord.ORD) : Ord.ORD with type t = O.t t
module MakeShow (S : Show.SHOW) : Show.SHOW with type t = S.t t
diff --git a/beluga/Support/Misc/index.html b/beluga/Support/Misc/index.html deleted file mode 100644 index d69e706dd..000000000 --- a/beluga/Support/Misc/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Misc (beluga.Support.Misc)

Module Support.Misc

Totally miscellaneous functions.

include module type of struct include Equality end
val (=) : int -> int -> bool

A restricted form of the equality operator that works only for integers.

Fully polymorphic equality is dangerous and limits refactorability of the code, so every module should open this one to avoid using polymorphic equality.

val noexcept : (unit -> unit) -> unit

Runs a function ignoring all exceptions. In general this is a terrible idea, but it is sometimes necessary when performing cleanup that may fail while in an exception handler.

exception NotImplemented of string

An exception to be raised in unimplemented features. * Code that raises this exception should never be committed.

val not_implemented : string -> 'a
val tuple : 'a -> 'b -> 'a0 * 'b0

Forms the tuple of its two inputs.

val throw : exn -> 'b -> 'a

Creates a constant function that raises the given exception. Useful when eliminating option-types.

diff --git a/beluga/Support/Monad/Make/argument-1-Monad/index.html b/beluga/Support/Monad/Make/argument-1-Monad/index.html deleted file mode 100644 index e6256191d..000000000 --- a/beluga/Support/Monad/Make/argument-1-Monad/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Monad (beluga.Support.Monad.Make.Monad)

Parameter Make.Monad

type +'a t

The type of actions in the monad.

val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

diff --git a/beluga/Support/Monad/Make/index.html b/beluga/Support/Monad/Make/index.html deleted file mode 100644 index 4c51c4f01..000000000 --- a/beluga/Support/Monad/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (beluga.Support.Monad.Make)

Module Monad.Make

Functor building the aliases for a minimal implementation for MONAD.

Parameters

module Monad : sig ... end

Signature

type 'a t = 'a Monad.t

The type of actions in the monad.

val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

diff --git a/beluga/Support/Monad/index.html b/beluga/Support/Monad/index.html deleted file mode 100644 index 000f85b51..000000000 --- a/beluga/Support/Monad/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Monad (beluga.Support.Monad)

Module Support.Monad

Definition of monadic types, which are abstract descriptors of computations.

For better performance, avoid using monads.

module type MONAD = sig ... end

The abstract datatype of actions.

module Make (Monad : sig ... end) : MONAD with type 'a t = 'a Monad.t

Functor building the aliases for a minimal implementation for MONAD.

diff --git a/beluga/Support/Monad/module-type-MONAD/index.html b/beluga/Support/Monad/module-type-MONAD/index.html deleted file mode 100644 index d16aed5a4..000000000 --- a/beluga/Support/Monad/module-type-MONAD/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MONAD (beluga.Support.Monad.MONAD)

Module type Monad.MONAD

The abstract datatype of actions.

Instances of MONAD should satisfy the following laws for MONAD.(>>=):

Using the Kleisli-composition operator MONAD.(>=>):

type +'a t

The type of actions in the monad.

val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

diff --git a/beluga/Support/Option/MakeEq/argument-1-E/index.html b/beluga/Support/Option/MakeEq/argument-1-E/index.html deleted file mode 100644 index da0bf0d03..000000000 --- a/beluga/Support/Option/MakeEq/argument-1-E/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -E (beluga.Support.Option.MakeEq.E)

Parameter MakeEq.E

type t

The type of elements to check for equality.

val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/Option/MakeEq/index.html b/beluga/Support/Option/MakeEq/index.html deleted file mode 100644 index c9c69688c..000000000 --- a/beluga/Support/Option/MakeEq/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MakeEq (beluga.Support.Option.MakeEq)

Module Option.MakeEq

Functor for an instance of Eq.EQ over option values using equal.

Parameters

module E : Eq.EQ

Signature

type t = E.t t

The type of elements to check for equality.

val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/Option/MakeOrd/argument-1-O/index.html b/beluga/Support/Option/MakeOrd/argument-1-O/index.html deleted file mode 100644 index 3d227d3cc..000000000 --- a/beluga/Support/Option/MakeOrd/argument-1-O/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -O (beluga.Support.Option.MakeOrd.O)

Parameter MakeOrd.O

type t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/Option/MakeOrd/index.html b/beluga/Support/Option/MakeOrd/index.html deleted file mode 100644 index 7bcf1c220..000000000 --- a/beluga/Support/Option/MakeOrd/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MakeOrd (beluga.Support.Option.MakeOrd)

Module Option.MakeOrd

Functor for an instance of Ord.ORD over option values using compare.

Parameters

module O : Ord.ORD

Signature

type t = O.t t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/Option/MakeShow/argument-1-S/index.html b/beluga/Support/Option/MakeShow/argument-1-S/index.html deleted file mode 100644 index 6d44564e2..000000000 --- a/beluga/Support/Option/MakeShow/argument-1-S/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S (beluga.Support.Option.MakeShow.S)

Parameter MakeShow.S

type t
val pp : Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Support/Option/MakeShow/index.html b/beluga/Support/Option/MakeShow/index.html deleted file mode 100644 index 5eca8f87f..000000000 --- a/beluga/Support/Option/MakeShow/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MakeShow (beluga.Support.Option.MakeShow)

Module Option.MakeShow

Functor for an instance of Show.SHOW over option values using pp.

Parameters

module S : Show.SHOW

Signature

type t = S.t t
val pp : Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Support/Option/index.html b/beluga/Support/Option/index.html deleted file mode 100644 index f1f6b52c4..000000000 --- a/beluga/Support/Option/index.html +++ /dev/null @@ -1,25 +0,0 @@ - -Option (beluga.Support.Option)

Module Support.Option

include module type of Stdlib.Option
type !'a t = 'a option =
  1. | None
  2. | Some of 'a
val none : 'a option
val some : 'a -> 'a option
val value : 'a option -> default:'a -> 'a
val get : 'a option -> 'a
val join : 'a option option -> 'a option
val fold : none:'a -> some:('b -> 'a) -> 'b option -> 'a
val iter : ('a -> unit) -> 'a option -> unit
val is_none : 'a option -> bool
val is_some : 'a option -> bool
val equal : ('a -> 'a -> bool) -> 'a option -> 'a option -> bool
val compare : ('a -> 'a -> int) -> 'a option -> 'a option -> int
val to_result : none:'e -> 'a option -> ('a, 'e) Stdlib.result
val to_list : 'a option -> 'a list
val to_seq : 'a option -> 'a Stdlib.Seq.t
val eliminate : (unit -> 'b) -> ('a -> 'b) -> 'a t -> 'b

eliminate none_handler some_handler o is some_handler v if o is Some v, and none_handler () otherwise.

val get_or_else : (unit -> 'a) -> 'a t -> 'a

get_or_else f o is f () if o is None and v if o is Some v.

val of_bool : bool -> unit t

of_bool b is Some () if b is true, and None otherwise.

When used with other monadic operations, this is (a specialized) guard function from Haskell, which allows to abort a monadic computation on account of a boolean check.

val from_predicate : ('a -> bool) -> 'a -> 'a t

from_predicate p a is Some a if p a, and None otherwise.

val lazy_alt : 'a t Stdlib.Lazy.t -> 'a t Stdlib.Lazy.t -> 'a t Stdlib.Lazy.t

lazy_alt a1 a2 is a1 if it is not lazy None, and a2 otherwise.

val (<||>) : 'a t Stdlib.Lazy.t -> 'a t Stdlib.Lazy.t -> 'a t Stdlib.Lazy.t

Infix operator alias of lazy_alt.

val void : 'a t -> unit t
val when_some : 'a t -> ('a -> unit) -> unit

Specialized effectful eliminator for option types.

val print : - (Format.formatter -> 'a -> unit) -> - Format.formatter -> - 'a t -> - unit

Prints an option by doing nothing if it is None; else it uses the given printer.

val pp : (Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit

Prints an option by showing "None" or "Some (X)" where "X" is generated by the given formatting function.

Instances

include Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

include Alternative.ALTERNATIVE with type 'a t := 'a t
val empty : 'a t

The identity element of (<|>).

val alt : 'a t -> 'a t -> 'a t

alt a1 a2 is a1 if it is not empty, and a2 otherwise.

val (<|>) : 'a t -> 'a t -> 'a t

Infix synonym of alt.

module MakeEq (E : Eq.EQ) : Eq.EQ with type t = E.t t

Functor for an instance of Eq.EQ over option values using equal.

module MakeOrd (O : Ord.ORD) : Ord.ORD with type t = O.t t

Functor for an instance of Ord.ORD over option values using compare.

module MakeShow (S : Show.SHOW) : Show.SHOW with type t = S.t t

Functor for an instance of Show.SHOW over option values using pp.

diff --git a/beluga/Support/Ord/Make/argument-1-T/index.html b/beluga/Support/Ord/Make/argument-1-T/index.html deleted file mode 100644 index 5dbd94774..000000000 --- a/beluga/Support/Ord/Make/argument-1-T/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -T (beluga.Support.Ord.Make.T)

Parameter Make.T

type t

See ORD.t

val compare : t -> t -> int
diff --git a/beluga/Support/Ord/Make/index.html b/beluga/Support/Ord/Make/index.html deleted file mode 100644 index 78a352c46..000000000 --- a/beluga/Support/Ord/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (beluga.Support.Ord.Make)

Module Ord.Make

Functor building an implementation of ORD given a type with a total comparator.

Parameters

module T : sig ... end

Signature

type t = T.t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/Ord/Reverse/argument-1-Ord/index.html b/beluga/Support/Ord/Reverse/argument-1-Ord/index.html deleted file mode 100644 index a54471988..000000000 --- a/beluga/Support/Ord/Reverse/argument-1-Ord/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Ord (beluga.Support.Ord.Reverse.Ord)

Parameter Reverse.Ord

type t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/Ord/Reverse/index.html b/beluga/Support/Ord/Reverse/index.html deleted file mode 100644 index a81fbf07f..000000000 --- a/beluga/Support/Ord/Reverse/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Reverse (beluga.Support.Ord.Reverse)

Module Ord.Reverse

Functor building an implementation of ORD whose ordering is the reverse of the given totally ordered type.

Parameters

module Ord : ORD

Signature

type t = Ord.t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/Ord/index.html b/beluga/Support/Ord/index.html deleted file mode 100644 index c14431b21..000000000 --- a/beluga/Support/Ord/index.html +++ /dev/null @@ -1,20 +0,0 @@ - -Ord (beluga.Support.Ord)

Module Support.Ord

Totally ordered types.

module type ORD = sig ... end

Module type for totally ordered types.

module Make (T : sig ... end) : ORD with type t = T.t

Functor building an implementation of ORD given a type with a total comparator.

module Reverse (Ord : ORD) : ORD with type t = Ord.t

Functor building an implementation of ORD whose ordering is the reverse of the given totally ordered type.

val make : ('t -> 't -> int) -> (module ORD with type t = 't)

make compare is equivalent to the functor Make (T) with T.compare = compare.

val contramap : - (module ORD with type t = 's) -> - ('t -> 's) -> - (module ORD - with type t = 't)

If val f : 't -> 's, then contramap ord f is an instance of ORD for values of type 't by the ORD instance ord for values of type 's.

val sequence : - (module ORD with type t = 's1) -> - (module ORD with type t = 's2) -> - ('t -> 's1) -> - ('t -> 's2) -> - (module ORD - with type t = 't)

If val f1 : 't -> 's1 and val f2 : 't -> 's2, then sequence ord1 ord2 f1 f2 is an instance of ORD for values of type 't whose ordering is first ordered by contramapping by ord1 and f1, and if that ordering is equal then ordered by contramapping by ord2 and f2.

val sequence3 : - (module ORD with type t = 's1) -> - (module ORD with type t = 's2) -> - (module ORD with type t = 's3) -> - ('t -> 's1) -> - ('t -> 's2) -> - ('t -> 's3) -> - (module ORD - with type t = 't)

If val f1 : 't -> 's1, val f2 : 't -> 's2 and val f3 : 't -> 's3, then sequence ord1 ord2 ord3 f1 f2 f3 is an instance of ORD for values of type 't whose ordering is ordered in sequence by:

  • contramapping by ord1 and f1,
  • contramapping by ord2 and f2,
  • contramapping by ord3 and f3.
diff --git a/beluga/Support/Ord/module-type-ORD/index.html b/beluga/Support/Ord/module-type-ORD/index.html deleted file mode 100644 index e57b62580..000000000 --- a/beluga/Support/Ord/module-type-ORD/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -ORD (beluga.Support.Ord.ORD)

Module type Ord.ORD

Module type for totally ordered types.

type t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/Pair/MakeEq/argument-1-E1/index.html b/beluga/Support/Pair/MakeEq/argument-1-E1/index.html deleted file mode 100644 index 7d1a1caf3..000000000 --- a/beluga/Support/Pair/MakeEq/argument-1-E1/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -E1 (beluga.Support.Pair.MakeEq.E1)

Parameter MakeEq.E1

type t

The type of elements to check for equality.

val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/Pair/MakeEq/argument-2-E2/index.html b/beluga/Support/Pair/MakeEq/argument-2-E2/index.html deleted file mode 100644 index a1d97c855..000000000 --- a/beluga/Support/Pair/MakeEq/argument-2-E2/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -E2 (beluga.Support.Pair.MakeEq.E2)

Parameter MakeEq.E2

type t

The type of elements to check for equality.

val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/Pair/MakeEq/index.html b/beluga/Support/Pair/MakeEq/index.html deleted file mode 100644 index a421f6312..000000000 --- a/beluga/Support/Pair/MakeEq/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MakeEq (beluga.Support.Pair.MakeEq)

Module Pair.MakeEq

Parameters

module E1 : Eq.EQ
module E2 : Eq.EQ

Signature

type t = (E1.t, E2.t) t

The type of elements to check for equality.

val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/Pair/MakeOrd/argument-1-O1/index.html b/beluga/Support/Pair/MakeOrd/argument-1-O1/index.html deleted file mode 100644 index 958ecd175..000000000 --- a/beluga/Support/Pair/MakeOrd/argument-1-O1/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -O1 (beluga.Support.Pair.MakeOrd.O1)

Parameter MakeOrd.O1

type t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/Pair/MakeOrd/argument-2-O2/index.html b/beluga/Support/Pair/MakeOrd/argument-2-O2/index.html deleted file mode 100644 index 3b9f85ce9..000000000 --- a/beluga/Support/Pair/MakeOrd/argument-2-O2/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -O2 (beluga.Support.Pair.MakeOrd.O2)

Parameter MakeOrd.O2

type t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/Pair/MakeOrd/index.html b/beluga/Support/Pair/MakeOrd/index.html deleted file mode 100644 index 05be2c9d0..000000000 --- a/beluga/Support/Pair/MakeOrd/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MakeOrd (beluga.Support.Pair.MakeOrd)

Module Pair.MakeOrd

Parameters

module O1 : Ord.ORD
module O2 : Ord.ORD

Signature

type t = (O1.t, O2.t) t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Support/Pair/MakeShow/argument-1-S1/index.html b/beluga/Support/Pair/MakeShow/argument-1-S1/index.html deleted file mode 100644 index a9aaaa1a0..000000000 --- a/beluga/Support/Pair/MakeShow/argument-1-S1/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S1 (beluga.Support.Pair.MakeShow.S1)

Parameter MakeShow.S1

type t
val pp : Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Support/Pair/MakeShow/argument-2-S2/index.html b/beluga/Support/Pair/MakeShow/argument-2-S2/index.html deleted file mode 100644 index 9500213f2..000000000 --- a/beluga/Support/Pair/MakeShow/argument-2-S2/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -S2 (beluga.Support.Pair.MakeShow.S2)

Parameter MakeShow.S2

type t
val pp : Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Support/Pair/MakeShow/index.html b/beluga/Support/Pair/MakeShow/index.html deleted file mode 100644 index 68f3790b5..000000000 --- a/beluga/Support/Pair/MakeShow/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MakeShow (beluga.Support.Pair.MakeShow)

Module Pair.MakeShow

Parameters

module S1 : Show.SHOW
module S2 : Show.SHOW

Signature

type t = (S1.t, S2.t) t
val pp : Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Support/Pair/index.html b/beluga/Support/Pair/index.html deleted file mode 100644 index e9638f700..000000000 --- a/beluga/Support/Pair/index.html +++ /dev/null @@ -1,27 +0,0 @@ - -Pair (beluga.Support.Pair)

Module Support.Pair

type ('a, 'b) t = 'a * 'b

The type of pairs.

Constructors

val left : 'a -> 'b -> 'a * 'b

left l r is (l, r).

val right : 'a -> 'b -> 'b * 'a

right r l is (l, r).

Destructors

val fst : ('a * _) -> 'a

fst (x, _) is x.

val snd : (_ * 'b) -> 'b

snd (_, y) is y.

Mapping

val map : fst:('a -> 'b) -> snd:('c -> 'd) -> ('a * 'c) -> 'b * 'd

map ~fst ~snd (x, y) is (fst x, snd y).

val map_right : ('a -> 'b) -> ('x * 'a) -> 'x * 'b

map_right f (x, y) is (x, f y).

val map_left : ('a -> 'b) -> ('a * 'x) -> 'b * 'x

map_left f (x, y) is (f x, y).

val bimap : ('a -> 'b) -> ('c -> 'd) -> ('a * 'c) -> 'b * 'd

bimap f g (x, y) is f x, f y.

val both : ('a -> 'b) -> ('a * 'a) -> 'b * 'b

both f (x, y) is (f x, f y).

Miscellaneous

val swap : ('a * 'b) -> 'b * 'a

swap (x, y) is (y, x).

val uncurry : ('a -> 'b -> 'c) -> ('a * 'b) -> 'c
val curry : (('a * 'b) -> 'c) -> 'a -> 'b -> 'c
val equal : - ('a -> 'a -> bool) -> - ('b -> 'b -> bool) -> - ('a, 'b) t -> - ('a, 'b) t -> - bool
val compare : - ('a -> 'a -> int) -> - ('b -> 'b -> int) -> - ('a, 'b) t -> - ('a, 'b) t -> - int
val pp : - (Format.formatter -> 'a -> unit) -> - (Format.formatter -> 'b -> unit) -> - Format.formatter -> - ('a * 'b) -> - unit
val show : - (Format.formatter -> 'a -> unit) -> - (Format.formatter -> 'b -> unit) -> - ('a * 'b) -> - string

Instances

module MakeEq (E1 : Eq.EQ) (E2 : Eq.EQ) : Eq.EQ with type t = (E1.t, E2.t) t
module MakeOrd - (O1 : Ord.ORD) - (O2 : Ord.ORD) : - Ord.ORD with type t = (O1.t, O2.t) t
module MakeShow - (S1 : Show.SHOW) - (S2 : Show.SHOW) : - Show.SHOW with type t = (S1.t, S2.t) t
diff --git a/beluga/Support/PureStack/index.html b/beluga/Support/PureStack/index.html deleted file mode 100644 index 4f058ca63..000000000 --- a/beluga/Support/PureStack/index.html +++ /dev/null @@ -1,19 +0,0 @@ - -PureStack (beluga.Support.PureStack)

Module Support.PureStack

Persistent stack data structure.

type 'a t

Essentially a list, but it additioanlly tracks its length as items are added and removed.

val empty : 'a t

Constructs an empty stack.

val length : 'a t -> int

Gets the length of the stack in O(1).

val to_list : 'a t -> 'a list

Converts the stack to a list.

val is_empty : 'a t -> bool

Decides whether a stack is empty.

val push : 'a -> 'a t -> 'a t

Pushes an item onto the stack.

val pop : 'a t -> ('a * 'a t) option

Pops an item from the stack.

val cut : int -> 'a t -> ('a list * 'a t) option

Tries to pop n items from a stack, yielding them in a list. The elements are collected in _reverse order_, so the old top of the stack is the last element of the returned list.

diff --git a/beluga/Support/Seq/index.html b/beluga/Support/Seq/index.html deleted file mode 100644 index 15866cdd0..000000000 --- a/beluga/Support/Seq/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Seq (beluga.Support.Seq)

Module Support.Seq

include module type of Stdlib.Seq
type !'a t = unit -> 'a node
and !'a node = 'a Stdlib__Seq.node =
  1. | Nil
  2. | Cons of 'a * 'a t
val is_empty : 'a t -> bool
val uncons : 'a t -> ('a * 'a t) option
val length : 'a t -> int
val iter : ('a -> unit) -> 'a t -> unit
val fold_left : ('a -> 'b -> 'a) -> 'a -> 'b t -> 'a
val iteri : (int -> 'a -> unit) -> 'a t -> unit
val fold_lefti : ('b -> int -> 'a -> 'b) -> 'b -> 'a t -> 'b
val for_all : ('a -> bool) -> 'a t -> bool
val exists : ('a -> bool) -> 'a t -> bool
val find : ('a -> bool) -> 'a t -> 'a option
val find_map : ('a -> 'b option) -> 'a t -> 'b option
val iter2 : ('a -> 'b -> unit) -> 'a t -> 'b t -> unit
val fold_left2 : ('a -> 'b -> 'c -> 'a) -> 'a -> 'b t -> 'c t -> 'a
val for_all2 : ('a -> 'b -> bool) -> 'a t -> 'b t -> bool
val exists2 : ('a -> 'b -> bool) -> 'a t -> 'b t -> bool
val equal : ('a -> 'b -> bool) -> 'a t -> 'b t -> bool
val compare : ('a -> 'b -> int) -> 'a t -> 'b t -> int
val empty : 'a t
val return : 'a -> 'a t
val cons : 'a -> 'a t -> 'a t
val init : int -> (int -> 'a) -> 'a t
val unfold : ('b -> ('a * 'b) option) -> 'b -> 'a t
val repeat : 'a -> 'a t
val forever : (unit -> 'a) -> 'a t
val cycle : 'a t -> 'a t
val iterate : ('a -> 'a) -> 'a -> 'a t
val map : ('a -> 'b) -> 'a t -> 'b t
val mapi : (int -> 'a -> 'b) -> 'a t -> 'b t
val filter : ('a -> bool) -> 'a t -> 'a t
val filter_map : ('a -> 'b option) -> 'a t -> 'b t
val scan : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b t
val take : int -> 'a t -> 'a t
val drop : int -> 'a t -> 'a t
val take_while : ('a -> bool) -> 'a t -> 'a t
val drop_while : ('a -> bool) -> 'a t -> 'a t
val group : ('a -> 'a -> bool) -> 'a t -> 'a t t
val memoize : 'a t -> 'a t
exception Forced_twice
val once : 'a t -> 'a t
val transpose : 'a t t -> 'a t t
val append : 'a t -> 'a t -> 'a t
val concat : 'a t t -> 'a t
val flat_map : ('a -> 'b t) -> 'a t -> 'b t
val concat_map : ('a -> 'b t) -> 'a t -> 'b t
val zip : 'a t -> 'b t -> ('a * 'b) t
val map2 : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t
val interleave : 'a t -> 'a t -> 'a t
val sorted_merge : ('a -> 'a -> int) -> 'a t -> 'a t -> 'a t
val product : 'a t -> 'b t -> ('a * 'b) t
val map_product : ('a -> 'b -> 'c) -> 'a t -> 'b t -> 'c t
val unzip : ('a * 'b) t -> 'a t * 'b t
val split : ('a * 'b) t -> 'a t * 'b t
val partition_map : ('a -> ('b, 'c) Stdlib.Either.t) -> 'a t -> 'b t * 'c t
val partition : ('a -> bool) -> 'a t -> 'a t * 'a t
val of_dispenser : (unit -> 'a option) -> 'a t
val to_dispenser : 'a t -> unit -> 'a option
val ints : int -> int t
val of_gen : (unit -> 'a option) -> 'a t

of_gen g is the sequence obtained by sequentially invoking the effectful function g to produce the next element x when g () = Option.Some x.

If it is ever the case that g () = Option.None, then the resultant sequence has finite length.

val of_list : 'a list -> 'a t

of_list l is the sequence obtained from the list l.

val to_list : 'a t -> 'a list

to_list s converts s to a list. The sequence traversal happens immediately and will not terminate on infinite sequences.

diff --git a/beluga/Support/Show/Make/argument-1-T/index.html b/beluga/Support/Show/Make/argument-1-T/index.html deleted file mode 100644 index 2f9dbffaa..000000000 --- a/beluga/Support/Show/Make/argument-1-T/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -T (beluga.Support.Show.Make.T)

Parameter Make.T

type t
val pp : Format.formatter -> t -> unit
diff --git a/beluga/Support/Show/Make/index.html b/beluga/Support/Show/Make/index.html deleted file mode 100644 index a8212cd06..000000000 --- a/beluga/Support/Show/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (beluga.Support.Show.Make)

Module Show.Make

Functor building an implementation of SHOW given a type with a pretty-printer.

Parameters

module T : sig ... end

Signature

type t = T.t
val pp : Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Support/Show/index.html b/beluga/Support/Show/index.html deleted file mode 100644 index 800f11425..000000000 --- a/beluga/Support/Show/index.html +++ /dev/null @@ -1,6 +0,0 @@ - -Show (beluga.Support.Show)

Module Support.Show

module type SHOW = sig ... end

Module type for types with functions for pretty-printing and converting values to readable strings.

module Make (T : sig ... end) : SHOW with type t = T.t

Functor building an implementation of SHOW given a type with a pretty-printer.

val make : (Format.formatter -> 't -> unit) -> (module SHOW with type t = 't)

make pp is equivalent to the functor Make (T) with T.pp = pp.

val contramap : - (module SHOW with type t = 's) -> - ('t -> 's) -> - (module SHOW - with type t = 't)

If val f : 't -> 's, then contramap show f is an instance of SHOW for values of type 't by the SHOW insance show for values of type 's.

diff --git a/beluga/Support/Show/module-type-SHOW/index.html b/beluga/Support/Show/module-type-SHOW/index.html deleted file mode 100644 index b1ec8d809..000000000 --- a/beluga/Support/Show/module-type-SHOW/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -SHOW (beluga.Support.Show.SHOW)

Module type Show.SHOW

Module type for types with functions for pretty-printing and converting values to readable strings.

type t
val pp : Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Support/Stack/index.html b/beluga/Support/Stack/index.html deleted file mode 100644 index e808d94bd..000000000 --- a/beluga/Support/Stack/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Stack (beluga.Support.Stack)

Module Support.Stack

include module type of Stdlib.Stack
type !'a t = 'a Stdlib__Stack.t
exception Empty
val create : unit -> 'a t
val push : 'a -> 'a t -> unit
val pop : 'a t -> 'a
val pop_opt : 'a t -> 'a option
val top : 'a t -> 'a
val top_opt : 'a t -> 'a option
val clear : 'a t -> unit
val copy : 'a t -> 'a t
val is_empty : 'a t -> bool
val length : 'a t -> int
val iter : ('a -> unit) -> 'a t -> unit
val fold : ('b -> 'a -> 'b) -> 'b -> 'a t -> 'b
val to_seq : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> 'a Stdlib.Seq.t -> unit
val of_seq : 'a Stdlib.Seq.t -> 'a t
val to_list : 'a t -> 'a list

to_list s converts s into a list, where the top element of s is the last element of the output list.

val to_list_rev : 'a t -> 'a list

to_list_rev s converts s into a list, where the top element of s is the first element of the list.

diff --git a/beluga/Support/State/Make/argument-1-State/index.html b/beluga/Support/State/Make/argument-1-State/index.html deleted file mode 100644 index e36289530..000000000 --- a/beluga/Support/State/Make/argument-1-State/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -State (beluga.Support.State.Make.State)

Parameter Make.State

type t
diff --git a/beluga/Support/State/Make/index.html b/beluga/Support/State/Make/index.html deleted file mode 100644 index 1fe189564..000000000 --- a/beluga/Support/State/Make/index.html +++ /dev/null @@ -1,30 +0,0 @@ - -Make (beluga.Support.State.Make)

Module State.Make

Functor building an implementation of STATE for a given type of states.

Parameters

module State : sig ... end

Signature

type state = State.t

The type of states inside the monad.

type 'a t = state -> state * 'a
val get : state t

Return the state from the internals of the monad.

val put : state -> unit t

Replace the state inside the monad.

val modify : (state -> state) -> unit t

Modify the state inside the monad.

val run : 'a t -> state -> state * 'a

run a init runs a with initial state init, returning (final, v) where final is the final state and v is the output.

val eval : 'a t -> state -> 'a

eval a init is run a init = (final, v), but outputs only v.

val exec : 'a t -> state -> state

exec a init is run a init = (final, v), but outputs only final.

Traversals

val traverse_tuple2 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a1 * 'a2) -> - ('b1 * 'b2) t
val traverse_tuple3 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a3 -> 'b3 t) -> - ('a1 * 'a2 * 'a3) -> - ('b1 * 'b2 * 'b3) t
val traverse_list : ('a -> 'b t) -> 'a List.t -> 'b List.t t
val traverse_list1 : ('a -> 'b t) -> 'a List1.t -> 'b List1.t t
val traverse_list2 : ('a -> 'b t) -> 'a List2.t -> 'b List2.t t
val traverse_list_void : ('a -> _ t) -> 'a List.t -> Stdlib.Unit.t t
val traverse_list1_void : ('a -> _ t) -> 'a List1.t -> Stdlib.Unit.t t
val traverse_list2_void : ('a -> _ t) -> 'a List2.t -> Stdlib.Unit.t t
val traverse_reverse_list : ('a -> 'b t) -> 'a List.t -> 'b List.t t
val traverse_reverse_list1 : ('a -> 'b t) -> 'a List1.t -> 'b List1.t t
val traverse_reverse_list2 : ('a -> 'b t) -> 'a List2.t -> 'b List2.t t
val traverse_reverse_list_void : ('a -> _ t) -> 'a List.t -> Stdlib.Unit.t t
val traverse_reverse_list1_void : ('a -> _ t) -> 'a List1.t -> Stdlib.Unit.t t
val traverse_reverse_list2_void : ('a -> _ t) -> 'a List2.t -> Stdlib.Unit.t t
val traverse_option : ('a -> 'b t) -> 'a Option.t -> 'b Option.t t
val traverse_option_void : ('a -> _ t) -> 'a Option.t -> Stdlib.Unit.t t
val seq_list : 'a t List.t -> 'a List.t t
val seq_list1 : 'a t List1.t -> 'a List1.t t
val seq_list_void : unit t list -> unit t

seq_list_void [x1; x2; ...; xn] performs x1, x2, ..., xn in order.

Instances

include Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

diff --git a/beluga/Support/State/index.html b/beluga/Support/State/index.html deleted file mode 100644 index 578496efe..000000000 --- a/beluga/Support/State/index.html +++ /dev/null @@ -1,37 +0,0 @@ - -State (beluga.Support.State)

Module Support.State

State monad definition.

The state monad is used to define stateful actions, i.e. actions that can read or write to some auxiliary data structure. In general, using the state monad is slower than using side effects because of extra memory allocations and eager closure constructions. For helpers to operations defined with respect to mutable states, see Imperative_state.

In order to effectively use the state monad, you should define:

  1. An abstract module type definition for the state data structure. This acts as an interface between concrete implementations of the state data structure and modules that are defined with respect to that state. Even if only an immutable data structure is intended to be implemented for this abstract definition, its operations should be implementable using a mutable state.
  2. A concrete implementation for that abstract state definition.
  3. A functor taking an abstract state definition as argument, and producing operations that use that state.

For instance:

module type DISAMBIGUATION_STATE = sig
-  include State.STATE
-
-  val with_bound_lf_variable : Identifier.t -> 'a t -> 'a t
-  (* ... *)
-end
-
-module Immutable_disambiguation_state : sig
-  include DISAMBIGUATION_STATE
-
-  val initial_state : state
-end = struct
-  (* ... *)
-end
-
-module Mutable_disambiguation_state : sig
-  include DISAMBIGUATION_STATE
-
-  val create_initial_state : unit -> state
-end = struct
-  (* ... *)
-end
-
-module type LF_DISAMBIGUATION = sig
-  include State.STATE
-
-  val disambiguate_lf_kind : Synprs.lf_object -> Synext.lf_kind t
-  (* ... *)
-end
-
-module Make_lf_disambiguation
-    (Disambiguation_state : DISAMBIGUATION_STATE) :
-  LF_DISAMBIGUATION with type state = Disambiguation_state.state =
-struct
-  (* ... *)
-end
module type STATE = sig ... end

The type of state monads.

module Make (State : sig ... end) : STATE with type state = State.t

Functor building an implementation of STATE for a given type of states.

diff --git a/beluga/Support/State/module-type-STATE/index.html b/beluga/Support/State/module-type-STATE/index.html deleted file mode 100644 index c5537b94d..000000000 --- a/beluga/Support/State/module-type-STATE/index.html +++ /dev/null @@ -1,30 +0,0 @@ - -STATE (beluga.Support.State.STATE)

Module type State.STATE

The type of state monads.

type state

The type of states inside the monad.

type 'a t = state -> state * 'a
val get : state t

Return the state from the internals of the monad.

val put : state -> unit t

Replace the state inside the monad.

val modify : (state -> state) -> unit t

Modify the state inside the monad.

val run : 'a t -> state -> state * 'a

run a init runs a with initial state init, returning (final, v) where final is the final state and v is the output.

val eval : 'a t -> state -> 'a

eval a init is run a init = (final, v), but outputs only v.

val exec : 'a t -> state -> state

exec a init is run a init = (final, v), but outputs only final.

Traversals

val traverse_tuple2 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a1 * 'a2) -> - ('b1 * 'b2) t
val traverse_tuple3 : - ('a1 -> 'b1 t) -> - ('a2 -> 'b2 t) -> - ('a3 -> 'b3 t) -> - ('a1 * 'a2 * 'a3) -> - ('b1 * 'b2 * 'b3) t
val traverse_list : ('a -> 'b t) -> 'a List.t -> 'b List.t t
val traverse_list1 : ('a -> 'b t) -> 'a List1.t -> 'b List1.t t
val traverse_list2 : ('a -> 'b t) -> 'a List2.t -> 'b List2.t t
val traverse_list_void : ('a -> _ t) -> 'a List.t -> Stdlib.Unit.t t
val traverse_list1_void : ('a -> _ t) -> 'a List1.t -> Stdlib.Unit.t t
val traverse_list2_void : ('a -> _ t) -> 'a List2.t -> Stdlib.Unit.t t
val traverse_reverse_list : ('a -> 'b t) -> 'a List.t -> 'b List.t t
val traverse_reverse_list1 : ('a -> 'b t) -> 'a List1.t -> 'b List1.t t
val traverse_reverse_list2 : ('a -> 'b t) -> 'a List2.t -> 'b List2.t t
val traverse_reverse_list_void : ('a -> _ t) -> 'a List.t -> Stdlib.Unit.t t
val traverse_reverse_list1_void : ('a -> _ t) -> 'a List1.t -> Stdlib.Unit.t t
val traverse_reverse_list2_void : ('a -> _ t) -> 'a List2.t -> Stdlib.Unit.t t
val traverse_option : ('a -> 'b t) -> 'a Option.t -> 'b Option.t t
val traverse_option_void : ('a -> _ t) -> 'a Option.t -> Stdlib.Unit.t t
val seq_list : 'a t List.t -> 'a List.t t
val seq_list1 : 'a t List1.t -> 'a List1.t t
val seq_list_void : unit t list -> unit t

seq_list_void [x1; x2; ...; xn] performs x1, x2, ..., xn in order.

Instances

include Monad.MONAD with type 'a t := 'a t
val return : 'a -> 'a t

return a injects a into the monadic type.

val bind : ('a -> 'b t) -> 'a t -> 'b t

bind f a is the sequential composition of two actions, passing any value produced by a as argument to f.

val (>>=) : 'a t -> ('a -> 'b t) -> 'b t

Operator alias of bind.

val compose : ('b -> 'c t) -> ('a -> 'b t) -> 'a -> 'c t

compose g f is the Kleisli composition of f and g, passing the input to f, then binding the output to g.

val (>=>) : ('a -> 'b t) -> ('b -> 'c t) -> 'a -> 'c t

Operator alias of compose.

val let* : 'a t -> ('a -> 'b t) -> 'b t

( let* ) ma f is bind f ma. This is a binding operator, and it is used as let* a = ma in f a.

val and* : 'a t -> 'b t -> ('a * 'b) t

( and* ) ma mb is let* a = ma in let* b = mb in return (a, b). This is a binding operator, and it is used as let* a = ma and* b = mb in ....

include Functor.FUNCTOR with type 'a t := 'a t

Combinators

val map : ('a -> 'b) -> 'a t -> 'b t

map f is the function that maps values of t by f. The order of arguments is for use in function pipelines as fb = fa |> map (fun a -> (* ... *)).

val ($>) : 'a t -> ('a -> 'b) -> 'b t

( $> ) is an infix synonym for map.

val let+ : 'a t -> ('a -> 'b) -> 'b t

( let+ ) ma f is map f a. This is a binding operator, and is used as let+ a = ma in f a

val and+ : 'a t -> 'b t -> ('a * 'b) t

( and+ ) ma mb is let+ a = ma in let+ b = mb in return (a, b). This is a binding operator, and it is used as let+ a = ma and+ b = mb in ....

include Apply.APPLY with type 'a t := 'a t
val ap : 'a t -> ('a -> 'b) t -> 'b t

ap fa fab applies argument fa to fab under the abstract datatype t.

val (<&>) : ('a -> 'b) t -> 'a t -> 'b t

( <&> ) is an infix synonym of ap.

Combinators

val ap_first : 'b t -> 'a t -> 'a t

ap_first second first combines actions first and second but keeps only first. That is, ap_first second first = first. The order of arguments is for use in function pipelines as first = first |> ap_first second.

val (<&) : 'a t -> 'b t -> 'a t

( <& ) is an infix synonym for ap_first.

val ap_second : 'b t -> 'a t -> 'b t

ap_second second first combines actions first and second but keeps only second. That is, ap_second second first = second. The order of arguments is for use in function pipelines as second = first |> ap_second second.

val (&>) : 'a t -> 'b t -> 'b t

( &> ) is an infix synonym for ap_second.

val seq2 : 'a1 t -> 'a2 t -> ('a1 * 'a2) t

seq2 fa1 fa2 sequentially executes actions fa1 and fa2, and keeps their outputs under the abstract datatype t.

val seq3 : 'a1 t -> 'a2 t -> 'a3 t -> ('a1 * 'a2 * 'a3) t

seq3 fa1 fa2 fa3 sequentially executes actions fa1, fa2 and fa3, and keeps their outputs under the abstract datatype t.

val seq4 : 'a1 t -> 'a2 t -> 'a3 t -> 'a4 t -> ('a1 * 'a2 * 'a3 * 'a4) t

seq4 fa1 fa2 fa3 fa4 sequentially executes actions fa1, fa2, fa3 and fa4, and keeps their outputs under the abstract datatype t.

val seq5 : - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - ('a1 * 'a2 * 'a3 * 'a4 * 'a5) t

seq5 fa1 fa2 fa3 fa4 fa5 sequentially executes actions fa1, fa2, fa3, fa4 and fa5, and keeps their outputs under the abstract datatype t.

val lift2 : ('a1 -> 'a2 -> 'r) -> 'a1 t -> 'a2 t -> 'r t

lift2 f ma1 ma2 sequentially executes actions ma1, ma2 and passes their outputs to f.

val lift3 : ('a1 -> 'a2 -> 'a3 -> 'r) -> 'a1 t -> 'a2 t -> 'a3 t -> 'r t

lift3 f ma1 ma2 ma3 sequentially executes actions ma1, ma2, ma3 and passes their outputs to f.

val lift4 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'r t

lift4 f ma1 ma2 ma3 ma4 sequentially executes actions ma1, ma2, ma3, ma4 and passes their outputs to f.

val lift5 : - ('a1 -> 'a2 -> 'a3 -> 'a4 -> 'a5 -> 'r) -> - 'a1 t -> - 'a2 t -> - 'a3 t -> - 'a4 t -> - 'a5 t -> - 'r t

lift5 f ma1 ma2 ma3 ma4 ma5 sequentially executes actions ma1, ma2, ma3, ma4, ma5 and passes their outputs to f.

val replicate : int -> 'a t -> 'a list t

replicate n a sequentially runs n times a.

  • raises Invalid_argument

    If n < 0.

diff --git a/beluga/Support/String/Hashtbl/index.html b/beluga/Support/String/Hashtbl/index.html deleted file mode 100644 index 4e37d5466..000000000 --- a/beluga/Support/String/Hashtbl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hashtbl (beluga.Support.String.Hashtbl)

Module String.Hashtbl

type key = t
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Support/String/index.html b/beluga/Support/String/index.html deleted file mode 100644 index 5714f54c3..000000000 --- a/beluga/Support/String/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -String (beluga.Support.String)

Module Support.String

include module type of Stdlib.String
type t = string
val make : int -> char -> string
val init : int -> (int -> char) -> string
val empty : string
val of_bytes : bytes -> string
val to_bytes : string -> bytes
val length : string -> int
val get : string -> int -> char
val concat : string -> string list -> string
val cat : string -> string -> string
val starts_with : prefix:string -> string -> bool
val ends_with : suffix:string -> string -> bool
val contains_from : string -> int -> char -> bool
val rcontains_from : string -> int -> char -> bool
val contains : string -> char -> bool
val sub : string -> int -> int -> string
val split_on_char : char -> string -> string list
val map : (char -> char) -> string -> string
val mapi : (int -> char -> char) -> string -> string
val fold_left : ('a -> char -> 'a) -> 'a -> string -> 'a
val fold_right : (char -> 'a -> 'a) -> string -> 'a -> 'a
val for_all : (char -> bool) -> string -> bool
val exists : (char -> bool) -> string -> bool
val trim : string -> string
val escaped : string -> string
val uppercase_ascii : string -> string
val lowercase_ascii : string -> string
val capitalize_ascii : string -> string
val uncapitalize_ascii : string -> string
val iter : (char -> unit) -> string -> unit
val iteri : (int -> char -> unit) -> string -> unit
val index_from : string -> int -> char -> int
val index_from_opt : string -> int -> char -> int option
val rindex_from : string -> int -> char -> int
val rindex_from_opt : string -> int -> char -> int option
val index : string -> char -> int
val index_opt : string -> char -> int option
val rindex : string -> char -> int
val rindex_opt : string -> char -> int option
val to_seq : t -> char Stdlib.Seq.t
val to_seqi : t -> (int * char) Stdlib.Seq.t
val of_seq : char Stdlib.Seq.t -> t
val get_utf_8_uchar : t -> int -> Stdlib.Uchar.utf_decode
val is_valid_utf_8 : t -> bool
val get_utf_16be_uchar : t -> int -> Stdlib.Uchar.utf_decode
val is_valid_utf_16be : t -> bool
val get_utf_16le_uchar : t -> int -> Stdlib.Uchar.utf_decode
val is_valid_utf_16le : t -> bool
val create : int -> bytes
  • deprecated Use Bytes.create/BytesLabels.create instead.
val set : bytes -> int -> char -> unit
  • deprecated Use Bytes.set/BytesLabels.set instead.
val blit : string -> int -> bytes -> int -> int -> unit
val copy : string -> string
  • deprecated Strings now immutable: no need to copy
val fill : bytes -> int -> int -> char -> unit
  • deprecated Use Bytes.fill/BytesLabels.fill instead.
val uppercase : string -> string
  • deprecated Use String.uppercase_ascii/StringLabels.uppercase_ascii instead.
val lowercase : string -> string
  • deprecated Use String.lowercase_ascii/StringLabels.lowercase_ascii instead.
val capitalize : string -> string
  • deprecated Use String.capitalize_ascii/StringLabels.capitalize_ascii instead.
val uncapitalize : string -> string
  • deprecated Use String.uncapitalize_ascii/StringLabels.uncapitalize_ascii instead.
val get_uint8 : string -> int -> int
val get_int8 : string -> int -> int
val get_uint16_ne : string -> int -> int
val get_uint16_be : string -> int -> int
val get_uint16_le : string -> int -> int
val get_int16_ne : string -> int -> int
val get_int16_be : string -> int -> int
val get_int16_le : string -> int -> int
val get_int32_ne : string -> int -> int32
val get_int32_be : string -> int -> int32
val get_int32_le : string -> int -> int32
val get_int64_ne : string -> int -> int64
val get_int64_be : string -> int -> int64
val get_int64_le : string -> int -> int64
val unsafe_get : string -> int -> char
val unsafe_set : bytes -> int -> char -> unit
  • deprecated
val unsafe_blit : string -> int -> bytes -> int -> int -> unit
val unsafe_fill : bytes -> int -> int -> char -> unit
  • deprecated
val unpack : string -> char list

unpack s is s as a list of characters.

val pack : char list -> string

pack cs is the string concatenation of cs.

val drop : int -> string -> string

drop n s is the substring of s without the first n leading characters.

Predicates

val is_empty : t -> bool

is_empty s is true if and only if s = "".

val is_non_empty : t -> bool

is_non_empty s is true if and only if s <> "".

Collections

module Set : Stdlib.Set.S with type elt = t
module Map : Stdlib.Map.S with type key = t
module Hashtbl : Hashtbl.S with type key = t

Instances

include Eq.EQ with type t := t
include Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Hash.HASH with type t := t
val hash : t -> int

hash e is the hash code computed for e.

If e1 and e2 as equal, then hash e1 and hash e2 must be equal.

include Show.SHOW with type t := t
val pp : Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Synapx/Comp/index.html b/beluga/Synapx/Comp/index.html deleted file mode 100644 index 4a01dcaab..000000000 --- a/beluga/Synapx/Comp/index.html +++ /dev/null @@ -1,5 +0,0 @@ - -Comp (beluga.Synapx.Comp)

Module Synapx.Comp

Approximate Computation Syntax

type unbox_modifier = [
  1. | `Strengthened
]
type case_pragma = Synint.Comp.case_pragma =
  1. | PragmaCase
  2. | PragmaNotCase
type context_case = Synint.Comp.context_case =
  1. | EmptyContext of Syncom.Location.t
  2. | ExtendedBy of Syncom.Location.t * int
type case_label = Synint.Comp.case_label =
  1. | Lf_constant of Syncom.Location.t * Syncom.Name.t * Syncom.Id.cid_term
  2. | Comp_constant of Syncom.Location.t * Syncom.Name.t * Syncom.Id.cid_comp_const
  3. | BVarCase of Syncom.Location.t
  4. | ContextCase of context_case
  5. | PVarCase of Syncom.Location.t * int * int option
type 'a generic_order = 'a Synint.Comp.generic_order =
  1. | Arg of 'a
  2. | Lex of 'a generic_order list
  3. | Simul of 'a generic_order list
type 'a generic_suffices_typ = [
  1. | `exact of 'a
  2. | `infer of Syncom.Location.t
]

Type specified in an interactive use of `suffices`

val map_suffices_typ : - ('a -> 'b) -> - 'a0 generic_suffices_typ -> - 'b0 generic_suffices_typ
val map_order : ('a -> 'b) -> 'a0 generic_order -> 'b0 generic_order
type kind =
  1. | Ctype of Syncom.Location.t
  2. | PiKind of Syncom.Location.t * LF.ctyp_decl * kind
type meta_typ = Syncom.Location.t * LF.ctyp
type meta_obj = Syncom.Location.t * LF.mfront
type meta_spine =
  1. | MetaNil
  2. | MetaApp of meta_obj * meta_spine
and branch =
  1. | Branch of Syncom.Location.t * LF.ctyp_decl LF.ctx * pattern * exp
and fun_branches =
  1. | NilFBranch of Syncom.Location.t
  2. | ConsFBranch of Syncom.Location.t * pattern_spine * exp * fun_branches
type ctyp_decl =
  1. | CTypDecl of Syncom.Name.t * typ
type gctx = ctyp_decl LF.ctx
type hypotheses = {
  1. cD : LF.mctx;
  2. cG : gctx;
}
type proof =
  1. | Incomplete of Syncom.Location.t * string option
  2. | Command of Syncom.Location.t * command * proof
  3. | Directive of Syncom.Location.t * directive
and command =
  1. | By of Syncom.Location.t * exp * Syncom.Name.t
  2. | Unbox of Syncom.Location.t * exp * Syncom.Name.t * unbox_modifier option
and directive =
  1. | Intros of Syncom.Location.t * hypothetical
  2. | Solve of Syncom.Location.t * exp
  3. | Split of Syncom.Location.t * exp * split_branch list
  4. | Suffices of Syncom.Location.t * exp * suffices_arg list
and suffices_arg = Syncom.Location.t * typ * proof
and split_branch = {
  1. case_label : case_label;
  2. branch_body : hypothetical;
  3. split_branch_loc : Syncom.Location.t;
}
and hypothetical = {
  1. hypotheses : hypotheses;
  2. proof : proof;
  3. hypothetical_loc : Syncom.Location.t;
}
type thm =
  1. | Program of exp
  2. | Proof of proof
val loc_of_exp : exp -> Syncom.Location.t
diff --git a/beluga/Synapx/LF/index.html b/beluga/Synapx/LF/index.html deleted file mode 100644 index 63966e57f..000000000 --- a/beluga/Synapx/LF/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -LF (beluga.Synapx.LF)

Module Synapx.LF

Approximate LF Syntax

type 'a ctx = 'a Synint.LF.ctx =
  1. | Empty
  2. | Dec of 'a ctx * 'a
type svar_class = Synint.LF.svar_class =
  1. | Ren
  2. | Subst
type kind =
  1. | Typ
  2. | PiKind of typ_decl * Syncom.Depend.t * Syncom.Plicity.t * kind
and typ_decl =
  1. | TypDecl of Syncom.Name.t * typ
  2. | TypDeclOpt of Syncom.Name.t
and cltyp =
  1. | MTyp of typ
  2. | PTyp of typ
  3. | STyp of svar_class * dctx
and ctyp =
  1. | ClTyp of cltyp * dctx
  2. | CTyp of Syncom.Id.cid_schema
and ctyp_decl =
  1. | Decl of Syncom.Name.t * ctyp * Syncom.Plicity.t
  2. | DeclOpt of Syncom.Name.t
and typ_rec =
  1. | SigmaLast of Syncom.Name.t option * typ
  2. | SigmaElem of Syncom.Name.t * typ * typ_rec
and tuple =
  1. | Last of normal
  2. | Cons of normal * tuple
and normal =
  1. | Lam of Syncom.Location.t * Syncom.Name.t * normal
  2. | Root of Syncom.Location.t * head * spine
  3. | LFHole of Syncom.Location.t * string option
  4. | Tuple of Syncom.Location.t * tuple
  5. | Ann of Syncom.Location.t * normal * typ
and head =
  1. | BVar of Syncom.Id.offset
  2. | Const of Syncom.Id.cid_term
  3. | MVar of cvar * sub option
  4. | Proj of head * proj
  5. | Hole
  6. | PVar of cvar * sub option
  7. | FVar of Syncom.Name.t
  8. | FMVar of Syncom.Name.t * sub option
  9. | FPVar of Syncom.Name.t * sub option
and proj =
  1. | ByPos of int
  2. | ByName of Syncom.Name.t
and spine =
  1. | Nil
  2. | App of normal * spine
and sub =
  1. | EmptySub
  2. | Id
  3. | Dot of front * sub
  4. | SVar of cvar * sub option
  5. | FSVar of Syncom.Name.t * sub option
and front =
  1. | Head of head
  2. | Obj of normal
and cvar =
  1. | Offset of Syncom.Id.offset
  2. | MInst of Int.LF.clobj * Int.LF.ctyp
and dctx =
  1. | Null
  2. | CtxVar of ctx_var
  3. | DDec of dctx * typ_decl
  4. | CtxHole
and ctx_var =
  1. | CtxName of Syncom.Name.t
  2. | CtxOffset of Syncom.Id.offset
and mctx = ctyp_decl ctx
and sch_elem =
  1. | SchElem of typ_decl ctx * typ_rec
and schema =
  1. | Schema of sch_elem list
and psi_hat = Int.LF.ctx_var option * Syncom.Id.offset
and mfront =
  1. | ClObj of dctx * sub
    (*

    Either a contextual term, plain substitution or renaming substitution.

    *)
  2. | CObj of dctx
    (*

    Context meta-object.

    *)
diff --git a/beluga/Syncom/Associativity/index.html b/beluga/Syncom/Associativity/index.html deleted file mode 100644 index df5455bcc..000000000 --- a/beluga/Syncom/Associativity/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Associativity (beluga.Syncom.Associativity)

Module Syncom.Associativity

Description for the associativity of user-defined operators.

type t = private
  1. | Left_associative
  2. | Right_associative
  3. | Non_associative

The type of annotation for the associativity of an infix operator.

Let f be an infix operator and a1, a2, and a3 be arguments. Then,

  • if f is left-associative, then a1 f a2 f a3 is parsed as (a1 f a2) f a3
  • if f is right-associative, then a1 f a2 f a3 is parsed as a1 f (a2 f a3)
  • if f is non-associative, then a1 f a2 f a3 is a syntax error.

Constructors

val left_associative : t

left_associative is Left_associative.

val right_associative : t

right_associative is Right_associative.

val non_associative : t

non_associative is Non_associative.

Predicates and Comparisons

val is_left_associative : t -> bool

is_left_associative f is true if and only if f is Left_associative.

val is_right_associative : t -> bool

is_right_associative f is true if and only if f is Right_associative.

val is_non_associative : t -> bool

is_non_associative f is true if and only if f is Non_associative.

Instances

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Syncom/Binding_tree/index.html b/beluga/Syncom/Binding_tree/index.html deleted file mode 100644 index 0bbcc33ee..000000000 --- a/beluga/Syncom/Binding_tree/index.html +++ /dev/null @@ -1,17 +0,0 @@ - -Binding_tree (beluga.Syncom.Binding_tree)

Module Syncom.Binding_tree

Mutable map data structure from namespaced identifiers to values.

A binding tree is a tree of identifiers mapped to values, like in a map data structure. Entries in a binding tree are toplevel if they are direct children of the tree root (i.e., they are not entries nested in namespaces). Identifiers may be used as keys for toplevel entries in the tree, and qualified identifiers may be used as keys for all entries in the tree (toplevel or nested in namespaces). Hence, a lookup in a binding tree traverses the tree from the root to an internal node or leaf by sequentially traversing the list of identifier segments in the qualified identifier.

exception Unbound_identifier of Identifier.t
exception Unbound_qualified_identifier of Qualified_identifier.t
exception Unbound_namespace of Qualified_identifier.t
type 'a t

The type of binding trees.

val is_empty : 'a t -> Stdlib.Bool.t

is_empty tree is true if and only if there are no bindings in tree.

val add_toplevel : Identifier.t -> 'a -> ?subtree:'a t -> 'a t -> Stdlib.Unit.t

add_toplevel identifier value ?subtree tree adds (value, subtree) bound for identifier in tree, where subtree defaults to empty. This shadows any previous bindings for identifier in tree.

val add : - Qualified_identifier.t -> - 'a -> - ?subtree:'a t -> - 'a t -> - Stdlib.Unit.t

add identifier entry ?subtree tree adds entry and subtree bound to identifier in tree. The namespaces of identifier must be bound in tree.

val add_all : 'a t -> 'a t -> Stdlib.Unit.t

add_all t1 t2 adds all the bindings from t2 to t1.

val remove : Identifier.t -> 'a t -> Stdlib.Unit.t

remove identifier tree removes the binding in tree for identifier.

val lookup_toplevel : Identifier.t -> 'a t -> 'a * 'a t

lookup_toplevel identifier tree is (value, subtree) where value and subtree are as added with add.

val lookup_toplevel_opt : Identifier.t -> 'a t -> ('a * 'a t) Support.Option.t

lookup_toplevel_opt identifier tree is Option.Some (value, subtree) where value and subtree are as added with add, and Option.None if there is no binding in tree for identifier.

val lookup : Qualified_identifier.t -> 'a t -> 'a * 'a t

lookup qualified_identifier tree is (value, subtree) where value and subtree are as added with add.

type 'a maximum_lookup_result =
  1. | Unbound of {
    1. segments : Identifier.t Support.List1.t;
    }
  2. | Partially_bound of {
    1. leading_segments : Identifier.t Support.List.t;
    2. segment : Identifier.t;
    3. trailing_segments : Identifier.t Support.List1.t;
    4. entry : 'a;
    5. subtree : 'a t;
    }
  3. | Bound of {
    1. entry : 'a;
    2. subtree : 'a t;
    }
val maximum_lookup : - Identifier.t Support.List1.t -> - 'a t -> - 'a maximum_lookup_result

maximum_lookup identifiers tree looks up as many bound identifiers in identifiers as possible against tree in sequence. This effectively matches identifiers as a path in tree.

maximum_lookup identifiers tree is one of three outcomes, in increasing length of matching path:

  1. `Unbound identifiers if the first identifier in identifiers is not bound in tree, so identifiers is not a path in tree.
  2. `Partially_bound (bound, (entry, subtree), unbound_identifiers) if not all identifiers in identifiers are bound in tree, so first few identifiers form a path in tree.
  3. `Bound (entry, subtree) if all identifiers in identifiers are bound, so they form a path in tree.
val open_namespace : Qualified_identifier.t -> 'a t -> Stdlib.Unit.t

open_namespace qualified_identifier tree adds all the bindings from subtree to tree if lookup qualified_identifier tree = (_value, subtree).

val is_identifier_bound : Identifier.t -> 'a t -> Stdlib.Bool.t

is_identifier_bound identifier tree is true if and only if there is a binding for identifier in tree.

val is_qualified_identifier_bound : - Qualified_identifier.t -> - 'a t -> - Stdlib.Bool.t

is_qualified_identifier_bound identifier tree is true if and only if there is a binding for identifier in tree.

val replace : - Qualified_identifier.t -> - ('a -> 'a t -> 'a * 'a t) -> - 'a t -> - Stdlib.Unit.t

replace identifier f tree replaces the value bound at identifier in tree with f entry subtree, with (entry, subtree) being the result of lookup identifier tree.

val mem : Qualified_identifier.t -> 'a t -> Stdlib.Bool.t

mem identifier tree is true if and only if there is a binding in tree for identifier.

val snapshot : 'a t -> 'a t

snapshot tree is a duplicate of tree that only retains the latest bindings. The values are kept as is. Snapshots of the subtrees in tree are also taken. A snapshot is not a deep copy precisely because the old bindings in the hashtables are not carried over.

A snapshot of a binding tree is essentially a frozen duplicate of it. This means that bindings in the snapshot cannot be removed in the same way that they are in the original tree because the previous bindings for any key are not copied over to the snapshot.

This is used to produce snapshots of the referencing environment during a traversal of a Beluga signature at the point of declaration of Harpoon programs, so that we may revisit the referencing environment at those points later.

val size : 'a t -> Support.Int.t

size tree is the total number of key-value pairs in tree.

val to_seq : 'a t -> (Qualified_identifier.t * 'a) Support.Seq.t

to_seq tree is the sequence of values mapped by qualified identifier in tree.

val create : Stdlib.Unit.t -> 'a t

create () is a new empty binding tree.

diff --git a/beluga/Syncom/Depend/index.html b/beluga/Syncom/Depend/index.html deleted file mode 100644 index b93be14a3..000000000 --- a/beluga/Syncom/Depend/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Depend (beluga.Syncom.Depend)

Module Syncom.Depend

Dependency annotations to parameters to dependent type functions.

In dependent function types Πx:A.B, either:

  1. B depends on x
  2. B may or may not depend on x
  3. B does not depend on x (which we usually denote as A → B)

This data type was first introduced in the Twelf system.

type t = private
  1. | Yes
    (*

    The dependent type depends on the parameter.

    In the case of dependent function types, this means that it cannot be an arrow.

    *)
  2. | Maybe
    (*

    The dependent type may or may not depend on the parameter, we just don't know at this point.

    In the case of dependent function types, this means that it can be either an arrow or a Pi-type.

    *)
  3. | No
    (*

    The dependent type does not depend on the parameter.

    In the case of dependent function types, this means that it is actually an arrow.

    *)

The type of annotation for parameters to dependent kinds or types.

In dependent function types Πx:A.B, the depend annotation refers to the relation between x and B.

Constructors

val yes : t

yes is Yes.

val maybe : t

maybe is Maybe.

val no : t

no is No.

Instances

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Syncom/Error/index.html b/beluga/Syncom/Error/index.html deleted file mode 100644 index 7989caf3e..000000000 --- a/beluga/Syncom/Error/index.html +++ /dev/null @@ -1,21 +0,0 @@ - -Error (beluga.Syncom.Error)

Module Syncom.Error

Utilities for raising and catching exceptions.

val enable_colored_output : unit -> unit

enable_colored_output () enables coloring functions in pretty-printing of exceptions.

val disable_colored_output : unit -> unit

disable_colored_output () disables coloring functions in pretty-printing of exceptions.

val raise : exn -> 'a

raise exn raises exn.

val re_raise : exn -> 'a

re_raise exn raises exn with the backtrace of the latest caught exception. This should only be used if exn was caught in a try-with expression.

val raise_notrace : exn -> 'a

raise_notrace exn raises exn without producing a stack trace. This is more efficient for exceptions used for control flow.

exception Violation of string

Violation message is the exception signalling a programmer error, like an unmet pre-condition. FIXME: This exception variant should not be exported, but it is incorrectly being used for backtracking with exceptions in the core library.

val raise_violation : ?location:Location.t -> string -> 'a

raise_violation ?location message raises a violation exception with the given message and location. A violation encountered at runtime indicates that there is a bug in the implementation, such as a pre-condition, post-condition or invariant not being upheld.

val located_exception : Location.t Support.List1.t -> exn -> exn

located_exception locations cause is a decorated exception having cause and locations for source file error-reporting. This exception is not exported from this module, so it may never be caught elsewhere.

This sort of exception is used to signal to the user which part of their source code is problematic.

val located_exception1 : Location.t -> exn -> exn

located_exception1 location cause is a decorated exception having cause and locations [location] for source file error-reporting.

val located_exception2 : Location.t -> Location.t -> exn -> exn

located_exception2 location1 location2 cause is a decorated exception having cause and locations [location1; location2] for source file error-reporting.

val raise_at : Location.t Support.List1.t -> exn -> 'a

raise_at locations cause raises located_exception locations cause.

val raise_at1 : Location.t -> exn -> 'a

raise_at1 location cause raises located_exception1 location cause.

val raise_at2 : Location.t -> Location.t -> exn -> 'a

raise_at2 location1 location2 cause raises located_exception2 location1 location2 cause.

val raise_at1_opt : Location.t Support.Option.t -> exn -> 'a

raise_at1_opt location_opt cause raises located_exception1 location cause if location_opt = Option.Some location, or raises cause if location_opt = Option.None.

val located_exception_printer : - (Support.Format.formatter -> unit) -> - Location.t Support.List1.t -> - Support.Format.formatter -> - unit

located_exception_printer pp locations is a printer for the exception printed by pp with location snippets for locations in order.

val composite_exception : exn Support.List2.t -> exn

composite_exception causes is the composite exception having many related causes. This exception is not exported from this module, so it may never be caught elsewhere.

This sort of exception is used to report multiple exception causes for the same problem. For instance, during disambiguation, we may have encountered a bound variable that is of the wrong type. This exception can be represented as the composite for an exception for the variable being bound and of an unexpected sort, and another exception for reporting the sort of bound variable it is.

val composite_exception2 : exn -> exn -> exn

composite_exception2 cause1 cause2 is the composite exception having causes [cause1; cause2].

val raise_composite_exception : exn Support.List2.t -> 'a
val raise_composite_exception2 : exn -> exn -> 'a
val aggregate_exception : exn Support.List2.t -> exn

aggregate_exception exceptions is the composite exception having many unrelated exceptions. This exception is not exported from this module, so it may never be caught elsewhere.

This sort of exception is used to report multiple different exceptions. For instance, during the indexing of a signature, unrelated exceptions may arise in different compilation units. These unrelated exceptions can be raised as an aggregate exception.

val aggregate_exception2 : exn -> exn -> exn

aggregate_exception2 exception1 exception2 is the aggregate exception having causes [exception1; exception2]. This exception is not exported from this module, so it may never be caught elsewhere.

val raise_aggregate_exception : exn Support.List2.t -> 'a
val raise_aggregate_exception2 : exn -> exn -> 'a
val raise_not_implemented : ?location:Location.t -> string -> 'a

raise_not_implemented ?location message raises an exception signalling that we've reached a segment of code that is not yet implemented. The optional location is used to additionally report to the user the part of their work that triggered this exception.

val raise_unsupported_exception_printing : exn -> 'a

raise_unsupported_exception_printing exn raises an exception signalling that a pretty-printer function for exceptions encountered an unsupported exception variant exn. This is used together with register_exception_printer.

val register_exception_printer : - (exn -> Support.Format.formatter -> unit) -> - unit

register_exception_printer pp_exn registers the pretty-printing function pp_exn for printing some exceptions. If pp_exn does not support an exception variant exn, then it should call raise_unsupported_exception_printing exn.

Example usage:

let () =
-  Error.register_exception_printer (function
-    | My_exception (message : string) ->
-        Format.dprintf "@[<v 0>My exception was raised:@ %s@]" message
-    | exn -> Error.raise_unsupported_exception_printing exn)
val find_printer : exn -> Support.Format.formatter -> unit

find_printer exn is the exception printer registered with register_exception_printer that handles exn. If there is no such printer, then raise_unsupported_exception_printing exn is evaluated.

find_printer is used when registering exception printers for exceptions that contain sub-exceptions, like located, aggregate or composite exceptions.

val mismatch_reporter : - string -> - string -> - (Support.Format.formatter -> 'a -> unit) -> - 'a -> - string -> - (Support.Format.formatter -> 'b -> unit) -> - 'b -> - Support.Format.formatter -> - unit

Helper function to construct an error message reporting a mismatch between something that was expected and what was actually encountered. e.g. a type mismatch or a context clash.

example: mismatch_reporter "Type mismatch." "Expected type" pp_ty1 ty1 "Inferred type" pp_ty2 ty2

diff --git a/beluga/Syncom/Fixity/index.html b/beluga/Syncom/Fixity/index.html deleted file mode 100644 index a90b830a6..000000000 --- a/beluga/Syncom/Fixity/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Fixity (beluga.Syncom.Fixity)

Module Syncom.Fixity

Description for the fixity of user-defined operators.

type t = private
  1. | Prefix
    (*

    The annotation for prefix operators.

    *)
  2. | Infix
    (*

    The annotation for infix operators.

    *)
  3. | Postfix
    (*

    The annotation for postfix operators.

    *)

The type of annotation for the fixity of an operator.

Let f be an operator and a, a1, a2 be arguments. Then,

  • if f is prefix, then it is called as f a
  • if f is infix, then it is called as a1 f a2
  • if f is postfix, then it is called as a f

Constructors

val prefix : t

prefix is Prefix.

val infix : t

infix is Infix

val postfix : t

postfix is Postfix

Predicates and Comparisons

val is_prefix : t -> bool

is_prefix f is true if and only if f is Prefix.

val is_infix : t -> bool

is_infix f is true if and only if f is Infix.

val is_postfix : t -> bool

is_postfix f is true if and only if f is Postfix.

Instances

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Syncom/Gensym/MVarData/index.html b/beluga/Syncom/Gensym/MVarData/index.html deleted file mode 100644 index d1c3a5d7e..000000000 --- a/beluga/Syncom/Gensym/MVarData/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MVarData (beluga.Syncom.Gensym.MVarData)

Module Gensym.MVarData

val gensym : unit -> string
val name_gensym : string -> unit -> string
val reset : unit -> unit
diff --git a/beluga/Syncom/Gensym/VarData/index.html b/beluga/Syncom/Gensym/VarData/index.html deleted file mode 100644 index 4ca5f1e66..000000000 --- a/beluga/Syncom/Gensym/VarData/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -VarData (beluga.Syncom.Gensym.VarData)

Module Gensym.VarData

Symbol generation for data variables. Symbols take the form a,..., z, a1, ...z1, a2, ...

val gensym : unit -> string
val name_gensym : string -> unit -> string
val reset : unit -> unit
diff --git a/beluga/Syncom/Gensym/index.html b/beluga/Syncom/Gensym/index.html deleted file mode 100644 index 273d9c160..000000000 --- a/beluga/Syncom/Gensym/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Gensym (beluga.Syncom.Gensym)

Module Syncom.Gensym

val create_symbols : string array -> string Stdlib.Seq.t
module type GENSYM = sig ... end

Functionality for generating unique symbols

module VarData : GENSYM

Symbol generation for data variables. Symbols take the form a,..., z, a1, ...z1, a2, ...

module MVarData : GENSYM
val reset : unit -> unit
diff --git a/beluga/Syncom/Gensym/module-type-GENSYM/index.html b/beluga/Syncom/Gensym/module-type-GENSYM/index.html deleted file mode 100644 index fab11775e..000000000 --- a/beluga/Syncom/Gensym/module-type-GENSYM/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -GENSYM (beluga.Syncom.Gensym.GENSYM)

Module type Gensym.GENSYM

Functionality for generating unique symbols

val gensym : unit -> string
val name_gensym : string -> unit -> string
val reset : unit -> unit
diff --git a/beluga/Syncom/HoleId/Make/index.html b/beluga/Syncom/HoleId/Make/index.html deleted file mode 100644 index cb7856f59..000000000 --- a/beluga/Syncom/HoleId/Make/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Make (beluga.Syncom.HoleId.Make)

Module HoleId.Make

Construct a counter for hole id numbers.

The reason this is wrapped in a generative functor is that functor instantiation allows the next function to operate on a private integer reference, that can be made inaccessible outside of this module.

Parameters

Signature

val next : unit -> t

Generates the next hole ID.

diff --git a/beluga/Syncom/HoleId/index.html b/beluga/Syncom/HoleId/index.html deleted file mode 100644 index 485b5b60d..000000000 --- a/beluga/Syncom/HoleId/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -HoleId (beluga.Syncom.HoleId)

Module Syncom.HoleId

type name =
  1. | Anonymous
  2. | Named of string
type t
val of_int : int -> t
val string_of_hole_id : t -> string
module Make () : sig ... end

Construct a counter for hole id numbers.

val name_of_option : string option -> name

Converts an option type to a name.

val option_of_name : name -> string option

Converts a name to an option type.

val string_of_name : name -> string

Stringifies a hole name.

If the hole is anonymous, then its name is the empty string.

val string_of_name_or_id : (name * t) -> string

Stringifies a hole name.

If the hole is anonymous, then use its hole id.

val is_anonymous : name -> bool

Decides whether a hole name is anonymous.

val fmt_ppr_name : Stdlib.Format.formatter -> name -> unit
val fmt_ppr_id : Stdlib.Format.formatter -> t -> unit
val compare : t -> t -> int
diff --git a/beluga/Syncom/Id/CompConst/Hashtbl/index.html b/beluga/Syncom/Id/CompConst/Hashtbl/index.html deleted file mode 100644 index ea3e2a092..000000000 --- a/beluga/Syncom/Id/CompConst/Hashtbl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hashtbl (beluga.Syncom.Id.CompConst.Hashtbl)

Module CompConst.Hashtbl

type key = t
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Support.Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Syncom/Id/CompConst/index.html b/beluga/Syncom/Id/CompConst/index.html deleted file mode 100644 index da2905607..000000000 --- a/beluga/Syncom/Id/CompConst/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -CompConst (beluga.Syncom.Id.CompConst)

Module Id.CompConst

type t

Constructors

val of_int : int -> t

Destructors

val to_int : t -> int

Collections

module Set : Stdlib.Set.S with type elt = t
module Map : Stdlib.Map.S with type key = t
module Hashtbl : Support.Hashtbl.S with type key = t

Instances

include Support.Eq.EQ with type t := t
include Support.Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Support.Hash.HASH with type t := t
val hash : t -> int

hash e is the hash code computed for e.

If e1 and e2 as equal, then hash e1 and hash e2 must be equal.

include Support.Show.SHOW with type t := t
val pp : Support.Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Syncom/Id/CompCotyp/Hashtbl/index.html b/beluga/Syncom/Id/CompCotyp/Hashtbl/index.html deleted file mode 100644 index 7984f3f86..000000000 --- a/beluga/Syncom/Id/CompCotyp/Hashtbl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hashtbl (beluga.Syncom.Id.CompCotyp.Hashtbl)

Module CompCotyp.Hashtbl

type key = t
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Support.Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Syncom/Id/CompCotyp/index.html b/beluga/Syncom/Id/CompCotyp/index.html deleted file mode 100644 index 2863b0e87..000000000 --- a/beluga/Syncom/Id/CompCotyp/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -CompCotyp (beluga.Syncom.Id.CompCotyp)

Module Id.CompCotyp

type t

Constructors

val of_int : int -> t

Destructors

val to_int : t -> int

Collections

module Set : Stdlib.Set.S with type elt = t
module Map : Stdlib.Map.S with type key = t
module Hashtbl : Support.Hashtbl.S with type key = t

Instances

include Support.Eq.EQ with type t := t
include Support.Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Support.Hash.HASH with type t := t
val hash : t -> int

hash e is the hash code computed for e.

If e1 and e2 as equal, then hash e1 and hash e2 must be equal.

include Support.Show.SHOW with type t := t
val pp : Support.Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Syncom/Id/CompDest/Hashtbl/index.html b/beluga/Syncom/Id/CompDest/Hashtbl/index.html deleted file mode 100644 index a7a83237d..000000000 --- a/beluga/Syncom/Id/CompDest/Hashtbl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hashtbl (beluga.Syncom.Id.CompDest.Hashtbl)

Module CompDest.Hashtbl

type key = t
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Support.Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Syncom/Id/CompDest/index.html b/beluga/Syncom/Id/CompDest/index.html deleted file mode 100644 index ffbe70c4f..000000000 --- a/beluga/Syncom/Id/CompDest/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -CompDest (beluga.Syncom.Id.CompDest)

Module Id.CompDest

type t

Constructors

val of_int : int -> t

Destructors

val to_int : t -> int

Collections

module Set : Stdlib.Set.S with type elt = t
module Map : Stdlib.Map.S with type key = t
module Hashtbl : Support.Hashtbl.S with type key = t

Instances

include Support.Eq.EQ with type t := t
include Support.Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Support.Hash.HASH with type t := t
val hash : t -> int

hash e is the hash code computed for e.

If e1 and e2 as equal, then hash e1 and hash e2 must be equal.

include Support.Show.SHOW with type t := t
val pp : Support.Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Syncom/Id/CompTyp/Hashtbl/index.html b/beluga/Syncom/Id/CompTyp/Hashtbl/index.html deleted file mode 100644 index eedf4e656..000000000 --- a/beluga/Syncom/Id/CompTyp/Hashtbl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hashtbl (beluga.Syncom.Id.CompTyp.Hashtbl)

Module CompTyp.Hashtbl

type key = t
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Support.Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Syncom/Id/CompTyp/index.html b/beluga/Syncom/Id/CompTyp/index.html deleted file mode 100644 index 691b970a1..000000000 --- a/beluga/Syncom/Id/CompTyp/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -CompTyp (beluga.Syncom.Id.CompTyp)

Module Id.CompTyp

type t

Constructors

val of_int : int -> t

Destructors

val to_int : t -> int

Collections

module Set : Stdlib.Set.S with type elt = t
module Map : Stdlib.Map.S with type key = t
module Hashtbl : Support.Hashtbl.S with type key = t

Instances

include Support.Eq.EQ with type t := t
include Support.Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Support.Hash.HASH with type t := t
val hash : t -> int

hash e is the hash code computed for e.

If e1 and e2 as equal, then hash e1 and hash e2 must be equal.

include Support.Show.SHOW with type t := t
val pp : Support.Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Syncom/Id/CompTypdef/Hashtbl/index.html b/beluga/Syncom/Id/CompTypdef/Hashtbl/index.html deleted file mode 100644 index ee4670fdd..000000000 --- a/beluga/Syncom/Id/CompTypdef/Hashtbl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hashtbl (beluga.Syncom.Id.CompTypdef.Hashtbl)

Module CompTypdef.Hashtbl

type key = t
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Support.Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Syncom/Id/CompTypdef/index.html b/beluga/Syncom/Id/CompTypdef/index.html deleted file mode 100644 index fc3c7e171..000000000 --- a/beluga/Syncom/Id/CompTypdef/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -CompTypdef (beluga.Syncom.Id.CompTypdef)

Module Id.CompTypdef

type t

Constructors

val of_int : int -> t

Destructors

val to_int : t -> int

Collections

module Set : Stdlib.Set.S with type elt = t
module Map : Stdlib.Map.S with type key = t
module Hashtbl : Support.Hashtbl.S with type key = t

Instances

include Support.Eq.EQ with type t := t
include Support.Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Support.Hash.HASH with type t := t
val hash : t -> int

hash e is the hash code computed for e.

If e1 and e2 as equal, then hash e1 and hash e2 must be equal.

include Support.Show.SHOW with type t := t
val pp : Support.Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Syncom/Id/Module/Hashtbl/index.html b/beluga/Syncom/Id/Module/Hashtbl/index.html deleted file mode 100644 index de19a2ff4..000000000 --- a/beluga/Syncom/Id/Module/Hashtbl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hashtbl (beluga.Syncom.Id.Module.Hashtbl)

Module Module.Hashtbl

type key = t
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Support.Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Syncom/Id/Module/index.html b/beluga/Syncom/Id/Module/index.html deleted file mode 100644 index 5143eb927..000000000 --- a/beluga/Syncom/Id/Module/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Module (beluga.Syncom.Id.Module)

Module Id.Module

type t

Constructors

val of_int : int -> t

Destructors

val to_int : t -> int

Collections

module Set : Stdlib.Set.S with type elt = t
module Map : Stdlib.Map.S with type key = t
module Hashtbl : Support.Hashtbl.S with type key = t

Instances

include Support.Eq.EQ with type t := t
include Support.Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Support.Hash.HASH with type t := t
val hash : t -> int

hash e is the hash code computed for e.

If e1 and e2 as equal, then hash e1 and hash e2 must be equal.

include Support.Show.SHOW with type t := t
val pp : Support.Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Syncom/Id/MutualGroup/Hashtbl/index.html b/beluga/Syncom/Id/MutualGroup/Hashtbl/index.html deleted file mode 100644 index 7ab121670..000000000 --- a/beluga/Syncom/Id/MutualGroup/Hashtbl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hashtbl (beluga.Syncom.Id.MutualGroup.Hashtbl)

Module MutualGroup.Hashtbl

type key = t
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Support.Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Syncom/Id/MutualGroup/index.html b/beluga/Syncom/Id/MutualGroup/index.html deleted file mode 100644 index 4c9d04b1d..000000000 --- a/beluga/Syncom/Id/MutualGroup/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -MutualGroup (beluga.Syncom.Id.MutualGroup)

Module Id.MutualGroup

type t

Constructors

val of_int : int -> t

Destructors

val to_int : t -> int

Collections

module Set : Stdlib.Set.S with type elt = t
module Map : Stdlib.Map.S with type key = t
module Hashtbl : Support.Hashtbl.S with type key = t

Instances

include Support.Eq.EQ with type t := t
include Support.Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Support.Hash.HASH with type t := t
val hash : t -> int

hash e is the hash code computed for e.

If e1 and e2 as equal, then hash e1 and hash e2 must be equal.

include Support.Show.SHOW with type t := t
val pp : Support.Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Syncom/Id/Prog/Hashtbl/index.html b/beluga/Syncom/Id/Prog/Hashtbl/index.html deleted file mode 100644 index 06c115bb3..000000000 --- a/beluga/Syncom/Id/Prog/Hashtbl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hashtbl (beluga.Syncom.Id.Prog.Hashtbl)

Module Prog.Hashtbl

type key = t
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Support.Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Syncom/Id/Prog/index.html b/beluga/Syncom/Id/Prog/index.html deleted file mode 100644 index d283f2143..000000000 --- a/beluga/Syncom/Id/Prog/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Prog (beluga.Syncom.Id.Prog)

Module Id.Prog

type t

Constructors

val of_int : int -> t

Destructors

val to_int : t -> int

Collections

module Set : Stdlib.Set.S with type elt = t
module Map : Stdlib.Map.S with type key = t
module Hashtbl : Support.Hashtbl.S with type key = t

Instances

include Support.Eq.EQ with type t := t
include Support.Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Support.Hash.HASH with type t := t
val hash : t -> int

hash e is the hash code computed for e.

If e1 and e2 as equal, then hash e1 and hash e2 must be equal.

include Support.Show.SHOW with type t := t
val pp : Support.Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Syncom/Id/Schema/Hashtbl/index.html b/beluga/Syncom/Id/Schema/Hashtbl/index.html deleted file mode 100644 index 320e192b2..000000000 --- a/beluga/Syncom/Id/Schema/Hashtbl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hashtbl (beluga.Syncom.Id.Schema.Hashtbl)

Module Schema.Hashtbl

type key = t
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Support.Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Syncom/Id/Schema/index.html b/beluga/Syncom/Id/Schema/index.html deleted file mode 100644 index 92d89cbd9..000000000 --- a/beluga/Syncom/Id/Schema/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Schema (beluga.Syncom.Id.Schema)

Module Id.Schema

type t

Constructors

val of_int : int -> t

Destructors

val to_int : t -> int

Collections

module Set : Stdlib.Set.S with type elt = t
module Map : Stdlib.Map.S with type key = t
module Hashtbl : Support.Hashtbl.S with type key = t

Instances

include Support.Eq.EQ with type t := t
include Support.Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Support.Hash.HASH with type t := t
val hash : t -> int

hash e is the hash code computed for e.

If e1 and e2 as equal, then hash e1 and hash e2 must be equal.

include Support.Show.SHOW with type t := t
val pp : Support.Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Syncom/Id/Term/Hashtbl/index.html b/beluga/Syncom/Id/Term/Hashtbl/index.html deleted file mode 100644 index 426ec0b7f..000000000 --- a/beluga/Syncom/Id/Term/Hashtbl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hashtbl (beluga.Syncom.Id.Term.Hashtbl)

Module Term.Hashtbl

type key = t
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Support.Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Syncom/Id/Term/index.html b/beluga/Syncom/Id/Term/index.html deleted file mode 100644 index f478f5254..000000000 --- a/beluga/Syncom/Id/Term/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Term (beluga.Syncom.Id.Term)

Module Id.Term

type t

Constructors

val of_int : int -> t

Destructors

val to_int : t -> int

Collections

module Set : Stdlib.Set.S with type elt = t
module Map : Stdlib.Map.S with type key = t
module Hashtbl : Support.Hashtbl.S with type key = t

Instances

include Support.Eq.EQ with type t := t
include Support.Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Support.Hash.HASH with type t := t
val hash : t -> int

hash e is the hash code computed for e.

If e1 and e2 as equal, then hash e1 and hash e2 must be equal.

include Support.Show.SHOW with type t := t
val pp : Support.Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Syncom/Id/Typ/Hashtbl/index.html b/beluga/Syncom/Id/Typ/Hashtbl/index.html deleted file mode 100644 index 09e66923a..000000000 --- a/beluga/Syncom/Id/Typ/Hashtbl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hashtbl (beluga.Syncom.Id.Typ.Hashtbl)

Module Typ.Hashtbl

type key = t
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Support.Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Syncom/Id/Typ/index.html b/beluga/Syncom/Id/Typ/index.html deleted file mode 100644 index 6389ba99f..000000000 --- a/beluga/Syncom/Id/Typ/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Typ (beluga.Syncom.Id.Typ)

Module Id.Typ

type t

Constructors

val of_int : int -> t

Destructors

val to_int : t -> int

Collections

module Set : Stdlib.Set.S with type elt = t
module Map : Stdlib.Map.S with type key = t
module Hashtbl : Support.Hashtbl.S with type key = t

Instances

include Support.Eq.EQ with type t := t
include Support.Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Support.Hash.HASH with type t := t
val hash : t -> int

hash e is the hash code computed for e.

If e1 and e2 as equal, then hash e1 and hash e2 must be equal.

include Support.Show.SHOW with type t := t
val pp : Support.Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Syncom/Id/index.html b/beluga/Syncom/Id/index.html deleted file mode 100644 index f2f0ed28a..000000000 --- a/beluga/Syncom/Id/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Id (beluga.Syncom.Id)

Module Syncom.Id

Constant IDs for referring to constants in the global mutable store.

These are essentially primary keys in a relational database.

module type ID = sig ... end

Definition of IDs as an abstract integer.

module Module : ID
module Typ : ID
module Term : ID
module Schema : ID
module CompTyp : ID
module CompCotyp : ID
module CompConst : ID
module CompDest : ID
module CompTypdef : ID
module Prog : ID
module MutualGroup : ID
type module_id = Module.t
type cid_typ = Typ.t

A constant identifier for types

type cid_term = Term.t

A constant identifier for terms

type cid_schema = Schema.t

A constant identifier for schemas

type cid_comp_typ = CompTyp.t

A constant identifier for computation-level data-types

type cid_comp_cotyp = CompCotyp.t

A constant identifier for computation-level codata-types

type cid_comp_const = CompConst.t

A constant identifier for computation-level constructors

type cid_comp_dest = CompDest.t

A constant identifier for computation-level destructors

type cid_comp_typdef = CompTypdef.t

A constant identifier for type synonyms.

type cid_prog = Prog.t

A constant identifier for recursive computations/programs

type cid_mutual_group = MutualGroup.t

A constant identifier for a group of mutually proven theorems.

type offset = int

An offset to be used during shifting for a DeBruijn variable representation

type var = int

The DeBruijn representation of a variable

Comparisons

val cid_typ_equal : cid_typ -> cid_typ -> bool
val cid_term_equal : cid_term -> cid_term -> bool
val cid_schema_equal : cid_schema -> cid_schema -> bool
val cid_comp_typ_equal : cid_comp_typ -> cid_comp_typ -> bool
val cid_comp_cotyp_equal : cid_comp_cotyp -> cid_comp_cotyp -> bool
val cid_comp_const_equal : cid_comp_const -> cid_comp_const -> bool
val cid_comp_dest_equal : cid_comp_dest -> cid_comp_dest -> bool
val cid_comp_typdef_equal : cid_comp_typdef -> cid_comp_typdef -> bool
val cid_prog_equal : cid_prog -> cid_prog -> bool
val cid_mutual_group_equal : cid_mutual_group -> cid_mutual_group -> bool
diff --git a/beluga/Syncom/Id/module-type-ID/Hashtbl/index.html b/beluga/Syncom/Id/module-type-ID/Hashtbl/index.html deleted file mode 100644 index 57eabbee1..000000000 --- a/beluga/Syncom/Id/module-type-ID/Hashtbl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hashtbl (beluga.Syncom.Id.ID.Hashtbl)

Module ID.Hashtbl

type key = t
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Support.Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Syncom/Id/module-type-ID/index.html b/beluga/Syncom/Id/module-type-ID/index.html deleted file mode 100644 index 2a9b23ceb..000000000 --- a/beluga/Syncom/Id/module-type-ID/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -ID (beluga.Syncom.Id.ID)

Module type Id.ID

Definition of IDs as an abstract integer.

This prevents mixing up the various ID types.

type t

Constructors

val of_int : int -> t

Destructors

val to_int : t -> int

Collections

module Set : Stdlib.Set.S with type elt = t
module Map : Stdlib.Map.S with type key = t
module Hashtbl : Support.Hashtbl.S with type key = t

Instances

include Support.Eq.EQ with type t := t
include Support.Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Support.Hash.HASH with type t := t
val hash : t -> int

hash e is the hash code computed for e.

If e1 and e2 as equal, then hash e1 and hash e2 must be equal.

include Support.Show.SHOW with type t := t
val pp : Support.Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Syncom/Identifier/Hashtbl/index.html b/beluga/Syncom/Identifier/Hashtbl/index.html deleted file mode 100644 index 01c3aa088..000000000 --- a/beluga/Syncom/Identifier/Hashtbl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hashtbl (beluga.Syncom.Identifier.Hashtbl)

Module Identifier.Hashtbl

type key = t
type !'a t
val create : int -> 'a t
val clear : 'a t -> unit
val reset : 'a t -> unit
val copy : 'a t -> 'a t
val add : 'a t -> key -> 'a -> unit
val remove : 'a t -> key -> unit
val find : 'a t -> key -> 'a
val find_opt : 'a t -> key -> 'a option
val find_all : 'a t -> key -> 'a list
val replace : 'a t -> key -> 'a -> unit
val mem : 'a t -> key -> bool
val iter : (key -> 'a -> unit) -> 'a t -> unit
val filter_map_inplace : (key -> 'a -> 'a option) -> 'a t -> unit
val fold : (key -> 'a -> 'b -> 'b) -> 'a t -> 'b -> 'b
val length : 'a t -> int
val stats : 'a t -> Support.Hashtbl.statistics
val to_seq : 'a t -> (key * 'a) Stdlib.Seq.t
val to_seq_keys : 'a t -> key Stdlib.Seq.t
val to_seq_values : 'a t -> 'a Stdlib.Seq.t
val add_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val replace_seq : 'a t -> (key * 'a) Stdlib.Seq.t -> unit
val of_seq : (key * 'a) Stdlib.Seq.t -> 'a t
diff --git a/beluga/Syncom/Identifier/index.html b/beluga/Syncom/Identifier/index.html deleted file mode 100644 index 32d5e5e3a..000000000 --- a/beluga/Syncom/Identifier/index.html +++ /dev/null @@ -1,4 +0,0 @@ - -Identifier (beluga.Syncom.Identifier)

Module Syncom.Identifier

String identifiers.

An identifier is a string with a location. The string may contain a '#' prefix for parameter variables or a '$' prefix for substitution variables.

Identifiers are totally ordered for efficient lookups in map data structures.

For identifiers prefixed by modules, see Qualified_identifier.

type t

Constructors

val make : ?location:Location.t -> Support.String.t -> t

Destructors

val location : t -> Location.t
val name : t -> Support.String.t

Exceptions

exception Unbound_identifier of t

Collections

module Set : Stdlib.Set.S with type elt = t
module Map : Stdlib.Map.S with type key = t
module Hashtbl : Support.Hashtbl.S with type key = t

Lists

Instances

include Support.Eq.EQ with type t := t
include Support.Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Support.Show.SHOW with type t := t
val pp : Support.Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

diff --git a/beluga/Syncom/Inductivity/index.html b/beluga/Syncom/Inductivity/index.html deleted file mode 100644 index 4bbeafcc4..000000000 --- a/beluga/Syncom/Inductivity/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Inductivity (beluga.Syncom.Inductivity)

Module Syncom.Inductivity

Annotations for parameters and variables generating induction hypotheses.

type t = private
  1. | Inductive
    (*

    The annotation for inductive parameters.

    *)
  2. | Not_inductive
    (*

    The annotation for non-inductive parameters.

    *)

The type of annotation for inductive or not inductive parameters.

An inductive parameter generates induction hypotheses when split on.

Constructors

val not_inductive : t

not_inductive is Not_inductive.

val inductive : t

inductive is Inductive.

Predicates and comparisons

val max : t -> t -> t

max ind1 ind2 is Inductive if at least one of ind1 and ind2 is Inductive. Otherwise, Not_inductive is returned.

val min : t -> t -> t

min ind1 ind2 is Not_inductive if at least one of ind1 and ind2 is Not_inductive. Otherwise, Inductive is returned.

val is_not_inductive : t -> bool

is_not_inductive ind is true if and only if ind is Not_inductive.

val is_inductive : t -> bool

is_inductive ind is true if and only if ind is Inductive.

Instances

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Syncom/Location/Ord_by_start/index.html b/beluga/Syncom/Location/Ord_by_start/index.html deleted file mode 100644 index 8ab76bee7..000000000 --- a/beluga/Syncom/Location/Ord_by_start/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Ord_by_start (beluga.Syncom.Location.Ord_by_start)

Module Location.Ord_by_start

type t = t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Syncom/Location/Ord_by_stop/index.html b/beluga/Syncom/Location/Ord_by_stop/index.html deleted file mode 100644 index 3db58c8fe..000000000 --- a/beluga/Syncom/Location/Ord_by_stop/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Ord_by_stop (beluga.Syncom.Location.Ord_by_stop)

Module Location.Ord_by_stop

type t = t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Syncom/Location/index.html b/beluga/Syncom/Location/index.html deleted file mode 100644 index fe17edcfe..000000000 --- a/beluga/Syncom/Location/index.html +++ /dev/null @@ -1,10 +0,0 @@ - -Location (beluga.Syncom.Location)

Module Syncom.Location

Character position ranges in source files.

A parser is typically responsible for constructing locations using positions generated by the lexer.

type t

The type of range over character positions in a source file.

Constructors

val ghost : t

ghost is the null location used for AST nodes having no correspondence to a source file.

val initial : string -> t

initial filename is the location at the beginning of the file with name filename.

val make : - filename:string -> - start_position:Position.t -> - stop_position:Position.t -> - t

make ~filename ~start_position ~stop_position is the non-ghost location starting at the character position start_position inclusively and ending at the character position stop_position exclusively in the file at filename.

val join : t -> t -> t

join l1 l2 is the smallest location that contains l1 and l2.

It is assumed that filename l1 = filename l2.

Ghost locations are left and right identities of join, meaning that:

  • If is_ghost l1, then join l1 l2 = l2.
  • If is_ghost l2, then join l1 l2 = l1.
val join_all : t -> t Support.List.t -> t

join_all init ls is each location in ls joined together, additionally with init.

val join_all_contramap : ('a -> t) -> t -> 'a Support.List.t -> t

join_all_contramap f init xs is each location contramapped by f from xs. joined together, additionally with init.

If xs = [x1; x2; ...; xn], then join_all_contramap f init xs = join_all init [f x1; f x2; ...; f xn].

val join_all1 : t Support.List1.t -> t
val join_all1_contramap : ('a -> t) -> 'a Support.List1.t -> t
val join_all2_contramap : ('a -> t) -> 'a Support.List2.t -> t
val start_position_as_location : t -> t
val stop_position_as_location : t -> t
val set_filename : string -> t -> t
val set_start : Position.t -> t -> t
val set_stop : Position.t -> t -> t
val set_start_line : int -> t -> t

set_start_line line location is location with its start line set to line. The start position's beginning of line and offset are not modified, so the output location may be invalid. This should only be used with locations that do not point to files, like ghost locations.

val set_stop_line : int -> t -> t

set_stop_line line location is like set_start_line line location but for the location's stop position.

Destructors

val filename : t -> string
val start_position : t -> Position.t
val stop_position : t -> Position.t
val start_offset : t -> int
val stop_offset : t -> int
val start_bol : t -> int
val stop_bol : t -> int
val start_line : t -> int
val stop_line : t -> int
val start_column : t -> int
val stop_column : t -> int
val spanned_offsets : t -> int

spanned_offsets location is stop_offset location - start_offset location.

Predicates and Comparisons

val is_ghost : t -> bool
module Ord_by_start : Support.Ord.ORD with type t = t
val compare_start : t -> t -> int
module Ord_by_stop : Support.Ord.ORD with type t = t
val compare_stop : t -> t -> int

Printing

val print : Support.Format.formatter -> t -> unit

Prints `<filename>, line <n>, column <n>'. Suitable for proper errors.

val pp : Support.Format.formatter -> t -> unit
val print_short : Support.Format.formatter -> t -> unit

Prints `line <n>, column <n>'. More suitable for debug prints.

val print_span_short : Support.Format.formatter -> t -> unit

Prints `<n>.<n> - <n>.<n>' indicating start and stop positions.

Interoperability

val make_from_lexing_positions : - filename:string -> - start_position:Stdlib.Lexing.position -> - stop_position:Stdlib.Lexing.position -> - t
val start_to_lexing_position : t -> Stdlib.Lexing.position
val stop_to_lexing_position : t -> Stdlib.Lexing.position
val to_lexing_positions : t -> Stdlib.Lexing.position * Stdlib.Lexing.position

Instances

Structural equality instance.

include Support.Eq.EQ with type t := t

Lexicographical ordering instance by filename, start position and stop position in that sequence.

include Support.Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Syncom/Name/index.html b/beluga/Syncom/Name/index.html deleted file mode 100644 index b3d353692..000000000 --- a/beluga/Syncom/Name/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Name (beluga.Syncom.Name)

Module Syncom.Name

type t

A `name' represents the original named representation of a variable. These are primarily used in parsing and pretty- printing. Names should never be constructed directly. See `mk_name'.

type max_usage = [
  1. | `used of int option
  2. | `unused
]
val base_name : t -> string
val get_modules : t -> string list
val mk_blank : Location.t option -> t

Generate a blank name (underscore).

val inc_hint_cnt : int option -> int option
val gen_fresh_name : t list -> t -> t
val location : t -> Location.t

Retrieves the location of this identifier. For identifiers generated internally, this will be a ghost.

val max_usage : t list -> string -> max_usage

Finds the maximum number used for the given name hint in the given context. Returns None if the name hint is unused.

val modify_number : (int option -> int option) -> t -> t

Change the number of a variable.

val mk_bvar_name : (unit -> string) option -> t

mk_bvar_name vGen_opt generates a fresh name for an LF-bound variable.

val mk_mvar_name : (unit -> string) option -> t

mk_mvar_name vGen_opt generates a fresh name for a meta-variable.

val mk_svar_name : (unit -> string) option -> t

mk_svar_name vGen_opt generates a fresh name for a substitution variable.

val mk_pvar_name : (unit -> string) option -> t

mk_pvar_name vGen_opt generates a fresh name for a parameter variable.

val mk_no_name : unit -> t

mk_no_name () generates a fresh name.

val mk_some_name : t -> t

mk_some_name name generates a fresh name derived from name.

val mk_some_string : string -> t

mk_some_name s generates a fresh name derived from s.

val make_from_identifier : Identifier.t -> t

make_from_identifier identifier constructs a name from identifier. This should be deprecated once the Name module is fully replaced with Identifier and Qualified_identifier.

val make_from_qualified_identifier : Qualified_identifier.t -> t

make_from_qualified_identifier identifier constructs a name from identifier. This should be deprecated once the Name module is fully replaced with Identifier and Qualified_identifier.

val to_identifier : t -> Identifier.t

to_identifier name is name as an Identifier.t.

It is assumed that get_module name = [].

val string_of_name : t -> string
val pp_list : Support.Format.formatter -> t list -> unit

Prints a list of space-separated names. This printer does not open a box!

Instances

Decide whether two names represent the same thing. This simply compares the string representations of the names. This corresponds with a user's intuition about when names are equal, and ignores all name generation hinting built in to the t type.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Support.Show.SHOW with type t := t
val pp : Support.Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

include Support.Hash.HASH with type t := t
val hash : t -> int

hash e is the hash code computed for e.

If e1 and e2 as equal, then hash e1 and hash e2 must be equal.

diff --git a/beluga/Syncom/Operator/index.html b/beluga/Syncom/Operator/index.html deleted file mode 100644 index a8d44a984..000000000 --- a/beluga/Syncom/Operator/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Operator (beluga.Syncom.Operator)

Module Syncom.Operator

Description of user-defined operators.

type t

The type of description for infix, prefix and postfix operators.

Destructors

val arity : t -> int

arity operator is the number of arguments operator is expected to be applied with.

  • If fixity operator = Fixity.Prefix, then arity operator = 1.
  • If fixity operator = Fixity.Infix, then arity operator = 2.
  • If fixity operator = Fixity.Postfix, then arity operator = 1.
val precedence : t -> int

precedence operator is the user-defined value for parsing the order of operations when operands and arguments are juxtaposed.

If precedence o1 < precedence o2, then o2 precedes o1 such that a o1 b o2 c is parsed as a o1 (b o2 c), where a, b and c are operands.

val fixity : t -> Fixity.t

fixity operator is the fixity of operator.

val associativity : t -> Associativity.t

associativity operator is the associativity of operator.

  • If fixity operator = Fixity.Prefix, then associativity operator = Associativity.Right_associative.
  • If fixity operator = Fixity.Postfix, then associativity operator = Associativity.Left_associative.

Constructors

val make_prefix : precedence:int -> t

make_prefix ~precedence is a description for a prefix operator with ~precedence.

val make_infix : associativity:Associativity.t -> precedence:int -> t

make_infix ~associativity ~precedence is a description for an infix operator with ~associativity and ~precedence.

val make_postfix : precedence:int -> t

make_postfix ~precedence is a description for a postfix operator with ~precedence.

Predicates

val is_prefix : t -> bool

is_prefix operator is true if and only if fixity operator = Fixity.Prefix.

val is_infix : t -> bool

is_infix operator is true if and only if fixity operator = Fixity.Infix.

val is_postfix : t -> bool

is_postfix operator is true if and only if fixity operator = Fixity.Postfix.

val is_unary : t -> bool

is_unary operator is true if and only if arity operator = 1.

val is_binary : t -> bool

is_binary operator is true if and only if arity operator = 2.

val is_left_associative : t -> bool

is_left_associative operator is true if and only if associativity operator = Associativity.Left_associative.

val is_right_associative : t -> bool

is_right_associative operator is true if and only if associativity operator = Associativity.Right_associative.

val is_non_associative : t -> bool

is_non_associative operator is true if and only if associativity operator = Associativity.Non_associative.

Instances

Structural equality instance. That is, operators are equal if they have the same arity, precedence, fixity and associativity.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Syncom/Parenthesizer/Make/argument-1-Format_state/index.html b/beluga/Syncom/Parenthesizer/Make/argument-1-Format_state/index.html deleted file mode 100644 index cfd8bea2e..000000000 --- a/beluga/Syncom/Parenthesizer/Make/argument-1-Format_state/index.html +++ /dev/null @@ -1,108 +0,0 @@ - -Format_state (beluga.Syncom.Parenthesizer.Make.Format_state)

Parameter Make.Format_state

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val pp_flush : state -> Stdlib.Unit.t

pp_flush state is analogous to Format.pp_print_flush.

val pp_newline : state -> Stdlib.Unit.t

pp_newline state is analogous to Format.pp_print_newline.

val pp_nop : state -> Stdlib.Unit.t

pp_nop state is (). This is useful to signal that nothing should be printed for some execution branch.

val pp_cut : state -> Stdlib.Unit.t

pp_cut state is analogous to Format.pp_print_cut.

val pp_space : state -> Stdlib.Unit.t

pp_space state is analogous to Format.pp_print_space. Note that this is a possibly breaking space, meaning that a newline may be printed at this point.

val pp_non_breaking_space : state -> Stdlib.Unit.t

pp_non_breaking_space state pretty-prints a non-breaking space, meaning that the printer does not insert break directives to that space.

val pp_break : state -> Support.Int.t -> Support.Int.t -> Stdlib.Unit.t

pp_break state width offset is analogous to Format.pp_print_break.

val pp_as : state -> Support.Int.t -> Support.String.t -> Stdlib.Unit.t

pp_as state size is analogous to Format.pp_print_as to pretty-print a string as if it were of length size. This is useful to pretty-print UTF-8 encoded strings of known codepoint count, or to print a string as if it isn't there, like for HTML tags or ASCII escape sequences.

val pp_box : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_box state ?(indent = 0) f evaluates f state in a compacting pretty-printing box wth offset indent in the formatter (see Format.pp_open_box). The box is opened before f state, and closed afterwards.

val pp_hbox : state -> (state -> Stdlib.Unit.t) -> Stdlib.Unit.t

pp_hbox state f evaluates f state in a horizontal pretty-printing box (see Format.pp_open_hbox). The box is opened before f state, and closed afterwards.

val pp_vbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_vbox state ?(indent = 0) f evaluates f state in a vertical pretty-printing box with offset indent (see Format.pp_open_vbox). The box is opened before f state, and closed afterwards.

val pp_hvbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_hovbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_bool : state -> Stdlib.Bool.t -> Stdlib.Unit.t
val pp_int : state -> Support.Int.t -> Stdlib.Unit.t
val pp_float : state -> Stdlib.Float.t -> Stdlib.Unit.t
val pp_char : state -> Stdlib.Char.t -> Stdlib.Unit.t
val pp_string : state -> Support.String.t -> Stdlib.Unit.t
val pp_option : - state -> - ?none:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val pp_list : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t
val pp_list1 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val pp_list2 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val pp_text : state -> Support.String.t -> Stdlib.Unit.t
val pp_utf_8 : state -> Support.String.t -> Stdlib.Unit.t
val pp_utf_8_text : state -> Support.String.t -> Stdlib.Unit.t
diff --git a/beluga/Syncom/Parenthesizer/Make/argument-2-Precedence/index.html b/beluga/Syncom/Parenthesizer/Make/argument-2-Precedence/index.html deleted file mode 100644 index a8f7f28d0..000000000 --- a/beluga/Syncom/Parenthesizer/Make/argument-2-Precedence/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Precedence (beluga.Syncom.Parenthesizer.Make.Precedence)

Parameter Make.Precedence

type t

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Syncom/Parenthesizer/Make/index.html b/beluga/Syncom/Parenthesizer/Make/index.html deleted file mode 100644 index da041463e..000000000 --- a/beluga/Syncom/Parenthesizer/Make/index.html +++ /dev/null @@ -1,148 +0,0 @@ - -Make (beluga.Syncom.Parenthesizer.Make)

Module Parenthesizer.Make

Parameters

Signature

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Format_state.state
type state = Format_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
type precedence = Precedence.t
val parenthesize_term_of_lesser_precedence : - state -> - (state -> 'a -> precedence) -> - parent_precedence:precedence -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a -> - Stdlib.Unit.t

parenthesize_term_of_lesser_precedence is a parenthesizing formatter that adds parentheses to the term if it has a strictly lesser precedence than that of its parent node in the AST.

val parenthesize_term_of_lesser_than_or_equal_precedence : - state -> - (state -> 'a -> precedence) -> - parent_precedence:precedence -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a -> - Stdlib.Unit.t

parenthesize_term_of_lesser_than_or_equal_precedence is a parenthesizing formatter that adds parentheses to the term if it has a lesser than or equal precedence with the precedence of its parent node in the AST.

val parenthesize_left_argument_left_associative_operator : - state -> - (state -> 'a -> precedence) -> - parent_precedence:precedence -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a -> - Stdlib.Unit.t

parenthesize_left_argument_left_associative_operator is a parenthesizing formatter for a term appearing as a left argument to an infix left-associative operator.

val parenthesize_right_argument_left_associative_operator : - state -> - (state -> 'a -> precedence) -> - parent_precedence:precedence -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a -> - Stdlib.Unit.t

parenthesize_right_argument_left_associative_operator is a parenthesizing formatter for a term appearing as a right argument to an infix left-associative operator.

val parenthesize_left_argument_right_associative_operator : - state -> - (state -> 'a -> precedence) -> - parent_precedence:precedence -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a -> - Stdlib.Unit.t

parenthesize_left_argument_right_associative_operator is a parenthesizing formatter for a term appearing as a left argument to an infix right-associative operator.

val parenthesize_right_argument_right_associative_operator : - state -> - (state -> 'a -> precedence) -> - parent_precedence:precedence -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a -> - Stdlib.Unit.t

parenthesize_right_argument_right_associative_operator is a parenthesizing formatter for a term appearing as a right argument to an infix right-associative operator.

val parenthesize_argument_non_associative_operator : - state -> - (state -> 'a -> precedence) -> - parent_precedence:precedence -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a -> - Stdlib.Unit.t

parenthesize_argument_non_associative_operator is a parenthesizing formatter for a term appearing as an argument to an infix non-associative operator.

val parenthesize_argument_prefix_operator : - state -> - (state -> 'a -> precedence) -> - parent_precedence:precedence -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a -> - Stdlib.Unit.t

parenthesize_argument_prefix_operator is a parenthesizing formatter for a term appearing as an argument to a prefix operator.

val parenthesize_argument_postfix_operator : - state -> - (state -> 'a -> precedence) -> - parent_precedence:precedence -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a -> - Stdlib.Unit.t

parenthesize_argument_postfix_operator is a parenthesizing formatter for a term appearing as an argument to a postifx operator.

val pp_application : - state -> - indent:Support.Int.t -> - guard_operator: - (state -> 'applicand -> [ `Operator of Operator.t | `Operand ]) -> - guard_operator_application: - (state -> - 'argument -> - [ `Operator_application of Operator.t - | `Operator of Operator.t - | `Operand ]) -> - precedence_of_applicand:(state -> 'applicand -> precedence) -> - precedence_of_argument:(state -> 'argument -> precedence) -> - pp_applicand:(state -> 'applicand -> Stdlib.Unit.t) -> - pp_argument:(state -> 'argument -> Stdlib.Unit.t) -> - parent_precedence:precedence -> - 'applicand -> - 'argument Support.List1.t -> - Stdlib.Unit.t
pp_application state ~indent ~guard_operator
-  ~guard_operator_application ~precedence_of_applicand
-  ~precedence_of_argument ~pp_applicand ~pp_argument
-  ~parent_precedence applicand arguments

pretty-prints the application of applicand with arguments as a juxtaposition of terms delimited by whitespaces, with minimal parentheses.

This pretty-printer supports applicands having a type different from that of its arguments. This allows for pretty-printing LF type-level applications, which have LF types as applicands and LF terms as arguments.

  • ~guard_operator state applicand is `Operator operator if applicand is an operator, and `Operand otherwise.
  • ~guard_operator_application state argument is `Operator_application operator if argument is the application of an operator, `Operator operator if operator is an operator in forced prefix notation (which requires parentheses), and `Operand otherwise.
  • ~precedence_of_applicand state applicand is the precedence of applicand.
  • ~precedence_of_argument state argument is the precedence of argument.
  • ~pp_applicand state is a pretty-printer for the applicand.
  • ~pp_argument state is a pretty-printer for an argument in the application.
  • ~parent_precedence is the precedence of the AST node parent to applicand and arguments, meaning that it is the precedence of the application.
diff --git a/beluga/Syncom/Parenthesizer/index.html b/beluga/Syncom/Parenthesizer/index.html deleted file mode 100644 index 50786863c..000000000 --- a/beluga/Syncom/Parenthesizer/index.html +++ /dev/null @@ -1,7 +0,0 @@ - -Parenthesizer (beluga.Syncom.Parenthesizer)

Module Syncom.Parenthesizer

Utilities for creating expression pretty-printers with minimal parentheses.

Handling Parentheses

Parentheses are re-introduced during pretty-printing using the precedence ordering specified in the parser. Operator associativities also need to be considered to avoid adding extraneous parentheses.

module type PARENTHESIZER = sig ... end

Module type for stateful helper printers for parenthesizing applications with user-defined operators.

diff --git a/beluga/Syncom/Parenthesizer/module-type-PARENTHESIZER/index.html b/beluga/Syncom/Parenthesizer/module-type-PARENTHESIZER/index.html deleted file mode 100644 index 21a4a62e4..000000000 --- a/beluga/Syncom/Parenthesizer/module-type-PARENTHESIZER/index.html +++ /dev/null @@ -1,147 +0,0 @@ - -PARENTHESIZER (beluga.Syncom.Parenthesizer.PARENTHESIZER)

Module type Parenthesizer.PARENTHESIZER

Module type for stateful helper printers for parenthesizing applications with user-defined operators.

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
type precedence
val parenthesize_term_of_lesser_precedence : - state -> - (state -> 'a -> precedence) -> - parent_precedence:precedence -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a -> - Stdlib.Unit.t

parenthesize_term_of_lesser_precedence is a parenthesizing formatter that adds parentheses to the term if it has a strictly lesser precedence than that of its parent node in the AST.

val parenthesize_term_of_lesser_than_or_equal_precedence : - state -> - (state -> 'a -> precedence) -> - parent_precedence:precedence -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a -> - Stdlib.Unit.t

parenthesize_term_of_lesser_than_or_equal_precedence is a parenthesizing formatter that adds parentheses to the term if it has a lesser than or equal precedence with the precedence of its parent node in the AST.

val parenthesize_left_argument_left_associative_operator : - state -> - (state -> 'a -> precedence) -> - parent_precedence:precedence -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a -> - Stdlib.Unit.t

parenthesize_left_argument_left_associative_operator is a parenthesizing formatter for a term appearing as a left argument to an infix left-associative operator.

val parenthesize_right_argument_left_associative_operator : - state -> - (state -> 'a -> precedence) -> - parent_precedence:precedence -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a -> - Stdlib.Unit.t

parenthesize_right_argument_left_associative_operator is a parenthesizing formatter for a term appearing as a right argument to an infix left-associative operator.

val parenthesize_left_argument_right_associative_operator : - state -> - (state -> 'a -> precedence) -> - parent_precedence:precedence -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a -> - Stdlib.Unit.t

parenthesize_left_argument_right_associative_operator is a parenthesizing formatter for a term appearing as a left argument to an infix right-associative operator.

val parenthesize_right_argument_right_associative_operator : - state -> - (state -> 'a -> precedence) -> - parent_precedence:precedence -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a -> - Stdlib.Unit.t

parenthesize_right_argument_right_associative_operator is a parenthesizing formatter for a term appearing as a right argument to an infix right-associative operator.

val parenthesize_argument_non_associative_operator : - state -> - (state -> 'a -> precedence) -> - parent_precedence:precedence -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a -> - Stdlib.Unit.t

parenthesize_argument_non_associative_operator is a parenthesizing formatter for a term appearing as an argument to an infix non-associative operator.

val parenthesize_argument_prefix_operator : - state -> - (state -> 'a -> precedence) -> - parent_precedence:precedence -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a -> - Stdlib.Unit.t

parenthesize_argument_prefix_operator is a parenthesizing formatter for a term appearing as an argument to a prefix operator.

val parenthesize_argument_postfix_operator : - state -> - (state -> 'a -> precedence) -> - parent_precedence:precedence -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a -> - Stdlib.Unit.t

parenthesize_argument_postfix_operator is a parenthesizing formatter for a term appearing as an argument to a postifx operator.

val pp_application : - state -> - indent:Support.Int.t -> - guard_operator: - (state -> 'applicand -> [ `Operator of Operator.t | `Operand ]) -> - guard_operator_application: - (state -> - 'argument -> - [ `Operator_application of Operator.t - | `Operator of Operator.t - | `Operand ]) -> - precedence_of_applicand:(state -> 'applicand -> precedence) -> - precedence_of_argument:(state -> 'argument -> precedence) -> - pp_applicand:(state -> 'applicand -> Stdlib.Unit.t) -> - pp_argument:(state -> 'argument -> Stdlib.Unit.t) -> - parent_precedence:precedence -> - 'applicand -> - 'argument Support.List1.t -> - Stdlib.Unit.t
pp_application state ~indent ~guard_operator
-  ~guard_operator_application ~precedence_of_applicand
-  ~precedence_of_argument ~pp_applicand ~pp_argument
-  ~parent_precedence applicand arguments

pretty-prints the application of applicand with arguments as a juxtaposition of terms delimited by whitespaces, with minimal parentheses.

This pretty-printer supports applicands having a type different from that of its arguments. This allows for pretty-printing LF type-level applications, which have LF types as applicands and LF terms as arguments.

  • ~guard_operator state applicand is `Operator operator if applicand is an operator, and `Operand otherwise.
  • ~guard_operator_application state argument is `Operator_application operator if argument is the application of an operator, `Operator operator if operator is an operator in forced prefix notation (which requires parentheses), and `Operand otherwise.
  • ~precedence_of_applicand state applicand is the precedence of applicand.
  • ~precedence_of_argument state argument is the precedence of argument.
  • ~pp_applicand state is a pretty-printer for the applicand.
  • ~pp_argument state is a pretty-printer for an argument in the application.
  • ~parent_precedence is the precedence of the AST node parent to applicand and arguments, meaning that it is the precedence of the application.
diff --git a/beluga/Syncom/Plicity/index.html b/beluga/Syncom/Plicity/index.html deleted file mode 100644 index f4d895c09..000000000 --- a/beluga/Syncom/Plicity/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Plicity (beluga.Syncom.Plicity)

Module Syncom.Plicity

Annotations for implicit or explicit parameters.

type t = private
  1. | Implicit
    (*

    The annotation for implicit parameters.

    *)
  2. | Explicit
    (*

    The annotation for explicit parameters.

    *)

The type of annotation for implicit or explicit parameters.

A parameter is implicit if

  • it was specified by the user as (g : ctx) in the external syntax, or
  • it was generated during reconstruction.

A parameter is explicit if it was specified by the user as {g : ctx} in the external syntax.

Constructors

val implicit : t

implicit is Implicit.

val explicit : t

explicit is Explicit.

Predicates and comparisons

val max : t -> t -> t

max p1 p2 is Explicit if at least one of p1 and p2 is Explicit. Otherwise, Implicit is returned.

val is_explicit : t -> bool

is_explicit p is true if and only if p is Explicit.

val is_implicit : t -> bool

is_implicit p is true if and only if p is Implicit.

Instances

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Syncom/Position/index.html b/beluga/Syncom/Position/index.html deleted file mode 100644 index 6a55009b0..000000000 --- a/beluga/Syncom/Position/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Position (beluga.Syncom.Position)

Module Syncom.Position

Character positions in source files.

The definition for a character position depends on the source file's encoding. A lexer is typically responsible for constructing positions.

type t

The type of character positions in a source file.

Constructors

val make : line:int -> beginning_of_line:int -> offset:int -> t

make ~line ~beginning_of_line ~offset is the source code position at a character distance offset from the initial position of a file. line is the number of the line (starting at 1) in which the character occurs. beginning_of_line is the character distance from the initial position of the file and the beginning of the line.

The character distances have to be computed with respect to the file's encoding. UTF-8, the default encoding for Beluga signatures, is a variable-width encoding, so it is incorrect to always count a byte as a character.

val initial : t

initial is the initial position of a character in a source file, with line initial = 1, beginning_of_line initial = 0 and offset initial = 0.

Destructors

val line : t -> int

line position is the line of position. The line count starts at 1.

val column : t -> int

column position is the column of position, computed from its beginning of line and actual offsets. The column count starts at 1.

val beginning_of_line : t -> int
val offset : t -> int

Instances

Equality of positions by their offsets.

include Support.Eq.EQ with type t := t

Total ordering of positions by their offsets.

include Support.Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

Interoperability

val make_from_lexing_position : Stdlib.Lexing.position -> t

make_from_lexing_position lexing_position is the character position derived from lexing_position using its pos_lnum, pos_bol and pos_cnum.

val to_lexing_position : ?filename:string -> t -> Stdlib.Lexing.position

to_lexing_position ?filename position is the lexing position derived from position with filename as pos_fname if it is defined, and "" otherwise.

diff --git a/beluga/Syncom/Qualified_identifier/index.html b/beluga/Syncom/Qualified_identifier/index.html deleted file mode 100644 index bbb1f4205..000000000 --- a/beluga/Syncom/Qualified_identifier/index.html +++ /dev/null @@ -1,6 +0,0 @@ - -Qualified_identifier (beluga.Syncom.Qualified_identifier)

Module Syncom.Qualified_identifier

Namespaced identifiers.

These are names for referring to bound names nested in namespaces.

Qualified identifiers may be prefixed by the namespaces that need to be opened in order to bring the referred constant in the current scope. The parts of a qualified identifier are delimited by '.'.

For instance, if z is an LF term-level constant, then the following are qualified identifiers:

type t

Constructors

val make : - ?location:Location.t -> - ?namespaces:Identifier.t Support.List.t -> - Identifier.t -> - t

make ?location ?namespaces name is the qualified identifier having location location, namespaces namespaces and name name.

The namespaces in namespaces are expected to be in order of appeareance as in the external syntax. That is, the qualified identifier qid = Util.Nat.z has namespaces qid = ["Util"; "Nat"].

  • If location is unspecified and namespaces = [], then the location is that of name.
  • If location is unspecified and namespaces <> [], then the location is the union of the locations for each module in namespaces and the location of name.
val make_simple : Identifier.t -> t

make_simple name is make name.

val prepend_module : Identifier.t -> t -> t

prepend_module module_ qid is the qualified name derived from qid with module_ prepended to it.

Destructors

val location : t -> Location.t

location qid is the location of qid.

val namespaces : t -> Identifier.t Support.List.t

namespaces qid is the module prefixes of qid.

For instance, if qid = Util.Nat.z, then namespaces qid = ["Util"; "Nat"].

val name : t -> Identifier.t

name qid is the identifier in the tail end position of qid.

For instance, if qid = Util.Nat.z, then name qid = "z".

Exceptions

exception Unbound_qualified_identifier of t
exception Unbound_namespace of t

Interoperability

val from_list1 : Identifier.t Support.List1.t -> t

from_list1 (x1, [x2; x3; ...; xn]) is the qualified identifier with namespaces [x1; x2; ...; x(n-1)] and name xn.

val to_list1 : t -> Identifier.t Support.List1.t

to_list1 id is the non-empty list (x1, [x2; x3; ...; xn]) where [x1; x2; ...; x(n-1)] are the namespaces of id, and xn is the name of id.

Instances

Equality of qualified identifiers by namespaces and names. Locations are ignored.

include Support.Eq.EQ with type t := t

Lexicographical ordering of qualified identifiers.

include Support.Ord.ORD with type t := t
val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

include Support.Show.SHOW with type t := t
val pp : Support.Format.formatter -> t -> unit

pp ppf t emits t pretty-printed to ppf.

val show : t -> string

show t pretty-prints t to a string.

Collections

module Map : Stdlib.Map.S with type key = t
module Set : Stdlib.Set.S with type elt = t
diff --git a/beluga/Synext/CLF/Context/Head/index.html b/beluga/Synext/CLF/Context/Head/index.html deleted file mode 100644 index 479346c16..000000000 --- a/beluga/Synext/CLF/Context/Head/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Head (beluga.Synext.CLF.Context.Head)

Module Context.Head

type t =
  1. | None of {
    1. location : Syncom.Location.t;
    }
  2. | Hole of {
    1. location : Syncom.Location.t;
    }
  3. | Context_variable of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Identifier.t;
    }
diff --git a/beluga/Synext/CLF/Context/Pattern/Head/index.html b/beluga/Synext/CLF/Context/Pattern/Head/index.html deleted file mode 100644 index cbcbdbfb4..000000000 --- a/beluga/Synext/CLF/Context/Pattern/Head/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Head (beluga.Synext.CLF.Context.Pattern.Head)

Module Pattern.Head

type t =
  1. | None of {
    1. location : Syncom.Location.t;
    }
  2. | Hole of {
    1. location : Syncom.Location.t;
    }
  3. | Context_variable of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Identifier.t;
    }
diff --git a/beluga/Synext/CLF/Context/Pattern/index.html b/beluga/Synext/CLF/Context/Pattern/index.html deleted file mode 100644 index cb2345a66..000000000 --- a/beluga/Synext/CLF/Context/Pattern/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Pattern (beluga.Synext.CLF.Context.Pattern)

Module Context.Pattern

External contextual LF context patterns.

module Head : sig ... end
diff --git a/beluga/Synext/CLF/Context/index.html b/beluga/Synext/CLF/Context/index.html deleted file mode 100644 index 8e51cd1eb..000000000 --- a/beluga/Synext/CLF/Context/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Context (beluga.Synext.CLF.Context)

Module CLF.Context

External contextual LF contexts.

In the parser, every untyped variable in head position of a context is disambiguated as a context variable.

{ Context.head; bindings; _ } is the context

  • ^ if head = Head.None and bindings = [].
  • x1 : t1, x2 : t2, ..., xn : tn if head = Head.None and bindings = [("x1", t1); ("x2", t2); ..., ("xn", tn)].
  • _ if head = Head.Hole and bindings = [].
  • _, x1 : t1, x2 : t2, ..., xn : tn if head = Head.Hole and bindings = [("x1", t1); ("x2", t2); ..., ("xn", tn)].
  • g if head = Head.Context_variable { identifier = "g"; _ } and bindings = [].
  • g, x1 : t1, x2 : t2, ..., xn : tn if head = Head.Context_variable { identifier = "g"; _ } and bindings = [("x1", t1); ("x2", t2); ..., ("xn", tn)].
module Head : sig ... end
module Pattern : sig ... end

External contextual LF context patterns.

diff --git a/beluga/Synext/CLF/Substitution/Head/index.html b/beluga/Synext/CLF/Substitution/Head/index.html deleted file mode 100644 index 49878ea0b..000000000 --- a/beluga/Synext/CLF/Substitution/Head/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Head (beluga.Synext.CLF.Substitution.Head)

Module Substitution.Head

type t =
  1. | None of {
    1. location : Syncom.Location.t;
    }
  2. | Identity of {
    1. location : Syncom.Location.t;
    }
  3. | Substitution_variable of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Identifier.t;
    3. closure : t Support.Option.t;
    }
diff --git a/beluga/Synext/CLF/Substitution/Pattern/Head/index.html b/beluga/Synext/CLF/Substitution/Pattern/Head/index.html deleted file mode 100644 index e334aab34..000000000 --- a/beluga/Synext/CLF/Substitution/Pattern/Head/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Head (beluga.Synext.CLF.Substitution.Pattern.Head)

Module Pattern.Head

type t =
  1. | None of {
    1. location : Syncom.Location.t;
    }
  2. | Identity of {
    1. location : Syncom.Location.t;
    }
  3. | Substitution_variable of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Identifier.t;
    3. closure : t Support.Option.t;
    }
diff --git a/beluga/Synext/CLF/Substitution/Pattern/index.html b/beluga/Synext/CLF/Substitution/Pattern/index.html deleted file mode 100644 index b70649651..000000000 --- a/beluga/Synext/CLF/Substitution/Pattern/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Pattern (beluga.Synext.CLF.Substitution.Pattern)

Module Substitution.Pattern

External contextual LF substitution patterns.

module Head : sig ... end
diff --git a/beluga/Synext/CLF/Substitution/index.html b/beluga/Synext/CLF/Substitution/index.html deleted file mode 100644 index 99780e290..000000000 --- a/beluga/Synext/CLF/Substitution/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Substitution (beluga.Synext.CLF.Substitution)

Module CLF.Substitution

External contextual LF substitutions.

type t = {
  1. location : Syncom.Location.t;
  2. head : Substitution.Head.t;
  3. terms : Term.t Support.List.t;
}

{ Substitution.head; terms; _ } is the substitution

  • ^ if head = Head.None and terms = []
  • m1, m2, ..., mn if head = Head.None and terms = [m1; m2; ...; mn]
  • .. if head = Head.Identity _ and terms = []
  • .., m1, m2, ..., mn if head = Head.Identity _ and terms = [m1; m2; ...; mn]
  • $S if head = Head.Substitution_variable { identifier = "$S"; closure = Option.None; _ } and terms = []
  • $S[o] if head = Head.Substitution_variable { identifier = "$S"; closure = Option.Some o; _ } and terms = []
  • $S, m1, m2, ..., mn if head = Head.Substitution_variable { identifier = "$S"; closure = Option.None; _ } and terms = [m1; m2; ...; mn]
  • $S[o], m1, m2, ..., mn if head = Head.Substitution_variable { identifier = "$S"; closure = Option.Some o; _ } and terms = [m1; m2; ...; mn]
module Head : sig ... end
module Pattern : sig ... end

External contextual LF substitution patterns.

diff --git a/beluga/Synext/CLF/Term/Pattern/index.html b/beluga/Synext/CLF/Term/Pattern/index.html deleted file mode 100644 index d7c17b551..000000000 --- a/beluga/Synext/CLF/Term/Pattern/index.html +++ /dev/null @@ -1,3 +0,0 @@ - -Pattern (beluga.Synext.CLF.Term.Pattern)

Module Term.Pattern

External contextual LF term patterns.

type t =
  1. | Variable of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Identifier.t;
    }
    (*

    Variable { identifier = "x"; _ } is the LF-bound variable pattern "x".

    *)
  2. | Meta_variable of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Identifier.t;
    }
    (*

    Meta_variable { identifier = "x"; _ } is the term-level meta-variable pattern "x".

    *)
  3. | Parameter_variable of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Identifier.t;
    }
    (*

    Parameter_variable { identifier = "#x"; _ } is the term-level parameter variable pattern with name "#x".

    *)
  4. | Constant of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Qualified_identifier.t;
    }
    (*

    Constant { identifier = "c"; _ } is the term-level constant pattern "c".

    *)
  5. | Wildcard of {
    1. location : Syncom.Location.t;
    }
    (*

    Wildcard _ is the term-level catch-all pattern _.

    *)
  6. | Tuple of {
    1. location : Syncom.Location.t;
    2. terms : t Support.List1.t;
    }
    (*

    Tuple { terms; _ } is the tuple pattern <p1; p2; ...; pn> if terms = [p1; p2; ...; pn].

    *)
  7. | Projection of {
    1. location : Syncom.Location.t;
    2. term : t;
    3. projection : [ `By_identifier of Syncom.Identifier.t - | `By_position of Support.Int.t ];
    }
    (*

    Projection { term; _ } is the pattern for the projection of a tuple term. This projection is used to indicate which element of a tuple the scrutinee is matched against in a case-expression. This is typically used for parameter variable patterns such as #p.1.

    *)
  8. | Abstraction of {
    1. location : Syncom.Location.t;
    2. parameter_identifier : Syncom.Identifier.t Support.Option.t;
    3. parameter_type : Typ.t Support.Option.t;
    4. body : t;
    }
    (*

    Abstraction { parameter_identifier = Option.Some "x"; parameter_type = Option.Some t; body; _ } is the pattern \x:t. body.

    *)
  9. | Substitution of {
    1. location : Syncom.Location.t;
    2. term : t;
    3. substitution : Substitution.t;
    }
    (*

    Substitution { term; substitution; _ } is the pattern term[substitution].

    *)
  10. | Application of {
    1. location : Syncom.Location.t;
    2. applicand : t;
    3. arguments : t Support.List1.t;
    }
    (*

    Application { applicand; arguments; _ } is the term-level application pattern of applicand with arguments.

    If applicand = Pattern.Constant _ with resolved operator description operator, then List1.length arguments = Operator.arity operator.

    *)
  11. | Type_annotated of {
    1. location : Syncom.Location.t;
    2. term : t;
    3. typ : Typ.t;
    }
    (*

    Type_annotated { term = x; typ = t; _ } is the pattern x : t.

    *)
diff --git a/beluga/Synext/CLF/Term/index.html b/beluga/Synext/CLF/Term/index.html deleted file mode 100644 index 7b476afad..000000000 --- a/beluga/Synext/CLF/Term/index.html +++ /dev/null @@ -1,3 +0,0 @@ - -Term (beluga.Synext.CLF.Term)

Module CLF.Term

External contextual LF terms.

type t =
  1. | Variable of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Identifier.t;
    }
    (*

    Variable { identifier = "x"; _ } is the LF-bound term-level variable with name "x".

    *)
  2. | Meta_variable of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Identifier.t;
    }
    (*

    Meta_variable { identifier = "x"; _ } is the meta-variable with name "x". It may be free or bound.

    *)
  3. | Parameter_variable of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Identifier.t;
    }
    (*

    Parameter_variable { identifier = "#x"; _ } is the term-level parameter variable with name "#x". It may be free or bound.

    *)
  4. | Constant of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Qualified_identifier.t;
    }
    (*

    Constant { identifier = "c"; _ } is the term-level constant with qualified identifier "c".

    *)
  5. | Substitution of {
    1. location : Syncom.Location.t;
    2. term : t;
    3. substitution : Substitution.t;
    }
    (*

    Substitution { term; substitution; _ } is the term term[substitution].

    *)
  6. | Application of {
    1. location : Syncom.Location.t;
    2. applicand : t;
    3. arguments : t Support.List1.t;
    }
    (*

    Application { applicand; arguments; _ } is the term-level application of applicand with arguments.

    If applicand = Term.Constant _ with resolved operator description operator, then List1.length arguments = Operator.arity operator.

    *)
  7. | Abstraction of {
    1. location : Syncom.Location.t;
    2. parameter_identifier : Syncom.Identifier.t Support.Option.t;
    3. parameter_type : Typ.t Support.Option.t;
    4. body : t;
    }
    (*
    • Abstraction { parameter_identifier = Option.Some "x"; body; _ } is the term \x. body.
    • Abstraction { parameter_identifier = Option.None; body; _ } is the term \_. body.
    *)
  8. | Hole of {
    1. location : Syncom.Location.t;
    2. variant : [ `Underscore | `Unlabelled | `Labelled of Syncom.Identifier.t ];
    }
    (*

    Hole { variant; _ } is the omission of a term for reconstruction.

    • If variant = `Underscore, then it is the hole _.
    • If variant = `Unlabelled, then it is the hole ?.
    • If variant = `Labelled label, then it is the hole ?label.
    *)
  9. | Tuple of {
    1. location : Syncom.Location.t;
    2. terms : t Support.List1.t;
    }
    (*

    Tuple { terms; _ } is the tuple term <t1; t2; ...; tn> if List1.to_list terms = [t1; t2; ...; tn].

    This should not be confused with computation-level tuples. The type of a contextual LF term-level tuple is a block.

    *)
  10. | Projection of {
    1. location : Syncom.Location.t;
    2. term : t;
    3. projection : [ `By_identifier of Syncom.Identifier.t - | `By_position of Support.Int.t ];
    }
    (*
    • Projection { term = u; projection = `By_identifier x; _ } is the term u.x.
    • Projection { term = u; projection = `By_position n; _ } is the term u.n.
    *)
  11. | Type_annotated of {
    1. location : Syncom.Location.t;
    2. term : t;
    3. typ : Typ.t;
    }
    (*

    Type_annotated { term = u; typ = t; _ } is the term u : t.

    *)
module Pattern : sig ... end

External contextual LF term patterns.

diff --git a/beluga/Synext/CLF/Typ/index.html b/beluga/Synext/CLF/Typ/index.html deleted file mode 100644 index 0c2ace0dc..000000000 --- a/beluga/Synext/CLF/Typ/index.html +++ /dev/null @@ -1,3 +0,0 @@ - -Typ (beluga.Synext.CLF.Typ)

Module CLF.Typ

External contextual LF types.

type t =
  1. | Constant of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Qualified_identifier.t;
    }
    (*

    Constant { identifier = "c"; _ } is the type-level constant with qualified identifier "c".

    *)
  2. | Application of {
    1. location : Syncom.Location.t;
    2. applicand : t;
    3. arguments : Term.t Support.List1.t;
    }
    (*

    Application { applicand; arguments; _ } is the type-level application of applicand with arguments.

    If applicand = Typ.Constant _ with resolved operator description operator, then List1.length arguments = Operator.arity operator.

    *)
  3. | Arrow of {
    1. location : Syncom.Location.t;
    2. domain : t;
    3. range : t;
    4. orientation : [ `Forward | `Backward ];
    }
    (*
    • Arrow { domain; range; orientation = `Forward; _ } is the type domain -> range.
    • Arrow { range; domain; orientation = `Backward; _ } is the type range <- domain.
    *)
  4. | Pi of {
    1. location : Syncom.Location.t;
    2. parameter_identifier : Syncom.Identifier.t Support.Option.t;
    3. parameter_type : t;
    4. plicity : Syncom.Plicity.t;
    5. body : t;
    }
    (*
    • Pi { parameter_identifier = Option.Some "x"; parameter_type = t; body; _ } is the dependent product type { x : t } body. The variable "x" ranges over LF terms.
    • Pi { parameter_identifier = Option.None; parameter_type = t; body; _ } is the dependent product type { _ : t } body.
    *)
  5. | Block of {
    1. location : Syncom.Location.t;
    2. elements : [ `Unnamed of t - | `Record of (Syncom.Identifier.t * t) Support.List1.t ];
    }
    (*
    • Block { elements = `Unnamed t; _ } is the block type block t.
    • Block { elements = `Record [("x1", t1); ("x2", t2); ...; ("xn", tn)]; _ } is the block type block (x1 : t1, x2 : t2, ..., xn : tn). This is a dependent sum type, or telescope, with tj being able to refer to "xi" when i < j.
    *)
diff --git a/beluga/Synext/CLF/index.html b/beluga/Synext/CLF/index.html deleted file mode 100644 index 9f69834d6..000000000 --- a/beluga/Synext/CLF/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -CLF (beluga.Synext.CLF)

Module Synext.CLF

module Typ : sig ... end

External contextual LF types.

module Term : sig ... end

External contextual LF terms.

module Substitution : sig ... end

External contextual LF substitutions.

module Context : sig ... end

External contextual LF contexts.

diff --git a/beluga/Synext/Comp/Case_branch/index.html b/beluga/Synext/Comp/Case_branch/index.html deleted file mode 100644 index 145f6c16c..000000000 --- a/beluga/Synext/Comp/Case_branch/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Case_branch (beluga.Synext.Comp.Case_branch)

Module Comp.Case_branch

External case analysis branches.

type t = {
  1. location : Syncom.Location.t;
  2. meta_context : Synext__.Synext_definition.Meta.Context.t;
  3. pattern : Pattern.t;
  4. body : Expression.t;
}
diff --git a/beluga/Synext/Comp/Cofunction_branch/index.html b/beluga/Synext/Comp/Cofunction_branch/index.html deleted file mode 100644 index 90153bec8..000000000 --- a/beluga/Synext/Comp/Cofunction_branch/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Cofunction_branch (beluga.Synext.Comp.Cofunction_branch)

Module Comp.Cofunction_branch

External cofunction branches.

type t = {
  1. location : Syncom.Location.t;
  2. meta_context : Synext__.Synext_definition.Meta.Context.t;
  3. copattern : Copattern.t;
  4. body : Expression.t;
}
diff --git a/beluga/Synext/Comp/Context/index.html b/beluga/Synext/Comp/Context/index.html deleted file mode 100644 index ca042147e..000000000 --- a/beluga/Synext/Comp/Context/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Context (beluga.Synext.Comp.Context)

Module Comp.Context

External computation-level contexts.

type t = {
  1. location : Syncom.Location.t;
  2. bindings : (Syncom.Identifier.t * Typ.t) Support.List.t;
}

{ Context.bindings; _ } is the computation-level context

  • ^ if bindings = []
  • x1 : a1, x2 : a2, ..., xn : an if bindings = [("x1", a1); ("x2", a2); ...; ("xn", an)]
diff --git a/beluga/Synext/Comp/Copattern/index.html b/beluga/Synext/Comp/Copattern/index.html deleted file mode 100644 index 96d37caeb..000000000 --- a/beluga/Synext/Comp/Copattern/index.html +++ /dev/null @@ -1,3 +0,0 @@ - -Copattern (beluga.Synext.Comp.Copattern)

Module Comp.Copattern

External computation-level copatterns.

diff --git a/beluga/Synext/Comp/Expression/index.html b/beluga/Synext/Comp/Expression/index.html deleted file mode 100644 index 7c35ad992..000000000 --- a/beluga/Synext/Comp/Expression/index.html +++ /dev/null @@ -1,6 +0,0 @@ - -Expression (beluga.Synext.Comp.Expression)

Module Comp.Expression

External computation-level expressions.

type t =
  1. | Variable of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Identifier.t;
    }
    (*

    Variable { identifier = "x"; _ } is the computation-level variable "x".

    *)
  2. | Constructor of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Qualified_identifier.t;
    }
    (*

    Constructor { identifier = "c"; _ } is the computation-level constant "c" referring to a constructor.

    *)
  3. | Program of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Qualified_identifier.t;
    }
    (*

    Program { identifier = "f"; _ } is the computation-level constant "f" referring to a value.

    *)
  4. | Fn of {
    1. location : Syncom.Location.t;
    2. parameters : (Syncom.Location.t * Syncom.Identifier.t Support.Option.t) - Support.List1.t;
    3. body : t;
    }
    (*

    Fn { parameters = ["x1"; "x2"; ...; "xn"]; body; _ } is the computation-level abstraction fn x1, x2, ..., xn => body.

    *)
  5. | Mlam of {
    1. location : Syncom.Location.t;
    2. parameters : (Syncom.Location.t - * (Syncom.Identifier.t Support.Option.t - * [ `Plain | `Hash | `Dollar ])) - Support.List1.t;
    3. body : t;
    }
    (*

    Mlam { parameters = ["X1"; "X2"; ...; "Xn"]; body; _ } is the computation-level abstraction over meta-objects mlam X1, X2, ..., Xn => body.

    *)
  6. | Fun of {
    1. location : Syncom.Location.t;
    2. branches : Cofunction_branch.t Support.List1.t;
    }
    (*

    Fun { branches = [(p1s, e1); (p2, e2); ...; (pn, en)]; _ } is the pattern-matching computation-level abstraction fun p1 => e1 | p2 => e2 | ... | pn => en. Each of p1, p2, ..., pn is a non-empty list of comma-separated copatterns, making this a cofunction.

    *)
  7. | Impossible of {
    1. location : Syncom.Location.t;
    2. scrutinee : t;
    }
    (*

    Impossible { expression = e; _ } is the pattern-matching with no branches impossible e.

    *)
  8. | Case of {
    1. location : Syncom.Location.t;
    2. scrutinee : t;
    3. check_coverage : Stdlib.Bool.t;
    4. branches : Case_branch.t Support.List1.t;
    }
    (*

    Case { scrutinee = e; branches = [(p1, e1); (p2, e2); ...; (pn, en)]; check_coverage; _ } is the pattern-matching expression case e of p1 => e1 | p2 => e2 | ... | pn => en.

    If check_coverage = false, then coverage-checking is disabled for this case-expression.

    *)
  9. | Tuple of {
    1. location : Syncom.Location.t;
    2. elements : t Support.List2.t;
    }
    (*

    Tuple { elements = [e1; e2; ...; en]; _ } is the tuple expression (e1, e2, ..., en).

    *)
  10. | Hole of {
    1. location : Syncom.Location.t;
    2. label : Syncom.Identifier.t Support.Option.t;
    }
    (*

    Hole { label = Option.Some "x"; _ } is the hole ?x ranging over computation-level expressions.

    *)
  11. | Box_hole of {
    1. location : Syncom.Location.t;
    }
    (*

    Box_hole _ is the hole _ ranging over meta-objects.

    *)
  12. | Application of {
    1. location : Syncom.Location.t;
    2. applicand : t;
    3. arguments : t Support.List1.t;
    }
    (*

    Application { applicand; arguments; _ } the application of applicand with arguments.

    If applicand = Expression.Program _ | Expression.Constructor _ with resolved operator description operator, then List1.length arguments = Operator.arity operator.

    *)
  13. | Observation of {
    1. location : Syncom.Location.t;
    2. scrutinee : t;
    3. destructor : Syncom.Qualified_identifier.t;
    }
    (*

    Observation { scrutinee = e; destructor = "c"; _ } is the observation e .c.

    *)
  14. | Type_annotated of {
    1. location : Syncom.Location.t;
    2. expression : t;
    3. typ : Typ.t;
    }
    (*

    Type_annotated { expression = e; typ = t; _ } is the type-annotated computation-level expression e : t.

    *)
diff --git a/beluga/Synext/Comp/Kind/index.html b/beluga/Synext/Comp/Kind/index.html deleted file mode 100644 index 96ca66501..000000000 --- a/beluga/Synext/Comp/Kind/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Kind (beluga.Synext.Comp.Kind)

Module Comp.Kind

External computation-level kinds.

type t =
  1. | Ctype of {
    1. location : Syncom.Location.t;
    }
    (*

    Ctype { _ } is the kind of computation-level types ctype.

    *)
diff --git a/beluga/Synext/Comp/Pattern/index.html b/beluga/Synext/Comp/Pattern/index.html deleted file mode 100644 index 6e8c2c232..000000000 --- a/beluga/Synext/Comp/Pattern/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Pattern (beluga.Synext.Comp.Pattern)

Module Comp.Pattern

External computation-level patterns.

type t =
  1. | Variable of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Identifier.t;
    }
  2. | Constructor of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Qualified_identifier.t;
    }
    (*

    Constructor { identifier = "c"; _ } is the computation-level constructor pattern "c".

    *)
  3. | Tuple of {
    1. location : Syncom.Location.t;
    2. elements : t Support.List2.t;
    }
  4. | Application of {
    1. location : Syncom.Location.t;
    2. applicand : t;
    3. arguments : t Support.List1.t;
    }
    (*

    Application { applicand; arguments; _ } the application of applicand with arguments.

    If applicand = Term.Constant _ with resolved operator description operator, then List1.length arguments = Operator.arity operator.

    *)
  5. | Type_annotated of {
    1. location : Syncom.Location.t;
    2. pattern : t;
    3. typ : Typ.t;
    }
  6. | Wildcard of {
    1. location : Syncom.Location.t;
    }
diff --git a/beluga/Synext/Comp/Typ/index.html b/beluga/Synext/Comp/Typ/index.html deleted file mode 100644 index 9978233d1..000000000 --- a/beluga/Synext/Comp/Typ/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Typ (beluga.Synext.Comp.Typ)

Module Comp.Typ

External computation-level types.

type t =
  1. | Inductive_typ_constant of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Qualified_identifier.t;
    }
    (*

    Inductive_typ_constant { identifier = "c"; } is the computation-level inductive type constant "c".

    *)
  2. | Stratified_typ_constant of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Qualified_identifier.t;
    }
    (*

    Stratified_typ_constant { identifier = "c"; } is the computation-level stratified type constant "c".

    *)
  3. | Coinductive_typ_constant of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Qualified_identifier.t;
    }
    (*

    Coinductive_typ_constant { identifier = "c"; } is the computation-level coinductive type constant "c".

    *)
  4. | Abbreviation_typ_constant of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Qualified_identifier.t;
    }
    (*

    Abbreviation_typ_constant { identifier = "c"; } is the computation-level abbreviated type constant "c".

    *)
  5. | Arrow of {
    1. location : Syncom.Location.t;
    2. domain : t;
    3. range : t;
    4. orientation : [ `Forward | `Backward ];
    }
    (*

    Arrow { domain; range; _ } is the computation-level type domain -> range.

    *)
  6. | Cross of {
    1. location : Syncom.Location.t;
    2. types : t Support.List2.t;
    }
    (*

    Cross { typs = [t1; t2; ...; tn]; _ } is the type of tuple t1 * t2 * ... * tn.

    *)
diff --git a/beluga/Synext/Comp/index.html b/beluga/Synext/Comp/index.html deleted file mode 100644 index 752cc6a3a..000000000 --- a/beluga/Synext/Comp/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Comp (beluga.Synext.Comp)

Module Synext.Comp

module Kind : sig ... end

External computation-level kinds.

module Typ : sig ... end

External computation-level types.

module Expression : sig ... end

External computation-level expressions.

module Case_branch : sig ... end

External case analysis branches.

module Cofunction_branch : sig ... end

External cofunction branches.

module Pattern : sig ... end

External computation-level patterns.

module Copattern : sig ... end

External computation-level copatterns.

module Context : sig ... end

External computation-level contexts.

diff --git a/beluga/Synext/Harpoon/Command/index.html b/beluga/Synext/Harpoon/Command/index.html deleted file mode 100644 index d78f3a951..000000000 --- a/beluga/Synext/Harpoon/Command/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Command (beluga.Synext.Harpoon.Command)

Module Harpoon.Command

type t
diff --git a/beluga/Synext/Harpoon/Directive/index.html b/beluga/Synext/Harpoon/Directive/index.html deleted file mode 100644 index 9a7b8613a..000000000 --- a/beluga/Synext/Harpoon/Directive/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Directive (beluga.Synext.Harpoon.Directive)

Module Harpoon.Directive

type t =
  1. | Intros of {
    1. location : Syncom.Location.t;
    2. hypothetical : Hypothetical.t;
    }
diff --git a/beluga/Synext/Harpoon/Hypothetical/index.html b/beluga/Synext/Harpoon/Hypothetical/index.html deleted file mode 100644 index 437118de3..000000000 --- a/beluga/Synext/Harpoon/Hypothetical/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hypothetical (beluga.Synext.Harpoon.Hypothetical)

Module Harpoon.Hypothetical

type t = {
  1. location : Syncom.Location.t;
  2. meta_context : Synext__.Synext_definition.Meta.Context.t;
  3. comp_context : Synext__.Synext_definition.Comp.Context.t;
  4. proof : Proof.t;
}
diff --git a/beluga/Synext/Harpoon/Proof/index.html b/beluga/Synext/Harpoon/Proof/index.html deleted file mode 100644 index cb899a49e..000000000 --- a/beluga/Synext/Harpoon/Proof/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Proof (beluga.Synext.Harpoon.Proof)

Module Harpoon.Proof

type t =
  1. | Incomplete of {
    1. location : Syncom.Location.t;
    2. label : Syncom.Identifier.t Support.Option.t;
    }
  2. | Command of {
    1. location : Syncom.Location.t;
    2. command : Command.t;
    3. body : t;
    }
  3. | Directive of {
    1. location : Syncom.Location.t;
    2. directive : Directive.t;
    }
diff --git a/beluga/Synext/Harpoon/Repl/Command/index.html b/beluga/Synext/Harpoon/Repl/Command/index.html deleted file mode 100644 index f623407ad..000000000 --- a/beluga/Synext/Harpoon/Repl/Command/index.html +++ /dev/null @@ -1,6 +0,0 @@ - -Command (beluga.Synext.Harpoon.Repl.Command)

Module Repl.Command

type t =
  1. | Rename of {
    1. location : Syncom.Location.t;
    2. rename_from : Syncom.Identifier.t * [ `Plain | `Hash | `Dollar ];
    3. rename_to : Syncom.Identifier.t * [ `Plain | `Hash | `Dollar ];
    4. level : [ `meta | `comp ];
    }
  2. | Toggle_automation of {
    1. location : Syncom.Location.t;
    2. kind : [ `auto_intros | `auto_solve_trivial ];
    3. change : [ `on | `off | `toggle ];
    }
  3. | Info of {
    1. location : Syncom.Location.t;
    2. kind : [ `prog ];
    3. object_identifier : Syncom.Qualified_identifier.t;
    }
  4. | Select_theorem of {
    1. location : Syncom.Location.t;
    2. theorem : Syncom.Qualified_identifier.t;
    }
  5. | Theorem of {
    1. location : Syncom.Location.t;
    2. subcommand : [ `list - | `defer - | `show_ihs - | `show_proof - | `dump_proof of Support.String.t ];
    }
  6. | Session of {
    1. location : Syncom.Location.t;
    2. subcommand : [ `list | `defer | `create | `serialize ];
    }
  7. | Subgoal of {
    1. location : Syncom.Location.t;
    2. subcommand : [ `list | `defer ];
    }
  8. | Undo of {
    1. location : Syncom.Location.t;
    }
  9. | Redo of {
    1. location : Syncom.Location.t;
    }
  10. | History of {
    1. location : Syncom.Location.t;
    }
  11. | Translate of {
    1. location : Syncom.Location.t;
    2. theorem : Syncom.Qualified_identifier.t;
    }
  12. | Intros of {
    1. location : Syncom.Location.t;
    2. introduced_variables : Syncom.Identifier.t Support.List1.t Support.Option.t;
    }
  13. | Msplit of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Identifier.t;
    }
  14. | Help of {
    1. location : Syncom.Location.t;
    }
  15. | Auto_invert_solve of {
    1. location : Syncom.Location.t;
    2. max_depth : Support.Int.t Support.Option.t;
    }
  16. | Inductive_auto_solve of {
    1. location : Syncom.Location.t;
    2. max_depth : Support.Int.t Support.Option.t;
    }
diff --git a/beluga/Synext/Harpoon/Repl/index.html b/beluga/Synext/Harpoon/Repl/index.html deleted file mode 100644 index f1dc25fdc..000000000 --- a/beluga/Synext/Harpoon/Repl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Repl (beluga.Synext.Harpoon.Repl)

Module Harpoon.Repl

module Command : sig ... end
diff --git a/beluga/Synext/Harpoon/Split_branch/Label/index.html b/beluga/Synext/Harpoon/Split_branch/Label/index.html deleted file mode 100644 index e8820ee00..000000000 --- a/beluga/Synext/Harpoon/Split_branch/Label/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Label (beluga.Synext.Harpoon.Split_branch.Label)

Module Split_branch.Label

type t =
  1. | Lf_constant of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Qualified_identifier.t;
    }
  2. | Comp_constant of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Qualified_identifier.t;
    }
  3. | Bound_variable of {
    1. location : Syncom.Location.t;
    }
  4. | Empty_context of {
    1. location : Syncom.Location.t;
    }
  5. | Extended_context of {
    1. location : Syncom.Location.t;
    2. schema_element : Support.Int.t;
      (*

      1-based

      *)
    }
  6. | Parameter_variable of {
    1. location : Syncom.Location.t;
    2. schema_element : Support.Int.t;
      (*

      1-based

      *)
    3. projection : Support.Int.t Support.Option.t;
      (*

      1-based

      *)
    }
diff --git a/beluga/Synext/Harpoon/Split_branch/index.html b/beluga/Synext/Harpoon/Split_branch/index.html deleted file mode 100644 index 3474ebd44..000000000 --- a/beluga/Synext/Harpoon/Split_branch/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Split_branch (beluga.Synext.Harpoon.Split_branch)

Module Harpoon.Split_branch

type t = {
  1. location : Syncom.Location.t;
  2. label : Split_branch.Label.t;
  3. body : Hypothetical.t;
}
module Label : sig ... end
diff --git a/beluga/Synext/Harpoon/Suffices_branch/index.html b/beluga/Synext/Harpoon/Suffices_branch/index.html deleted file mode 100644 index c08322b76..000000000 --- a/beluga/Synext/Harpoon/Suffices_branch/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Suffices_branch (beluga.Synext.Harpoon.Suffices_branch)

Module Harpoon.Suffices_branch

type t = {
  1. location : Syncom.Location.t;
  2. goal : Synext__.Synext_definition.Comp.Typ.t;
  3. proof : Proof.t;
}
diff --git a/beluga/Synext/Harpoon/index.html b/beluga/Synext/Harpoon/index.html deleted file mode 100644 index 7fd7fbc3d..000000000 --- a/beluga/Synext/Harpoon/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Harpoon (beluga.Synext.Harpoon)

Module Synext.Harpoon

module Proof : sig ... end
module Command : sig ... end
module Directive : sig ... end
module Split_branch : sig ... end
module Suffices_branch : sig ... end
module Hypothetical : sig ... end
module Repl : sig ... end
diff --git a/beluga/Synext/LF/Kind/index.html b/beluga/Synext/LF/Kind/index.html deleted file mode 100644 index d7b543a81..000000000 --- a/beluga/Synext/LF/Kind/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Kind (beluga.Synext.LF.Kind)

Module LF.Kind

External LF kinds.

type t =
  1. | Typ of {
    1. location : Syncom.Location.t;
    }
    (*

    Typ { _ } is the kind of simple types type.

    *)
  2. | Arrow of {
    1. location : Syncom.Location.t;
    2. domain : Typ.t;
    3. range : t;
    }
    (*

    Arrow { domain; range; _ } is the kind domain -> range.

    *)
  3. | Pi of {
    1. location : Syncom.Location.t;
    2. parameter_identifier : Syncom.Identifier.t Support.Option.t;
    3. parameter_type : Typ.t Support.Option.t;
    4. plicity : Syncom.Plicity.t;
    5. body : t;
    }
    (*

    Pi { parameter_identifier = Option.Some "x"; parameter_type = Option.Some t; body; _ } is the dependent product kind { x : t } body. The variable "x" ranges over LF terms.

    *)
diff --git a/beluga/Synext/LF/Term/index.html b/beluga/Synext/LF/Term/index.html deleted file mode 100644 index 4e423b174..000000000 --- a/beluga/Synext/LF/Term/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Term (beluga.Synext.LF.Term)

Module LF.Term

External LF terms.

type t =
  1. | Variable of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Identifier.t;
    }
    (*

    Variable { identifier = "x"; _ } is the term-level variable with name "x". It may be free or bound. If it is free, then an implicit type-level or kind-level Pi binder should be reconstructed for it.

    *)
  2. | Constant of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Qualified_identifier.t;
    }
    (*

    Constant { identifier = "c"; _ } is the term-level constant with qualified identifier "c".

    *)
  3. | Application of {
    1. location : Syncom.Location.t;
    2. applicand : t;
    3. arguments : t Support.List1.t;
    }
    (*

    Application { applicand; arguments; _ } is the term-level application of applicand with arguments.

    If applicand = Term.Constant _ with resolved operator description operator, then List1.length arguments = Operator.arity operator.

    *)
  4. | Abstraction of {
    1. location : Syncom.Location.t;
    2. parameter_identifier : Syncom.Identifier.t Support.Option.t;
    3. parameter_type : Typ.t Support.Option.t;
    4. body : t;
    }
    (*

    Abstraction { parameter_identifier = Option.Some "x"; parameter_type = Option.Some t; body; _ } is the term \(x : t). body. The variable "x" ranges over LF terms. The parameter identifier may be omitted (represented as _), and the parameter type annotation is typically omitted.

    *)
  5. | Wildcard of {
    1. location : Syncom.Location.t;
    }
    (*

    Wildcard { _ } is the omission _ of a fresh term-level variable. This is analogous to a fresh free variable.

    *)
  6. | Type_annotated of {
    1. location : Syncom.Location.t;
    2. term : t;
    3. typ : Typ.t;
    }
    (*

    Type_annotated { term = u; typ = t; _ } is the term u : t.

    *)
diff --git a/beluga/Synext/LF/Typ/index.html b/beluga/Synext/LF/Typ/index.html deleted file mode 100644 index 07bf27f7c..000000000 --- a/beluga/Synext/LF/Typ/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Typ (beluga.Synext.LF.Typ)

Module LF.Typ

External LF types.

type t =
  1. | Constant of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Qualified_identifier.t;
    }
    (*

    Constant { identifier = "c"; _ } is the type-level constant with qualified identifier "c".

    *)
  2. | Application of {
    1. location : Syncom.Location.t;
    2. applicand : t;
    3. arguments : Term.t Support.List1.t;
    }
    (*

    Application { applicand; arguments; _ } is the type-level application of applicand with arguments.

    If applicand = Typ.Constant _ with resolved operator description operator, then List1.length arguments = Operator.arity operator.

    *)
  3. | Arrow of {
    1. location : Syncom.Location.t;
    2. domain : t;
    3. range : t;
    4. orientation : [ `Forward | `Backward ];
    }
    (*
    • Arrow { domain; range; orientation = `Forward; _ } is the type domain -> range.
    • Arrow { range; domain; orientation = `Backward; _ } is the type range <- domain.
    *)
  4. | Pi of {
    1. location : Syncom.Location.t;
    2. parameter_identifier : Syncom.Identifier.t Support.Option.t;
    3. parameter_type : t Support.Option.t;
    4. plicity : Syncom.Plicity.t;
    5. body : t;
    }
    (*

    Pi { parameter_identifier = Option.Some "x"; parameter_type = Option.Some t; body; _ } is the dependent product type { x : t } body. The variable "x" ranges over LF terms.

    *)
diff --git a/beluga/Synext/LF/index.html b/beluga/Synext/LF/index.html deleted file mode 100644 index 20ed9bff8..000000000 --- a/beluga/Synext/LF/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -LF (beluga.Synext.LF)

Module Synext.LF

module Kind : sig ... end

External LF kinds.

module Typ : sig ... end

External LF types.

module Term : sig ... end

External LF terms.

diff --git a/beluga/Synext/Make_precedences/Clf_precedence/Ord/index.html b/beluga/Synext/Make_precedences/Clf_precedence/Ord/index.html deleted file mode 100644 index c20c5a4fd..000000000 --- a/beluga/Synext/Make_precedences/Clf_precedence/Ord/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Ord (beluga.Synext.Make_precedences.Clf_precedence.Ord)

Module Clf_precedence.Ord

type t = precedence

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Synext/Make_precedences/Clf_precedence/index.html b/beluga/Synext/Make_precedences/Clf_precedence/index.html deleted file mode 100644 index 8374739bf..000000000 --- a/beluga/Synext/Make_precedences/Clf_precedence/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Clf_precedence (beluga.Synext.Make_precedences.Clf_precedence)

Module Make_precedences.Clf_precedence

type precedence
module Ord : Support.Ord.ORD with type t = precedence
diff --git a/beluga/Synext/Make_precedences/Comp_expression_precedence/Ord/index.html b/beluga/Synext/Make_precedences/Comp_expression_precedence/Ord/index.html deleted file mode 100644 index 49ad0fe16..000000000 --- a/beluga/Synext/Make_precedences/Comp_expression_precedence/Ord/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Ord (beluga.Synext.Make_precedences.Comp_expression_precedence.Ord)

Module Comp_expression_precedence.Ord

type t = precedence

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Synext/Make_precedences/Comp_expression_precedence/index.html b/beluga/Synext/Make_precedences/Comp_expression_precedence/index.html deleted file mode 100644 index 191f2f4fa..000000000 --- a/beluga/Synext/Make_precedences/Comp_expression_precedence/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Comp_expression_precedence (beluga.Synext.Make_precedences.Comp_expression_precedence)

Module Make_precedences.Comp_expression_precedence

type precedence
module Ord : Support.Ord.ORD with type t = precedence
diff --git a/beluga/Synext/Make_precedences/Comp_pattern_precedence/Ord/index.html b/beluga/Synext/Make_precedences/Comp_pattern_precedence/Ord/index.html deleted file mode 100644 index cd83df0a0..000000000 --- a/beluga/Synext/Make_precedences/Comp_pattern_precedence/Ord/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Ord (beluga.Synext.Make_precedences.Comp_pattern_precedence.Ord)

Module Comp_pattern_precedence.Ord

type t = precedence

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Synext/Make_precedences/Comp_pattern_precedence/index.html b/beluga/Synext/Make_precedences/Comp_pattern_precedence/index.html deleted file mode 100644 index 3db5aec70..000000000 --- a/beluga/Synext/Make_precedences/Comp_pattern_precedence/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Comp_pattern_precedence (beluga.Synext.Make_precedences.Comp_pattern_precedence)

Module Make_precedences.Comp_pattern_precedence

type precedence
module Ord : Support.Ord.ORD with type t = precedence
diff --git a/beluga/Synext/Make_precedences/Comp_sort_precedence/Ord/index.html b/beluga/Synext/Make_precedences/Comp_sort_precedence/Ord/index.html deleted file mode 100644 index 54ad91fb8..000000000 --- a/beluga/Synext/Make_precedences/Comp_sort_precedence/Ord/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Ord (beluga.Synext.Make_precedences.Comp_sort_precedence.Ord)

Module Comp_sort_precedence.Ord

type t = precedence

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Synext/Make_precedences/Comp_sort_precedence/index.html b/beluga/Synext/Make_precedences/Comp_sort_precedence/index.html deleted file mode 100644 index 7a4f58e5f..000000000 --- a/beluga/Synext/Make_precedences/Comp_sort_precedence/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Comp_sort_precedence (beluga.Synext.Make_precedences.Comp_sort_precedence)

Module Make_precedences.Comp_sort_precedence

type precedence
module Ord : Support.Ord.ORD with type t = precedence
diff --git a/beluga/Synext/Make_precedences/Lf_precedence/Ord/index.html b/beluga/Synext/Make_precedences/Lf_precedence/Ord/index.html deleted file mode 100644 index abf6975a8..000000000 --- a/beluga/Synext/Make_precedences/Lf_precedence/Ord/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Ord (beluga.Synext.Make_precedences.Lf_precedence.Ord)

Module Lf_precedence.Ord

type t = precedence

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Synext/Make_precedences/Lf_precedence/index.html b/beluga/Synext/Make_precedences/Lf_precedence/index.html deleted file mode 100644 index 9d49f8a81..000000000 --- a/beluga/Synext/Make_precedences/Lf_precedence/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Lf_precedence (beluga.Synext.Make_precedences.Lf_precedence)

Module Make_precedences.Lf_precedence

type precedence
module Ord : Support.Ord.ORD with type t = precedence
diff --git a/beluga/Synext/Make_precedences/Schema_precedence/Ord/index.html b/beluga/Synext/Make_precedences/Schema_precedence/Ord/index.html deleted file mode 100644 index b24c1b5dd..000000000 --- a/beluga/Synext/Make_precedences/Schema_precedence/Ord/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Ord (beluga.Synext.Make_precedences.Schema_precedence.Ord)

Module Schema_precedence.Ord

type t = precedence

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Synext/Make_precedences/Schema_precedence/index.html b/beluga/Synext/Make_precedences/Schema_precedence/index.html deleted file mode 100644 index 0634a4a0a..000000000 --- a/beluga/Synext/Make_precedences/Schema_precedence/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Schema_precedence (beluga.Synext.Make_precedences.Schema_precedence)

Module Make_precedences.Schema_precedence

type precedence
module Ord : Support.Ord.ORD with type t = precedence
diff --git a/beluga/Synext/Make_precedences/argument-1-S/index.html b/beluga/Synext/Make_precedences/argument-1-S/index.html deleted file mode 100644 index e1b953055..000000000 --- a/beluga/Synext/Make_precedences/argument-1-S/index.html +++ /dev/null @@ -1,75 +0,0 @@ - -S (beluga.Synext.Make_precedences.S)

Parameter Make_precedences.S

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val lookup_operator_precedence : - state -> - Syncom.Qualified_identifier.t -> - Support.Int.t Support.Option.t
diff --git a/beluga/Synext/Make_precedences/index.html b/beluga/Synext/Make_precedences/index.html deleted file mode 100644 index 6b62b6bd9..000000000 --- a/beluga/Synext/Make_precedences/index.html +++ /dev/null @@ -1,87 +0,0 @@ - -Make_precedences (beluga.Synext.Make_precedences)

Module Synext.Make_precedences

Parameters

module S : sig ... end

Signature

include Support.Imperative_state.IMPERATIVE_STATE with type state = S.state
type state = S.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t

Precedence of LF Syntax

module Lf_precedence : sig ... end
val precedence_of_lf_kind : state -> lf_kind -> Lf_precedence.precedence
val precedence_of_lf_typ : state -> lf_typ -> Lf_precedence.precedence
val precedence_of_lf_term : state -> lf_term -> Lf_precedence.precedence

Precedence of Contextual LF Syntax

module Clf_precedence : sig ... end
val precedence_of_clf_typ : state -> clf_typ -> Clf_precedence.precedence
val precedence_of_clf_term : state -> clf_term -> Clf_precedence.precedence
val precedence_of_clf_term_pattern : - state -> - clf_term_pattern -> - Clf_precedence.precedence

Precedence of Meta-Level Syntax

module Schema_precedence : sig ... end
val precedence_of_schema : state -> schema -> Schema_precedence.precedence

Precedence of Computation-Level Syntax

module Comp_sort_precedence : sig ... end
val precedence_of_comp_kind : - state -> - comp_kind -> - Comp_sort_precedence.precedence
val precedence_of_comp_typ : - state -> - comp_typ -> - Comp_sort_precedence.precedence
module Comp_expression_precedence : sig ... end
val precedence_of_comp_expression : - state -> - comp_expression -> - Comp_expression_precedence.precedence
module Comp_pattern_precedence : sig ... end
val precedence_of_comp_pattern : - state -> - comp_pattern -> - Comp_pattern_precedence.precedence
diff --git a/beluga/Synext/Make_printer/argument-1-Printing_state/index.html b/beluga/Synext/Make_printer/argument-1-Printing_state/index.html deleted file mode 100644 index 1bdc2917d..000000000 --- a/beluga/Synext/Make_printer/argument-1-Printing_state/index.html +++ /dev/null @@ -1,192 +0,0 @@ - -Printing_state (beluga.Synext.Make_printer.Printing_state)

Parameter Make_printer.Printing_state

include Support.Format_state.S with type state := state
include Support.Imperative_state.IMPERATIVE_STATE with type state := state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val pp_flush : state -> Stdlib.Unit.t

pp_flush state is analogous to Format.pp_print_flush.

val pp_newline : state -> Stdlib.Unit.t

pp_newline state is analogous to Format.pp_print_newline.

val pp_nop : state -> Stdlib.Unit.t

pp_nop state is (). This is useful to signal that nothing should be printed for some execution branch.

val pp_cut : state -> Stdlib.Unit.t

pp_cut state is analogous to Format.pp_print_cut.

val pp_space : state -> Stdlib.Unit.t

pp_space state is analogous to Format.pp_print_space. Note that this is a possibly breaking space, meaning that a newline may be printed at this point.

val pp_non_breaking_space : state -> Stdlib.Unit.t

pp_non_breaking_space state pretty-prints a non-breaking space, meaning that the printer does not insert break directives to that space.

val pp_break : state -> Support.Int.t -> Support.Int.t -> Stdlib.Unit.t

pp_break state width offset is analogous to Format.pp_print_break.

val pp_as : state -> Support.Int.t -> Support.String.t -> Stdlib.Unit.t

pp_as state size is analogous to Format.pp_print_as to pretty-print a string as if it were of length size. This is useful to pretty-print UTF-8 encoded strings of known codepoint count, or to print a string as if it isn't there, like for HTML tags or ASCII escape sequences.

val pp_box : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_box state ?(indent = 0) f evaluates f state in a compacting pretty-printing box wth offset indent in the formatter (see Format.pp_open_box). The box is opened before f state, and closed afterwards.

val pp_hbox : state -> (state -> Stdlib.Unit.t) -> Stdlib.Unit.t

pp_hbox state f evaluates f state in a horizontal pretty-printing box (see Format.pp_open_hbox). The box is opened before f state, and closed afterwards.

val pp_vbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_vbox state ?(indent = 0) f evaluates f state in a vertical pretty-printing box with offset indent (see Format.pp_open_vbox). The box is opened before f state, and closed afterwards.

val pp_hvbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_hovbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_bool : state -> Stdlib.Bool.t -> Stdlib.Unit.t
val pp_int : state -> Support.Int.t -> Stdlib.Unit.t
val pp_float : state -> Stdlib.Float.t -> Stdlib.Unit.t
val pp_char : state -> Stdlib.Char.t -> Stdlib.Unit.t
val pp_string : state -> Support.String.t -> Stdlib.Unit.t
val pp_option : - state -> - ?none:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val pp_list : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t
val pp_list1 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val pp_list2 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val pp_text : state -> Support.String.t -> Stdlib.Unit.t
val pp_utf_8 : state -> Support.String.t -> Stdlib.Unit.t
val pp_utf_8_text : state -> Support.String.t -> Stdlib.Unit.t
val add_module : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - (state -> 'a) -> - 'a

add_module state identifier f is the result of f when run in a state in a new module with identifier. Bindings added by f are added to the new module only. The resultant state has identifier bound to the newly created module.

val open_module : state -> Syncom.Qualified_identifier.t -> Stdlib.Unit.t

open_module state module_identifier adds the bindings in the module having identifier module_identifier in state.

If module_identifier is unbound in state, then an exception is raised.

val add_abbreviation : - state -> - Syncom.Qualified_identifier.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation state module_identifier abbreviation adds abbreviation for referring to the module module_identifier in state.

If module_identifier is unbound in state, then an exception is raised.

val set_default_associativity : - state -> - Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state associativity sets associativity as the default associativity for new user-defined infix operators.

val get_default_associativity : state -> Syncom.Associativity.t

get_default_associativity state is the default associativity for new user-defined infix operators.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state precedence sets precedence as the default precedence for new user-defined operators.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the default precedence for new user-defined operators.

val add_lf_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_lf_term_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_inductive_computation_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_stratified_computation_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_coinductive_computation_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_abbreviation_computation_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_computation_term_constructor : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_computation_term_destructor : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_program_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence constant sets constant as a prefix operator with precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.

If constant is unbound in state, then an exception is raised.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Syncom.Associativity.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity constant sets constant as an infix operator with:

  • precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.
  • associativity a if associativity = Option.Some a, or state's default associativity if associativity = Option.None.

If constant is unbound in state, then an exception is raised.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence constant sets constant as a postfix operator with precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.

If constant is unbound, then an exception is raised.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Syncom.Associativity.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state constant is the operator description corresponding to constant bound in state.

If constant is unbound in state, then an exception is raised.

val lookup_operator_precedence : - state -> - Syncom.Qualified_identifier.t -> - Support.Int.t Support.Option.t
diff --git a/beluga/Synext/Make_printer/index.html b/beluga/Synext/Make_printer/index.html deleted file mode 100644 index 682c4003e..000000000 --- a/beluga/Synext/Make_printer/index.html +++ /dev/null @@ -1,73 +0,0 @@ - -Make_printer (beluga.Synext.Make_printer)

Module Synext.Make_printer

Parameters

module Printing_state : sig ... end

Signature

include Support.Imperative_state.IMPERATIVE_STATE - with type state = Printing_state.state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val pp_signature_file : state -> signature_file -> Stdlib.Unit.t

pp_signature_file state signature_file pretty-prints signature_file with respect to the pretty-printing state state.

val pp_signature : state -> signature -> Stdlib.Unit.t

pp_signature signature state pretty-prints signature as the concatenation of its signature files, and with respect to state.

diff --git a/beluga/Synext/Meta/Context/index.html b/beluga/Synext/Meta/Context/index.html deleted file mode 100644 index dffdf63e5..000000000 --- a/beluga/Synext/Meta/Context/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Context (beluga.Synext.Meta.Context)

Module Meta.Context

External meta-contexts.

type t = {
  1. location : Syncom.Location.t;
  2. bindings : (Syncom.Identifier.t * Typ.t) Support.List.t;
}

{ Context.bindings; _ } is the meta-context

  • ^ if bindings = []
  • x1 : a1, x2 : a2, ..., xn : an if bindings = [("x1", a1, _); ("x2", a2, _); ...; ("xn", an, _)]
diff --git a/beluga/Synext/Meta/Object/index.html b/beluga/Synext/Meta/Object/index.html deleted file mode 100644 index 624686f64..000000000 --- a/beluga/Synext/Meta/Object/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Object (beluga.Synext.Meta.Object)

Module Meta.Object

External meta-objects.

type t
diff --git a/beluga/Synext/Meta/Pattern/index.html b/beluga/Synext/Meta/Pattern/index.html deleted file mode 100644 index a7d16b7ac..000000000 --- a/beluga/Synext/Meta/Pattern/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Pattern (beluga.Synext.Meta.Pattern)

Module Meta.Pattern

External meta-object patterns.

type t
diff --git a/beluga/Synext/Meta/Schema/index.html b/beluga/Synext/Meta/Schema/index.html deleted file mode 100644 index 033a09f61..000000000 --- a/beluga/Synext/Meta/Schema/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Schema (beluga.Synext.Meta.Schema)

Module Meta.Schema

External context schemas.

type t =
  1. | Constant of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Qualified_identifier.t;
    }
    (*

    Constant { identifier = "ctx"; _ } is the schema having identifier "ctx" declared elsewhere in the signature.

    A tuple term has a block type t matching against this schema if t matches against the schema referred to as `identifier'.

    *)
  2. | Alternation of {
    1. location : Syncom.Location.t;
    2. schemas : t Support.List2.t;
    }
    (*

    Alternation { schemas = [g1; g2; ...; gn]; _ } is the schema g1 + g2 + ... + gn.

    A tuple term has a block type t matching against this schema if t matches against at least one of g1, g2, ..., gn.

    *)
diff --git a/beluga/Synext/Meta/Typ/index.html b/beluga/Synext/Meta/Typ/index.html deleted file mode 100644 index c7df9213a..000000000 --- a/beluga/Synext/Meta/Typ/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Typ (beluga.Synext.Meta.Typ)

Module Meta.Typ

External meta-types.

type t =
  1. | Context_schema of {
    1. location : Syncom.Location.t;
    2. schema : Syncom.Qualified_identifier.t;
    }
    (*

    Context_schema_constant { schema; _ } is the context schema schema.

    *)
diff --git a/beluga/Synext/Meta/index.html b/beluga/Synext/Meta/index.html deleted file mode 100644 index 3100fab6d..000000000 --- a/beluga/Synext/Meta/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Meta (beluga.Synext.Meta)

Module Synext.Meta

module Typ : sig ... end

External meta-types.

module Object : sig ... end

External meta-objects.

module Pattern : sig ... end

External meta-object patterns.

module Context : sig ... end

External meta-contexts.

module Schema : sig ... end

External context schemas.

diff --git a/beluga/Synext/Printer/index.html b/beluga/Synext/Printer/index.html deleted file mode 100644 index 792b13d8b..000000000 --- a/beluga/Synext/Printer/index.html +++ /dev/null @@ -1,198 +0,0 @@ - -Printer (beluga.Synext.Printer)

Module Synext.Printer

Concrete implementation of pretty-printing for Beluga signatures.

Concrete implementation of pretty-printing for Beluga signatures.

include sig ... end
val pp_signature_file : - Synext__.Synext_pp_state.Printing_state.state -> - signature_file -> - Stdlib.Unit.t

pp_signature_file state signature_file pretty-prints signature_file with respect to the pretty-printing state state.

val pp_signature : - Synext__.Synext_pp_state.Printing_state.state -> - signature -> - Stdlib.Unit.t

pp_signature signature state pretty-prints signature as the concatenation of its signature files, and with respect to state.

Concrete implementation of PRINTING_STATE backed by a mutable data structure.

include Support.Format_state.S with type state := state
include Support.Imperative_state.IMPERATIVE_STATE with type state := state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val pp_flush : state -> Stdlib.Unit.t

pp_flush state is analogous to Format.pp_print_flush.

val pp_newline : state -> Stdlib.Unit.t

pp_newline state is analogous to Format.pp_print_newline.

val pp_nop : state -> Stdlib.Unit.t

pp_nop state is (). This is useful to signal that nothing should be printed for some execution branch.

val pp_cut : state -> Stdlib.Unit.t

pp_cut state is analogous to Format.pp_print_cut.

val pp_space : state -> Stdlib.Unit.t

pp_space state is analogous to Format.pp_print_space. Note that this is a possibly breaking space, meaning that a newline may be printed at this point.

val pp_non_breaking_space : state -> Stdlib.Unit.t

pp_non_breaking_space state pretty-prints a non-breaking space, meaning that the printer does not insert break directives to that space.

val pp_break : state -> Support.Int.t -> Support.Int.t -> Stdlib.Unit.t

pp_break state width offset is analogous to Format.pp_print_break.

val pp_as : state -> Support.Int.t -> Support.String.t -> Stdlib.Unit.t

pp_as state size is analogous to Format.pp_print_as to pretty-print a string as if it were of length size. This is useful to pretty-print UTF-8 encoded strings of known codepoint count, or to print a string as if it isn't there, like for HTML tags or ASCII escape sequences.

val pp_box : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_box state ?(indent = 0) f evaluates f state in a compacting pretty-printing box wth offset indent in the formatter (see Format.pp_open_box). The box is opened before f state, and closed afterwards.

val pp_hbox : state -> (state -> Stdlib.Unit.t) -> Stdlib.Unit.t

pp_hbox state f evaluates f state in a horizontal pretty-printing box (see Format.pp_open_hbox). The box is opened before f state, and closed afterwards.

val pp_vbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_vbox state ?(indent = 0) f evaluates f state in a vertical pretty-printing box with offset indent (see Format.pp_open_vbox). The box is opened before f state, and closed afterwards.

val pp_hvbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_hovbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_bool : state -> Stdlib.Bool.t -> Stdlib.Unit.t
val pp_int : state -> Support.Int.t -> Stdlib.Unit.t
val pp_float : state -> Stdlib.Float.t -> Stdlib.Unit.t
val pp_char : state -> Stdlib.Char.t -> Stdlib.Unit.t
val pp_string : state -> Support.String.t -> Stdlib.Unit.t
val pp_option : - state -> - ?none:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val pp_list : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t
val pp_list1 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val pp_list2 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val pp_text : state -> Support.String.t -> Stdlib.Unit.t
val pp_utf_8 : state -> Support.String.t -> Stdlib.Unit.t
val pp_utf_8_text : state -> Support.String.t -> Stdlib.Unit.t
val add_module : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - (state -> 'a) -> - 'a

add_module state identifier f is the result of f when run in a state in a new module with identifier. Bindings added by f are added to the new module only. The resultant state has identifier bound to the newly created module.

val open_module : state -> Syncom.Qualified_identifier.t -> Stdlib.Unit.t

open_module state module_identifier adds the bindings in the module having identifier module_identifier in state.

If module_identifier is unbound in state, then an exception is raised.

val add_abbreviation : - state -> - Syncom.Qualified_identifier.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation state module_identifier abbreviation adds abbreviation for referring to the module module_identifier in state.

If module_identifier is unbound in state, then an exception is raised.

val set_default_associativity : - state -> - Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state associativity sets associativity as the default associativity for new user-defined infix operators.

val get_default_associativity : state -> Syncom.Associativity.t

get_default_associativity state is the default associativity for new user-defined infix operators.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state precedence sets precedence as the default precedence for new user-defined operators.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the default precedence for new user-defined operators.

val add_lf_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_lf_term_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_inductive_computation_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_stratified_computation_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_coinductive_computation_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_abbreviation_computation_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_computation_term_constructor : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_computation_term_destructor : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_program_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence constant sets constant as a prefix operator with precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.

If constant is unbound in state, then an exception is raised.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Syncom.Associativity.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity constant sets constant as an infix operator with:

  • precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.
  • associativity a if associativity = Option.Some a, or state's default associativity if associativity = Option.None.

If constant is unbound in state, then an exception is raised.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence constant sets constant as a postfix operator with precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.

If constant is unbound, then an exception is raised.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Syncom.Associativity.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state constant is the operator description corresponding to constant bound in state.

If constant is unbound in state, then an exception is raised.

val lookup_operator_precedence : - state -> - Syncom.Qualified_identifier.t -> - Support.Int.t Support.Option.t
val create_initial_state : Support.Format.formatter -> state

create_initial_state ppf constructs an empty printing state.

val set_formatter : state -> Support.Format.formatter -> Stdlib.Unit.t

set_formatter state ppf sets ppf as instance of formatter for printing with state.

diff --git a/beluga/Synext/Printing_state/index.html b/beluga/Synext/Printing_state/index.html deleted file mode 100644 index 1429c5b65..000000000 --- a/beluga/Synext/Printing_state/index.html +++ /dev/null @@ -1,192 +0,0 @@ - -Printing_state (beluga.Synext.Printing_state)

Module Synext.Printing_state

Concrete implementation of PRINTING_STATE backed by a mutable data structure.

Concrete implementation of PRINTING_STATE backed by a mutable data structure.

include Support.Format_state.S with type state := state
include Support.Imperative_state.IMPERATIVE_STATE with type state := state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val pp_flush : state -> Stdlib.Unit.t

pp_flush state is analogous to Format.pp_print_flush.

val pp_newline : state -> Stdlib.Unit.t

pp_newline state is analogous to Format.pp_print_newline.

val pp_nop : state -> Stdlib.Unit.t

pp_nop state is (). This is useful to signal that nothing should be printed for some execution branch.

val pp_cut : state -> Stdlib.Unit.t

pp_cut state is analogous to Format.pp_print_cut.

val pp_space : state -> Stdlib.Unit.t

pp_space state is analogous to Format.pp_print_space. Note that this is a possibly breaking space, meaning that a newline may be printed at this point.

val pp_non_breaking_space : state -> Stdlib.Unit.t

pp_non_breaking_space state pretty-prints a non-breaking space, meaning that the printer does not insert break directives to that space.

val pp_break : state -> Support.Int.t -> Support.Int.t -> Stdlib.Unit.t

pp_break state width offset is analogous to Format.pp_print_break.

val pp_as : state -> Support.Int.t -> Support.String.t -> Stdlib.Unit.t

pp_as state size is analogous to Format.pp_print_as to pretty-print a string as if it were of length size. This is useful to pretty-print UTF-8 encoded strings of known codepoint count, or to print a string as if it isn't there, like for HTML tags or ASCII escape sequences.

val pp_box : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_box state ?(indent = 0) f evaluates f state in a compacting pretty-printing box wth offset indent in the formatter (see Format.pp_open_box). The box is opened before f state, and closed afterwards.

val pp_hbox : state -> (state -> Stdlib.Unit.t) -> Stdlib.Unit.t

pp_hbox state f evaluates f state in a horizontal pretty-printing box (see Format.pp_open_hbox). The box is opened before f state, and closed afterwards.

val pp_vbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_vbox state ?(indent = 0) f evaluates f state in a vertical pretty-printing box with offset indent (see Format.pp_open_vbox). The box is opened before f state, and closed afterwards.

val pp_hvbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_hovbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_bool : state -> Stdlib.Bool.t -> Stdlib.Unit.t
val pp_int : state -> Support.Int.t -> Stdlib.Unit.t
val pp_float : state -> Stdlib.Float.t -> Stdlib.Unit.t
val pp_char : state -> Stdlib.Char.t -> Stdlib.Unit.t
val pp_string : state -> Support.String.t -> Stdlib.Unit.t
val pp_option : - state -> - ?none:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val pp_list : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t
val pp_list1 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val pp_list2 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val pp_text : state -> Support.String.t -> Stdlib.Unit.t
val pp_utf_8 : state -> Support.String.t -> Stdlib.Unit.t
val pp_utf_8_text : state -> Support.String.t -> Stdlib.Unit.t
val add_module : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - (state -> 'a) -> - 'a

add_module state identifier f is the result of f when run in a state in a new module with identifier. Bindings added by f are added to the new module only. The resultant state has identifier bound to the newly created module.

val open_module : state -> Syncom.Qualified_identifier.t -> Stdlib.Unit.t

open_module state module_identifier adds the bindings in the module having identifier module_identifier in state.

If module_identifier is unbound in state, then an exception is raised.

val add_abbreviation : - state -> - Syncom.Qualified_identifier.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation state module_identifier abbreviation adds abbreviation for referring to the module module_identifier in state.

If module_identifier is unbound in state, then an exception is raised.

val set_default_associativity : - state -> - Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state associativity sets associativity as the default associativity for new user-defined infix operators.

val get_default_associativity : state -> Syncom.Associativity.t

get_default_associativity state is the default associativity for new user-defined infix operators.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state precedence sets precedence as the default precedence for new user-defined operators.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the default precedence for new user-defined operators.

val add_lf_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_lf_term_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_inductive_computation_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_stratified_computation_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_coinductive_computation_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_abbreviation_computation_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_computation_term_constructor : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_computation_term_destructor : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_program_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence constant sets constant as a prefix operator with precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.

If constant is unbound in state, then an exception is raised.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Syncom.Associativity.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity constant sets constant as an infix operator with:

  • precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.
  • associativity a if associativity = Option.Some a, or state's default associativity if associativity = Option.None.

If constant is unbound in state, then an exception is raised.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence constant sets constant as a postfix operator with precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.

If constant is unbound, then an exception is raised.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Syncom.Associativity.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state constant is the operator description corresponding to constant bound in state.

If constant is unbound in state, then an exception is raised.

val lookup_operator_precedence : - state -> - Syncom.Qualified_identifier.t -> - Support.Int.t Support.Option.t
val create_initial_state : Support.Format.formatter -> state

create_initial_state ppf constructs an empty printing state.

val set_formatter : state -> Support.Format.formatter -> Stdlib.Unit.t

set_formatter state ppf sets ppf as instance of formatter for printing with state.

diff --git a/beluga/Synext/Signature/Declaration/index.html b/beluga/Synext/Signature/Declaration/index.html deleted file mode 100644 index 4972da088..000000000 --- a/beluga/Synext/Signature/Declaration/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Declaration (beluga.Synext.Signature.Declaration)

Module Signature.Declaration

type t =
  1. | Recursive_declarations of {
    1. location : Syncom.Location.t;
    2. declarations : t Support.List1.t;
    }
    (*

    Recursive declaration(s).

    *)
  2. | Module of {
    1. location : Syncom.Location.t;
    2. identifier : Syncom.Identifier.t;
    3. entries : Entry.t Support.List.t;
    }
    (*

    Namespace declaration for other declarations.

    *)

Parsed signature element

diff --git a/beluga/Synext/Signature/Entry/index.html b/beluga/Synext/Signature/Entry/index.html deleted file mode 100644 index cab05daca..000000000 --- a/beluga/Synext/Signature/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Synext.Signature.Entry)

Module Signature.Entry

type t =
  1. | Pragma of {
    1. location : Syncom.Location.t;
    2. pragma : Pragma.t;
    }
  2. | Declaration of {
    1. location : Syncom.Location.t;
    2. declaration : Declaration.t;
    }
  3. | Comment of {
    1. location : Syncom.Location.t;
    2. content : Support.String.t;
    }
    (*

    Documentation comment

    *)
diff --git a/beluga/Synext/Signature/Global_pragma/index.html b/beluga/Synext/Signature/Global_pragma/index.html deleted file mode 100644 index 269284efd..000000000 --- a/beluga/Synext/Signature/Global_pragma/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Global_pragma (beluga.Synext.Signature.Global_pragma)

Module Signature.Global_pragma

Global signature pragmas for setting compilation parameters

Global pragmas must appear at the beginning of a signature. They act like command-line interface flags.

type t =
  1. | No_strengthening of {
    1. location : Syncom.Location.t;
    }
    (*

    No_strengthening _ is the pragma --nostrengthen for globally disabling strengthening during LF reconstruction.

    *)
  2. | Warn_on_coverage_error of {
    1. location : Syncom.Location.t;
    }
    (*

    Warn_on_coverage_error _ is the pragma --warncoverage for only printing pattern coverage problems.

    *)
  3. | Initiate_coverage_checking of {
    1. location : Syncom.Location.t;
    }
    (*

    Initiate_coverage_checking _ is the pragma --coverage for initiating coverage checking. Unless --warncoverage is used, then coverage problems raise exceptions.

    *)
diff --git a/beluga/Synext/Signature/Pragma/index.html b/beluga/Synext/Signature/Pragma/index.html deleted file mode 100644 index c6931ea7b..000000000 --- a/beluga/Synext/Signature/Pragma/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Pragma (beluga.Synext.Signature.Pragma)

Module Signature.Pragma

Signature pragmas for setting compilation parameters

Plain pragmas may be interspersed between signature declarations.

type t =
  1. | Name of {
    1. location : Syncom.Location.t;
    2. constant : Syncom.Qualified_identifier.t;
    3. meta_variable_base : Syncom.Identifier.t;
    4. computation_variable_base : Syncom.Identifier.t Support.Option.t;
    }
    (*

    Name { constant = c; meta_variable_base = u; computation_variable_base = Option.Some x; _ } is the pragma --name c u x. for configuring the name-generation settings for meta-variables and computation-level variables generated for objects of type c.

    *)
  2. | Default_associativity of {
    1. location : Syncom.Location.t;
    2. associativity : Syncom.Associativity.t;
    }
    (*

    Default_associativity { associativity; _ } is the pragma --assoc <associativity>. where <associativity> is either left, right or none. This pragma assigns the default associativity for infix constants declared afterwards.

    *)
  3. | Prefix_fixity of {
    1. location : Syncom.Location.t;
    2. constant : Syncom.Qualified_identifier.t;
    3. precedence : Support.Int.t Support.Option.t;
    4. postponed : Stdlib.Bool.t;
    }
    (*

    Prefix_fixity { constant = c; precedence; postponed; _ } is the pragma --prefix c precedence. for configuring the constant c to be parsed as a prefix operator with precedence.

    If a precedence is already assigned to c, and precedence = Option.None, then the pre-existing precedence is used.

    If postponed = false, then the pragma is attached to a constant declared earlier than the pragma. Otherwise, when postponed = true, then the pragma is attached to a constant declared immediately after the pragma.

    *)
  4. | Infix_fixity of {
    1. location : Syncom.Location.t;
    2. constant : Syncom.Qualified_identifier.t;
    3. precedence : Support.Int.t Support.Option.t;
    4. associativity : Syncom.Associativity.t Support.Option.t;
    5. postponed : Stdlib.Bool.t;
    }
    (*

    Infix_fixity { constant = c; precedence; associativity; postponed; _ } is the pragma --infix c precedence associativity. for configuring the constant c to be parsed as an infix operator with precedence and associativity.

    • If a precedence is already assigned to c, and precedence = Option.None, then the pre-existing precedence is used.
    • If associativity = Option.None, then the associativity defaults to the associativity configured by the --default_associativity assoc. pragma, or Associativity.Non_associative if that pragma was never used.

    If postponed = false, then the pragma is attached to a constant declared earlier than the pragma. Otherwise, when postponed = true, then the pragma is attached to a constant declared immediately after the pragma.

    *)
  5. | Postfix_fixity of {
    1. location : Syncom.Location.t;
    2. constant : Syncom.Qualified_identifier.t;
    3. precedence : Support.Int.t Support.Option.t;
    4. postponed : Stdlib.Bool.t;
    }
    (*

    Postfix_fixity { constant = c; precedence; postponed; _ } is the pragma --postfix c precedence. for configuring the constant c to be parsed as a postfix operator with precedence.

    If a precedence is already assigned to c, and precedence = Option.None, then the pre-existing precedence is used.

    If postponed = false, then the pragma is attached to a constant declared earlier than the pragma. Otherwise, when postponed = true, then the pragma is attached to a constant declared immediately after the pragma.

    *)
  6. | Not of {
    1. location : Syncom.Location.t;
    }
    (*

    Not _ is the pragma --not which asserts that the declaration that follows it fails reconstruction.

    *)
  7. | Open_module of {
    1. location : Syncom.Location.t;
    2. module_identifier : Syncom.Qualified_identifier.t;
    }
    (*

    Open { module_identifier; _ } is the pragma --open module_identifier. for opening the module module_identifier, which adds its values to the current scope.

    *)
  8. | Abbreviation of {
    1. location : Syncom.Location.t;
    2. module_identifier : Syncom.Qualified_identifier.t;
    3. abbreviation : Syncom.Identifier.t;
    }
    (*

    Abbreviation { module_identifier; abbreviation; _ } is the pragma --abbrev module_identifier abbreviation. for defining the alias abbreviation for the module module_identifier.

    *)
diff --git a/beluga/Synext/Signature/Totality/Declaration/index.html b/beluga/Synext/Signature/Totality/Declaration/index.html deleted file mode 100644 index 2a6e644c3..000000000 --- a/beluga/Synext/Signature/Totality/Declaration/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Declaration (beluga.Synext.Signature.Totality.Declaration)

Module Totality.Declaration

type t =
  1. | Trust of {
    1. location : Syncom.Location.t;
    }
    (*

    Trust _ is the totality declaration trust which indicates that the totality of the annotated function is not checked.

    *)
  2. | Numeric of {
    1. location : Syncom.Location.t;
    2. order : Support.Int.t Order.t Support.Option.t;
    }
    (*
    • Numeric { order = Option.None; _ } is the totality declaration total which indicates that the annotated function should be checked for totality without totality argument.
    • Numeric { order = Option.Some order; _ } is the totality declaration total order which indicates that the annotated function should be checked for totality with order.
    *)
  3. | Named of {
    1. location : Syncom.Location.t;
    2. order : Syncom.Identifier.t Order.t Support.Option.t;
    3. program : Syncom.Identifier.t;
    4. argument_labels : Syncom.Identifier.t Support.Option.t Support.List.t;
    }
    (*
    • Named { order = Option.None; program = "f"; argument_labels = ["x1"; "x2"; ...; "xn"]; _ } is the totality declaration total (f x1 x2 ... xn) which indicates that the annotated function should be checked for totality without totality argument.
    • Named { order = Option.Some order; program = "f"; argument_labels = ["x1"; "x2"; ...; "xn"]; _ } is the totality declaration total x (f x1 x2 ... xn) which indicates that the annotated function should be checked for totality with order.
    *)
diff --git a/beluga/Synext/Signature/Totality/Order/index.html b/beluga/Synext/Signature/Totality/Order/index.html deleted file mode 100644 index 32cbcacec..000000000 --- a/beluga/Synext/Signature/Totality/Order/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Order (beluga.Synext.Signature.Totality.Order)

Module Totality.Order

Totality argument orderings for totality-checking.

type 'a t =
  1. | Argument of {
    1. location : Syncom.Location.t;
    2. argument : 'a;
    }
  2. | Lexical_ordering of {
    1. location : Syncom.Location.t;
    2. arguments : 'a t Support.List1.t;
    }
  3. | Simultaneous_ordering of {
    1. location : Syncom.Location.t;
    2. arguments : 'a t Support.List1.t;
    }
diff --git a/beluga/Synext/Signature/Totality/index.html b/beluga/Synext/Signature/Totality/index.html deleted file mode 100644 index 759e276ed..000000000 --- a/beluga/Synext/Signature/Totality/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Totality (beluga.Synext.Signature.Totality)

Module Signature.Totality

Totality declarations and orderings for configuring the totality checker for theorems and proofs.

For instance, the named totality declaration

/ total [x y z] (f x y z w) /

specifies that the function named f is checked for totality using the lexical ordering [x y z] of its arguments.

module Declaration : sig ... end
module Order : sig ... end

Totality argument orderings for totality-checking.

diff --git a/beluga/Synext/Signature/index.html b/beluga/Synext/Signature/index.html deleted file mode 100644 index 327eb3e24..000000000 --- a/beluga/Synext/Signature/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Signature (beluga.Synext.Signature)

Module Synext.Signature

module Pragma : sig ... end

Signature pragmas for setting compilation parameters

module Global_pragma : sig ... end

Global signature pragmas for setting compilation parameters

module Totality : sig ... end

Totality declarations and orderings for configuring the totality checker for theorems and proofs.

module Declaration : sig ... end
module Entry : sig ... end
type signature_file = {
  1. location : Syncom.Location.t;
  2. global_pragmas : Global_pragma.t Support.List.t;
  3. entries : Entry.t Support.List.t;
}
diff --git a/beluga/Synext/module-type-BASE_PRECEDENCE/Ord/index.html b/beluga/Synext/module-type-BASE_PRECEDENCE/Ord/index.html deleted file mode 100644 index 81919ae21..000000000 --- a/beluga/Synext/module-type-BASE_PRECEDENCE/Ord/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Ord (beluga.Synext.BASE_PRECEDENCE.Ord)

Module BASE_PRECEDENCE.Ord

type t = precedence

The type of elements to compare.

val compare : t -> t -> int

compare a b compares a and b for ordering.

  • compare a b < 0 if a precedes b (denoted a < b),
  • compare a b = 0 if a is equal to b (denoted a = b),
  • compare a b > 0 if a succeeds b (denoted a > b).

This should satisfy the following properties:

  • Comparability: (compare a b <= 0 || compare b a >= 0) = true,
  • Transitivity: if (compare a b <= 0) = true and (compare b c <= 0) = true, then (compare a c <= 0) = true,
  • Reflexivity: (compare a a = 0) = true,
  • Antisymmetry: if (compare a b <= 0) = true and (compare a b >= 0) = true then (compare a b = 0) = true.
val (<) : t -> t -> bool
val (<=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val max : t -> t -> t

max a b is a if a >= b and b otherwise.

val min : t -> t -> t

min a b is a if a <= b and b otherwise.

include Support.Eq.EQ with type t := t
val equal : t -> t -> bool

equal a b is true if and only if a and b are equal. This should satisfy the following properties:

  • Reflexivity: equal a a = true
  • Symmetry: equal a b is equivalent to equal b a
  • Transitivity: if equal a b = true and equal b c = true, then equal a c = true
val (=) : t -> t -> bool

Operator alias of equal.

val (<>) : t -> t -> bool

Negation of operator (=).

diff --git a/beluga/Synext/module-type-BASE_PRECEDENCE/index.html b/beluga/Synext/module-type-BASE_PRECEDENCE/index.html deleted file mode 100644 index a0b7b0383..000000000 --- a/beluga/Synext/module-type-BASE_PRECEDENCE/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -BASE_PRECEDENCE (beluga.Synext.BASE_PRECEDENCE)

Module type Synext.BASE_PRECEDENCE

type precedence
module Ord : Support.Ord.ORD with type t = precedence
diff --git a/beluga/Synext/module-type-PRECEDENCE_STATE/index.html b/beluga/Synext/module-type-PRECEDENCE_STATE/index.html deleted file mode 100644 index 4e1ef1007..000000000 --- a/beluga/Synext/module-type-PRECEDENCE_STATE/index.html +++ /dev/null @@ -1,75 +0,0 @@ - -PRECEDENCE_STATE (beluga.Synext.PRECEDENCE_STATE)

Module type Synext.PRECEDENCE_STATE

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val lookup_operator_precedence : - state -> - Syncom.Qualified_identifier.t -> - Support.Int.t Support.Option.t
diff --git a/beluga/Synext/module-type-PRINTER/index.html b/beluga/Synext/module-type-PRINTER/index.html deleted file mode 100644 index 0396f6c7f..000000000 --- a/beluga/Synext/module-type-PRINTER/index.html +++ /dev/null @@ -1,72 +0,0 @@ - -PRINTER (beluga.Synext.PRINTER)

Module type Synext.PRINTER

Abstract definition for pretty-printing Beluga signatures.

include Support.Imperative_state.IMPERATIVE_STATE
type state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val pp_signature_file : state -> signature_file -> Stdlib.Unit.t

pp_signature_file state signature_file pretty-prints signature_file with respect to the pretty-printing state state.

val pp_signature : state -> signature -> Stdlib.Unit.t

pp_signature signature state pretty-prints signature as the concatenation of its signature files, and with respect to state.

diff --git a/beluga/Synext/module-type-PRINTING_STATE/index.html b/beluga/Synext/module-type-PRINTING_STATE/index.html deleted file mode 100644 index 8e91ccab7..000000000 --- a/beluga/Synext/module-type-PRINTING_STATE/index.html +++ /dev/null @@ -1,192 +0,0 @@ - -PRINTING_STATE (beluga.Synext.PRINTING_STATE)

Module type Synext.PRINTING_STATE

Abstract definition for the pretty-printing state.

include Support.Format_state.S with type state := state
include Support.Imperative_state.IMPERATIVE_STATE with type state := state
val traverse_tuple2 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - ('a1 * 'a2) -> - 'b1 * 'b2
val traverse_tuple3 : - state -> - (state -> 'a1 -> 'b1) -> - (state -> 'a2 -> 'b2) -> - (state -> 'a3 -> 'b3) -> - ('a1 * 'a2 * 'a3) -> - 'b1 * 'b2 * 'b3
val traverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in order, meaning that y1 is computed first, then y2, etc.

val traverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_list state f [x1; x2; ...; xn] is f state x1; f state x2; ...; f state xn.

val iter_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_reverse_list : - state -> - (state -> 'a -> 'b) -> - 'a Support.List.t -> - 'b Support.List.t

traverse_reverse_list state f [x1; x2; ...; xn] is [y1; y2; ...; yn] where yi = f state xi, and y1, y2, ..., yn are computed in reverse order, meaning that yn is computed first, then y(n-1), etc.

val traverse_reverse_list1 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List1.t -> - 'b Support.List1.t
val traverse_reverse_list2 : - state -> - (state -> 'a -> 'b) -> - 'a Support.List2.t -> - 'b Support.List2.t
val iter_rev_list : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t

iter_rev_list state f [x1; x2; ...; xn] is f state xn; f state x(n-1); ...; f state x1.

val iter_rev_list1 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val iter_rev_list2 : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val traverse_option : - state -> - (state -> 'a -> 'b) -> - 'a Support.Option.t -> - 'b Support.Option.t
val iter_option : - state -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val seq_list : state -> (state -> 'a) Support.List.t -> 'a Support.List.t
val seq_list1 : state -> (state -> 'a) Support.List1.t -> 'a Support.List1.t
val iter_seq : - state -> - (state -> Stdlib.Unit.t) Support.List.t -> - Stdlib.Unit.t
val pp_flush : state -> Stdlib.Unit.t

pp_flush state is analogous to Format.pp_print_flush.

val pp_newline : state -> Stdlib.Unit.t

pp_newline state is analogous to Format.pp_print_newline.

val pp_nop : state -> Stdlib.Unit.t

pp_nop state is (). This is useful to signal that nothing should be printed for some execution branch.

val pp_cut : state -> Stdlib.Unit.t

pp_cut state is analogous to Format.pp_print_cut.

val pp_space : state -> Stdlib.Unit.t

pp_space state is analogous to Format.pp_print_space. Note that this is a possibly breaking space, meaning that a newline may be printed at this point.

val pp_non_breaking_space : state -> Stdlib.Unit.t

pp_non_breaking_space state pretty-prints a non-breaking space, meaning that the printer does not insert break directives to that space.

val pp_break : state -> Support.Int.t -> Support.Int.t -> Stdlib.Unit.t

pp_break state width offset is analogous to Format.pp_print_break.

val pp_as : state -> Support.Int.t -> Support.String.t -> Stdlib.Unit.t

pp_as state size is analogous to Format.pp_print_as to pretty-print a string as if it were of length size. This is useful to pretty-print UTF-8 encoded strings of known codepoint count, or to print a string as if it isn't there, like for HTML tags or ASCII escape sequences.

val pp_box : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_box state ?(indent = 0) f evaluates f state in a compacting pretty-printing box wth offset indent in the formatter (see Format.pp_open_box). The box is opened before f state, and closed afterwards.

val pp_hbox : state -> (state -> Stdlib.Unit.t) -> Stdlib.Unit.t

pp_hbox state f evaluates f state in a horizontal pretty-printing box (see Format.pp_open_hbox). The box is opened before f state, and closed afterwards.

val pp_vbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t

pp_vbox state ?(indent = 0) f evaluates f state in a vertical pretty-printing box with offset indent (see Format.pp_open_vbox). The box is opened before f state, and closed afterwards.

val pp_hvbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_hovbox : - state -> - ?indent:Support.Int.t -> - (state -> Stdlib.Unit.t) -> - Stdlib.Unit.t
val pp_bool : state -> Stdlib.Bool.t -> Stdlib.Unit.t
val pp_int : state -> Support.Int.t -> Stdlib.Unit.t
val pp_float : state -> Stdlib.Float.t -> Stdlib.Unit.t
val pp_char : state -> Stdlib.Char.t -> Stdlib.Unit.t
val pp_string : state -> Support.String.t -> Stdlib.Unit.t
val pp_option : - state -> - ?none:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.Option.t -> - Stdlib.Unit.t
val pp_list : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List.t -> - Stdlib.Unit.t
val pp_list1 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List1.t -> - Stdlib.Unit.t
val pp_list2 : - state -> - ?sep:(state -> Stdlib.Unit.t) -> - (state -> 'a -> Stdlib.Unit.t) -> - 'a Support.List2.t -> - Stdlib.Unit.t
val pp_text : state -> Support.String.t -> Stdlib.Unit.t
val pp_utf_8 : state -> Support.String.t -> Stdlib.Unit.t
val pp_utf_8_text : state -> Support.String.t -> Stdlib.Unit.t
val add_module : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - (state -> 'a) -> - 'a

add_module state identifier f is the result of f when run in a state in a new module with identifier. Bindings added by f are added to the new module only. The resultant state has identifier bound to the newly created module.

val open_module : state -> Syncom.Qualified_identifier.t -> Stdlib.Unit.t

open_module state module_identifier adds the bindings in the module having identifier module_identifier in state.

If module_identifier is unbound in state, then an exception is raised.

val add_abbreviation : - state -> - Syncom.Qualified_identifier.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t

add_abbreviation state module_identifier abbreviation adds abbreviation for referring to the module module_identifier in state.

If module_identifier is unbound in state, then an exception is raised.

val set_default_associativity : - state -> - Syncom.Associativity.t -> - Stdlib.Unit.t

set_default_associativity state associativity sets associativity as the default associativity for new user-defined infix operators.

val get_default_associativity : state -> Syncom.Associativity.t

get_default_associativity state is the default associativity for new user-defined infix operators.

val set_default_precedence : state -> Support.Int.t -> Stdlib.Unit.t

set_default_precedence state precedence sets precedence as the default precedence for new user-defined operators.

val get_default_precedence : state -> Support.Int.t

get_default_precedence state is the default precedence for new user-defined operators.

val add_lf_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_lf_term_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_schema_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_inductive_computation_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_stratified_computation_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_coinductive_computation_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_abbreviation_computation_type_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_computation_term_constructor : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_computation_term_destructor : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_program_constant : - state -> - ?location:Syncom.Location.t -> - Syncom.Identifier.t -> - Stdlib.Unit.t
val add_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_prefix_notation state ?precedence constant sets constant as a prefix operator with precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.

If constant is unbound in state, then an exception is raised.

val add_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Syncom.Associativity.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_infix_notation state ?precedence ?associativity constant sets constant as an infix operator with:

  • precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.
  • associativity a if associativity = Option.Some a, or state's default associativity if associativity = Option.None.

If constant is unbound in state, then an exception is raised.

val add_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postfix_notation state ?precedence constant sets constant as a postfix operator with precedence p if precedence = Option.Some p, or state's default precedence if precedence = Option.None.

If constant is unbound, then an exception is raised.

val add_postponed_prefix_notation : - state -> - ?precedence:Support.Int.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_prefix_notation state ?precedence identifier adds a postponed prefix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_infix_notation : - state -> - ?precedence:Support.Int.t -> - ?associativity:Syncom.Associativity.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_infix_notation state ?precedence ?associativity identifier adds a postponed infix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead. Likewise, if associativity = Option.None, then get_default_associativity is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val add_postponed_postfix_notation : - state -> - ?precedence:Support.Int.t -> - Syncom.Qualified_identifier.t -> - Stdlib.Unit.t

add_postponed_postfix_notation state ?precedence identifier adds a postponed postfix notation for identifier. If precedence = Option.None, then get_default_precedence is used instead.

This notation is postponed, meaning that it only applies once apply_postponed_fixity_pragmas is called.

val apply_postponed_fixity_pragmas : state -> unit

apply_postponed_fixity_pragmas state adds in scope the postponed prefix, infix and postfix fixity pragmas. This function should be called only when the targets of those postponed pragmas are in scope. That is, postponed fixity pragmas are applied after the subsequent declaration is added, or after a group of mutually recursive declarations are added.

lookup_operator state constant is the operator description corresponding to constant bound in state.

If constant is unbound in state, then an exception is raised.

val lookup_operator_precedence : - state -> - Syncom.Qualified_identifier.t -> - Support.Int.t Support.Option.t
diff --git a/beluga/Synint/Comp/SubgoalPath/index.html b/beluga/Synint/Comp/SubgoalPath/index.html deleted file mode 100644 index 54b5d931c..000000000 --- a/beluga/Synint/Comp/SubgoalPath/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -SubgoalPath (beluga.Synint.Comp.SubgoalPath)

Module Comp.SubgoalPath

type t =
  1. | Here
  2. | Intros of t
  3. | Suffices of exp * int * t
  4. | MetaSplit of exp * meta_branch_label * t
  5. | CompSplit of exp * Syncom.Id.cid_comp_const * t
  6. | ContextSplit of exp * context_case * t
val equals : 'a -> 'b -> 'c
type builder = t -> t
val start : 'a -> 'b
val append : builder -> builder -> builder
val build_here : builder -> t
val build_intros : t -> t
val build_suffices : exp -> int -> t -> t
val build_meta_split : exp -> meta_branch_label -> t -> t
val build_comp_split : exp -> Syncom.Id.cid_comp_const -> t -> t
val build_context_split : exp -> context_case -> t -> t
diff --git a/beluga/Synint/Comp/index.html b/beluga/Synint/Comp/index.html deleted file mode 100644 index 043024455..000000000 --- a/beluga/Synint/Comp/index.html +++ /dev/null @@ -1,38 +0,0 @@ - -Comp (beluga.Synint.Comp)

Module Synint.Comp

type unbox_modifier = [
  1. | `Strengthened
]
type case_pragma =
  1. | PragmaCase
  2. | PragmaNotCase
type context_case =
  1. | EmptyContext of Syncom.Location.t
  2. | ExtendedBy of Syncom.Location.t * int
type case_label =
  1. | Lf_constant of Syncom.Location.t * Syncom.Name.t * Syncom.Id.cid_term
  2. | Comp_constant of Syncom.Location.t * Syncom.Name.t * Syncom.Id.cid_comp_const
  3. | BVarCase of Syncom.Location.t
  4. | ContextCase of context_case
  5. | PVarCase of Syncom.Location.t * int * int option
type 'a generic_order =
  1. | Arg of 'a
  2. | Lex of 'a generic_order list
  3. | Simul of 'a generic_order list
type 'a generic_suffices_typ = [
  1. | `exact of 'a
  2. | `infer of Syncom.Location.t
]

Type specified in an interactive use of `suffices`

val map_suffices_typ : - ('a -> 'b) -> - 'a0 generic_suffices_typ -> - 'b0 generic_suffices_typ
val map_order : ('a -> 'b) -> 'a0 generic_order -> 'b0 generic_order
type kind =
  1. | Ctype of Syncom.Location.t
  2. | PiKind of Syncom.Location.t * LF.ctyp_decl * kind
type meta_typ = LF.ctyp
type meta_obj = Syncom.Location.t * LF.mfront
type meta_spine =
  1. | MetaNil
  2. | MetaApp of meta_obj * meta_typ * meta_spine * Syncom.Plicity.t
type suffices_typ = typ generic_suffices_typ
val loc_of_typ : typ -> Syncom.Location.t
val loc_of_suffices_typ : suffices_typ -> Syncom.Location.t
type ih_arg =
  1. | M of meta_obj * meta_typ
  2. | V of Syncom.Id.offset
  3. | E
  4. | DC
type wf_tag = bool
type ctyp_decl =
  1. | CTypDecl of Syncom.Name.t * typ * wf_tag
  2. | CTypDeclOpt of Syncom.Name.t
type ih_decl =
  1. | WfRec of Syncom.Name.t * ih_arg list * typ
val rename_ctyp_decl : - (Syncom.Name.t -> Syncom.Name.t) -> - ctyp_decl -> - ctyp_decl
type gctx = ctyp_decl LF.ctx
type ihctx = ih_decl LF.ctx
and pattern_spine =
  1. | PatNil
  2. | PatApp of Syncom.Location.t * pattern * pattern_spine
  3. | PatObs of Syncom.Location.t * Syncom.Id.cid_comp_dest * LF.msub * pattern_spine
and branch =
  1. | Branch of Syncom.Location.t - * LF.mctx - * LF.mctx * gctx - * pattern - * LF.msub - * exp
and fun_branches =
  1. | NilFBranch of Syncom.Location.t
  2. | ConsFBranch of Syncom.Location.t - * LF.mctx * gctx * pattern_spine * exp - * fun_branches
type tclo = typ * LF.msub
type order = int generic_order
type 'order total_dec_kind = [
  1. | `inductive of 'order
  2. | `not_recursive
  3. | `trust
  4. | `partial
]
val map_total_dec_kind : - ('o2 -> 'o20) -> - 'o21 total_dec_kind -> - 'o22 total_dec_kind
val option_of_total_dec_kind : [> `inductive of 'a ] -> 'b option
val apply_many : exp -> exp list -> exp

Applies a spine of checkable terms to a synthesizable term, from left to right.

val loc_of_exp : exp -> Syncom.Location.t
type total_dec = {
  1. name : Syncom.Name.t;
  2. tau : typ;
  3. order : order total_dec_kind;
}
val make_total_dec : Syncom.Name.t -> typ -> order total_dec_kind -> total_dec
val is_meta_obj : exp -> meta_obj option

Decides whether this synthesizable expression is actually an annotated box.

val head_of_meta_obj : meta_obj -> (LF.dctx_hat * LF.head) option
val itermToClObj : LF.iterm -> LF.clobj
val metaObjToMFront : ('a * 'b) -> 'c
val head_of_application : exp -> exp

Finds the head of an application. Chases meta-applications and computation applications.

val strip_pattern : pattern -> pattern

Removes all type annotations from a pattern.

val strip_pattern_spine : pattern_spine -> pattern_spine
type defer_kind = [
  1. | `subgoal
  2. | `theorem
]
type invoke_kind = [
  1. | `ih
  2. | `lemma
]
type split_kind = [
  1. | `split
  2. | `invert
  3. | `impossible
]
type level = [
  1. | `meta
  2. | `comp
]
type hypotheses = {
  1. cD : LF.mctx;
  2. cG : gctx;
  3. cIH : ihctx;
}
val no_hypotheses : hypotheses
type meta_branch_label = [
  1. | `ctor of Syncom.Id.cid_term
  2. | `pvar of int option
  3. | `bvar
]
module SubgoalPath : sig ... end
type proof =
  1. | Incomplete of Syncom.Location.t * proof_state
  2. | Command of command * proof
  3. | Directive of directive
and command =
  1. | By of exp * Syncom.Name.t * typ
  2. | Unbox of exp * Syncom.Name.t * LF.ctyp * unbox_modifier option
and proof_state = {
  1. context : hypotheses;
  2. label : SubgoalPath.builder;
  3. goal : tclo;
  4. solution : proof option Stdlib.ref;
}
and directive =
  1. | Intros of hypothetical
  2. | Solve of exp
  3. | ImpossibleSplit of exp
  4. | Suffices of exp * suffices_arg list
  5. | MetaSplit of exp * typ * meta_branch list
  6. | CompSplit of exp * typ * comp_branch list
  7. | ContextSplit of exp * typ * context_branch list
and suffices_arg = Syncom.Location.t * typ * proof
and context_branch = context_case split_branch
and 'b split_branch =
  1. | SplitBranch of 'b * gctx * pattern * LF.msub * hypothetical

A general branch of a case analysis.

and hypothetical =
  1. | Hypothetical of Syncom.Location.t * hypotheses * proof

A hypothetical derivation lists meta-hypotheses and hypotheses, then proceeds with a proof.

An open subgoal is a proof state together with a reference ot the theorem in which it occurs.

val make_proof_state : SubgoalPath.builder -> tclo -> proof_state

Generates a unsolved subgoal with the given goal in an empty context, with no label.

val incomplete_proof : Syncom.Location.t -> proof_state -> proof

Smart constructor for an unfinished proof ending.

val intros : hypotheses -> proof -> proof

Smart constructor for the intros directive.

val suffices : exp -> suffices_arg list -> proof
val proof_cons : command -> proof -> proof
val solve : exp -> proof
val context_split : exp -> typ -> context_branch list -> proof
val context_branch : - context_case -> - (gctx * pattern) -> - LF.msub -> - hypotheses -> - proof -> - context_branch
val meta_split : exp -> typ -> meta_branch list -> proof
val impossible_split : exp -> proof
val meta_branch : - meta_branch_label -> - (gctx * pattern) -> - LF.msub -> - hypotheses -> - proof -> - meta_branch
val comp_split : exp -> typ -> comp_branch list -> proof
val comp_branch : - Syncom.Id.cid_comp_const -> - (gctx * pattern) -> - LF.msub -> - hypotheses -> - proof -> - comp_branch
val prepend_commands : command list -> proof -> proof

Gives a more convenient way of writing complex proofs by using list syntax.

val name_of_ctyp_decl : ctyp_decl -> Syncom.Name.t
val metavariable_of_exp : - exp -> - (Syncom.Id.offset * Syncom.Id.offset option) option

Decides whether the computational term is actually a variable index object. See `LF.variable_of_mfront`.

val variable_of_exp : exp -> Syncom.Id.offset option
type thm =
  1. | Proof of proof
  2. | Program of exp
type env =
  1. | Empty
  2. | Cons of value * env
and value =
  1. | FnValue of Syncom.Name.t * exp * LF.msub * env
  2. | FunValue of fun_branches_value
  3. | ThmValue of Syncom.Id.cid_prog * thm * LF.msub * env
  4. | MLamValue of Syncom.Name.t * exp * LF.msub * env
  5. | CtxValue of Syncom.Name.t * exp * LF.msub * env
  6. | BoxValue of meta_obj
  7. | ConstValue of Syncom.Id.cid_prog
  8. | DataValue of Syncom.Id.cid_comp_const * data_spine
  9. | TupleValue of value Support.List2.t
and data_spine =
  1. | DataNil
  2. | DataApp of value * data_spine
and fun_branches_value =
  1. | NilValBranch
  2. | ConsValBranch of pattern_spine * exp * LF.msub * env * fun_branches_value
diff --git a/beluga/Synint/LF/index.html b/beluga/Synint/LF/index.html deleted file mode 100644 index ed25cd364..000000000 --- a/beluga/Synint/LF/index.html +++ /dev/null @@ -1,9 +0,0 @@ - -LF (beluga.Synint.LF)

Module Synint.LF

type 'a ctx =
  1. | Empty
  2. | Dec of 'a ctx * 'a
type svar_class =
  1. | Ren
  2. | Subst
type kind =
  1. | Typ
  2. | PiKind of typ_decl * Syncom.Depend.t * Syncom.Plicity.t * kind
and typ_decl =
  1. | TypDecl of Syncom.Name.t * typ
  2. | TypDeclOpt of Syncom.Name.t
and cltyp =
  1. | MTyp of typ
  2. | PTyp of typ
  3. | STyp of svar_class * dctx

Right-hand side of the turnstile for meta-types

and ctyp =
  1. | ClTyp of cltyp * dctx
  2. | CTyp of Syncom.Id.cid_schema option

Meta-types

and ctyp_decl =
  1. | Decl of {
    1. name : Syncom.Name.t;
    2. typ : ctyp;
    3. plicity : Syncom.Plicity.t;
    4. inductivity : Syncom.Inductivity.t;
    }
  2. | DeclOpt of {
    1. name : Syncom.Name.t;
    2. plicity : Syncom.Plicity.t;
    }
and typ =
  1. | Atom of Syncom.Location.t * Syncom.Id.cid_typ * spine
  2. | PiTyp of typ_decl * Syncom.Depend.t * Syncom.Plicity.t * typ
  3. | Sigma of typ_rec
  4. | TClo of typ * sub
and head =
  1. | BVar of Syncom.Id.offset
  2. | Const of Syncom.Id.cid_term
  3. | MMVar of mm_var_inst
  4. | MPVar of mm_var_inst
  5. | MVar of cvar * sub
  6. | PVar of Syncom.Id.offset * sub
  7. | AnnH of head * typ
  8. | Proj of head * int
  9. | FVar of Syncom.Name.t
  10. | FMVar of fvarsub
  11. | FPVar of fvarsub
  12. | HClo of Syncom.Id.offset * Syncom.Id.offset * sub
  13. | HMClo of Syncom.Id.offset * mm_var_inst
and fvarsub = Syncom.Name.t * sub
and spine =
  1. | Nil
  2. | App of normal * spine
  3. | SClo of spine * sub
and sub =
  1. | Shift of Syncom.Id.offset
  2. | SVar of Syncom.Id.offset * int * sub
  3. | FSVar of Syncom.Id.offset * fvarsub
  4. | Dot of front * sub
  5. | MSVar of Syncom.Id.offset * mm_var_inst
  6. | EmptySub
  7. | Undefs
and front =
  1. | Head of head
  2. | Obj of normal
  3. | Undef
and mfront =
  1. | ClObj of dctx_hat * clobj
  2. | CObj of dctx
  3. | MV of Syncom.Id.offset
  4. | MUndef
and clobj =
  1. | MObj of normal
  2. | PObj of head
  3. | SObj of sub
and msub =
  1. | MShift of int
  2. | MDot of mfront * msub
and cvar =
  1. | Offset of Syncom.Id.offset
  2. | Inst of mm_var
and mm_var = {
  1. name : Syncom.Name.t;
  2. instantiation : iterm option Stdlib.ref;
  3. cD : mctx;
  4. mmvar_id : int;
  5. typ : ctyp;
  6. constraints : cnstr list Stdlib.ref;
  7. plicity : Syncom.Plicity.t;
  8. inductivity : Syncom.Inductivity.t;
}
and mm_var_inst' = mm_var * msub
and mm_var_inst = mm_var_inst' * sub
and iterm =
  1. | INorm of normal
  2. | IHead of head
  3. | ISub of sub
  4. | ICtx of dctx
and tvar =
  1. | TInst of typ option Stdlib.ref * dctx * kind * cnstr list Stdlib.ref
and constrnt_id = int
and constrnt =
  1. | Queued of constrnt_id
  2. | Eqn of constrnt_id * mctx * dctx * iterm * iterm
and cnstr = constrnt Stdlib.ref
and dctx =
  1. | Null
  2. | CtxVar of ctx_var
  3. | DDec of dctx * typ_decl
and ctx_var =
  1. | CtxName of Syncom.Name.t
  2. | CtxOffset of Syncom.Id.offset
  3. | CInst of mm_var_inst'
and sch_elem =
  1. | SchElem of typ_decl ctx * typ_rec
and schema =
  1. | Schema of sch_elem list
and dctx_hat = ctx_var option * Syncom.Id.offset
and typ_rec =
  1. | SigmaLast of Syncom.Name.t option * typ
  2. | SigmaElem of Syncom.Name.t * typ * typ_rec
and tuple =
  1. | Last of normal
  2. | Cons of normal * tuple
and mctx = ctyp_decl ctx
val map_plicity : (Syncom.Plicity.t -> Syncom.Plicity.t) -> normal -> normal
val proj_maybe : head -> int option -> head
val tclo : typ -> sub -> typ

Helper for forming TClo LF types, which avoids doing so if the substitution is the identity.

val mm_var_inst : mm_var -> msub -> sub -> mm_var_inst

Forms an MMVar instantiation by attaching an LF substitution and a meta-substituation to the variable.

val is_mmvar_instantiated : mm_var -> bool
val type_of_mmvar_instantiated : mm_var -> ctyp
val rename_ctyp_decl : - (Syncom.Name.t -> Syncom.Name.t) -> - ctyp_decl -> - ctyp_decl
val head : head -> normal

Embeds a head into a normal by using an empty spine. Very useful for constructing variables as normals. Note that the normal will have a ghost location, as heads don't carry a location.

val mvar : cvar -> sub -> head
val mmvar : mm_var_inst -> head
val mpvar : mm_var_inst -> head

Assert that the contextual type declaration be a real Decl, and not a DeclOpt. Raises a violation if it is a DeclOpt.

val null_hat : dctx_hat
val loc_of_normal : normal -> Syncom.Location.t
type nclo = normal * sub
type sclo = spine * sub
type tclo = typ * sub
type trec_clo = typ_rec * sub
val blockLength : typ_rec -> int
val getType : head -> (typ_rec * sub) -> int -> typ * sub
val getIndex : typ_rec -> Syncom.Name.t -> int
val is_explicit : ctyp_decl -> bool
val name_of_ctyp_decl : ctyp_decl -> Syncom.Name.t
val variable_of_mfront : - mfront -> - (Syncom.Id.offset * Syncom.Id.offset option) option

Decides whether the given mfront is a variable, viz. projection of a pattern variable, metavariable, or context variable. Returns the offset of the variable, and optionally the projection offset.

val get_constraint_id : constrnt -> constrnt_id
val drop_spine : int -> spine -> spine
diff --git a/beluga/Synint/Sgn/index.html b/beluga/Synint/Sgn/index.html deleted file mode 100644 index 86ee7b7b5..000000000 --- a/beluga/Synint/Sgn/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sgn (beluga.Synint.Sgn)

Module Synint.Sgn

type global_prag =
  1. | No_strengthening of {
    1. location : Syncom.Location.t;
    }
  2. | Warn_on_coverage_error of {
    1. location : Syncom.Location.t;
    }
  3. | Initiate_coverage_checking of {
    1. location : Syncom.Location.t;
    }
type prag =
  1. | NamePrag of {
    1. location : Syncom.Location.t;
    2. constant : Syncom.Qualified_identifier.t;
    3. meta_variable_base : Syncom.Identifier.t;
    4. computation_variable_base : Syncom.Identifier.t Support.Option.t;
    }
  2. | NotPrag of {
    1. location : Syncom.Location.t;
    }
  3. | OpenPrag of {
    1. location : Syncom.Location.t;
    2. module_identifier : Syncom.Qualified_identifier.t;
    }
  4. | DefaultAssocPrag of {
    1. location : Syncom.Location.t;
    2. associativity : Syncom.Associativity.t;
    }
  5. | PrefixFixityPrag of {
    1. location : Syncom.Location.t;
    2. constant : Syncom.Qualified_identifier.t;
    3. precedence : Support.Int.t Support.Option.t;
    4. postponed : Stdlib.Bool.t;
    }
  6. | InfixFixityPrag of {
    1. location : Syncom.Location.t;
    2. constant : Syncom.Qualified_identifier.t;
    3. precedence : Support.Int.t Support.Option.t;
    4. associativity : Syncom.Associativity.t Support.Option.t;
    5. postponed : Stdlib.Bool.t;
    }
  7. | PostfixFixityPrag of {
    1. location : Syncom.Location.t;
    2. constant : Syncom.Qualified_identifier.t;
    3. precedence : Support.Int.t Support.Option.t;
    4. postponed : Stdlib.Bool.t;
    }
  8. | AbbrevPrag of {
    1. location : Syncom.Location.t;
    2. module_identifier : Syncom.Qualified_identifier.t;
    3. abbreviation : Syncom.Identifier.t;
    }
    (*

    AbbrevPrag { module_identifier; abbreviation; _ } is the pragma --abbrev module_identifier abbreviation. for defining the alias abbreviation for the module module_identifier.

    *)
  9. | Query of {
    1. location : Syncom.Location.t;
    2. name : Syncom.Identifier.t Support.Option.t;
    3. typ : LF.typ * Syncom.Id.offset;
    4. expected_solutions : Support.Int.t Support.Option.t;
    5. maximum_tries : Support.Int.t Support.Option.t;
    }
    (*

    Logic programming query on LF type

    *)
type positivity_flag =
  1. | Nocheck
  2. | Positivity
  3. | Stratify of Syncom.Location.t * int
  4. | StratifyAll of Syncom.Location.t
type decl =
  1. | Typ of {
    1. location : Syncom.Location.t;
    2. cid : Syncom.Id.cid_typ;
    3. identifier : Syncom.Identifier.t;
    4. kind : LF.kind;
    }
    (*

    LF type family declaration

    *)
  2. | Const of {
    1. location : Syncom.Location.t;
    2. cid : Syncom.Id.cid_term;
    3. identifier : Syncom.Identifier.t;
    4. typ : LF.typ;
    }
    (*

    LF type constant declaration

    *)
  3. | CompTyp of {
    1. location : Syncom.Location.t;
    2. cid : Syncom.Id.cid_comp_typ;
    3. identifier : Syncom.Identifier.t;
    4. kind : Comp.kind;
    5. positivity_flag : positivity_flag;
    }
    (*

    Computation-level data type constant declaration

    *)
  4. | CompCotyp of {
    1. location : Syncom.Location.t;
    2. cid : Syncom.Id.cid_comp_cotyp;
    3. identifier : Syncom.Identifier.t;
    4. kind : Comp.kind;
    }
    (*

    Computation-level codata type constant declaration

    *)
  5. | CompConst of {
    1. location : Syncom.Location.t;
    2. cid : Syncom.Id.cid_comp_const;
    3. identifier : Syncom.Identifier.t;
    4. typ : Comp.typ;
    }
    (*

    Computation-level type constructor declaration

    *)
  6. | CompDest of {
    1. location : Syncom.Location.t;
    2. cid : Syncom.Id.cid_comp_dest;
    3. identifier : Syncom.Identifier.t;
    4. mctx : LF.mctx;
    5. observation_typ : Comp.typ;
    6. return_typ : Comp.typ;
    }
    (*

    Computation-level type destructor declaration

    *)
  7. | CompTypAbbrev of {
    1. location : Syncom.Location.t;
    2. cid : Syncom.Id.cid_comp_typdef;
    3. identifier : Syncom.Identifier.t;
    4. kind : Comp.kind;
    5. typ : Comp.typ;
    }
    (*

    Synonym declaration for computation-level type

    *)
  8. | Schema of {
    1. location : Syncom.Location.t;
    2. cid : Syncom.Id.cid_schema;
    3. identifier : Syncom.Identifier.t;
    4. schema : LF.schema;
    }
    (*

    Declaration of a specification for a set of contexts

    *)
  9. | Val of {
    1. location : Syncom.Location.t;
    2. cid : Syncom.Id.cid_prog;
    3. identifier : Syncom.Identifier.t;
    4. typ : Comp.typ;
    5. expression : Comp.exp;
    6. expression_value : Comp.value option;
    }
    (*

    Computation-level value declaration

    *)
  10. | Recursive_declarations of {
    1. location : Syncom.Location.t;
    2. declarations : decl Support.List1.t;
    }
    (*

    Mutually-recursive declarations

    *)
  11. | Theorem of {
    1. identifier : Syncom.Identifier.t;
    2. cid : Syncom.Id.cid_prog;
    3. typ : Comp.typ;
    4. body : Comp.thm;
    5. location : Syncom.Location.t;
    }
    (*

    Theorem declaration

    *)
  12. | Module of {
    1. location : Syncom.Location.t;
    2. cid : Syncom.Id.module_id;
    3. identifier : Syncom.Identifier.t;
    4. entries : entry list;
    }
    (*

    Namespace declaration for other declarations

    *)

Reconstructed signature element

and entry =
  1. | Pragma of {
    1. location : Syncom.Location.t;
    2. pragma : prag;
    }
  2. | Declaration of {
    1. location : Syncom.Location.t;
    2. declaration : decl;
    }
  3. | Comment of {
    1. location : Syncom.Location.t;
    2. content : Support.String.t;
    }
    (*

    Documentation comment

    *)
type sgn_file = {
  1. location : Syncom.Location.t;
  2. global_pragmas : global_prag list;
  3. entries : entry list;
}

Reconstructed Beluga project

diff --git a/beluga/Synprs/CLF/Context_object/Head/index.html b/beluga/Synprs/CLF/Context_object/Head/index.html deleted file mode 100644 index c3c8cec57..000000000 --- a/beluga/Synprs/CLF/Context_object/Head/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Head (beluga.Synprs.CLF.Context_object.Head)

Module Context_object.Head

type t =
  1. | None of {
    1. location : Beluga_syntax.Syncom.Location.t;
    }
  2. | Identity of {
    1. location : Beluga_syntax.Syncom.Location.t;
    }
diff --git a/beluga/Synprs/CLF/Context_object/index.html b/beluga/Synprs/CLF/Context_object/index.html deleted file mode 100644 index 8b626f603..000000000 --- a/beluga/Synprs/CLF/Context_object/index.html +++ /dev/null @@ -1,3 +0,0 @@ - -Context_object (beluga.Synprs.CLF.Context_object)

Module CLF.Context_object

Contextual LF substitutions and contexts blurred together.

module Head : sig ... end
diff --git a/beluga/Synprs/CLF/Object/index.html b/beluga/Synprs/CLF/Object/index.html deleted file mode 100644 index 00df6ed93..000000000 --- a/beluga/Synprs/CLF/Object/index.html +++ /dev/null @@ -1,6 +0,0 @@ - -Object (beluga.Synprs.CLF.Object)

Module CLF.Object

Contextual LF types, terms and patterns blurred together.

type t =
  1. | Raw_identifier of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. identifier : Beluga_syntax.Syncom.Identifier.t * [ `Plain | `Hash | `Dollar ];
    3. prefixed : Stdlib.Bool.t;
    }
    (*
    • Raw_identifier { identifier = "$x"; modifier = `Dollar; _ } is the substitution variable "$x".
    • Raw_identifier { identifier = "#x"; modifier = `Hash; _ } is the parameter variable "#x".
    • Raw_identifier { identifier = "x"; prefixed = false; _ } is the variable or constant "x".
    • Raw_identifier { identifier = "x"; prefixed = true; _ } is the prefixed variable or constant "(x)".

    A prefixed constant may appear as an argument, or as applicand in prefix notation irrespective of its pre-defined fixity and associativity.

    *)
  2. | Raw_qualified_identifier of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. identifier : Beluga_syntax.Syncom.Qualified_identifier.t;
    3. prefixed : Stdlib.Bool.t;
    }
    (*
    • Raw_qualified_identifier { identifier = "M.x"; prefixed = false; _ } is the constant "M.x".
    • Raw_qualified_identifier { identifier = "M.x"; prefixed = true; _ } is the prefixed constant "(M.x)".

    Since identifiers are ambiguous with qualified identifiers in the parser, the following may be assumed during disambiguation: List.length (Qualified_identifier.namespaces identifier) >= 1.

    Qualified identifiers are ambiguous with named projections.

    A prefixed constant may appear as an argument, or as applicand in prefix notation irrespective of its pre-defined fixity and associativity.

    *)
  3. | Raw_hole of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. variant : [ `Underscore - | `Unlabelled - | `Labelled of Beluga_syntax.Syncom.Identifier.t ];
    }
  4. | Raw_pi of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. parameter_identifier : Beluga_syntax.Syncom.Identifier.t Support.Option.t;
    3. parameter_sort : t Support.Option.t;
    4. plicity : Beluga_syntax.Syncom.Plicity.t;
    5. body : t;
    }
    (*

    Raw_pi { parameter_identifier = Option.Some "x"; parameter_sort = Option.Some t; body; _ } is the Pi kind or type { x : t } body.

    It is a syntax error to omit the parameter sort. Implicit Pis currently do not have a corresponding syntax, but it may be added in the future.

    *)
  5. | Raw_lambda of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. parameter_identifier : Beluga_syntax.Syncom.Identifier.t Support.Option.t;
    3. parameter_sort : t Support.Option.t;
    4. body : t;
    }
  6. | Raw_arrow of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. domain : t;
    3. range : t;
    4. orientation : [ `Forward | `Backward ];
    }
  7. | Raw_annotated of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. object_ : t;
    3. sort : t;
    }
  8. | Raw_application of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. objects : t Support.List2.t;
    }
    (*

    Raw_application { objects; _ } is the juxtaposition of objects delimited by whitespaces. objects may contain prefix, infix or postfix operators, along with operands. These are rewritten during the disambiguation to the external syntax.

    *)
  9. | Raw_block of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. elements : (Beluga_syntax.Syncom.Identifier.t Support.Option.t * t) - Support.List1.t;
    }
  10. | Raw_tuple of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. elements : t Support.List1.t;
    }
  11. | Raw_projection of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. object_ : t;
    3. projection : [ `By_identifier of Beluga_syntax.Syncom.Identifier.t - | `By_position of Support.Int.t ];
    }
  12. | Raw_substitution of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. object_ : t;
    3. substitution : Context_object.t;
    }
diff --git a/beluga/Synprs/CLF/index.html b/beluga/Synprs/CLF/index.html deleted file mode 100644 index 99c1f05c6..000000000 --- a/beluga/Synprs/CLF/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -CLF (beluga.Synprs.CLF)

Module Synprs.CLF

The intermediate representation of contextual LF types, terms and patterns to delay the handling of data-dependent aspects of the grammar.

This is LF augmented with substitutions, contexts and blocks.

The intermediate representation of contextual LF types, terms and patterns to delay the handling of data-dependent aspects of the grammar.

This is LF augmented with substitutions, contexts and blocks.

module Object : sig ... end

Contextual LF types, terms and patterns blurred together.

module Context_object : sig ... end

Contextual LF substitutions and contexts blurred together.

diff --git a/beluga/Synprs/Comp/Context_object/index.html b/beluga/Synprs/Comp/Context_object/index.html deleted file mode 100644 index 30adfd0b2..000000000 --- a/beluga/Synprs/Comp/Context_object/index.html +++ /dev/null @@ -1,3 +0,0 @@ - -Context_object (beluga.Synprs.Comp.Context_object)

Module Comp.Context_object

diff --git a/beluga/Synprs/Comp/Copattern_object/index.html b/beluga/Synprs/Comp/Copattern_object/index.html deleted file mode 100644 index 2bfbd4d50..000000000 --- a/beluga/Synprs/Comp/Copattern_object/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Copattern_object (beluga.Synprs.Comp.Copattern_object)

Module Comp.Copattern_object

type t =
  1. | Raw_observation of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. observation : Beluga_syntax.Syncom.Qualified_identifier.t;
    }
  2. | Raw_pattern of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. pattern : Pattern_object.t;
    }
diff --git a/beluga/Synprs/Comp/Expression_object/index.html b/beluga/Synprs/Comp/Expression_object/index.html deleted file mode 100644 index 4162c4ab5..000000000 --- a/beluga/Synprs/Comp/Expression_object/index.html +++ /dev/null @@ -1,7 +0,0 @@ - -Expression_object (beluga.Synprs.Comp.Expression_object)

Module Comp.Expression_object

type t =
  1. | Raw_identifier of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. identifier : Beluga_syntax.Syncom.Identifier.t;
    3. prefixed : Stdlib.Bool.t;
    }
  2. | Raw_qualified_identifier of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. identifier : Beluga_syntax.Syncom.Qualified_identifier.t;
    3. prefixed : Stdlib.Bool.t;
    }
    (*
    • Raw_qualified_identifier { identifier = "M.x"; prefixed = false; _ } is the constant "M.x".
    • Raw_qualified_identifier { identifier = "M.x"; prefixed = true; _ } is the prefixed constant "(M.x)".

    Since identifiers are ambiguous with qualified identifiers in the parser, the following may be assumed during disambiguation: List.length (Qualified_identifier.namespaces identifier) >= 1.

    Qualified identifiers are ambiguous with observations.

    A prefixed constant may appear as an argument, or as applicand in prefix notation irrespective of its pre-defined fixity and associativity.

    *)
  3. | Raw_fn of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. parameters : (Beluga_syntax.Syncom.Location.t - * Beluga_syntax.Syncom.Identifier.t Support.Option.t) - Support.List1.t;
    3. body : t;
    }
  4. | Raw_mlam of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. parameters : (Beluga_syntax.Syncom.Location.t - * (Beluga_syntax.Syncom.Identifier.t Support.Option.t - * [ `Plain | `Hash | `Dollar ])) - Support.List1.t;
    3. body : t;
    }
  5. | Raw_impossible of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. scrutinee : t;
    }
  6. | Raw_tuple of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. elements : t Support.List2.t;
    }
  7. | Raw_hole of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. label : Beluga_syntax.Syncom.Identifier.t Support.Option.t;
    }
  8. | Raw_box_hole of {
    1. location : Beluga_syntax.Syncom.Location.t;
    }
  9. | Raw_application of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. expressions : t Support.List2.t;
    }
  10. | Raw_annotated of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. expression : t;
    3. typ : Sort_object.t;
    }
  11. | Raw_observation of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. scrutinee : t;
    3. destructor : Beluga_syntax.Syncom.Qualified_identifier.t;
    }
    (*

    Raw_observation { scrutinee = e; destructor = ".tl"; _ } is the observation e .tl.

    Because of the lexical convention, destructor may be multiple consecutive destructors. For instance, (x) .tl .tl has destructor = ".tl.tl".

    *)
diff --git a/beluga/Synprs/Comp/Pattern_object/index.html b/beluga/Synprs/Comp/Pattern_object/index.html deleted file mode 100644 index dda640779..000000000 --- a/beluga/Synprs/Comp/Pattern_object/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Pattern_object (beluga.Synprs.Comp.Pattern_object)

Module Comp.Pattern_object

type t =
  1. | Raw_identifier of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. identifier : Beluga_syntax.Syncom.Identifier.t;
    3. prefixed : Stdlib.Bool.t;
    }
  2. | Raw_qualified_identifier of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. identifier : Beluga_syntax.Syncom.Qualified_identifier.t;
    3. prefixed : Stdlib.Bool.t;
    }
  3. | Raw_tuple of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. elements : t Support.List2.t;
    }
  4. | Raw_application of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. patterns : t Support.List2.t;
    }
  5. | Raw_annotated of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. pattern : t;
    3. typ : Sort_object.t;
    }
  6. | Raw_wildcard of {
    1. location : Beluga_syntax.Syncom.Location.t;
    }
diff --git a/beluga/Synprs/Comp/Sort_object/index.html b/beluga/Synprs/Comp/Sort_object/index.html deleted file mode 100644 index f07b1195c..000000000 --- a/beluga/Synprs/Comp/Sort_object/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Sort_object (beluga.Synprs.Comp.Sort_object)

Module Comp.Sort_object

Computational kinds and types blurred together.

type t =
  1. | Raw_identifier of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. identifier : Beluga_syntax.Syncom.Identifier.t;
    3. prefixed : Stdlib.Bool.t;
    }
  2. | Raw_qualified_identifier of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. identifier : Beluga_syntax.Syncom.Qualified_identifier.t;
    3. prefixed : Stdlib.Bool.t;
    }
  3. | Raw_ctype of {
    1. location : Beluga_syntax.Syncom.Location.t;
    }
  4. | Raw_arrow of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. domain : t;
    3. range : t;
    4. orientation : [ `Forward | `Backward ];
    }
  5. | Raw_cross of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. operands : t Support.List2.t;
    }
  6. | Raw_application of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. objects : t Support.List2.t;
    }
diff --git a/beluga/Synprs/Comp/index.html b/beluga/Synprs/Comp/index.html deleted file mode 100644 index 6fdce0c41..000000000 --- a/beluga/Synprs/Comp/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Comp (beluga.Synprs.Comp)

Module Synprs.Comp

The intermediate representation of computation-level kinds, types, expressions and patterns to delay the handling of data-dependent aspects of the grammar.

The intermediate representation of computation-level kinds, types, expressions and patterns to delay the handling of data-dependent aspects of the grammar.

module Sort_object : sig ... end

Computational kinds and types blurred together.

module Expression_object : sig ... end
module Pattern_object : sig ... end
module Copattern_object : sig ... end
module Context_object : sig ... end
diff --git a/beluga/Synprs/Harpoon/Command/index.html b/beluga/Synprs/Harpoon/Command/index.html deleted file mode 100644 index 3a952b4d6..000000000 --- a/beluga/Synprs/Harpoon/Command/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Command (beluga.Synprs.Harpoon.Command)

Module Harpoon.Command

type t
diff --git a/beluga/Synprs/Harpoon/Directive/index.html b/beluga/Synprs/Harpoon/Directive/index.html deleted file mode 100644 index 8b641abc3..000000000 --- a/beluga/Synprs/Harpoon/Directive/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Directive (beluga.Synprs.Harpoon.Directive)

Module Harpoon.Directive

type t =
  1. | Intros of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. hypothetical : Hypothetical.t;
    }
diff --git a/beluga/Synprs/Harpoon/Hypothetical/index.html b/beluga/Synprs/Harpoon/Hypothetical/index.html deleted file mode 100644 index a2962a6b8..000000000 --- a/beluga/Synprs/Harpoon/Hypothetical/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Hypothetical (beluga.Synprs.Harpoon.Hypothetical)

Module Harpoon.Hypothetical

type t = {
  1. location : Beluga_syntax.Syncom.Location.t;
  2. meta_context : Synprs__.Synprs_definition.Meta.Context_object.t;
  3. comp_context : Synprs__.Synprs_definition.Comp.Context_object.t;
  4. proof : Proof.t;
}
diff --git a/beluga/Synprs/Harpoon/Proof/index.html b/beluga/Synprs/Harpoon/Proof/index.html deleted file mode 100644 index 072b963e8..000000000 --- a/beluga/Synprs/Harpoon/Proof/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Proof (beluga.Synprs.Harpoon.Proof)

Module Harpoon.Proof

type t =
  1. | Incomplete of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. label : Beluga_syntax.Syncom.Identifier.t Support.Option.t;
    }
  2. | Command of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. command : Command.t;
    3. body : t;
    }
  3. | Directive of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. directive : Directive.t;
    }
diff --git a/beluga/Synprs/Harpoon/Repl/Command/index.html b/beluga/Synprs/Harpoon/Repl/Command/index.html deleted file mode 100644 index 076102372..000000000 --- a/beluga/Synprs/Harpoon/Repl/Command/index.html +++ /dev/null @@ -1,7 +0,0 @@ - -Command (beluga.Synprs.Harpoon.Repl.Command)

Module Repl.Command

type t =
  1. | Rename of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. rename_from : Beluga_syntax.Syncom.Identifier.t * [ `Plain | `Hash | `Dollar ];
    3. rename_to : Beluga_syntax.Syncom.Identifier.t * [ `Plain | `Hash | `Dollar ];
    4. level : [ `meta | `comp ];
    }
  2. | Toggle_automation of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. kind : [ `auto_intros | `auto_solve_trivial ];
    3. change : [ `on | `off | `toggle ];
    }
  3. | Info of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. kind : [ `prog ];
    3. object_identifier : Beluga_syntax.Syncom.Qualified_identifier.t;
    }
  4. | Select_theorem of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. theorem : Beluga_syntax.Syncom.Qualified_identifier.t;
    }
  5. | Theorem of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. subcommand : [ `list - | `defer - | `show_ihs - | `show_proof - | `dump_proof of Support.String.t ];
    }
  6. | Session of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. subcommand : [ `list | `defer | `create | `serialize ];
    }
  7. | Subgoal of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. subcommand : [ `list | `defer ];
    }
  8. | Undo of {
    1. location : Beluga_syntax.Syncom.Location.t;
    }
  9. | Redo of {
    1. location : Beluga_syntax.Syncom.Location.t;
    }
  10. | History of {
    1. location : Beluga_syntax.Syncom.Location.t;
    }
  11. | Translate of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. theorem : Beluga_syntax.Syncom.Qualified_identifier.t;
    }
  12. | Intros of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. introduced_variables : Beluga_syntax.Syncom.Identifier.t Support.List1.t - Support.Option.t;
    }
  13. | Msplit of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. identifier : Beluga_syntax.Syncom.Identifier.t * [ `Plain | `Hash | `Dollar ];
    }
  14. | Help of {
    1. location : Beluga_syntax.Syncom.Location.t;
    }
  15. | Auto_invert_solve of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. max_depth : Support.Int.t Support.Option.t;
    }
  16. | Inductive_auto_solve of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. max_depth : Support.Int.t Support.Option.t;
    }
diff --git a/beluga/Synprs/Harpoon/Repl/index.html b/beluga/Synprs/Harpoon/Repl/index.html deleted file mode 100644 index 0620325fc..000000000 --- a/beluga/Synprs/Harpoon/Repl/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Repl (beluga.Synprs.Harpoon.Repl)

Module Harpoon.Repl

module Command : sig ... end
diff --git a/beluga/Synprs/Harpoon/Split_branch/Label/index.html b/beluga/Synprs/Harpoon/Split_branch/Label/index.html deleted file mode 100644 index 635ac4191..000000000 --- a/beluga/Synprs/Harpoon/Split_branch/Label/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Label (beluga.Synprs.Harpoon.Split_branch.Label)

Module Split_branch.Label

type t =
  1. | Constant of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. identifier : Beluga_syntax.Syncom.Qualified_identifier.t;
    }
  2. | Bound_variable of {
    1. location : Beluga_syntax.Syncom.Location.t;
    }
  3. | Empty_context of {
    1. location : Beluga_syntax.Syncom.Location.t;
    }
  4. | Extended_context of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. schema_element : Support.Int.t;
      (*

      1-based

      *)
    }
  5. | Parameter_variable of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. schema_element : Support.Int.t;
      (*

      1-based

      *)
    3. projection : Support.Int.t Support.Option.t;
      (*

      1-based

      *)
    }
diff --git a/beluga/Synprs/Harpoon/Split_branch/index.html b/beluga/Synprs/Harpoon/Split_branch/index.html deleted file mode 100644 index ecb62f8ea..000000000 --- a/beluga/Synprs/Harpoon/Split_branch/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Split_branch (beluga.Synprs.Harpoon.Split_branch)

Module Harpoon.Split_branch

module Label : sig ... end
diff --git a/beluga/Synprs/Harpoon/Suffices_branch/index.html b/beluga/Synprs/Harpoon/Suffices_branch/index.html deleted file mode 100644 index 1d54ad24b..000000000 --- a/beluga/Synprs/Harpoon/Suffices_branch/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Suffices_branch (beluga.Synprs.Harpoon.Suffices_branch)

Module Harpoon.Suffices_branch

type t = {
  1. location : Beluga_syntax.Syncom.Location.t;
  2. goal : Synprs__.Synprs_definition.Comp.Sort_object.t;
  3. proof : Proof.t;
}
diff --git a/beluga/Synprs/Harpoon/index.html b/beluga/Synprs/Harpoon/index.html deleted file mode 100644 index 17aee69d2..000000000 --- a/beluga/Synprs/Harpoon/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Harpoon (beluga.Synprs.Harpoon)

Module Synprs.Harpoon

The intermediate representation of Harpoon proof scripts and REPL commands to delay the handling of data-dependent aspects of the grammar.

The intermediate representation of Harpoon proof scripts and REPL commands to delay the handling of data-dependent aspects of the grammar.

module Proof : sig ... end
module Command : sig ... end
module Directive : sig ... end
module Split_branch : sig ... end
module Suffices_branch : sig ... end
module Hypothetical : sig ... end
module Repl : sig ... end
diff --git a/beluga/Synprs/LF/Object/index.html b/beluga/Synprs/LF/Object/index.html deleted file mode 100644 index a69e01bb9..000000000 --- a/beluga/Synprs/LF/Object/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Object (beluga.Synprs.LF.Object)

Module LF.Object

LF kinds, types and terms blurred together.

type t =
  1. | Raw_identifier of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. identifier : Beluga_syntax.Syncom.Identifier.t;
    3. prefixed : Stdlib.Bool.t;
    }
    (*
    • Raw_identifier { identifier = "x"; prefixed = false; _ } is the variable or constant "x".
    • Raw_identifier { identifier = "x"; prefixed = true; _ } is the prefixed variable or constant "(x)".

    A prefixed constant may appear as an argument, or as applicand in prefix notation irrespective of its pre-defined fixity and associativity.

    *)
  2. | Raw_qualified_identifier of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. identifier : Beluga_syntax.Syncom.Qualified_identifier.t;
    3. prefixed : Stdlib.Bool.t;
    }
    (*
    • Raw_qualified_identifier { identifier = "M.x"; prefixed = false; _ } is the constant "M.x".
    • Raw_qualified_identifier { identifier = "M.x"; prefixed = true; _ } is the prefixed constant "(M.x)".

    Since identifiers are ambiguous with qualified identifiers in the parser, the following may be assumed during disambiguation: List.length (Qualified_identifier.namespaces identifier) >= 1.

    A prefixed constant may appear as an argument, or as applicand in prefix notation irrespective of its pre-defined fixity and associativity.

    *)
  3. | Raw_type of {
    1. location : Beluga_syntax.Syncom.Location.t;
    }
  4. | Raw_hole of {
    1. location : Beluga_syntax.Syncom.Location.t;
    }
  5. | Raw_pi of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. parameter_identifier : Beluga_syntax.Syncom.Identifier.t Support.Option.t;
    3. parameter_sort : t Support.Option.t;
    4. plicity : Beluga_syntax.Syncom.Plicity.t;
    5. body : t;
    }
    (*

    Raw_pi { parameter_identifier = Option.Some "x"; parameter_sort = Option.Some t; body; _ } is the Pi kind or type { x : t } body.

    It is a syntax error to omit the parameter sort. Implicit Pis currently do not have a corresponding syntax, but it may be added in the future.

    *)
  6. | Raw_lambda of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. parameter_identifier : Beluga_syntax.Syncom.Identifier.t Support.Option.t;
    3. parameter_sort : t Support.Option.t;
    4. body : t;
    }
  7. | Raw_arrow of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. domain : t;
    3. range : t;
    4. orientation : [ `Forward | `Backward ];
    }
  8. | Raw_annotated of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. object_ : t;
    3. sort : t;
    }
  9. | Raw_application of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. objects : t Support.List2.t;
    }
    (*

    Raw_application { objects; _ } is the juxtaposition of objects delimited by whitespaces. objects may contain prefix, infix or postfix operators, along with operands. These are rewritten during the disambiguation to the external syntax.

    *)
diff --git a/beluga/Synprs/LF/index.html b/beluga/Synprs/LF/index.html deleted file mode 100644 index 16bfd475f..000000000 --- a/beluga/Synprs/LF/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -LF (beluga.Synprs.LF)

Module Synprs.LF

The intermediate representation of LF kinds, types and terms to delay the handling of data-dependent aspects of the grammar.

The parsers associated with these types are only intended to be used in the definition of LF type-level or term-level constants. This is a weak, representational function space without case analysis or recursion.

The intermediate representation of LF kinds, types and terms to delay the handling of data-dependent aspects of the grammar.

The parsers associated with these types are only intended to be used in the definition of LF type-level or term-level constants. This is a weak, representational function space without case analysis or recursion.

module Object : sig ... end

LF kinds, types and terms blurred together.

diff --git a/beluga/Synprs/Meta/Context_object/index.html b/beluga/Synprs/Meta/Context_object/index.html deleted file mode 100644 index 6e4d06242..000000000 --- a/beluga/Synprs/Meta/Context_object/index.html +++ /dev/null @@ -1,4 +0,0 @@ - -Context_object (beluga.Synprs.Meta.Context_object)

Module Meta.Context_object

Meta-contexts.

type t = {
  1. location : Beluga_syntax.Syncom.Location.t;
  2. bindings : ((Beluga_syntax.Syncom.Identifier.t * [ `Plain | `Hash | `Dollar ]) - * Thing.t Support.Option.t) - Support.List.t;
}
diff --git a/beluga/Synprs/Meta/Schema_object/index.html b/beluga/Synprs/Meta/Schema_object/index.html deleted file mode 100644 index 774bc9e69..000000000 --- a/beluga/Synprs/Meta/Schema_object/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Schema_object (beluga.Synprs.Meta.Schema_object)

Module Meta.Schema_object

Context schemas.

type t =
  1. | Raw_constant of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. identifier : Beluga_syntax.Syncom.Qualified_identifier.t;
    }
  2. | Raw_alternation of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. schemas : t Support.List2.t;
    }
diff --git a/beluga/Synprs/Meta/Thing/index.html b/beluga/Synprs/Meta/Thing/index.html deleted file mode 100644 index d347fd832..000000000 --- a/beluga/Synprs/Meta/Thing/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Thing (beluga.Synprs.Meta.Thing)

Module Meta.Thing

Meta-objects, meta-types, meta-patterns.

type t =
  1. | RawSchema of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. schema : Beluga_syntax.Syncom.Qualified_identifier.t;
    }
    (*

    RawSchema { schema; _ } is the context schema schema.

    *)
diff --git a/beluga/Synprs/Meta/index.html b/beluga/Synprs/Meta/index.html deleted file mode 100644 index a6c5fe0ef..000000000 --- a/beluga/Synprs/Meta/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Meta (beluga.Synprs.Meta)

Module Synprs.Meta

The intermediate representation of meta-types, meta-objects and meta-patterns to delay the handling of data-dependent aspects of the grammar.

The intermediate representation of meta-types, meta-objects and meta-patterns to delay the handling of data-dependent aspects of the grammar.

module Thing : sig ... end

Meta-objects, meta-types, meta-patterns.

module Schema_object : sig ... end

Context schemas.

module Context_object : sig ... end

Meta-contexts.

diff --git a/beluga/Synprs/Signature/Declaration/index.html b/beluga/Synprs/Signature/Declaration/index.html deleted file mode 100644 index 2baea64af..000000000 --- a/beluga/Synprs/Signature/Declaration/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Declaration (beluga.Synprs.Signature.Declaration)

Module Signature.Declaration

type t =
  1. | Raw_recursive_declarations of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. declarations : t Support.List1.t;
    }
  2. | Raw_module of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. identifier : Beluga_syntax.Syncom.Identifier.t;
    3. entries : Entry.t Support.List.t;
    }
diff --git a/beluga/Synprs/Signature/Entry/index.html b/beluga/Synprs/Signature/Entry/index.html deleted file mode 100644 index d19d0eb8f..000000000 --- a/beluga/Synprs/Signature/Entry/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Entry (beluga.Synprs.Signature.Entry)

Module Signature.Entry

type t =
  1. | Raw_declaration of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. declaration : Declaration.t;
    }
  2. | Raw_pragma of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. pragma : Pragma.t;
    }
  3. | Raw_comment of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. content : Support.String.t;
    }
diff --git a/beluga/Synprs/Signature/Global_pragma/index.html b/beluga/Synprs/Signature/Global_pragma/index.html deleted file mode 100644 index 1a8a160bf..000000000 --- a/beluga/Synprs/Signature/Global_pragma/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Global_pragma (beluga.Synprs.Signature.Global_pragma)

Module Signature.Global_pragma

type t =
  1. | No_strengthening of {
    1. location : Beluga_syntax.Syncom.Location.t;
    }
  2. | Warn_on_coverage_error of {
    1. location : Beluga_syntax.Syncom.Location.t;
    }
  3. | Initiate_coverage_checking of {
    1. location : Beluga_syntax.Syncom.Location.t;
    }
diff --git a/beluga/Synprs/Signature/Pragma/index.html b/beluga/Synprs/Signature/Pragma/index.html deleted file mode 100644 index 0335de277..000000000 --- a/beluga/Synprs/Signature/Pragma/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Pragma (beluga.Synprs.Signature.Pragma)

Module Signature.Pragma

diff --git a/beluga/Synprs/Signature/Totality/Declaration/index.html b/beluga/Synprs/Signature/Totality/Declaration/index.html deleted file mode 100644 index d0d86ff66..000000000 --- a/beluga/Synprs/Signature/Totality/Declaration/index.html +++ /dev/null @@ -1,3 +0,0 @@ - -Declaration (beluga.Synprs.Signature.Totality.Declaration)

Module Totality.Declaration

diff --git a/beluga/Synprs/Signature/Totality/Order/index.html b/beluga/Synprs/Signature/Totality/Order/index.html deleted file mode 100644 index b567feb4d..000000000 --- a/beluga/Synprs/Signature/Totality/Order/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Order (beluga.Synprs.Signature.Totality.Order)

Module Totality.Order

type 'a t =
  1. | Argument of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. argument : 'a;
    }
  2. | Lexical_ordering of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. arguments : 'a t Support.List1.t;
    }
  3. | Simultaneous_ordering of {
    1. location : Beluga_syntax.Syncom.Location.t;
    2. arguments : 'a t Support.List1.t;
    }
diff --git a/beluga/Synprs/Signature/Totality/index.html b/beluga/Synprs/Signature/Totality/index.html deleted file mode 100644 index c4f448d41..000000000 --- a/beluga/Synprs/Signature/Totality/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Totality (beluga.Synprs.Signature.Totality)

Module Signature.Totality

module Declaration : sig ... end
module Order : sig ... end
diff --git a/beluga/Synprs/Signature/index.html b/beluga/Synprs/Signature/index.html deleted file mode 100644 index 6c57127e3..000000000 --- a/beluga/Synprs/Signature/index.html +++ /dev/null @@ -1,2 +0,0 @@ - -Signature (beluga.Synprs.Signature)

Module Synprs.Signature

The intermediate representation of Beluga signatures to delay the handling of data-dependent aspects of the grammar.

The intermediate representation of Beluga signatures to delay the handling of data-dependent aspects of the grammar.

module Pragma : sig ... end
module Global_pragma : sig ... end
module Totality : sig ... end
module Declaration : sig ... end
module Entry : sig ... end
type signature_file = {
  1. location : Beluga_syntax.Syncom.Location.t;
  2. global_pragmas : Global_pragma.t Support.List.t;
  3. entries : Entry.t Support.List.t;
}

Parsed Beluga project