tla-ts 0.0.9 → 0.0.10-dev.b4a856304

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (390) hide show
  1. package/README.md +29 -1
  2. package/dist/compile.cjs +23 -0
  3. package/dist/compile.js +23 -0
  4. package/dist/deciders.cjs +28 -28
  5. package/dist/deciders.js +43 -43
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.d.cts +72 -10
  8. package/dist/index.d.ts +72 -10
  9. package/dist/index.js +1 -1
  10. package/dist/parallel-worker.cjs +1 -1
  11. package/dist/parallel-worker.js +1 -1
  12. package/dist/prove-worker.cjs +1 -1
  13. package/dist/prove-worker.js +1 -1
  14. package/dist/prove.cjs +116 -36
  15. package/dist/prove.js +116 -36
  16. package/dist/run.cjs +143 -31
  17. package/dist/run.js +143 -31
  18. package/dist/tlapm.cjs +2 -2
  19. package/dist/tlapm.js +2 -2
  20. package/dist/transfer.cjs +128 -103
  21. package/dist/transfer.js +128 -103
  22. package/dist/worker.cjs +7 -7
  23. package/dist/worker.js +7 -7
  24. package/package.json +3 -1
  25. package/src/ast.ts +7 -21
  26. package/src/bags.ts +99 -99
  27. package/src/builtins.ts +44 -75
  28. package/src/bundled-modules.ts +1 -8
  29. package/src/check.ts +576 -300
  30. package/src/cli/options.ts +11 -6
  31. package/src/cli/run.ts +2 -2
  32. package/src/cli/runtime-invariants.ts +135 -0
  33. package/src/cli/shared.ts +20 -9
  34. package/src/cli/tlapm.ts +0 -12
  35. package/src/cli/tlc-arguments.ts +646 -0
  36. package/src/cli/tlc-usage.ts +362 -0
  37. package/src/cli/tlc.ts +538 -220
  38. package/src/cli/typescript.ts +23 -0
  39. package/src/cli/xml-exporter.ts +4 -16
  40. package/src/cli.ts +0 -1
  41. package/src/codegen.ts +191 -64
  42. package/src/config.ts +140 -109
  43. package/src/coverage.ts +837 -0
  44. package/src/dependencies.ts +6 -40
  45. package/src/dfid.ts +618 -0
  46. package/src/environment.ts +240 -118
  47. package/src/errors.ts +70 -55
  48. package/src/evaluate.ts +630 -297
  49. package/src/exit-codes.ts +37 -3
  50. package/src/fingerprints.ts +10 -10
  51. package/src/index.ts +3 -0
  52. package/src/instances.ts +79 -11
  53. package/src/java-overrides.ts +2 -12
  54. package/src/json-reader.ts +456 -0
  55. package/src/json.ts +262 -139
  56. package/src/levels.ts +2 -3
  57. package/src/lexer.ts +17 -26
  58. package/src/liveness-checker.ts +10 -18
  59. package/src/liveness.ts +121 -49
  60. package/src/obligations/action.ts +4 -28
  61. package/src/obligations/anonymize.ts +84 -80
  62. package/src/obligations/equality.ts +1 -1
  63. package/src/obligations/expression.ts +2 -19
  64. package/src/obligations/format.ts +1 -9
  65. package/src/obligations/generate.ts +1 -11
  66. package/src/obligations/index.ts +0 -11
  67. package/src/obligations/levels.ts +4 -8
  68. package/src/obligations/module.ts +1 -15
  69. package/src/obligations/normalize.ts +5 -24
  70. package/src/obligations/operators.ts +1 -2
  71. package/src/obligations/pragma.ts +1 -10
  72. package/src/obligations/printer.ts +47 -46
  73. package/src/obligations/proof.ts +1 -5
  74. package/src/obligations/regroup.ts +1 -4
  75. package/src/obligations/simplify.ts +3 -14
  76. package/src/obligations/source.ts +1 -21
  77. package/src/obligations/subexpression.ts +5 -11
  78. package/src/obligations/substitution.ts +1 -3
  79. package/src/obligations/temporal.ts +8 -14
  80. package/src/obligations/tuples.ts +3 -9
  81. package/src/parallel-worker.ts +29 -39
  82. package/src/parallel.ts +29 -13
  83. package/src/parser.ts +436 -90
  84. package/src/pcal/ast.ts +7 -28
  85. package/src/pcal/parse.ts +11 -39
  86. package/src/pcal/tokenize.ts +4 -20
  87. package/src/pcal/translate.ts +10 -42
  88. package/src/pcal/validate.ts +3 -21
  89. package/src/pretty-print.ts +1 -2
  90. package/src/prover/decide-pool.ts +5 -10
  91. package/src/prover/deciders.ts +0 -4
  92. package/src/prover/first-order.ts +0 -11
  93. package/src/prover/isabelle/decide.ts +0 -6
  94. package/src/prover/isabelle/encode.ts +11 -23
  95. package/src/prover/isabelle/isar/inner-syntax.ts +108 -114
  96. package/src/prover/isabelle/isar/method.ts +25 -38
  97. package/src/prover/isabelle/isar/proof.ts +1 -10
  98. package/src/prover/isabelle/isar/statement.ts +1 -6
  99. package/src/prover/isabelle/isar/theory.ts +15 -26
  100. package/src/prover/isabelle/isar/type-check.ts +11 -25
  101. package/src/prover/isabelle/provers/blast/blast.ts +10 -41
  102. package/src/prover/isabelle/provers/blast/branch.ts +1 -32
  103. package/src/prover/isabelle/provers/blast/prove.ts +1 -35
  104. package/src/prover/isabelle/provers/blast/rules.ts +6 -44
  105. package/src/prover/isabelle/provers/blast/state.ts +2 -28
  106. package/src/prover/isabelle/provers/blast/term.ts +9 -36
  107. package/src/prover/isabelle/provers/clasimp.ts +1 -13
  108. package/src/prover/isabelle/provers/classical.ts +14 -42
  109. package/src/prover/isabelle/provers/hypsubst.ts +11 -25
  110. package/src/prover/isabelle/pure/bicompose.ts +16 -13
  111. package/src/prover/isabelle/pure/consts.ts +1 -7
  112. package/src/prover/isabelle/pure/conv.ts +1 -9
  113. package/src/prover/isabelle/pure/drule.ts +24 -40
  114. package/src/prover/isabelle/pure/envir.ts +3 -52
  115. package/src/prover/isabelle/pure/goal.ts +1 -7
  116. package/src/prover/isabelle/pure/interrupt.ts +0 -5
  117. package/src/prover/isabelle/pure/list.ts +0 -3
  118. package/src/prover/isabelle/pure/logic.ts +1 -14
  119. package/src/prover/isabelle/pure/name.ts +2 -9
  120. package/src/prover/isabelle/pure/net.ts +3 -59
  121. package/src/prover/isabelle/pure/object-logic.ts +3 -10
  122. package/src/prover/isabelle/pure/pattern.ts +2 -19
  123. package/src/prover/isabelle/pure/raw-simplifier.ts +13 -49
  124. package/src/prover/isabelle/pure/rewriter.ts +26 -58
  125. package/src/prover/isabelle/pure/search.ts +3 -10
  126. package/src/prover/isabelle/pure/seq.ts +1 -10
  127. package/src/prover/isabelle/pure/simplifier.ts +4 -12
  128. package/src/prover/isabelle/pure/table.ts +1 -31
  129. package/src/prover/isabelle/pure/tactic.ts +12 -22
  130. package/src/prover/isabelle/pure/tactical.ts +6 -12
  131. package/src/prover/isabelle/pure/term-ord.ts +2 -6
  132. package/src/prover/isabelle/pure/term.ts +2 -43
  133. package/src/prover/isabelle/pure/thm.ts +13 -36
  134. package/src/prover/isabelle/pure/type.ts +2 -15
  135. package/src/prover/isabelle/pure/unify.ts +20 -30
  136. package/src/prover/isabelle/pure/variable.ts +3 -7
  137. package/src/prover/isabelle/tla/classical-setup.ts +9 -19
  138. package/src/prover/isabelle/tla/context.ts +8 -16
  139. package/src/prover/isabelle/tla/logic.ts +4 -11
  140. package/src/prover/isabelle/tla/simpdata.ts +46 -34
  141. package/src/prover/isabelle/tools/intuitionistic.ts +1 -10
  142. package/src/prover/ocaml.ts +0 -6
  143. package/src/prover/prep/action.ts +4 -36
  144. package/src/prover/prep/enabled-axioms.ts +12 -19
  145. package/src/prover/prep/fingerprint.ts +0 -16
  146. package/src/prover/prep/level-comparison.ts +8 -12
  147. package/src/prover/prep/md5.ts +0 -2
  148. package/src/prover/prep/methods.ts +9 -36
  149. package/src/prover/prep/normalize.ts +4 -28
  150. package/src/prover/prove-worker.ts +0 -2
  151. package/src/prover/prove.ts +0 -36
  152. package/src/prover/ptl/decide.ts +7 -12
  153. package/src/prover/ptl/encode.ts +14 -36
  154. package/src/prover/ptl/sat.ts +24 -32
  155. package/src/prover/ptl/tableau.ts +12 -26
  156. package/src/prover/smt/axioms.ts +0 -7
  157. package/src/prover/smt/context.ts +19 -26
  158. package/src/prover/smt/data.ts +51 -54
  159. package/src/prover/smt/encode.ts +14 -35
  160. package/src/prover/smt/extensionality.ts +0 -10
  161. package/src/prover/smt/flatten.ts +3 -22
  162. package/src/prover/smt/format.ts +5 -10
  163. package/src/prover/smt/instances.ts +0 -10
  164. package/src/prover/smt/rewrite.ts +66 -101
  165. package/src/prover/smt/solver/act-cache.ts +0 -15
  166. package/src/prover/smt/solver/arith-rewriter.ts +3 -48
  167. package/src/prover/smt/solver/array.ts +1 -3
  168. package/src/prover/smt/solver/asserted-formulas.ts +1 -43
  169. package/src/prover/smt/solver/ast-lt.ts +1 -11
  170. package/src/prover/smt/solver/ast-util.ts +1 -6
  171. package/src/prover/smt/solver/ast.ts +1 -143
  172. package/src/prover/smt/solver/auf-solver.ts +6 -39
  173. package/src/prover/smt/solver/case-split-queue.ts +1 -9
  174. package/src/prover/smt/solver/cg-table.ts +1 -18
  175. package/src/prover/smt/solver/clause.ts +1 -27
  176. package/src/prover/smt/solver/conflict-resolution.ts +0 -9
  177. package/src/prover/smt/solver/context.ts +4 -61
  178. package/src/prover/smt/solver/ctx-simplify.ts +14 -41
  179. package/src/prover/smt/solver/der.ts +2 -21
  180. package/src/prover/smt/solver/dyn-ack.ts +1 -11
  181. package/src/prover/smt/solver/e-matching.ts +3 -34
  182. package/src/prover/smt/solver/enode.ts +1 -21
  183. package/src/prover/smt/solver/expr-ref.ts +1 -5
  184. package/src/prover/smt/solver/expr-safe-replace.ts +0 -5
  185. package/src/prover/smt/solver/fingerprints.ts +1 -12
  186. package/src/prover/smt/solver/flat-literals.ts +1 -9
  187. package/src/prover/smt/solver/goal.ts +2 -14
  188. package/src/prover/smt/solver/hash.ts +0 -8
  189. package/src/prover/smt/solver/hashtable.ts +1 -12
  190. package/src/prover/smt/solver/internalizer.ts +6 -98
  191. package/src/prover/smt/solver/lbool.ts +1 -2
  192. package/src/prover/smt/solver/literal.ts +0 -3
  193. package/src/prover/smt/solver/lp/bound-propagator.ts +8 -26
  194. package/src/prover/smt/solver/lp/constraints.ts +2 -8
  195. package/src/prover/smt/solver/lp/containers.ts +12 -30
  196. package/src/prover/smt/solver/lp/core-solver.ts +10 -31
  197. package/src/prover/smt/solver/lp/cross-nested.ts +6 -20
  198. package/src/prover/smt/solver/lp/dep-intervals.ts +7 -22
  199. package/src/prover/smt/solver/lp/dependency.ts +1 -4
  200. package/src/prover/smt/solver/lp/dioph-eq.ts +12 -98
  201. package/src/prover/smt/solver/lp/explanation.ts +1 -6
  202. package/src/prover/smt/solver/lp/gomory.ts +9 -22
  203. package/src/prover/smt/solver/lp/hnf-cutter.ts +17 -23
  204. package/src/prover/smt/solver/lp/hnf.ts +11 -26
  205. package/src/prover/smt/solver/lp/int-cube.ts +15 -36
  206. package/src/prover/smt/solver/lp/int-solver.ts +4 -34
  207. package/src/prover/smt/solver/lp/lar-solver.ts +32 -81
  208. package/src/prover/smt/solver/lp/lar-term.ts +1 -5
  209. package/src/prover/smt/solver/lp/lp-settings.ts +1 -14
  210. package/src/prover/smt/solver/lp/maximize-term.ts +20 -45
  211. package/src/prover/smt/solver/lp/nex-creator.ts +5 -28
  212. package/src/prover/smt/solver/lp/nex.ts +1 -6
  213. package/src/prover/smt/solver/lp/nla-backoff.ts +1 -4
  214. package/src/prover/smt/solver/lp/nla-basics.ts +5 -30
  215. package/src/prover/smt/solver/lp/nla-core.ts +35 -130
  216. package/src/prover/smt/solver/lp/nla-divisions.ts +32 -42
  217. package/src/prover/smt/solver/lp/nla-emonics.ts +4 -21
  218. package/src/prover/smt/solver/lp/nla-factorization.ts +1 -4
  219. package/src/prover/smt/solver/lp/nla-grobner.ts +15 -69
  220. package/src/prover/smt/solver/lp/nla-horner.ts +3 -11
  221. package/src/prover/smt/solver/lp/nla-intervals.ts +2 -12
  222. package/src/prover/smt/solver/lp/nla-monomial-bounds.ts +16 -41
  223. package/src/prover/smt/solver/lp/nla-monotone.ts +2 -6
  224. package/src/prover/smt/solver/lp/nla-order.ts +2 -13
  225. package/src/prover/smt/solver/lp/nla-patcher.ts +4 -7
  226. package/src/prover/smt/solver/lp/nla-tangents.ts +1 -9
  227. package/src/prover/smt/solver/lp/nla-throttle.ts +1 -6
  228. package/src/prover/smt/solver/lp/nla-types.ts +1 -11
  229. package/src/prover/smt/solver/lp/nla-var-eqs.ts +4 -25
  230. package/src/prover/smt/solver/lp/nra-solver.ts +5 -52
  231. package/src/prover/smt/solver/lp/numeric-pair.ts +1 -4
  232. package/src/prover/smt/solver/lp/pdd-interval.ts +1 -3
  233. package/src/prover/smt/solver/lp/pdd-simplifier.ts +2 -14
  234. package/src/prover/smt/solver/lp/pdd-solver.ts +4 -33
  235. package/src/prover/smt/solver/lp/pdd.ts +7 -70
  236. package/src/prover/smt/solver/lp/random-updater.ts +1 -8
  237. package/src/prover/smt/solver/lp/static-matrix.ts +9 -19
  238. package/src/prover/smt/solver/lp/union-find.ts +1 -6
  239. package/src/prover/smt/solver/mam-compiler.ts +14 -56
  240. package/src/prover/smt/solver/mam-interpreter.ts +1 -21
  241. package/src/prover/smt/solver/maximize-ac-sharing.ts +2 -17
  242. package/src/prover/smt/solver/model-checker.ts +2 -36
  243. package/src/prover/smt/solver/model-evaluator.ts +3 -29
  244. package/src/prover/smt/solver/model-finder.ts +3 -15
  245. package/src/prover/smt/solver/model-generator.ts +1 -12
  246. package/src/prover/smt/solver/model-macro-solver.ts +12 -69
  247. package/src/prover/smt/solver/nlsat/algebraic.ts +55 -151
  248. package/src/prover/smt/solver/nlsat/atoms.ts +5 -19
  249. package/src/prover/smt/solver/nlsat/evaluator.ts +17 -22
  250. package/src/prover/smt/solver/nlsat/explain.ts +3 -47
  251. package/src/prover/smt/solver/nlsat/interval-set.ts +9 -50
  252. package/src/prover/smt/solver/nlsat/levelwise.ts +48 -129
  253. package/src/prover/smt/solver/nlsat/mpbq.ts +3 -14
  254. package/src/prover/smt/solver/nlsat/polynomial.ts +17 -156
  255. package/src/prover/smt/solver/nlsat/solver.ts +7 -67
  256. package/src/prover/smt/solver/nlsat/types.ts +1 -8
  257. package/src/prover/smt/solver/nlsat/upolynomial-factorization.ts +1 -44
  258. package/src/prover/smt/solver/nlsat/upolynomial.ts +11 -92
  259. package/src/prover/smt/solver/nnf.ts +3 -38
  260. package/src/prover/smt/solver/pattern-inference.ts +2 -15
  261. package/src/prover/smt/solver/poly-rewriter.ts +3 -23
  262. package/src/prover/smt/solver/propagate-values.ts +1 -10
  263. package/src/prover/smt/solver/proto-model.ts +3 -48
  264. package/src/prover/smt/solver/pull-quant.ts +1 -12
  265. package/src/prover/smt/solver/qe-lite-der.ts +1 -29
  266. package/src/prover/smt/solver/qe-lite-fm.ts +2 -25
  267. package/src/prover/smt/solver/qe-lite.ts +3 -33
  268. package/src/prover/smt/solver/qi-queue.ts +1 -16
  269. package/src/prover/smt/solver/quant-tactics.ts +5 -22
  270. package/src/prover/smt/solver/quantifier-analyzer.ts +17 -37
  271. package/src/prover/smt/solver/quantifier-manager.ts +1 -8
  272. package/src/prover/smt/solver/random-gen.ts +1 -2
  273. package/src/prover/smt/solver/rational.ts +1 -8
  274. package/src/prover/smt/solver/ref-vector.ts +1 -6
  275. package/src/prover/smt/solver/relevancy.ts +2 -15
  276. package/src/prover/smt/solver/rewriter-tpl.ts +3 -147
  277. package/src/prover/smt/solver/rewriter.ts +3 -85
  278. package/src/prover/smt/solver/rlimit.ts +2 -20
  279. package/src/prover/smt/solver/smtlib-parser.ts +2 -37
  280. package/src/prover/smt/solver/solver.ts +23 -34
  281. package/src/prover/smt/solver/sort.ts +1 -5
  282. package/src/prover/smt/solver/sticky-generations.ts +0 -5
  283. package/src/prover/smt/solver/theory-lra-axioms.ts +3 -24
  284. package/src/prover/smt/solver/theory-lra-bounds.ts +0 -5
  285. package/src/prover/smt/solver/theory-lra-final-check.ts +4 -22
  286. package/src/prover/smt/solver/theory-lra-internalize.ts +1 -27
  287. package/src/prover/smt/solver/theory-lra-model.ts +4 -19
  288. package/src/prover/smt/solver/theory-lra-propagate.ts +1 -15
  289. package/src/prover/smt/solver/theory-lra-state.ts +3 -8
  290. package/src/prover/smt/solver/theory-lra.ts +1 -8
  291. package/src/prover/smt/solver/var-subst.ts +2 -26
  292. package/src/prover/smt/table.ts +0 -8
  293. package/src/prover/tlapm/cache.ts +20 -25
  294. package/src/prover/tlapm/ocaml-marshal.ts +19 -21
  295. package/src/prover/tlapm/tlapm.ts +12 -17
  296. package/src/prover/verdict.ts +0 -2
  297. package/src/prover/zenon/check/check.ts +0 -9
  298. package/src/prover/zenon/check/definitions.ts +5 -15
  299. package/src/prover/zenon/check/equality.ts +0 -8
  300. package/src/prover/zenon/check/functions.ts +0 -4
  301. package/src/prover/zenon/check/keys.ts +0 -7
  302. package/src/prover/zenon/check/propositional.ts +0 -3
  303. package/src/prover/zenon/check/records.ts +0 -5
  304. package/src/prover/zenon/check/relations.ts +0 -13
  305. package/src/prover/zenon/check/rewrites.ts +0 -6
  306. package/src/prover/zenon/check/sets.ts +0 -3
  307. package/src/prover/zenon/check/terms.ts +0 -17
  308. package/src/prover/zenon/check/tla.ts +0 -6
  309. package/src/prover/zenon/decide.ts +0 -12
  310. package/src/prover/zenon/encode.ts +1 -8
  311. package/src/prover/zenon/eqrel.ts +0 -13
  312. package/src/prover/zenon/equality-rules.ts +0 -4
  313. package/src/prover/zenon/expr.ts +1 -26
  314. package/src/prover/zenon/index-table.ts +17 -38
  315. package/src/prover/zenon/isar-case.ts +9 -19
  316. package/src/prover/zenon/isar.ts +1 -29
  317. package/src/prover/zenon/limits.ts +0 -4
  318. package/src/prover/zenon/llproof.ts +0 -9
  319. package/src/prover/zenon/mltoll.ts +54 -76
  320. package/src/prover/zenon/node.ts +1 -11
  321. package/src/prover/zenon/ocaml.ts +1 -17
  322. package/src/prover/zenon/parse.ts +2 -7
  323. package/src/prover/zenon/phrase.ts +1 -11
  324. package/src/prover/zenon/proof.ts +0 -9
  325. package/src/prover/zenon/propositional-rules.ts +0 -5
  326. package/src/prover/zenon/rules.ts +2 -6
  327. package/src/prover/zenon/search.ts +1 -17
  328. package/src/prover/zenon/tla/functions.ts +57 -29
  329. package/src/prover/zenon/tla/llproof.ts +63 -70
  330. package/src/prover/zenon/tla/records.ts +56 -27
  331. package/src/prover/zenon/tla/rewrites.ts +12 -19
  332. package/src/prover/zenon/tla/sets.ts +68 -39
  333. package/src/prover/zenon/tla/terms.ts +0 -6
  334. package/src/prover/zenon/tla/tla.ts +59 -58
  335. package/src/randomization.ts +84 -35
  336. package/src/resolve.ts +18 -60
  337. package/src/runtime.ts +11 -4
  338. package/src/sany/builtins.ts +3 -4
  339. package/src/sany/generator.ts +119 -169
  340. package/src/sany/levels.ts +6 -30
  341. package/src/sany/lexer.ts +7 -23
  342. package/src/sany/linter.ts +1 -8
  343. package/src/sany/modules.ts +1 -5
  344. package/src/sany/nodes.ts +0 -31
  345. package/src/sany/parse-error.ts +39 -117
  346. package/src/sany/report.ts +29 -63
  347. package/src/sany/selectors.ts +15 -39
  348. package/src/sany/source.ts +1 -17
  349. package/src/sany/xml.ts +13 -63
  350. package/src/search.ts +494 -154
  351. package/src/simulate.ts +694 -0
  352. package/src/spec-description.ts +166 -48
  353. package/src/standard-definitions.ts +2 -3
  354. package/src/standard-modules.ts +264 -68
  355. package/src/state-graph.ts +51 -18
  356. package/src/subexpressions.ts +31 -5
  357. package/src/substitution-levels.ts +2 -3
  358. package/src/successors.ts +267 -77
  359. package/src/symmetry.ts +31 -8
  360. package/src/tableau.ts +27 -24
  361. package/src/tlc/fingerprint.ts +183 -61
  362. package/src/tlc/jar-data.ts +113 -6
  363. package/src/tlc/messages.ts +122 -37
  364. package/src/tlc/order.ts +33 -38
  365. package/src/tlc/random.ts +16 -16
  366. package/src/tlc/replay.ts +563 -211
  367. package/src/tlc/summary.ts +2 -4
  368. package/src/tlc/tlc-operators.ts +81 -36
  369. package/src/tlc/tlcext-operators.ts +138 -117
  370. package/src/tlc/trace-spec.ts +273 -0
  371. package/src/tlc/value-stream.ts +143 -0
  372. package/src/tlc/version.ts +2 -4
  373. package/src/transfer.ts +22 -25
  374. package/src/typescript/actions.ts +481 -0
  375. package/src/typescript/collections.ts +600 -0
  376. package/src/typescript/compile.ts +65 -0
  377. package/src/typescript/context.ts +94 -0
  378. package/src/typescript/emit.ts +121 -0
  379. package/src/typescript/expressions.ts +496 -0
  380. package/src/typescript/formula.ts +152 -0
  381. package/src/typescript/functions.ts +284 -0
  382. package/src/typescript/model.ts +163 -0
  383. package/src/typescript/names.ts +114 -0
  384. package/src/typescript/program.ts +48 -0
  385. package/src/typescript/properties.ts +139 -0
  386. package/src/typescript/scope.ts +112 -0
  387. package/src/typescript/steps.ts +165 -0
  388. package/src/typescript/types.ts +171 -0
  389. package/src/values.ts +826 -276
  390. package/src/worker.ts +7 -8
@@ -1,8 +1,4 @@
1
1
  // Ported from Zenon's index.ml, as shipped in tlapm. Copyright 2004 INRIA, see LICENSE.
2
- //
3
- // The formulas on the current branch, indexed by head symbol, by the sides of equalities and
4
- // transitive relations, and the cache of proved lemmas. Formulas are added and removed in LIFO
5
- // order as the search descends and backtracks. Lists keep Zenon's order, latest first.
6
2
 
7
3
  import {
8
4
  isNegatedRelation,
@@ -27,7 +23,6 @@ interface Suspect {
27
23
  records: LemmaRecord[];
28
24
  }
29
25
 
30
- // A stack of values per key, as a Hashtbl with Hashtbl.add and Hashtbl.remove.
31
26
  const pushValue = <Key, Value>(table: Map<Key, Value[]>, key: Key, value: Value) => {
32
27
  const values = table.get(key);
33
28
  if (values === undefined) table.set(key, [value]);
@@ -44,7 +39,6 @@ const popValue = <Key, Value>(table: Map<Key, Value[]>, key: Key) => {
44
39
  const getLatestFirst = <Key, Value>(table: Map<Key, Value[]>, key: Key) =>
45
40
  [...(table.get(key) ?? [])].reverse();
46
41
 
47
- // Zenon's head of a term, or undefined for No_head. Taus and metavariables are heads by identity.
48
42
  type Head = string | Expr;
49
43
 
50
44
  export const getHead = (expression: Expr): Head | undefined => {
@@ -68,19 +62,10 @@ export const getHead = (expression: Expr): Head | undefined => {
68
62
  }
69
63
  };
70
64
 
71
- // Zenon indexes formulas by head under a string; every tau shares "t." and every metavariable "".
72
65
  const getHeadKey = (head: Head) =>
73
66
  typeof head === "string" ? head : head.kind === "tau" ? "t." : "";
74
67
 
75
- // Zenon's add_element and remove_element on a table of lists. Removing from a one-element list
76
- // drops the key whatever the element, as Zenon does.
77
- const addElement = <Key, Value>(table: Map<Key, Value[]>, key: Key, value: Value) => {
78
- const values = table.get(key);
79
- if (values === undefined) table.set(key, [value]);
80
- else values.push(value);
81
- };
82
-
83
- // False stands for Zenon's Not_found.
68
+ // Removing from a one-element list drops the key whatever the element, as Zenon does.
84
69
  const removeElement = <Key, Value>(table: Map<Key, Value[]>, key: Key, value: Value) => {
85
70
  const values = table.get(key);
86
71
  if (values === undefined) return false;
@@ -89,9 +74,6 @@ const removeElement = <Key, Value>(table: Map<Key, Value[]>, key: Key, value: Va
89
74
  return true;
90
75
  };
91
76
 
92
- const getValues = <Key, Value>(table: Map<Key, Value[]>, key: Key) => getLatestFirst(table, key);
93
-
94
- // Keys pair a relation with a head. Heads that are expressions are told apart by identity.
95
77
  const getHeadId = (head: Head) => (typeof head === "string" ? `s${head}` : `e${head.id}`);
96
78
 
97
79
  const getRelationKey = (relation: string, head: Head) => `${relation}\u0000${getHeadId(head)}`;
@@ -129,7 +111,6 @@ export const createIndex = (exprs: Expressions) => {
129
111
  const withGoalness = <Formula extends Expr>(list: Formula[]): [Formula, number][] =>
130
112
  list.map((formula) => [formula, getGoalness(formula)]);
131
113
 
132
- // Zenon's negpos: a negation under the head of its operand, anything else under its own head.
133
114
  const actOnHead = (
134
115
  formula: Expr,
135
116
  action: <Formula extends Expr>(
@@ -187,7 +168,7 @@ export const createIndex = (exprs: Expressions) => {
187
168
  ]);
188
169
  formulaCount++;
189
170
  topFormulaCount = Math.max(topFormulaCount, formulaCount);
190
- actOnHead(formula, addElement);
171
+ actOnHead(formula, pushValue);
191
172
  const lemma = lemmas.get(formula);
192
173
  if (lemma !== undefined) lemma.isPresent = true;
193
174
  newFormulas.unshift(formula);
@@ -240,14 +221,13 @@ export const createIndex = (exprs: Expressions) => {
240
221
  if (lemma !== undefined) lemma.isPresent = false;
241
222
  };
242
223
 
243
- // Zenon's add_trans, which stops at the first side without a head. False means No_head.
244
224
  const addTrans = (formula: RelationExpr) => {
245
225
  const leftHead = getHead(formula.args[0]);
246
226
  if (leftHead === undefined) return false;
247
- addElement(transLeft, getRelationKey(formula.symbol, leftHead), formula);
227
+ pushValue(transLeft, getRelationKey(formula.symbol, leftHead), formula);
248
228
  const rightHead = getHead(formula.args[1]);
249
229
  if (rightHead === undefined) return false;
250
- addElement(transRight, getRelationKey(formula.symbol, rightHead), formula);
230
+ pushValue(transRight, getRelationKey(formula.symbol, rightHead), formula);
251
231
  return true;
252
232
  };
253
233
 
@@ -255,13 +235,13 @@ export const createIndex = (exprs: Expressions) => {
255
235
  const relation = formula.args[0];
256
236
  const leftHead = getHead(relation.args[0]);
257
237
  if (leftHead !== undefined) {
258
- addElement(negTransLeft, getRelationKey(relation.symbol, leftHead), formula);
259
- addElement(allNegTransLeft, getHeadId(leftHead), formula);
238
+ pushValue(negTransLeft, getRelationKey(relation.symbol, leftHead), formula);
239
+ pushValue(allNegTransLeft, getHeadId(leftHead), formula);
260
240
  }
261
241
  const rightHead = getHead(relation.args[1]);
262
242
  if (rightHead !== undefined) {
263
- addElement(negTransRight, getRelationKey(relation.symbol, rightHead), formula);
264
- addElement(allNegTransRight, getHeadId(rightHead), formula);
243
+ pushValue(negTransRight, getRelationKey(relation.symbol, rightHead), formula);
244
+ pushValue(allNegTransRight, getHeadId(rightHead), formula);
265
245
  }
266
246
  };
267
247
 
@@ -276,8 +256,6 @@ export const createIndex = (exprs: Expressions) => {
276
256
  suspects.unshift([{ proof, cursor: 0, records }]);
277
257
  };
278
258
 
279
- // A cached lemma whose conclusions are all on the branch. A lemma waits on the first conclusion
280
- // that is missing, and is checked again when that formula comes back.
281
259
  const searchLemma = (): Proof | undefined => {
282
260
  for (const formula of newFormulas) {
283
261
  const record = lemmas.get(formula);
@@ -312,8 +290,8 @@ export const createIndex = (exprs: Expressions) => {
312
290
  remove,
313
291
  isMember,
314
292
  getGoalness,
315
- findPositive: (symbol: string) => withGoalness(getValues(positive, symbol)),
316
- findNegative: (symbol: string) => withGoalness(getValues(negative, symbol)),
293
+ findPositive: (symbol: string) => withGoalness(getLatestFirst(positive, symbol)),
294
+ findNegative: (symbol: string) => withGoalness(getLatestFirst(negative, symbol)),
317
295
  findEqualRight: (term: Expr) => getLatestFirst(equalLeftRight, term),
318
296
  findEqualLeft: (term: Expr) => getLatestFirst(equalRightLeft, term),
319
297
  findDisequalities: (term: Expr) => [
@@ -329,16 +307,17 @@ export const createIndex = (exprs: Expressions) => {
329
307
  addTrans,
330
308
  addNegTrans,
331
309
  findTransLeft: (relation: string, head: Head) =>
332
- withGoalness(getValues(transLeft, getRelationKey(relation, head))),
310
+ withGoalness(getLatestFirst(transLeft, getRelationKey(relation, head))),
333
311
  findTransRight: (relation: string, head: Head) =>
334
- withGoalness(getValues(transRight, getRelationKey(relation, head))),
312
+ withGoalness(getLatestFirst(transRight, getRelationKey(relation, head))),
335
313
  findNegTransLeft: (relation: string, head: Head) =>
336
- withGoalness(getValues(negTransLeft, getRelationKey(relation, head))),
314
+ withGoalness(getLatestFirst(negTransLeft, getRelationKey(relation, head))),
337
315
  findNegTransRight: (relation: string, head: Head) =>
338
- withGoalness(getValues(negTransRight, getRelationKey(relation, head))),
339
- findAllNegTransLeft: (head: Head) => withGoalness(getValues(allNegTransLeft, getHeadId(head))),
316
+ withGoalness(getLatestFirst(negTransRight, getRelationKey(relation, head))),
317
+ findAllNegTransLeft: (head: Head) =>
318
+ withGoalness(getLatestFirst(allNegTransLeft, getHeadId(head))),
340
319
  findAllNegTransRight: (head: Head) =>
341
- withGoalness(getValues(allNegTransRight, getHeadId(head))),
320
+ withGoalness(getLatestFirst(allNegTransRight, getHeadId(head))),
342
321
  addLemma,
343
322
  searchLemma,
344
323
  addDefinition: (definition: Definition) => definitions.set(definition.symbol, definition),
@@ -1,20 +1,18 @@
1
- // Ported from Zenon's isar_case.ml and enum.ml, as shipped in tlapm. Copyright 2009 INRIA, see
2
- // LICENSE.
3
- //
4
- // The lemmas for CASE expressions and record sets with more arms or fields than Zenon.thy covers.
5
- // Each one is a template that Zenon's Enum expands for the arity: the text between @@@ and ...
6
- // repeats counting up, the text between ... and @@@ repeats counting down.
1
+ // Ported from Zenon's isar_case.ml and enum.ml, as shipped in tlapm. Copyright 2009 INRIA, see LICENSE.
7
2
 
8
3
  import { TlaZenonError } from "../../errors";
9
4
 
10
- // A run of digits or of other characters.
11
5
  interface Lexeme {
12
6
  isNumber: boolean;
13
7
  text: string;
14
8
  }
15
9
 
16
- // A piece of a pattern: text, or a number that grows by its step at each repetition.
17
- type Piece = string | { base: number; step: number };
10
+ interface Progression {
11
+ base: number;
12
+ step: number;
13
+ }
14
+
15
+ type Piece = string | Progression;
18
16
 
19
17
  interface Pattern {
20
18
  pieces: Piece[];
@@ -26,7 +24,6 @@ const isDigit = (char: string | undefined) => char !== undefined && char >= "0"
26
24
  const lex = (text: string): Lexeme[] =>
27
25
  text.match(/[0-9]+|[^0-9]+/g)?.map((run) => ({ isNumber: isDigit(run[0]), text: run })) ?? [];
28
26
 
29
- // The repeated text and the separator of a pattern without numbers: its two equal halves.
30
27
  const splitText = (text: string): Pattern => {
31
28
  const half = Math.floor(text.length / 2);
32
29
  const odd = text.length % 2;
@@ -50,8 +47,6 @@ const correlate = (first: Lexeme[], second: Lexeme[]): Piece[] | undefined => {
50
47
  return pieces.every((piece) => piece !== undefined) ? pieces : undefined;
51
48
  };
52
49
 
53
- // Zenon's split_sep: the separator inside the middle text, after the end of the first instance's
54
- // last lexeme and before the start of the second instance's first.
55
50
  const splitSeparator = (
56
51
  before: Lexeme,
57
52
  middle: string,
@@ -69,7 +64,6 @@ const splitSeparator = (
69
64
  ];
70
65
  };
71
66
 
72
- // Zenon's split_sep2, for two instances that meet between two numbers.
73
67
  const splitSeparatorBetween = (
74
68
  before: Lexeme,
75
69
  first: Lexeme,
@@ -95,7 +89,6 @@ const splitSeparatorBetween = (
95
89
  throw new TlaZenonError("Zenon: a template whose instances don't meet");
96
90
  };
97
91
 
98
- // Zenon's Enum.parse: a template's text holds two instances of the pattern and the separator.
99
92
  const parsePattern = (text: string): Pattern | undefined => {
100
93
  const lexemes = lex(text);
101
94
  const length = lexemes.length;
@@ -132,10 +125,9 @@ const parsePattern = (text: string): Pattern | undefined => {
132
125
  return pieces === undefined ? undefined : { pieces, separator: split[1] };
133
126
  };
134
127
 
135
- const getInstance = (pieces: Piece[], value: (piece: { base: number; step: number }) => number) =>
136
- pieces.map((piece) => (typeof piece === "string" ? piece : String(value(piece)))).join("");
128
+ const getInstance = (pieces: Piece[], getValue: (piece: Progression) => number) =>
129
+ pieces.map((piece) => (typeof piece === "string" ? piece : String(getValue(piece)))).join("");
137
130
 
138
- // Zenon's expand_string and expand_string_rev: the pattern repeated count times.
139
131
  const expandPattern = (count: number, text: string, isReversed: boolean) => {
140
132
  const pattern = parsePattern(text);
141
133
  if (pattern === undefined) return undefined;
@@ -153,7 +145,6 @@ const expandPattern = (count: number, text: string, isReversed: boolean) => {
153
145
  .join(pattern.separator);
154
146
  };
155
147
 
156
- // Zenon's read_suffix: a count adjustment such as [n-1] after the end marker.
157
148
  const readAdjustment = (text: string, position: number): [number, number] => {
158
149
  const match = /^\[n(?:\]|([+-])([0-9]*)\])/.exec(text.slice(position));
159
150
  if (match === null) return [0, position];
@@ -168,7 +159,6 @@ const trimNewlines = (text: string) => {
168
159
  throw new TlaZenonError("Zenon: a bad template");
169
160
  };
170
161
 
171
- // Zenon's Enum.expand_text.
172
162
  const expandTemplate = (count: number, template: string) => {
173
163
  const parts: string[] = [];
174
164
  let position = 0;
@@ -1,9 +1,4 @@
1
- // Ported from Zenon's lltoisar.ml and the -oisar path of main.ml, as shipped in tlapm. Copyright
2
- // 2008 INRIA, see LICENSE.
3
- //
4
- // Prints a proof as the Isar text that Zenon writes with -oisar, which tlapm checks with Isabelle.
5
- // Zenon numbers each formula the first time it prints or names it: z_H<n> names a hypothesis and
6
- // ?z_h<n> abbreviates a formula that an earlier (is "...") pattern bound.
1
+ // Ported from Zenon's lltoisar.ml and the -oisar path of main.ml, as shipped in tlapm. Copyright 2008 INRIA, see LICENSE.
7
2
 
8
3
  import { TlaZenonError } from "../../errors";
9
4
  import { FALSE, GOAL_NAME, TRUE, type BinderExpr, type Expr, type Expressions } from "./expr";
@@ -50,7 +45,6 @@ const PREFIXES: Record<string, string> = {
50
45
  "TLA.box": "isa'box",
51
46
  };
52
47
 
53
- // Zenon drops the namespace of the symbols it doesn't rename.
54
48
  const stripNamespace = (symbol: string) =>
55
49
  symbol.length > 4 && symbol.startsWith("TLA.")
56
50
  ? symbol.slice(4)
@@ -58,7 +52,6 @@ const stripNamespace = (symbol: string) =>
58
52
  ? symbol.slice(6)
59
53
  : symbol;
60
54
 
61
- // Zenon's Misc.base26.
62
55
  const toBase26 = (number: number): string =>
63
56
  number < 26
64
57
  ? String.fromCharCode(97 + number)
@@ -70,7 +63,6 @@ const getPairs = <Item>(items: Item[]): [Item, Item][] =>
70
63
  items[2 * position + 1],
71
64
  ]);
72
65
 
73
- // The numeral that Zenon prints for 0 and its successors, up to 15.
74
66
  const getNumeral = (expression: Expr, limit: number): number | undefined => {
75
67
  if (limit < 0) return undefined;
76
68
  if (expression.kind === "var" && expression.symbol === "0") return 0;
@@ -99,12 +91,8 @@ const getLastBranchIsOther = (branches: Expr[][]) => {
99
91
  return last.length === 2;
100
92
  };
101
93
 
102
- // Zenon's iinc: the indentation stops growing at 15.
103
94
  const increment = (indent: number) => (indent >= 15 ? indent : indent + 1);
104
95
 
105
- // What the search knew when it found a proof: the .znn file's phrases, the proofs that it reused
106
- // and the properties of relations that the hypotheses stated. The printer stops at the search's
107
- // limits.
108
96
  interface IsarContext {
109
97
  exprs: Expressions;
110
98
  phrases: Phrase[];
@@ -113,12 +101,9 @@ interface IsarContext {
113
101
  limits: Limits;
114
102
  }
115
103
 
116
- // The Isar text that Zenon prints with -oisar for a proof that the search found, or undefined when
117
- // the limits stop the printer first.
118
104
  export const printIsar = (proof: MlProof, context: IsarContext): string | undefined => {
119
105
  const exprs = context.exprs;
120
106
  const numbers = new Map<Expr, number>();
121
- // Zenon's Index.get_number.
122
107
  const getNumber = (expression: Expr) => {
123
108
  const existing = numbers.get(expression);
124
109
  if (existing !== undefined) return existing;
@@ -149,8 +134,6 @@ export const printIsar = (proof: MlProof, context: IsarContext): string | undefi
149
134
  return exprs.elam(binder.args[0], binder.symbol, binder.args[1]);
150
135
  };
151
136
 
152
- // The formulas that (is "...") patterns bound, as a persistent set: a version is the length of
153
- // the log, and a version only reads the log's prefix, which later additions from it don't change.
154
137
  const dictLog: number[] = [];
155
138
  const dictPositions = new Map<number, number>();
156
139
  const isBound = (dict: number, number: number) => {
@@ -164,7 +147,6 @@ export const printIsar = (proof: MlProof, context: IsarContext): string | undefi
164
147
  return dict + 1;
165
148
  };
166
149
 
167
- // Zenon's p_expr: the bound variables are those that a pattern can't abbreviate.
168
150
  const printExpr = (env: string[], dict: number, expression: Expr): string => {
169
151
  const number = getNumber(expression);
170
152
  if (isBound(dict, number) && !expression.freeVars.some((name) => env.includes(name)))
@@ -257,7 +239,6 @@ export const printIsar = (proof: MlProof, context: IsarContext): string | undefi
257
239
 
258
240
  const expr = (dict: number, expression: Expr) => printExpr([], dict, expression);
259
241
 
260
- // Zenon's p_apply: the instance of a lambda, through the lambda's abbreviation if it has one.
261
242
  const printApply = (dict: number, lambda: Expr, argument: Expr) => {
262
243
  const number = getNumber(lambda);
263
244
  return isBound(dict, number)
@@ -265,14 +246,12 @@ export const printIsar = (proof: MlProof, context: IsarContext): string | undefi
265
246
  : expr(dict, exprs.apply(lambda, argument));
266
247
  };
267
248
 
268
- // Zenon's mk_pat: a pattern variable for a formula that has none yet.
269
249
  const makePattern = (dict: number, expression: Expr): [string, number] => {
270
250
  if (expression.kind === "var" && !isMetaName(expression.symbol)) return ["_", dict];
271
251
  const number = getNumber(expression);
272
252
  return isBound(dict, number) ? ["_", dict] : [vname(expression), bind(dict, number)];
273
253
  };
274
254
 
275
- // Zenon's p_is: binds the formula's parts to pattern variables.
276
255
  const printIs = (dict: number, formula: Expr): number => {
277
256
  const binary = (prefix: string, left: Expr, operator: string, right: Expr, suffix: string) => {
278
257
  const first = makePattern(dict, left);
@@ -340,7 +319,6 @@ export const printIsar = (proof: MlProof, context: IsarContext): string | undefi
340
319
  return printIs(current, formula);
341
320
  }, dict);
342
321
 
343
- // Zenon's p_sub: each branch assumes its formulas and proves FALSE.
344
322
  const printBranches = (
345
323
  indent: number,
346
324
  dict: number,
@@ -359,7 +337,6 @@ export const printIsar = (proof: MlProof, context: IsarContext): string | undefi
359
337
  });
360
338
  };
361
339
 
362
- // A have for each formula of the branch that the subproof uses, then the subproof.
363
340
  const printHaves = (
364
341
  indent: number,
365
342
  dict: number,
@@ -410,7 +387,6 @@ export const printIsar = (proof: MlProof, context: IsarContext): string | undefi
410
387
  printBranches(indent, dict, branches, proof.subproofs);
411
388
  };
412
389
 
413
- // Zenon's p_gamma and p_delta: the instance of a quantified formula.
414
390
  const printInstance = (
415
391
  indent: number,
416
392
  dict: number,
@@ -436,7 +412,6 @@ export const printIsar = (proof: MlProof, context: IsarContext): string | undefi
436
412
  printTree(indent, next, subproof);
437
413
  };
438
414
 
439
- // Zenon's p_sub_equal: proves an argument equal to the other, unless the subproof needn't.
440
415
  const printSubEqual = (
441
416
  indent: number,
442
417
  dict: number,
@@ -460,7 +435,6 @@ export const printIsar = (proof: MlProof, context: IsarContext): string | undefi
460
435
  return next;
461
436
  };
462
437
 
463
- // Zenon's p_subst: rewrites the arguments that differ one at a time.
464
438
  const printSubstitution = (
465
439
  indent: number,
466
440
  dict: number,
@@ -811,7 +785,6 @@ export const printIsar = (proof: MlProof, context: IsarContext): string | undefi
811
785
  );
812
786
  };
813
787
 
814
- // A hypothesis of a product or record set's rules, and its negation, each in its own branch.
815
788
  const printNegatedHaves = (
816
789
  indent: number,
817
790
  dict: number,
@@ -1200,7 +1173,6 @@ export const printIsar = (proof: MlProof, context: IsarContext): string | undefi
1200
1173
  line(indent, "qed\n");
1201
1174
  };
1202
1175
 
1203
- // Zenon's p_theorem.
1204
1176
  const theorem = lemmas[lemmas.length - 1];
1205
1177
  const hypotheses = context.phrases.flatMap((phrase) => (phrase.kind === "hyp" ? [phrase] : []));
1206
1178
  const negatedGoal =
@@ -1,12 +1,8 @@
1
- // When Zenon gives up: past the deadline, a time from Date.now(), or once the signal aborts. tlapm
2
- // kills Zenon at its deadline whether Zenon is searching or printing the proof, so the search, the
3
- // checker and the printer each check the limits at every step.
4
1
  export interface Limits {
5
2
  deadline: number;
6
3
  signal: AbortSignal | undefined;
7
4
  }
8
5
 
9
- // Why the limits stop Zenon now, if they do.
10
6
  export const getLimitFailure = (limits: Limits) =>
11
7
  Date.now() > limits.deadline
12
8
  ? "time limit"
@@ -1,7 +1,4 @@
1
1
  // Ported from Zenon's llproof.ml, as shipped in tlapm. Copyright 2004 INRIA, see LICENSE.
2
- //
3
- // The low-level proofs that Zenon prints: each node's conclusions are the formulas its subproofs
4
- // leave open, and the proof is a list of lemmas, the theorem last.
5
2
 
6
3
  import { TlaZenonError } from "../../errors";
7
4
  import { FALSE, TRUE, type Expr, type Expressions } from "./expr";
@@ -17,7 +14,6 @@ export type LlRule =
17
14
  | { kind: "eqsym"; left: Expr; right: Expr }
18
15
  | { kind: "notnot"; formula: Expr }
19
16
  | { kind: "connect" | "notconnect"; connective: Connective; left: Expr; right: Expr }
20
- // The quantified formula, and the witness or the term that instantiates it.
21
17
  | { kind: "ex" | "all" | "notex" | "notall"; quantified: Expr; term: Expr }
22
18
  | { kind: "pnotp"; positive: Expr; negative: Expr }
23
19
  | { kind: "notequal"; left: Expr; right: Expr }
@@ -37,7 +33,6 @@ export interface LlProof {
37
33
  subproofs: LlProof[];
38
34
  }
39
35
 
40
- // A lemma's parameters pair each free tau or metavariable with its type.
41
36
  export interface Lemma {
42
37
  name: string;
43
38
  params: [string, Expr][];
@@ -65,7 +60,6 @@ const makeLeaf = (conclusions: Expr[], rule: LlRule): LlProof => ({
65
60
  subproofs: [],
66
61
  });
67
62
 
68
- // Zenon's direct_close: a node that closes the conclusions at once, if one does.
69
63
  const getDirectClose = (exprs: Expressions, conclusions: Expr[]): LlProof | undefined => {
70
64
  for (const [position, formula] of conclusions.entries()) {
71
65
  const rest = conclusions.slice(position + 1);
@@ -90,7 +84,6 @@ const getDirectClose = (exprs: Expressions, conclusions: Expr[]): LlProof | unde
90
84
  return undefined;
91
85
  };
92
86
 
93
- // The formulas that a rule takes from its conclusions.
94
87
  const getEliminated = (exprs: Expressions, lemmas: Map<string, Lemma>, rule: LlRule): Expr[] => {
95
88
  const equal = (left: Expr, right: Expr) => exprs.eapp("=", [left, right]);
96
89
  switch (rule.kind) {
@@ -135,8 +128,6 @@ const getEliminated = (exprs: Expressions, lemmas: Map<string, Lemma>, rule: LlR
135
128
  }
136
129
  };
137
130
 
138
- // Zenon's Llproof.optimise: drops the conclusions that no rule uses and the nodes whose subproof
139
- // already proves their conclusions.
140
131
  export const optimise = (exprs: Expressions, proof: Lemma[]): Lemma[] => {
141
132
  const lemmas = new Map<string, Lemma>();
142
133
  const optimiseTree = (tree: LlProof): LlProof => {