tla-ts 0.0.9 → 0.0.10-dev.09e53c2a6

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 (625) hide show
  1. package/README.md +30 -1
  2. package/dist/compile.cjs +23 -0
  3. package/dist/compile.js +23 -0
  4. package/dist/deciders.cjs +41 -37
  5. package/dist/deciders.js +57 -53
  6. package/dist/index.cjs +1 -1
  7. package/dist/index.d.cts +109 -10
  8. package/dist/index.d.ts +109 -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 +2746 -410
  15. package/dist/prove.js +2745 -409
  16. package/dist/run.cjs +146 -31
  17. package/dist/run.js +146 -31
  18. package/dist/tlapm.cjs +2 -2
  19. package/dist/tlapm.js +2 -2
  20. package/dist/transfer.cjs +132 -104
  21. package/dist/transfer.js +132 -104
  22. package/dist/worker.cjs +6 -6
  23. package/dist/worker.js +6 -6
  24. package/package.json +3 -1
  25. package/src/ast.ts +45 -59
  26. package/src/bags.ts +99 -102
  27. package/src/builtins.ts +28 -75
  28. package/src/bundled-modules.ts +1 -8
  29. package/src/check-failure.ts +116 -0
  30. package/src/check-trace.ts +282 -0
  31. package/src/check.ts +797 -782
  32. package/src/cli/options.ts +12 -32
  33. package/src/cli/run.ts +0 -2
  34. package/src/cli/runtime-invariants.ts +136 -0
  35. package/src/cli/shared.ts +19 -12
  36. package/src/cli/tlapm.ts +433 -82
  37. package/src/cli/tlc-arguments.ts +652 -0
  38. package/src/cli/tlc-output.ts +687 -0
  39. package/src/cli/tlc-usage.ts +360 -0
  40. package/src/cli/tlc.ts +323 -658
  41. package/src/cli/typescript.ts +23 -0
  42. package/src/cli/xml-exporter.ts +27 -49
  43. package/src/cli.ts +0 -1
  44. package/src/codegen.ts +196 -74
  45. package/src/config.ts +140 -109
  46. package/src/coverage.ts +830 -0
  47. package/src/dependencies.ts +36 -54
  48. package/src/dfid.ts +618 -0
  49. package/src/environment-config.ts +315 -0
  50. package/src/environment.ts +178 -339
  51. package/src/errors.ts +100 -57
  52. package/src/evaluate.ts +598 -340
  53. package/src/exit-codes.ts +38 -3
  54. package/src/fingerprints.ts +75 -11
  55. package/src/index.ts +3 -0
  56. package/src/instances.ts +126 -21
  57. package/src/java-hash.ts +7 -0
  58. package/src/java-overrides.ts +4 -19
  59. package/src/json-reader.ts +455 -0
  60. package/src/json.ts +252 -139
  61. package/src/levels.ts +46 -58
  62. package/src/lexer.ts +83 -101
  63. package/src/liveness-checker.ts +590 -311
  64. package/src/liveness.ts +180 -124
  65. package/src/obligations/action.ts +17 -44
  66. package/src/obligations/anonymize.ts +120 -95
  67. package/src/obligations/enabled-axioms.ts +218 -0
  68. package/src/obligations/equality.ts +1 -3
  69. package/src/obligations/expression.ts +37 -26
  70. package/src/obligations/format.ts +0 -10
  71. package/src/obligations/generate.ts +66 -64
  72. package/src/obligations/index.ts +38 -19
  73. package/src/obligations/levels.ts +27 -18
  74. package/src/obligations/module.ts +28 -55
  75. package/src/obligations/normalize.ts +30 -37
  76. package/src/obligations/operators.ts +0 -3
  77. package/src/obligations/pragma.ts +52 -24
  78. package/src/obligations/printer.ts +89 -58
  79. package/src/obligations/proof.ts +3 -6
  80. package/src/obligations/regroup.ts +0 -5
  81. package/src/obligations/simplify.ts +57 -63
  82. package/src/obligations/source.ts +119 -95
  83. package/src/obligations/subexpression.ts +49 -28
  84. package/src/obligations/substitution.ts +1 -5
  85. package/src/obligations/temporal.ts +12 -20
  86. package/src/obligations/tuples.ts +2 -10
  87. package/src/parallel-worker.ts +30 -60
  88. package/src/parallel.ts +59 -73
  89. package/src/parser.ts +1082 -399
  90. package/src/pcal/ast.ts +53 -86
  91. package/src/pcal/parse.ts +144 -219
  92. package/src/pcal/tokenize.ts +91 -131
  93. package/src/pcal/translate.ts +83 -130
  94. package/src/pcal/validate.ts +48 -68
  95. package/src/pretty-print.ts +7 -8
  96. package/src/prover/decide-pool.ts +8 -13
  97. package/src/prover/deciders.ts +12 -13
  98. package/src/prover/first-order.ts +0 -11
  99. package/src/prover/isabelle/decide.ts +3 -31
  100. package/src/prover/isabelle/encode.ts +82 -64
  101. package/src/prover/isabelle/isar/attrib.ts +250 -0
  102. package/src/prover/isabelle/isar/context.ts +335 -0
  103. package/src/prover/isabelle/isar/induct.ts +382 -0
  104. package/src/prover/isabelle/isar/inner-syntax.ts +262 -117
  105. package/src/prover/isabelle/isar/method.ts +510 -226
  106. package/src/prover/isabelle/isar/proof.ts +570 -23
  107. package/src/prover/isabelle/isar/rule-cases.ts +224 -0
  108. package/src/prover/isabelle/isar/theory.ts +488 -88
  109. package/src/prover/isabelle/isar/toplevel.ts +331 -0
  110. package/src/prover/isabelle/isar/type-check.ts +99 -38
  111. package/src/prover/isabelle/provers/blast/blast.ts +16 -105
  112. package/src/prover/isabelle/provers/blast/branch.ts +0 -33
  113. package/src/prover/isabelle/provers/blast/prove.ts +0 -36
  114. package/src/prover/isabelle/provers/blast/rules.ts +5 -45
  115. package/src/prover/isabelle/provers/blast/state.ts +1 -29
  116. package/src/prover/isabelle/provers/blast/term.ts +8 -37
  117. package/src/prover/isabelle/provers/clasimp.ts +0 -14
  118. package/src/prover/isabelle/provers/classical.ts +58 -61
  119. package/src/prover/isabelle/provers/hypsubst.ts +27 -52
  120. package/src/prover/isabelle/pure/bicompose.ts +24 -39
  121. package/src/prover/isabelle/pure/consts.ts +0 -8
  122. package/src/prover/isabelle/pure/conv.ts +2 -18
  123. package/src/prover/isabelle/pure/drule.ts +95 -45
  124. package/src/prover/isabelle/pure/envir.ts +2 -53
  125. package/src/prover/isabelle/pure/goal.ts +1 -9
  126. package/src/prover/isabelle/pure/interrupt.ts +0 -5
  127. package/src/prover/isabelle/pure/list.ts +0 -3
  128. package/src/prover/isabelle/pure/logic.ts +1 -16
  129. package/src/prover/isabelle/pure/name.ts +1 -10
  130. package/src/prover/isabelle/pure/net.ts +2 -60
  131. package/src/prover/isabelle/pure/object-logic.ts +15 -16
  132. package/src/prover/isabelle/pure/pattern.ts +1 -20
  133. package/src/prover/isabelle/pure/raw-simplifier.ts +16 -63
  134. package/src/prover/isabelle/pure/rewriter.ts +31 -74
  135. package/src/prover/isabelle/pure/search.ts +2 -11
  136. package/src/prover/isabelle/pure/seq.ts +0 -11
  137. package/src/prover/isabelle/pure/simplifier.ts +27 -16
  138. package/src/prover/isabelle/pure/table.ts +2 -33
  139. package/src/prover/isabelle/pure/tactic.ts +11 -23
  140. package/src/prover/isabelle/pure/tactical.ts +47 -48
  141. package/src/prover/isabelle/pure/term-ord.ts +1 -7
  142. package/src/prover/isabelle/pure/term.ts +1 -44
  143. package/src/prover/isabelle/pure/thm.ts +26 -48
  144. package/src/prover/isabelle/pure/type.ts +1 -16
  145. package/src/prover/isabelle/pure/unify.ts +19 -31
  146. package/src/prover/isabelle/pure/variable.ts +2 -8
  147. package/src/prover/isabelle/tla/classical-setup.ts +17 -25
  148. package/src/prover/isabelle/tla/context.ts +65 -26
  149. package/src/prover/isabelle/tla/logic-data.ts +1 -1
  150. package/src/prover/isabelle/tla/logic.ts +53 -32
  151. package/src/prover/isabelle/tla/simpdata.ts +45 -44
  152. package/src/prover/isabelle/tools/intuitionistic.ts +28 -21
  153. package/src/prover/ocaml.ts +4 -7
  154. package/src/prover/prep/action.ts +33 -66
  155. package/src/prover/prep/enabled-axioms.ts +22 -20
  156. package/src/prover/prep/fingerprint.ts +2 -21
  157. package/src/prover/prep/level-comparison.ts +8 -12
  158. package/src/prover/prep/md5.ts +0 -2
  159. package/src/prover/prep/methods.ts +189 -86
  160. package/src/prover/prep/normalize.ts +42 -37
  161. package/src/prover/prove-worker.ts +0 -2
  162. package/src/prover/prove.ts +398 -133
  163. package/src/prover/ptl/decide.ts +96 -56
  164. package/src/prover/ptl/encode.ts +15 -38
  165. package/src/prover/ptl/sat.ts +24 -32
  166. package/src/prover/ptl/tableau.ts +40 -28
  167. package/src/prover/smt/arithmetic.ts +310 -0
  168. package/src/prover/smt/axioms.ts +12 -15
  169. package/src/prover/smt/context.ts +60 -32
  170. package/src/prover/smt/data.ts +517 -401
  171. package/src/prover/smt/encode.ts +155 -85
  172. package/src/prover/smt/extensionality.ts +5 -13
  173. package/src/prover/smt/flatten.ts +7 -28
  174. package/src/prover/smt/format.ts +33 -14
  175. package/src/prover/smt/instances.ts +7 -11
  176. package/src/prover/smt/layout.ts +91 -0
  177. package/src/prover/smt/rewrite.ts +1026 -658
  178. package/src/prover/smt/simplify.ts +441 -0
  179. package/src/prover/smt/solver/ackermannize-bv-tactic.ts +61 -0
  180. package/src/prover/smt/solver/ackr-helper.ts +179 -0
  181. package/src/prover/smt/solver/ackr-model-converter.ts +105 -0
  182. package/src/prover/smt/solver/act-cache.ts +0 -16
  183. package/src/prover/smt/solver/add-bounds-tactic.ts +59 -0
  184. package/src/prover/smt/solver/aig-tactic.ts +52 -0
  185. package/src/prover/smt/solver/aig.ts +889 -0
  186. package/src/prover/smt/solver/arith-rewriter.ts +615 -53
  187. package/src/prover/smt/solver/arith-terms.ts +121 -0
  188. package/src/prover/smt/solver/array-decl-plugin.ts +175 -0
  189. package/src/prover/smt/solver/array-rewriter.ts +309 -0
  190. package/src/prover/smt/solver/array.ts +1 -3
  191. package/src/prover/smt/solver/asserted-formulas.ts +87 -58
  192. package/src/prover/smt/solver/ast-lt.ts +166 -22
  193. package/src/prover/smt/solver/ast-util.ts +160 -7
  194. package/src/prover/smt/solver/ast.ts +1424 -180
  195. package/src/prover/smt/solver/auf-solver.ts +7 -44
  196. package/src/prover/smt/solver/bit-blast-tactic.ts +582 -0
  197. package/src/prover/smt/solver/bit-blaster.ts +871 -0
  198. package/src/prover/smt/solver/bound-manager.ts +196 -0
  199. package/src/prover/smt/solver/bound-simplifier.ts +600 -0
  200. package/src/prover/smt/solver/bv-bound-chk.ts +492 -0
  201. package/src/prover/smt/solver/bv-decl-plugin.ts +338 -0
  202. package/src/prover/smt/solver/bv-divrem-bounds.ts +95 -0
  203. package/src/prover/smt/solver/bv-rewriter.ts +1901 -0
  204. package/src/prover/smt/solver/bv1-blast.ts +214 -0
  205. package/src/prover/smt/solver/bv2fpa-converter.ts +174 -0
  206. package/src/prover/smt/solver/bv2int-rewriter.ts +544 -0
  207. package/src/prover/smt/solver/bv2real-rewriter.ts +533 -0
  208. package/src/prover/smt/solver/card2bv.ts +110 -0
  209. package/src/prover/smt/solver/case-split-queue.ts +0 -10
  210. package/src/prover/smt/solver/cg-table.ts +39 -42
  211. package/src/prover/smt/solver/check-logic.ts +330 -0
  212. package/src/prover/smt/solver/clause.ts +0 -27
  213. package/src/prover/smt/solver/cofactor-elim-term-ite.ts +278 -0
  214. package/src/prover/smt/solver/conflict-resolution.ts +78 -11
  215. package/src/prover/smt/solver/context.ts +519 -175
  216. package/src/prover/smt/solver/ctx-simplify.ts +33 -50
  217. package/src/prover/smt/solver/ctx-solver-simplify.ts +122 -0
  218. package/src/prover/smt/solver/datatype-decl-plugin.ts +572 -0
  219. package/src/prover/smt/solver/datatype-rewriter.ts +82 -0
  220. package/src/prover/smt/solver/demodulator.ts +786 -0
  221. package/src/prover/smt/solver/dependent-expr-state.ts +81 -0
  222. package/src/prover/smt/solver/der.ts +39 -30
  223. package/src/prover/smt/solver/diff-neq.ts +206 -0
  224. package/src/prover/smt/solver/distribute-forall.ts +57 -0
  225. package/src/prover/smt/solver/dom-simplify.ts +511 -0
  226. package/src/prover/smt/solver/dt2bv-tactic.ts +260 -0
  227. package/src/prover/smt/solver/dyn-ack.ts +0 -11
  228. package/src/prover/smt/solver/e-matching.ts +9 -41
  229. package/src/prover/smt/solver/elim-small-bv-tactic.ts +129 -0
  230. package/src/prover/smt/solver/elim-uncnstr.ts +545 -0
  231. package/src/prover/smt/solver/enode.ts +100 -23
  232. package/src/prover/smt/solver/eq2bv-tactic.ts +218 -0
  233. package/src/prover/smt/solver/euf/arith-axioms.ts +403 -0
  234. package/src/prover/smt/solver/euf/arith-internalize.ts +653 -0
  235. package/src/prover/smt/solver/euf/arith-solver.ts +889 -0
  236. package/src/prover/smt/solver/euf/array-axioms.ts +527 -0
  237. package/src/prover/smt/solver/euf/array-internalize.ts +428 -0
  238. package/src/prover/smt/solver/euf/array-solver.ts +306 -0
  239. package/src/prover/smt/solver/euf/bv-ackerman.ts +162 -0
  240. package/src/prover/smt/solver/euf/bv-internalize.ts +748 -0
  241. package/src/prover/smt/solver/euf/bv-solver.ts +449 -0
  242. package/src/prover/smt/solver/euf/dt-solver.ts +618 -0
  243. package/src/prover/smt/solver/euf/egraph.ts +907 -0
  244. package/src/prover/smt/solver/euf/euf-solver.ts +1205 -0
  245. package/src/prover/smt/solver/euf/fpa-solver.ts +317 -0
  246. package/src/prover/smt/solver/euf/mam.ts +1050 -0
  247. package/src/prover/smt/solver/euf/q-ematch.ts +830 -0
  248. package/src/prover/smt/solver/euf/q-mbi.ts +587 -0
  249. package/src/prover/smt/solver/euf/q-model-fixer.ts +296 -0
  250. package/src/prover/smt/solver/euf/q-solver.ts +361 -0
  251. package/src/prover/smt/solver/euf/th-solver.ts +335 -0
  252. package/src/prover/smt/solver/euf/th-solvers.ts +30 -0
  253. package/src/prover/smt/solver/expr-ref.ts +0 -5
  254. package/src/prover/smt/solver/expr-safe-replace.ts +26 -7
  255. package/src/prover/smt/solver/expr2polynomial.ts +146 -0
  256. package/src/prover/smt/solver/factor.ts +141 -0
  257. package/src/prover/smt/solver/fd-solver.ts +265 -0
  258. package/src/prover/smt/solver/fingerprints.ts +15 -26
  259. package/src/prover/smt/solver/fix-dl-var.ts +148 -0
  260. package/src/prover/smt/solver/flat-literals.ts +0 -9
  261. package/src/prover/smt/solver/fm-tactic.ts +884 -0
  262. package/src/prover/smt/solver/fpa-decl-plugin.ts +618 -0
  263. package/src/prover/smt/solver/fpa-rewriter.ts +640 -0
  264. package/src/prover/smt/solver/fpa2bv-converter.ts +2249 -0
  265. package/src/prover/smt/solver/fpa2bv-rewriter.ts +348 -0
  266. package/src/prover/smt/solver/fpa2bv-tactic.ts +73 -0
  267. package/src/prover/smt/solver/goal.ts +176 -28
  268. package/src/prover/smt/solver/goal2nlsat.ts +189 -0
  269. package/src/prover/smt/solver/guard-set.ts +219 -0
  270. package/src/prover/smt/solver/hash.ts +0 -9
  271. package/src/prover/smt/solver/hashtable.ts +26 -23
  272. package/src/prover/smt/solver/inf-eps.ts +63 -0
  273. package/src/prover/smt/solver/inj-axiom.ts +101 -0
  274. package/src/prover/smt/solver/internalizer.ts +112 -132
  275. package/src/prover/smt/solver/lackr.ts +381 -0
  276. package/src/prover/smt/solver/lbool.ts +0 -2
  277. package/src/prover/smt/solver/lia2card.ts +268 -0
  278. package/src/prover/smt/solver/lia2pb.ts +154 -0
  279. package/src/prover/smt/solver/literal.ts +0 -4
  280. package/src/prover/smt/solver/logic-tactics.ts +345 -0
  281. package/src/prover/smt/solver/lp/bound-propagator.ts +7 -26
  282. package/src/prover/smt/solver/lp/constraints.ts +1 -8
  283. package/src/prover/smt/solver/lp/containers.ts +11 -30
  284. package/src/prover/smt/solver/lp/core-solver.ts +23 -29
  285. package/src/prover/smt/solver/lp/cross-nested.ts +5 -20
  286. package/src/prover/smt/solver/lp/dep-intervals.ts +6 -24
  287. package/src/prover/smt/solver/lp/dependency.ts +0 -5
  288. package/src/prover/smt/solver/lp/dioph-eq.ts +8 -103
  289. package/src/prover/smt/solver/lp/explanation.ts +0 -6
  290. package/src/prover/smt/solver/lp/gomory.ts +8 -22
  291. package/src/prover/smt/solver/lp/hnf-cutter.ts +16 -23
  292. package/src/prover/smt/solver/lp/hnf.ts +10 -28
  293. package/src/prover/smt/solver/lp/int-cube.ts +17 -39
  294. package/src/prover/smt/solver/lp/int-solver.ts +3 -35
  295. package/src/prover/smt/solver/lp/lar-solver.ts +69 -82
  296. package/src/prover/smt/solver/lp/lar-term.ts +0 -5
  297. package/src/prover/smt/solver/lp/lp-settings.ts +0 -14
  298. package/src/prover/smt/solver/lp/maximize-term.ts +76 -52
  299. package/src/prover/smt/solver/lp/nex-creator.ts +4 -28
  300. package/src/prover/smt/solver/lp/nex.ts +0 -6
  301. package/src/prover/smt/solver/lp/nla-backoff.ts +0 -5
  302. package/src/prover/smt/solver/lp/nla-basics.ts +48 -30
  303. package/src/prover/smt/solver/lp/nla-core.ts +91 -135
  304. package/src/prover/smt/solver/lp/nla-divisions.ts +31 -43
  305. package/src/prover/smt/solver/lp/nla-emonics.ts +3 -21
  306. package/src/prover/smt/solver/lp/nla-factorization.ts +0 -4
  307. package/src/prover/smt/solver/lp/nla-grobner.ts +22 -72
  308. package/src/prover/smt/solver/lp/nla-horner.ts +2 -12
  309. package/src/prover/smt/solver/lp/nla-intervals.ts +1 -12
  310. package/src/prover/smt/solver/lp/nla-monomial-bounds.ts +15 -42
  311. package/src/prover/smt/solver/lp/nla-monotone.ts +1 -6
  312. package/src/prover/smt/solver/lp/nla-order.ts +0 -13
  313. package/src/prover/smt/solver/lp/nla-patcher.ts +3 -7
  314. package/src/prover/smt/solver/lp/nla-powers.ts +220 -0
  315. package/src/prover/smt/solver/lp/nla-tangents.ts +0 -10
  316. package/src/prover/smt/solver/lp/nla-throttle.ts +0 -6
  317. package/src/prover/smt/solver/lp/nla-transcendentals.ts +324 -0
  318. package/src/prover/smt/solver/lp/nla-types.ts +0 -12
  319. package/src/prover/smt/solver/lp/nla-var-eqs.ts +4 -26
  320. package/src/prover/smt/solver/lp/nra-solver.ts +123 -112
  321. package/src/prover/smt/solver/lp/numeric-pair.ts +0 -4
  322. package/src/prover/smt/solver/lp/pdd-interval.ts +0 -3
  323. package/src/prover/smt/solver/lp/pdd-simplifier.ts +1 -14
  324. package/src/prover/smt/solver/lp/pdd-solver.ts +2 -33
  325. package/src/prover/smt/solver/lp/pdd.ts +7 -70
  326. package/src/prover/smt/solver/lp/random-updater.ts +0 -9
  327. package/src/prover/smt/solver/lp/static-matrix.ts +8 -19
  328. package/src/prover/smt/solver/lp/union-find.ts +5 -5
  329. package/src/prover/smt/solver/macro-finder.ts +530 -0
  330. package/src/prover/smt/solver/mam-compiler.ts +129 -139
  331. package/src/prover/smt/solver/mam-interpreter.ts +0 -21
  332. package/src/prover/smt/solver/max-bv-sharing-tactic.ts +17 -0
  333. package/src/prover/smt/solver/max-cliques.ts +105 -0
  334. package/src/prover/smt/solver/maxcore.ts +309 -0
  335. package/src/prover/smt/solver/maximize-ac-sharing.ts +8 -21
  336. package/src/prover/smt/solver/maxlex.ts +115 -0
  337. package/src/prover/smt/solver/maxsmt-base.ts +105 -0
  338. package/src/prover/smt/solver/maxsmt.ts +92 -0
  339. package/src/prover/smt/solver/mbp/mbp-arith.ts +467 -0
  340. package/src/prover/smt/solver/mbp/mbp-basic-tg.ts +101 -0
  341. package/src/prover/smt/solver/mbp/mbp-plugin.ts +287 -0
  342. package/src/prover/smt/solver/mbp/mbp-qel.ts +48 -0
  343. package/src/prover/smt/solver/mbp/mbp-solve-plugin.ts +271 -0
  344. package/src/prover/smt/solver/mbp/mbp-term-graph.ts +606 -0
  345. package/src/prover/smt/solver/model-based-opt.ts +844 -0
  346. package/src/prover/smt/solver/model-checker.ts +19 -62
  347. package/src/prover/smt/solver/model-evaluator.ts +190 -40
  348. package/src/prover/smt/solver/model-finder.ts +14 -32
  349. package/src/prover/smt/solver/model-generator.ts +56 -40
  350. package/src/prover/smt/solver/model-macro-solver.ts +60 -114
  351. package/src/prover/smt/solver/model-printer.ts +214 -0
  352. package/src/prover/smt/solver/mpf.ts +711 -0
  353. package/src/prover/smt/solver/mus.ts +51 -0
  354. package/src/prover/smt/solver/muz/dl-context.ts +404 -0
  355. package/src/prover/smt/solver/muz/dl-mk-bit-blast.ts +97 -0
  356. package/src/prover/smt/solver/muz/dl-mk-coi-filter.ts +167 -0
  357. package/src/prover/smt/solver/muz/dl-mk-elim-term-ite.ts +125 -0
  358. package/src/prover/smt/solver/muz/dl-mk-interp-tail-simplifier.ts +299 -0
  359. package/src/prover/smt/solver/muz/dl-mk-rule-inliner.ts +455 -0
  360. package/src/prover/smt/solver/muz/dl-mk-slice.ts +340 -0
  361. package/src/prover/smt/solver/muz/dl-mk-subsumption-checker.ts +163 -0
  362. package/src/prover/smt/solver/muz/dl-rule-set.ts +273 -0
  363. package/src/prover/smt/solver/muz/dl-rule-transformer.ts +123 -0
  364. package/src/prover/smt/solver/muz/dl-rule.ts +496 -0
  365. package/src/prover/smt/solver/muz/hnf.ts +201 -0
  366. package/src/prover/smt/solver/muz/horn-subsume-model-converter.ts +176 -0
  367. package/src/prover/smt/solver/muz/horn-tactic.ts +201 -0
  368. package/src/prover/smt/solver/muz/rule-properties.ts +337 -0
  369. package/src/prover/smt/solver/muz/spacer-context.ts +1406 -0
  370. package/src/prover/smt/solver/muz/spacer-dl-interface.ts +52 -0
  371. package/src/prover/smt/solver/muz/spacer-generalizers.ts +241 -0
  372. package/src/prover/smt/solver/muz/spacer-manager.ts +127 -0
  373. package/src/prover/smt/solver/muz/spacer-pdr.ts +218 -0
  374. package/src/prover/smt/solver/muz/spacer-prop-solver.ts +333 -0
  375. package/src/prover/smt/solver/muz/spacer-util.ts +282 -0
  376. package/src/prover/smt/solver/muz/substitution.ts +203 -0
  377. package/src/prover/smt/solver/nla2bv-tactic.ts +285 -0
  378. package/src/prover/smt/solver/nlqsat.ts +484 -0
  379. package/src/prover/smt/solver/nlsat/algebraic.ts +177 -160
  380. package/src/prover/smt/solver/nlsat/atoms.ts +24 -24
  381. package/src/prover/smt/solver/nlsat/evaluator.ts +16 -22
  382. package/src/prover/smt/solver/nlsat/explain.ts +65 -69
  383. package/src/prover/smt/solver/nlsat/interval-set.ts +9 -51
  384. package/src/prover/smt/solver/nlsat/levelwise.ts +48 -135
  385. package/src/prover/smt/solver/nlsat/mpbq.ts +47 -14
  386. package/src/prover/smt/solver/nlsat/polynomial.ts +29 -161
  387. package/src/prover/smt/solver/nlsat/solver.ts +241 -110
  388. package/src/prover/smt/solver/nlsat/transcendental-eval.ts +310 -0
  389. package/src/prover/smt/solver/nlsat/transcendentals.ts +367 -0
  390. package/src/prover/smt/solver/nlsat/types.ts +0 -9
  391. package/src/prover/smt/solver/nlsat/upolynomial-factorization.ts +1 -47
  392. package/src/prover/smt/solver/nlsat/upolynomial.ts +10 -93
  393. package/src/prover/smt/solver/nlsat-tactic.ts +82 -0
  394. package/src/prover/smt/solver/nnf.ts +107 -60
  395. package/src/prover/smt/solver/normalize-bounds.ts +53 -0
  396. package/src/prover/smt/solver/occf.ts +97 -0
  397. package/src/prover/smt/solver/opt-context.ts +787 -0
  398. package/src/prover/smt/solver/opt-nlsat.ts +375 -0
  399. package/src/prover/smt/solver/opt-pareto.ts +282 -0
  400. package/src/prover/smt/solver/opt-preprocess.ts +101 -0
  401. package/src/prover/smt/solver/opt-solver.ts +308 -0
  402. package/src/prover/smt/solver/opt-value.ts +55 -0
  403. package/src/prover/smt/solver/optsmt.ts +692 -0
  404. package/src/prover/smt/solver/parallel-tactic.ts +299 -0
  405. package/src/prover/smt/solver/pattern-inference.ts +21 -26
  406. package/src/prover/smt/solver/pb-rewriter.ts +284 -0
  407. package/src/prover/smt/solver/pb2bv-tactic.ts +540 -0
  408. package/src/prover/smt/solver/poly-rewriter.ts +204 -79
  409. package/src/prover/smt/solver/probes.ts +512 -0
  410. package/src/prover/smt/solver/propagate-values.ts +37 -30
  411. package/src/prover/smt/solver/proto-model.ts +650 -66
  412. package/src/prover/smt/solver/pull-quant.ts +28 -23
  413. package/src/prover/smt/solver/purify-arith.ts +632 -0
  414. package/src/prover/smt/solver/qe-arith-plugin.ts +1098 -0
  415. package/src/prover/smt/solver/qe-lite-der.ts +2 -31
  416. package/src/prover/smt/solver/qe-lite-fm.ts +4 -28
  417. package/src/prover/smt/solver/qe-lite.ts +39 -49
  418. package/src/prover/smt/solver/qe-mbp.ts +270 -0
  419. package/src/prover/smt/solver/qe.ts +1498 -0
  420. package/src/prover/smt/solver/qel.ts +25 -0
  421. package/src/prover/smt/solver/qi-queue.ts +0 -16
  422. package/src/prover/smt/solver/qsat.ts +814 -0
  423. package/src/prover/smt/solver/quant-hoist.ts +196 -0
  424. package/src/prover/smt/solver/quant-tactics.ts +17 -74
  425. package/src/prover/smt/solver/quantifier-analyzer.ts +26 -47
  426. package/src/prover/smt/solver/quantifier-manager.ts +8 -23
  427. package/src/prover/smt/solver/quasi-macros.ts +243 -0
  428. package/src/prover/smt/solver/random-gen.ts +0 -2
  429. package/src/prover/smt/solver/rational.ts +45 -8
  430. package/src/prover/smt/solver/recfun-decl-plugin.ts +261 -0
  431. package/src/prover/smt/solver/recfun-rewriter.ts +107 -0
  432. package/src/prover/smt/solver/reduce-args.ts +225 -0
  433. package/src/prover/smt/solver/reduce-bv-size.ts +119 -0
  434. package/src/prover/smt/solver/ref-vector.ts +0 -6
  435. package/src/prover/smt/solver/relevancy.ts +2 -16
  436. package/src/prover/smt/solver/rewriter-tpl.ts +52 -129
  437. package/src/prover/smt/solver/rewriter.ts +477 -120
  438. package/src/prover/smt/solver/rlimit.ts +39 -21
  439. package/src/prover/smt/solver/sat/asymm-branch.ts +325 -0
  440. package/src/prover/smt/solver/sat/big.ts +177 -0
  441. package/src/prover/smt/solver/sat/clause-use-list.ts +71 -0
  442. package/src/prover/smt/solver/sat/clause.ts +203 -0
  443. package/src/prover/smt/solver/sat/cleaner.ts +94 -0
  444. package/src/prover/smt/solver/sat/config.ts +122 -0
  445. package/src/prover/smt/solver/sat/consequences.ts +203 -0
  446. package/src/prover/smt/solver/sat/elim-eqs.ts +142 -0
  447. package/src/prover/smt/solver/sat/goal2sat.ts +526 -0
  448. package/src/prover/smt/solver/sat/inc-sat-solver.ts +378 -0
  449. package/src/prover/smt/solver/sat/model-converter.ts +136 -0
  450. package/src/prover/smt/solver/sat/pb-constraint.ts +261 -0
  451. package/src/prover/smt/solver/sat/pb-solver.ts +1577 -0
  452. package/src/prover/smt/solver/sat/probing.ts +170 -0
  453. package/src/prover/smt/solver/sat/sat-tactic.ts +43 -0
  454. package/src/prover/smt/solver/sat/sat2goal.ts +165 -0
  455. package/src/prover/smt/solver/sat/scc.ts +142 -0
  456. package/src/prover/smt/solver/sat/simplifier.ts +1618 -0
  457. package/src/prover/smt/solver/sat/solver.ts +2127 -0
  458. package/src/prover/smt/solver/sat/var-queue.ts +117 -0
  459. package/src/prover/smt/solver/sat/watch-list.ts +140 -0
  460. package/src/prover/smt/solver/search-tree.ts +284 -0
  461. package/src/prover/smt/solver/seq-axioms.ts +1010 -0
  462. package/src/prover/smt/solver/seq-decl-plugin.ts +819 -0
  463. package/src/prover/smt/solver/seq-derive.ts +1301 -0
  464. package/src/prover/smt/solver/seq-eq-approx.ts +236 -0
  465. package/src/prover/smt/solver/seq-eq-solver.ts +439 -0
  466. package/src/prover/smt/solver/seq-factory.ts +89 -0
  467. package/src/prover/smt/solver/seq-monadic.ts +728 -0
  468. package/src/prover/smt/solver/seq-range-predicate.ts +235 -0
  469. package/src/prover/smt/solver/seq-re-rewriter.ts +1170 -0
  470. package/src/prover/smt/solver/seq-re-util.ts +758 -0
  471. package/src/prover/smt/solver/seq-regex-bisim.ts +144 -0
  472. package/src/prover/smt/solver/seq-regex-live.ts +200 -0
  473. package/src/prover/smt/solver/seq-rewriter.ts +2402 -0
  474. package/src/prover/smt/solver/seq-skolem.ts +317 -0
  475. package/src/prover/smt/solver/seq-subset.ts +165 -0
  476. package/src/prover/smt/solver/seq-view-witness.ts +353 -0
  477. package/src/prover/smt/solver/smt-consequences.ts +297 -0
  478. package/src/prover/smt/solver/smt-kernel.ts +83 -0
  479. package/src/prover/smt/solver/smt-logics.ts +66 -0
  480. package/src/prover/smt/solver/smt-setup.ts +496 -0
  481. package/src/prover/smt/solver/smt2-printer.ts +765 -0
  482. package/src/prover/smt/solver/smtlib-parser.ts +3140 -365
  483. package/src/prover/smt/solver/smtlib-script.ts +1631 -0
  484. package/src/prover/smt/solver/solve-eqs.ts +929 -0
  485. package/src/prover/smt/solver/solver.ts +119 -39
  486. package/src/prover/smt/solver/sort.ts +1 -5
  487. package/src/prover/smt/solver/static-features.ts +314 -0
  488. package/src/prover/smt/solver/sticky-generations.ts +0 -6
  489. package/src/prover/smt/solver/tactic.ts +1986 -0
  490. package/src/prover/smt/solver/term-enumeration.ts +205 -0
  491. package/src/prover/smt/solver/theory-array.ts +1240 -0
  492. package/src/prover/smt/solver/theory-bv.ts +1200 -0
  493. package/src/prover/smt/solver/theory-char.ts +355 -0
  494. package/src/prover/smt/solver/theory-datatype.ts +598 -0
  495. package/src/prover/smt/solver/theory-finite-set.ts +30 -0
  496. package/src/prover/smt/solver/theory-fpa.ts +389 -0
  497. package/src/prover/smt/solver/theory-lra-axioms.ts +55 -25
  498. package/src/prover/smt/solver/theory-lra-bounds.ts +31 -11
  499. package/src/prover/smt/solver/theory-lra-final-check.ts +59 -91
  500. package/src/prover/smt/solver/theory-lra-internalize.ts +94 -53
  501. package/src/prover/smt/solver/theory-lra-model.ts +23 -53
  502. package/src/prover/smt/solver/theory-lra-propagate.ts +24 -40
  503. package/src/prover/smt/solver/theory-lra-state.ts +6 -27
  504. package/src/prover/smt/solver/theory-lra.ts +188 -8
  505. package/src/prover/smt/solver/theory-pb.ts +934 -0
  506. package/src/prover/smt/solver/theory-polymorphism.ts +58 -0
  507. package/src/prover/smt/solver/theory-recfun.ts +307 -0
  508. package/src/prover/smt/solver/theory-seq-regex.ts +867 -0
  509. package/src/prover/smt/solver/theory-seq-solve.ts +1373 -0
  510. package/src/prover/smt/solver/theory-seq-state.ts +871 -0
  511. package/src/prover/smt/solver/theory-seq.ts +961 -0
  512. package/src/prover/smt/solver/theory.ts +189 -0
  513. package/src/prover/smt/solver/tseitin-cnf.ts +485 -0
  514. package/src/prover/smt/solver/var-subst.ts +37 -39
  515. package/src/prover/smt/table.ts +3 -10
  516. package/src/prover/smt/types.ts +146 -0
  517. package/src/prover/tlapm/cache.ts +67 -41
  518. package/src/prover/tlapm/ocaml-marshal.ts +19 -21
  519. package/src/prover/tlapm/tlapm.ts +21 -20
  520. package/src/prover/tlapm-library.ts +3208 -0
  521. package/src/prover/verdict.ts +9 -2
  522. package/src/prover/zenon/check/check.ts +1 -11
  523. package/src/prover/zenon/check/definitions.ts +5 -15
  524. package/src/prover/zenon/check/equality.ts +0 -8
  525. package/src/prover/zenon/check/functions.ts +0 -4
  526. package/src/prover/zenon/check/keys.ts +0 -7
  527. package/src/prover/zenon/check/propositional.ts +0 -3
  528. package/src/prover/zenon/check/records.ts +1 -6
  529. package/src/prover/zenon/check/relations.ts +2 -14
  530. package/src/prover/zenon/check/rewrites.ts +2 -21
  531. package/src/prover/zenon/check/sets.ts +40 -61
  532. package/src/prover/zenon/check/terms.ts +1 -19
  533. package/src/prover/zenon/check/tla.ts +0 -6
  534. package/src/prover/zenon/decide.ts +10 -19
  535. package/src/prover/zenon/encode.ts +0 -9
  536. package/src/prover/zenon/eqrel.ts +2 -15
  537. package/src/prover/zenon/equality-rules.ts +0 -6
  538. package/src/prover/zenon/expr.ts +8 -28
  539. package/src/prover/zenon/index-table.ts +26 -59
  540. package/src/prover/zenon/isar-case.ts +8 -20
  541. package/src/prover/zenon/isar.ts +35 -65
  542. package/src/prover/zenon/limits.ts +0 -4
  543. package/src/prover/zenon/llproof.ts +2 -22
  544. package/src/prover/zenon/mltoll.ts +66 -106
  545. package/src/prover/zenon/node.ts +20 -15
  546. package/src/prover/zenon/ocaml.ts +1 -17
  547. package/src/prover/zenon/parse.ts +9 -13
  548. package/src/prover/zenon/phrase.ts +1 -13
  549. package/src/prover/zenon/proof.ts +0 -11
  550. package/src/prover/zenon/propositional-rules.ts +0 -7
  551. package/src/prover/zenon/rules.ts +2 -8
  552. package/src/prover/zenon/search.ts +11 -35
  553. package/src/prover/zenon/tla/functions.ts +59 -33
  554. package/src/prover/zenon/tla/llproof.ts +67 -78
  555. package/src/prover/zenon/tla/records.ts +57 -35
  556. package/src/prover/zenon/tla/rewrites.ts +12 -21
  557. package/src/prover/zenon/tla/sets.ts +88 -59
  558. package/src/prover/zenon/tla/terms.ts +0 -8
  559. package/src/prover/zenon/tla/tla.ts +66 -66
  560. package/src/randomization.ts +81 -35
  561. package/src/resolve.ts +67 -185
  562. package/src/runtime.ts +26 -22
  563. package/src/sany/builtins.ts +2 -5
  564. package/src/sany/generation.ts +394 -0
  565. package/src/sany/generator-def-entries.ts +210 -0
  566. package/src/sany/generator-definitions.ts +686 -0
  567. package/src/sany/generator-expressions.ts +1100 -0
  568. package/src/sany/generator-proofs.ts +662 -0
  569. package/src/sany/generator.ts +191 -2764
  570. package/src/sany/levels.ts +5 -35
  571. package/src/sany/lexer.ts +58 -77
  572. package/src/sany/linter.ts +0 -10
  573. package/src/sany/modules.ts +1 -5
  574. package/src/sany/nodes.ts +5 -43
  575. package/src/sany/parse-error.ts +39 -117
  576. package/src/sany/report.ts +32 -69
  577. package/src/sany/selectors.ts +49 -76
  578. package/src/sany/source.ts +1 -17
  579. package/src/sany/xml.ts +35 -117
  580. package/src/search.ts +671 -169
  581. package/src/simulate.ts +712 -0
  582. package/src/spec-description.ts +192 -100
  583. package/src/standard-definitions.ts +4 -4
  584. package/src/standard-modules.ts +264 -95
  585. package/src/state-graph.ts +52 -33
  586. package/src/subexpressions.ts +69 -52
  587. package/src/substitution-levels.ts +7 -7
  588. package/src/successors.ts +267 -100
  589. package/src/symmetry.ts +35 -27
  590. package/src/tableau.ts +29 -26
  591. package/src/tlc/fingerprint.ts +267 -79
  592. package/src/tlc/jar-data.ts +112 -6
  593. package/src/tlc/messages.ts +125 -54
  594. package/src/tlc/order.ts +39 -69
  595. package/src/tlc/random.ts +37 -49
  596. package/src/tlc/replay.ts +553 -228
  597. package/src/tlc/summary.ts +64 -60
  598. package/src/tlc/tlc-operators.ts +78 -44
  599. package/src/tlc/tlcext-operators.ts +171 -122
  600. package/src/tlc/trace-spec.ts +249 -0
  601. package/src/tlc/value-stream.ts +139 -0
  602. package/src/tlc/version.ts +1 -4
  603. package/src/transfer.ts +22 -25
  604. package/src/typed-tier.ts +6535 -0
  605. package/src/typescript/actions.ts +479 -0
  606. package/src/typescript/collections.ts +614 -0
  607. package/src/typescript/compile.ts +63 -0
  608. package/src/typescript/context.ts +94 -0
  609. package/src/typescript/emit.ts +121 -0
  610. package/src/typescript/expressions.ts +496 -0
  611. package/src/typescript/formula.ts +154 -0
  612. package/src/typescript/functions.ts +284 -0
  613. package/src/typescript/model.ts +162 -0
  614. package/src/typescript/names.ts +114 -0
  615. package/src/typescript/program.ts +48 -0
  616. package/src/typescript/properties.ts +139 -0
  617. package/src/typescript/scope.ts +112 -0
  618. package/src/typescript/steps.ts +167 -0
  619. package/src/typescript/types.ts +171 -0
  620. package/src/values.ts +832 -484
  621. package/src/worker.ts +7 -8
  622. package/src/prover/isabelle/isar/statement.ts +0 -57
  623. package/src/prover/smt/solver/z3-license.txt +0 -10
  624. package/src/prover/tlaps-module.ts +0 -510
  625. package/src/prover/zenon/LICENSE +0 -32
package/dist/worker.cjs CHANGED
@@ -6,19 +6,19 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- const e={success:0,assumptionViolation:10,deadlock:11,safetyViolation:12,livenessViolation:13,assertViolation:14,specEvaluationFailure:75,safetyEvaluationFailure:76,livenessEvaluationFailure:77,specParseError:150,configParseError:151,error:255},t=/* @__PURE__ */ new WeakMap,n=(e,n)=>(e instanceof Error&&!t.has(e)&&t.set(e,n),e),r=e=>t.get(e),i=t=>{try{return t()}catch(t){throw n(t,e.error)}},a=e=>{let t=i(e);return t&&{branches:t.branches,addInitialState:(e,n,r)=>i(()=>t.addInitialState(e,n,r)),addState:(e,n,r,a)=>i(()=>t.addState(e,n,r,a)),findViolation:()=>i(()=>t.findViolation()),getViolatedProperties:(e,n)=>i(()=>t.getViolatedProperties(e,n))}},o=e=>`TLC threw an unexpected exception.\nThis was probably caused by an error in the spec or model.\nSee the User Output or TLC Console for clues to what happened.\nThe exception was a ${e}\n: `,s=o(`java.lang.RuntimeException`),c=o(`tlc2.tool.EvalException`),l=e=>e instanceof RangeError&&e.message===`Maximum call stack size exceeded`;var u=class extends Error{constructor(e,t){super(e,{cause:t}),this.name=`TlaError`}},d=class extends u{failure;sany;constructor(e,t,n,r){super(e,t),this.name=`TlaSyntaxError`,this.failure=n,this.sany=r}},f=class extends d{location;parseError;constructor(e,t,n){super(e),this.location=t,this.parseError=n}},p=class extends f{constructor(e,t,n=!0){super(`Cannot find source file for module ${e} imported in module ${t}.`,n?t:void 0)}};const m=(e,t=!1,n,r=[])=>new d(e.map(e=>`${e.location}\n\n${e.message}`).join(`
9
+ const e={success:0,assumptionViolation:10,deadlock:11,safetyViolation:12,livenessViolation:13,assertViolation:14,specEvaluationFailure:75,safetyEvaluationFailure:76,livenessEvaluationFailure:77,specParseError:150,configParseError:151,error:255},t=new Map([...[...Array.from({length:24},(e,t)=>2222+t),2272,2273,2274,2280,2281,...Array.from({length:7},(e,t)=>5001+t)].map(t=>[t,e.configParseError]),[2253,e.livenessEvaluationFailure],[2109,e.specEvaluationFailure],[2115,e.specEvaluationFailure],[2103,e.specEvaluationFailure],[2147,e.specEvaluationFailure],[2111,e.safetyEvaluationFailure],[2146,e.safetyEvaluationFailure],[2107,e.safetyViolation],[2110,e.safetyViolation],[2112,e.livenessViolation],[2113,e.livenessViolation],[2116,e.livenessViolation],[2108,e.livenessViolation],[2114,e.deadlock],[2104,e.assumptionViolation],[2105,e.assumptionViolation],[2404,e.assumptionViolation],[2405,e.assumptionViolation],[2780,e.assumptionViolation],[2132,e.assertViolation],[2171,e.specParseError],[3002,e.specParseError]]),n=n=>t.get(n)??e.error,r=/* @__PURE__ */ new WeakMap,i=(e,t)=>(e instanceof Error&&!r.has(e)&&r.set(e,t),e),a=e=>r.get(e),o=t=>{try{return t()}catch(t){throw i(t,e.error)}},s=e=>{let t=o(e);return t&&{branches:t.branches,solutions:t.solutions,addInitialState:(e,n,r)=>o(()=>t.addInitialState(e,n,r)),addState:(e,n,r,i)=>o(()=>t.addState(e,n,r,i)),findViolation:()=>o(()=>t.findViolation()),getViolatedProperties:(e,n)=>o(()=>t.getViolatedProperties(e,n))}},c=e=>`TLC threw an unexpected exception.\nThis was probably caused by an error in the spec or model.\nSee the User Output or TLC Console for clues to what happened.\nThe exception was a ${e}\n: `,l=c(`java.lang.RuntimeException`),u=c(`tlc2.tool.EvalException`),ee=e=>e instanceof RangeError&&e.message===`Maximum call stack size exceeded`||e instanceof SyntaxError&&e.message.endsWith(`: Stack overflow`);var d=class extends Error{constructor(e,t){super(e,{cause:t}),this.name=`TlaError`}},f=class extends d{failure;sany;constructor(e,t,n,r){super(e,t),this.name=`TlaSyntaxError`,this.failure=n,this.sany=r}},p=class extends f{location;parseError;constructor(e,t,n){super(e),this.location=t,this.parseError=n}},te=class extends p{constructor(e,t,n=!0){super(`Cannot find source file for module ${e} imported in module ${t}.`,n?t:void 0)}};const m=(e,t=!1,n,r=[])=>new f(e.map(e=>`${e.location}\n\n${e.message}`).join(`
10
10
 
11
11
  `),void 0,void 0,{errors:e,warnings:r,isFatal:t,parseError:n}),h=(e,t)=>m([{location:`In module ${t}`,message:`Cannot find source file for module ${e} imported in module ${t}.`}],!0),g=e=>`*** Warnings: ${e.length}\n\n${e.map(e=>`${e.location}\n\n${e.message}\n\n\n`).join(`
12
- `)}`,_=e=>`line ${e.start.line}, col ${e.start.column} to line ${e.end.line}, col ${e.end.column} of module ${e.module}`,v=(e,t)=>m([{location:_(t),message:e}]);var y=class extends u{constructor(e,t){super(e,t),this.name=`TlaConfigError`}},b=class extends u{constructor(e,t){super(e,t),this.name=`TlaEvaluationError`}};const x=`This was a Java StackOverflowError. It was probably the result
12
+ `)}`,_=e=>`line ${e.start.line}, col ${e.start.column} to line ${e.end.line}, col ${e.end.column} of module ${e.module}`,ne=(e,t)=>m([{location:_(t),message:e}]);var v=class extends d{constructor(e,t){super(e,t),this.name=`TlaConfigError`}},y=class extends d{constructor(e,t){super(e,t),this.name=`TlaEvaluationError`}};const b=`This was a Java StackOverflowError. It was probably the result
13
13
  of an incorrect recursive function definition that caused TLC to enter
14
14
  an infinite loop when trying to compute the function or its application
15
- to an element in its putative domain.`;var S=class extends b{constructor(){super(x)}};const C=()=>n(new S,e.error);var w=class extends b{state;action;variables;constructor(e,t,n,r){super(e),this.state=t,this.action=n,this.variables=r}},T=class extends b{variable;constructor(e,t){super(e),this.variable=t}},E=class extends b{exitCode;constructor(t,n=e.error){super(t),this.name=`TlaEvaluationError`,this.exitCode=n}},D=class extends b{state;constructor(e){super(`current state is not a legal state`),this.name=`TlaEvaluationError`,this.state=e}},O=class extends u{failure;exception;constructor(e,t={}){super(e),this.name=`TlaProofError`,this.failure=t.exception===void 0?t.failure??e:void 0,this.exception=t.exception??`Failure(${JSON.stringify(this.failure)})`}},k=class extends O{constructor(e=`Assert_failure`){super(`Oops, this seems to be a bug in TLAPM.`,{exception:e}),this.name=`TlaProofError`}},A=class extends u{constructor(e,t){super(e,t),this.name=`TlaProverError`}},j=class extends u{constructor(e,t){super(e,t),this.name=`TlaZenonError`}},M=class{name=`TlaIsabelleError`;exception;message;constructor(e,t){this.exception=e,this.message=t}},N=class extends u{constructor(e,t){super(e,t),this.name=`TlaUnsupportedError`}},P=class extends u{constructor(e,t){super(e,t),this.name=`SmtUnsupportedError`}},F=class extends u{constructor(){super(`the SMT solver was canceled`),this.name=`SmtCanceledError`}},I=class extends u{constructor(e){super(e),this.name=`SmtInvariantError`}},L=class extends u{constructor(e){super(`nlsat does not implement ${e}`),this.name=`NlsatUnsupportedError`}},R=class extends u{constructor(){super(`the pdd manager ran out of nodes`),this.name=`PddMemoryOutError`}},z=class extends u{constructor(e,t){super(e,t),this.name=`SmtParseError`}},B=class extends N{unwound;constructor(e,t){super(e),this.name=`TlaJavaException`,this.unwound=t}};const V=t=>r(t)??(t instanceof d?e.specParseError:t instanceof y?e.configParseError:t instanceof b?e.specEvaluationFailure:e.error);var H=class extends u{node;constructor(e,t){super(e),this.name=`PcalError`,this.node=t}},U=class extends u{constructor(e){super(e),this.name=`PcalRuntimeError`}},W=class extends u{constructor(e){super(`You have discovered a bug in pcal.trans.\nSend the following information and the\ninput file to the current maintainer(s).\n\n -- ${e}.`),this.name=`PcalBugError`}};const G=`node:worker_threads`,K=()=>typeof Worker==`function`||typeof process<`u`&&process.versions?.node!==void 0,q=async(e,t,n)=>{if(typeof Worker==`function`){let r=new Worker(e,{type:`module`});return r.addEventListener(`message`,e=>t(e.data)),r.addEventListener(`error`,n),r}let r=new(await(import(
15
+ to an element in its putative domain.`;var x=class extends y{constructor(){super(b)}};const S=()=>i(new x,e.error);var C=class extends y{},w=class extends y{state;action;variables;constructor(e,t,n,r){super(e),this.state=t,this.action=n,this.variables=r}},T=class extends y{variable;constructor(e,t){super(e),this.variable=t}},E=class extends y{exitCode;constructor(t,n=e.error){super(t),this.exitCode=n}},D=class extends y{constructor(t){super(t),i(this,e.error)}},O=class extends C{constructor(){super(`PickSuccessor reached the end of standard input without an answer whether to extend the behavior.`)}},k=class extends y{constructor(t){super(`The directory ${t} holds no checkpoint to recover from.`),i(this,e.error)}},A=class extends y{},j=class extends y{};const M=`Too many possible next states for the last state in the trace.`;var N=class extends y{constructor(){super(M)}},P=class extends y{code;constructor(e,t){super(t),this.code=e}},F=class extends y{state;constructor(e){super(`current state is not a legal state`),this.state=e}},I=class extends d{failure;exception;locus;constructor(e,t={}){super(e),this.locus=t.locus,this.name=`TlaProofError`,this.failure=t.exception===void 0?t.failure??e:void 0,this.exception=t.exception??`Failure(${JSON.stringify(this.failure)})`}},L=class extends I{constructor(e=`Assert_failure`){super(`Oops, this seems to be a bug in TLAPM.`,{exception:e})}},R=class extends d{constructor(e,t){super(e,t),this.name=`TlaProverError`}},z=class extends R{locus;constructor(e,t){super(e),this.name=`TlaMethodError`,this.locus=t}},B=class extends d{constructor(e,t){super(e,t),this.name=`TlaZenonError`}},V=class{name=`TlaIsabelleError`;exception;message;constructor(e,t){this.exception=e,this.message=t}};const H=(e,t)=>e instanceof V&&e.exception===t;var U=class extends d{constructor(e,t){super(e,t),this.name=`TlaUnsupportedError`}},W=class extends d{constructor(e,t){super(e,t),this.name=`SmtUnsupportedError`}},G=class extends d{constructor(){super(`the SMT solver was canceled`),this.name=`SmtCanceledError`}},K=class extends d{constructor(e){super(e),this.name=`SmtInvariantError`}},q=class extends d{constructor(e){super(`nlsat does not implement ${e}`),this.name=`NlsatUnsupportedError`}},J=class extends d{constructor(){super(`the pdd manager ran out of nodes`),this.name=`PddMemoryOutError`}},Y=class extends d{line;column;constructor(e,t){super(e),this.name=`SmtParseError`,this.line=t.line,this.column=t.column}},X=class extends U{unwound;constructor(e,t){super(e),this.name=`TlaJavaException`,this.unwound=t}};const Z=t=>a(t)??(t instanceof f?e.specParseError:t instanceof v?e.configParseError:t instanceof y?e.specEvaluationFailure:e.error);var re=class extends d{node;constructor(e,t){super(e),this.name=`PcalError`,this.node=t}},ie=class extends d{constructor(e){super(e),this.name=`PcalRuntimeError`}},ae=class extends d{constructor(e){super(`You have discovered a bug in pcal.trans.\nSend the following information and the\ninput file to the current maintainer(s).\n\n -- ${e}.`),this.name=`PcalBugError`}},oe=class extends d{constructor(e,t){let n=t?.getSourceFile(),r=n?.getLineAndCharacterOfPosition(t?.getStart()??0);super(n===void 0||r===void 0?e:`${n.fileName}:${r.line+1}:${r.character+1} ${e}`),this.name=`TlaTypeScriptError`}};const Q=`node:worker_threads`,$=()=>typeof Worker==`function`||typeof process<`u`&&process.versions?.node!==void 0,se=async(e,t,n)=>{if(typeof Worker==`function`){let r=new Worker(e,{type:`module`});return r.addEventListener(`message`,e=>t(e.data)),r.addEventListener(`error`,n),r}let r=new(await(import(
16
16
  /* @vite-ignore */
17
17
  /* webpackIgnore: true */
18
- G))).Worker(e);return r.on(`message`,t),r.on(`error`,n),{postMessage:(e,t)=>r.postMessage(e,t),terminate:()=>void r.terminate()}},J=async()=>typeof globalThis.postMessage==`function`?globalThis:(await import(
18
+ Q))).Worker(e);return r.on(`message`,t),r.on(`error`,n),{postMessage:(e,t)=>r.postMessage(e,t),terminate:()=>void r.terminate()}},ce=async()=>typeof globalThis.postMessage==`function`?globalThis:(await import(
19
19
  /* @vite-ignore */
20
20
  /* webpackIgnore: true */
21
- G)).parentPort,Y=()=>{let e=`Bun`in globalThis?import(
21
+ Q)).parentPort,le=()=>{let e=`Bun`in globalThis?import(
22
22
  /* @vite-ignore */
23
23
  /* webpackIgnore: true */
24
- `bun:jsc`):void 0;return async()=>{(await e)?.edenGC(),await new Promise(e=>typeof setImmediate==`function`?setImmediate(e):setTimeout(e,0))}};Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return r}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return _}});
24
+ `bun:jsc`):void 0;return async()=>{(await e)?.edenGC(),await new Promise(e=>typeof setImmediate==`function`?setImmediate(e):setTimeout(e,0))}};Object.defineProperty(exports,"$",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return se}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return W}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"ot",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return $}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return le}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return C}});
package/dist/worker.js CHANGED
@@ -6,19 +6,19 @@
6
6
  * This source code is licensed under the MIT license found in the
7
7
  * LICENSE file in the root directory of this source tree.
8
8
  */
9
- const e={success:0,assumptionViolation:10,deadlock:11,safetyViolation:12,livenessViolation:13,assertViolation:14,specEvaluationFailure:75,safetyEvaluationFailure:76,livenessEvaluationFailure:77,specParseError:150,configParseError:151,error:255},t=/* @__PURE__ */ new WeakMap,n=(e,n)=>(e instanceof Error&&!t.has(e)&&t.set(e,n),e),r=e=>t.get(e),i=t=>{try{return t()}catch(t){throw n(t,e.error)}},a=e=>{let t=i(e);return t&&{branches:t.branches,addInitialState:(e,n,r)=>i(()=>t.addInitialState(e,n,r)),addState:(e,n,r,a)=>i(()=>t.addState(e,n,r,a)),findViolation:()=>i(()=>t.findViolation()),getViolatedProperties:(e,n)=>i(()=>t.getViolatedProperties(e,n))}},o=e=>`TLC threw an unexpected exception.\nThis was probably caused by an error in the spec or model.\nSee the User Output or TLC Console for clues to what happened.\nThe exception was a ${e}\n: `,s=o(`java.lang.RuntimeException`),c=o(`tlc2.tool.EvalException`),l=e=>e instanceof RangeError&&e.message===`Maximum call stack size exceeded`;var u=class extends Error{constructor(e,t){super(e,{cause:t}),this.name=`TlaError`}},d=class extends u{failure;sany;constructor(e,t,n,r){super(e,t),this.name=`TlaSyntaxError`,this.failure=n,this.sany=r}},f=class extends d{location;parseError;constructor(e,t,n){super(e),this.location=t,this.parseError=n}},p=class extends f{constructor(e,t,n=!0){super(`Cannot find source file for module ${e} imported in module ${t}.`,n?t:void 0)}};const m=(e,t=!1,n,r=[])=>new d(e.map(e=>`${e.location}\n\n${e.message}`).join(`
9
+ const e={success:0,assumptionViolation:10,deadlock:11,safetyViolation:12,livenessViolation:13,assertViolation:14,specEvaluationFailure:75,safetyEvaluationFailure:76,livenessEvaluationFailure:77,specParseError:150,configParseError:151,error:255},t=new Map([...[...Array.from({length:24},(e,t)=>2222+t),2272,2273,2274,2280,2281,...Array.from({length:7},(e,t)=>5001+t)].map(t=>[t,e.configParseError]),[2253,e.livenessEvaluationFailure],[2109,e.specEvaluationFailure],[2115,e.specEvaluationFailure],[2103,e.specEvaluationFailure],[2147,e.specEvaluationFailure],[2111,e.safetyEvaluationFailure],[2146,e.safetyEvaluationFailure],[2107,e.safetyViolation],[2110,e.safetyViolation],[2112,e.livenessViolation],[2113,e.livenessViolation],[2116,e.livenessViolation],[2108,e.livenessViolation],[2114,e.deadlock],[2104,e.assumptionViolation],[2105,e.assumptionViolation],[2404,e.assumptionViolation],[2405,e.assumptionViolation],[2780,e.assumptionViolation],[2132,e.assertViolation],[2171,e.specParseError],[3002,e.specParseError]]),n=n=>t.get(n)??e.error,r=/* @__PURE__ */ new WeakMap,i=(e,t)=>(e instanceof Error&&!r.has(e)&&r.set(e,t),e),a=e=>r.get(e),o=t=>{try{return t()}catch(t){throw i(t,e.error)}},s=e=>{let t=o(e);return t&&{branches:t.branches,solutions:t.solutions,addInitialState:(e,n,r)=>o(()=>t.addInitialState(e,n,r)),addState:(e,n,r,i)=>o(()=>t.addState(e,n,r,i)),findViolation:()=>o(()=>t.findViolation()),getViolatedProperties:(e,n)=>o(()=>t.getViolatedProperties(e,n))}},c=e=>`TLC threw an unexpected exception.\nThis was probably caused by an error in the spec or model.\nSee the User Output or TLC Console for clues to what happened.\nThe exception was a ${e}\n: `,l=c(`java.lang.RuntimeException`),u=c(`tlc2.tool.EvalException`),ee=e=>e instanceof RangeError&&e.message===`Maximum call stack size exceeded`||e instanceof SyntaxError&&e.message.endsWith(`: Stack overflow`);var d=class extends Error{constructor(e,t){super(e,{cause:t}),this.name=`TlaError`}},f=class extends d{failure;sany;constructor(e,t,n,r){super(e,t),this.name=`TlaSyntaxError`,this.failure=n,this.sany=r}},p=class extends f{location;parseError;constructor(e,t,n){super(e),this.location=t,this.parseError=n}},te=class extends p{constructor(e,t,n=!0){super(`Cannot find source file for module ${e} imported in module ${t}.`,n?t:void 0)}};const m=(e,t=!1,n,r=[])=>new f(e.map(e=>`${e.location}\n\n${e.message}`).join(`
10
10
 
11
11
  `),void 0,void 0,{errors:e,warnings:r,isFatal:t,parseError:n}),h=(e,t)=>m([{location:`In module ${t}`,message:`Cannot find source file for module ${e} imported in module ${t}.`}],!0),g=e=>`*** Warnings: ${e.length}\n\n${e.map(e=>`${e.location}\n\n${e.message}\n\n\n`).join(`
12
- `)}`,_=e=>`line ${e.start.line}, col ${e.start.column} to line ${e.end.line}, col ${e.end.column} of module ${e.module}`,v=(e,t)=>m([{location:_(t),message:e}]);var y=class extends u{constructor(e,t){super(e,t),this.name=`TlaConfigError`}},b=class extends u{constructor(e,t){super(e,t),this.name=`TlaEvaluationError`}};const x=`This was a Java StackOverflowError. It was probably the result
12
+ `)}`,_=e=>`line ${e.start.line}, col ${e.start.column} to line ${e.end.line}, col ${e.end.column} of module ${e.module}`,ne=(e,t)=>m([{location:_(t),message:e}]);var v=class extends d{constructor(e,t){super(e,t),this.name=`TlaConfigError`}},y=class extends d{constructor(e,t){super(e,t),this.name=`TlaEvaluationError`}};const b=`This was a Java StackOverflowError. It was probably the result
13
13
  of an incorrect recursive function definition that caused TLC to enter
14
14
  an infinite loop when trying to compute the function or its application
15
- to an element in its putative domain.`;var S=class extends b{constructor(){super(x)}};const C=()=>n(new S,e.error);var w=class extends b{state;action;variables;constructor(e,t,n,r){super(e),this.state=t,this.action=n,this.variables=r}},T=class extends b{variable;constructor(e,t){super(e),this.variable=t}},E=class extends b{exitCode;constructor(t,n=e.error){super(t),this.name=`TlaEvaluationError`,this.exitCode=n}},D=class extends b{state;constructor(e){super(`current state is not a legal state`),this.name=`TlaEvaluationError`,this.state=e}},O=class extends u{failure;exception;constructor(e,t={}){super(e),this.name=`TlaProofError`,this.failure=t.exception===void 0?t.failure??e:void 0,this.exception=t.exception??`Failure(${JSON.stringify(this.failure)})`}},k=class extends O{constructor(e=`Assert_failure`){super(`Oops, this seems to be a bug in TLAPM.`,{exception:e}),this.name=`TlaProofError`}},A=class extends u{constructor(e,t){super(e,t),this.name=`TlaProverError`}},j=class extends u{constructor(e,t){super(e,t),this.name=`TlaZenonError`}},M=class{name=`TlaIsabelleError`;exception;message;constructor(e,t){this.exception=e,this.message=t}},N=class extends u{constructor(e,t){super(e,t),this.name=`TlaUnsupportedError`}},P=class extends u{constructor(e,t){super(e,t),this.name=`SmtUnsupportedError`}},F=class extends u{constructor(){super(`the SMT solver was canceled`),this.name=`SmtCanceledError`}},I=class extends u{constructor(e){super(e),this.name=`SmtInvariantError`}},L=class extends u{constructor(e){super(`nlsat does not implement ${e}`),this.name=`NlsatUnsupportedError`}},R=class extends u{constructor(){super(`the pdd manager ran out of nodes`),this.name=`PddMemoryOutError`}},z=class extends u{constructor(e,t){super(e,t),this.name=`SmtParseError`}},B=class extends N{unwound;constructor(e,t){super(e),this.name=`TlaJavaException`,this.unwound=t}};const V=t=>r(t)??(t instanceof d?e.specParseError:t instanceof y?e.configParseError:t instanceof b?e.specEvaluationFailure:e.error);var H=class extends u{node;constructor(e,t){super(e),this.name=`PcalError`,this.node=t}},U=class extends u{constructor(e){super(e),this.name=`PcalRuntimeError`}},W=class extends u{constructor(e){super(`You have discovered a bug in pcal.trans.\nSend the following information and the\ninput file to the current maintainer(s).\n\n -- ${e}.`),this.name=`PcalBugError`}};const G=`node:worker_threads`,K=()=>typeof Worker==`function`||typeof process<`u`&&process.versions?.node!==void 0,q=async(e,t,n)=>{if(typeof Worker==`function`){let r=new Worker(e,{type:`module`});return r.addEventListener(`message`,e=>t(e.data)),r.addEventListener(`error`,n),r}let r=new(await(import(
15
+ to an element in its putative domain.`;var x=class extends y{constructor(){super(b)}};const S=()=>i(new x,e.error);var C=class extends y{},w=class extends y{state;action;variables;constructor(e,t,n,r){super(e),this.state=t,this.action=n,this.variables=r}},T=class extends y{variable;constructor(e,t){super(e),this.variable=t}},E=class extends y{exitCode;constructor(t,n=e.error){super(t),this.exitCode=n}},D=class extends y{constructor(t){super(t),i(this,e.error)}},O=class extends C{constructor(){super(`PickSuccessor reached the end of standard input without an answer whether to extend the behavior.`)}},k=class extends y{constructor(t){super(`The directory ${t} holds no checkpoint to recover from.`),i(this,e.error)}},A=class extends y{},j=class extends y{};const M=`Too many possible next states for the last state in the trace.`;var N=class extends y{constructor(){super(M)}},P=class extends y{code;constructor(e,t){super(t),this.code=e}},F=class extends y{state;constructor(e){super(`current state is not a legal state`),this.state=e}},I=class extends d{failure;exception;locus;constructor(e,t={}){super(e),this.locus=t.locus,this.name=`TlaProofError`,this.failure=t.exception===void 0?t.failure??e:void 0,this.exception=t.exception??`Failure(${JSON.stringify(this.failure)})`}},L=class extends I{constructor(e=`Assert_failure`){super(`Oops, this seems to be a bug in TLAPM.`,{exception:e})}},R=class extends d{constructor(e,t){super(e,t),this.name=`TlaProverError`}},z=class extends R{locus;constructor(e,t){super(e),this.name=`TlaMethodError`,this.locus=t}},B=class extends d{constructor(e,t){super(e,t),this.name=`TlaZenonError`}},V=class{name=`TlaIsabelleError`;exception;message;constructor(e,t){this.exception=e,this.message=t}};const H=(e,t)=>e instanceof V&&e.exception===t;var U=class extends d{constructor(e,t){super(e,t),this.name=`TlaUnsupportedError`}},W=class extends d{constructor(e,t){super(e,t),this.name=`SmtUnsupportedError`}},G=class extends d{constructor(){super(`the SMT solver was canceled`),this.name=`SmtCanceledError`}},K=class extends d{constructor(e){super(e),this.name=`SmtInvariantError`}},q=class extends d{constructor(e){super(`nlsat does not implement ${e}`),this.name=`NlsatUnsupportedError`}},J=class extends d{constructor(){super(`the pdd manager ran out of nodes`),this.name=`PddMemoryOutError`}},Y=class extends d{line;column;constructor(e,t){super(e),this.name=`SmtParseError`,this.line=t.line,this.column=t.column}},X=class extends U{unwound;constructor(e,t){super(e),this.name=`TlaJavaException`,this.unwound=t}};const Z=t=>a(t)??(t instanceof f?e.specParseError:t instanceof v?e.configParseError:t instanceof y?e.specEvaluationFailure:e.error);var re=class extends d{node;constructor(e,t){super(e),this.name=`PcalError`,this.node=t}},ie=class extends d{constructor(e){super(e),this.name=`PcalRuntimeError`}},ae=class extends d{constructor(e){super(`You have discovered a bug in pcal.trans.\nSend the following information and the\ninput file to the current maintainer(s).\n\n -- ${e}.`),this.name=`PcalBugError`}},oe=class extends d{constructor(e,t){let n=t?.getSourceFile(),r=n?.getLineAndCharacterOfPosition(t?.getStart()??0);super(n===void 0||r===void 0?e:`${n.fileName}:${r.line+1}:${r.character+1} ${e}`),this.name=`TlaTypeScriptError`}};const Q=`node:worker_threads`,$=()=>typeof Worker==`function`||typeof process<`u`&&process.versions?.node!==void 0,se=async(e,t,n)=>{if(typeof Worker==`function`){let r=new Worker(e,{type:`module`});return r.addEventListener(`message`,e=>t(e.data)),r.addEventListener(`error`,n),r}let r=new(await(import(
16
16
  /* @vite-ignore */
17
17
  /* webpackIgnore: true */
18
- G))).Worker(e);return r.on(`message`,t),r.on(`error`,n),{postMessage:(e,t)=>r.postMessage(e,t),terminate:()=>void r.terminate()}},J=async()=>typeof globalThis.postMessage==`function`?globalThis:(await import(
18
+ Q))).Worker(e);return r.on(`message`,t),r.on(`error`,n),{postMessage:(e,t)=>r.postMessage(e,t),terminate:()=>void r.terminate()}},ce=async()=>typeof globalThis.postMessage==`function`?globalThis:(await import(
19
19
  /* @vite-ignore */
20
20
  /* webpackIgnore: true */
21
- G)).parentPort,Y=()=>{let e=`Bun`in globalThis?import(
21
+ Q)).parentPort,le=()=>{let e=`Bun`in globalThis?import(
22
22
  /* @vite-ignore */
23
23
  /* webpackIgnore: true */
24
- `bun:jsc`):void 0;return async()=>{(await e)?.edenGC(),await new Promise(e=>typeof setImmediate==`function`?setImmediate(e):setTimeout(e,0))}};export{N as A,g as B,E as C,S as D,f as E,h as F,r as G,o as H,m as I,n as K,v as L,k as M,c as N,d as O,s as P,C as R,p as S,A as T,l as U,V,e as W,b as _,L as a,M as b,U as c,F as d,I as f,u as g,y as h,q as i,j,T as k,R as l,P as m,J as n,W as o,z as p,a as q,K as r,H as s,Y as t,x as u,D as v,O as w,B as x,w as y,_ as z};
24
+ `bun:jsc`):void 0;return async()=>{(await e)?.edenGC(),await new Promise(e=>typeof setImmediate==`function`?setImmediate(e):setTimeout(e,0))}};export{c as $,I as A,U as B,w as C,k as D,z as E,f as F,l as G,B as H,N as I,ne as J,h as K,oe as L,p as M,j as N,te as O,x as P,Z as Q,T as R,F as S,X as T,L as U,P as V,u as W,_ as X,S as Y,g as Z,v as _,q as a,i as at,y as b,ie as c,G as d,H as et,K as f,A as g,M as h,se as i,n as it,R as j,E as k,J as l,W as m,ce as n,e as nt,ae as o,s as ot,Y as p,m as q,$ as r,a as rt,re as s,le as t,ee as tt,b as u,O as v,V as w,D as x,d as y,C as z};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tla-ts",
3
- "version": "0.0.9",
3
+ "version": "0.0.10-dev.09e53c2a6",
4
4
  "description": "A TLA+ interpreter and model checker in TypeScript, 2× faster than TLC",
5
5
  "keywords": [
6
6
  "formal verification",
@@ -55,9 +55,11 @@
55
55
  "access": "public"
56
56
  },
57
57
  "dependencies": {
58
+ "@typescript/typescript6": "6.0.2",
58
59
  "fflate": "^0.8.3"
59
60
  },
60
61
  "devDependencies": {
62
+ "@engine262/engine262": "0.0.1-d553e7b52501fbc47eae981c8d0fa7a5c26d0171",
61
63
  "@types/node": "^22",
62
64
  "publint": "^0.3.0",
63
65
  "typescript": "^7.0.2",
package/src/ast.ts CHANGED
@@ -27,15 +27,13 @@ export interface DecimalExpression {
27
27
  location: SourceLocation;
28
28
  }
29
29
 
30
- export interface StringExpression {
30
+ interface StringExpression {
31
31
  kind: "String";
32
32
  value: string;
33
33
  location: SourceLocation;
34
34
  }
35
35
 
36
- // selectorRanges holds the range of each part of a name such as foo!lab, where SANY reports an
37
- // error in selecting that part. spelling holds the text of an operator written as a synonym.
38
- export interface IdentifierExpression {
36
+ interface IdentifierExpression {
39
37
  kind: "Identifier";
40
38
  name: string;
41
39
  spelling?: string;
@@ -44,36 +42,27 @@ export interface IdentifierExpression {
44
42
  resolution?: LocalResolution;
45
43
  }
46
44
 
47
- // spelling holds the text of an operator written as a synonym, such as (+) for \oplus, which SANY
48
- // reports as written.
49
45
  export interface ApplyExpression {
50
46
  kind: "Apply";
51
47
  operator: string;
52
48
  spelling?: string;
53
49
  args: Expression[];
54
- // The number of args each part of a name like F(x)!l(y) takes, when a part before the last takes
55
- // some.
56
50
  argumentCounts?: number[];
57
- // The range of the parenthesized arguments of a named operator, or of the whole name when its
58
- // last part takes none, where SANY reports their count.
59
51
  argumentsRange?: SourceRange;
60
52
  selectorRanges?: SourceRange[];
61
- // The range of the arguments of each part of a name like F(x)!l(y), for a part that takes some.
62
53
  argumentRanges?: (SourceRange | undefined)[];
63
54
  location: SourceLocation;
64
55
  resolution?: LocalResolution;
65
56
  }
66
57
 
67
- export interface OperatorReferenceExpression {
58
+ interface OperatorReferenceExpression {
68
59
  kind: "OperatorReference";
69
60
  operator: string;
70
61
  spelling?: string;
71
62
  location: SourceLocation;
72
63
  }
73
64
 
74
- // operator holds the operator, such as SUBSET, that an argument names, which tla-ts reads as a
75
- // LAMBDA.
76
- export interface LambdaExpression {
65
+ interface LambdaExpression {
77
66
  kind: "Lambda";
78
67
  params: string[];
79
68
  paramRanges?: SourceRange[];
@@ -82,35 +71,33 @@ export interface LambdaExpression {
82
71
  location: SourceLocation;
83
72
  }
84
73
 
85
- export interface JunctionExpression {
74
+ interface JunctionExpression {
86
75
  kind: "And" | "Or";
87
76
  operands: Expression[];
88
77
  isBulleted?: boolean;
89
- // SANY parses an infix chain such as A /\ B /\ C as (A /\ B) /\ C, whose node of each prefix of
90
- // two or more operands ends after the parentheses of its last operand.
91
78
  prefixEnds?: SourceLocation[];
92
79
  location: SourceLocation;
93
80
  }
94
81
 
95
- export interface PrimeExpression {
82
+ interface PrimeExpression {
96
83
  kind: "Prime";
97
84
  expression: Expression;
98
85
  location: SourceLocation;
99
86
  }
100
87
 
101
- export interface UnchangedExpression {
88
+ interface UnchangedExpression {
102
89
  kind: "Unchanged";
103
90
  expression: Expression;
104
91
  location: SourceLocation;
105
92
  }
106
93
 
107
- export interface EnabledExpression {
94
+ interface EnabledExpression {
108
95
  kind: "Enabled";
109
96
  expression: Expression;
110
97
  location: SourceLocation;
111
98
  }
112
99
 
113
- export interface IfExpression {
100
+ interface IfExpression {
114
101
  kind: "If";
115
102
  condition: Expression;
116
103
  consequent: Expression;
@@ -123,10 +110,11 @@ export interface CaseArm {
123
110
  body: Expression;
124
111
  }
125
112
 
126
- export interface CaseExpression {
113
+ interface CaseExpression {
127
114
  kind: "Case";
128
115
  arms: CaseArm[];
129
116
  other: Expression | undefined;
117
+ otherRange?: SourceRange;
130
118
  location: SourceLocation;
131
119
  }
132
120
 
@@ -138,7 +126,6 @@ export interface LetExpression {
138
126
  location: SourceLocation;
139
127
  }
140
128
 
141
- // ranges holds the range of each name the pattern binds.
142
129
  export type BoundPattern =
143
130
  | { kind: "Name"; name: string; ranges?: SourceRange[] }
144
131
  | { kind: "Tuple"; names: string[]; ranges?: SourceRange[] };
@@ -155,7 +142,7 @@ export interface QuantifierExpression {
155
142
  location: SourceLocation;
156
143
  }
157
144
 
158
- export interface UnboundedQuantifierExpression {
145
+ interface UnboundedQuantifierExpression {
159
146
  kind: "UnboundedQuantifier";
160
147
  quantifier: "Forall" | "Exists";
161
148
  names: string[];
@@ -165,7 +152,7 @@ export interface UnboundedQuantifierExpression {
165
152
  location: SourceLocation;
166
153
  }
167
154
 
168
- export interface ChooseExpression {
155
+ interface ChooseExpression {
169
156
  kind: "Choose";
170
157
  pattern: BoundPattern;
171
158
  set: Expression | undefined;
@@ -173,27 +160,27 @@ export interface ChooseExpression {
173
160
  location: SourceLocation;
174
161
  }
175
162
 
176
- export interface SetEnumerationExpression {
163
+ interface SetEnumerationExpression {
177
164
  kind: "SetEnumeration";
178
165
  elements: Expression[];
179
166
  location: SourceLocation;
180
167
  }
181
168
 
182
- export interface SetFilterExpression {
169
+ interface SetFilterExpression {
183
170
  kind: "SetFilter";
184
171
  bound: Bound;
185
172
  predicate: Expression;
186
173
  location: SourceLocation;
187
174
  }
188
175
 
189
- export interface SetMapExpression {
176
+ interface SetMapExpression {
190
177
  kind: "SetMap";
191
178
  expression: Expression;
192
179
  bounds: Bound[];
193
180
  location: SourceLocation;
194
181
  }
195
182
 
196
- export interface TupleExpression {
183
+ interface TupleExpression {
197
184
  kind: "Tuple";
198
185
  elements: Expression[];
199
186
  location: SourceLocation;
@@ -207,7 +194,7 @@ export interface FunctionConstructionExpression {
207
194
  isRecursive?: boolean;
208
195
  }
209
196
 
210
- export interface FunctionSetExpression {
197
+ interface FunctionSetExpression {
211
198
  kind: "FunctionSet";
212
199
  domain: Expression;
213
200
  range: Expression;
@@ -220,7 +207,7 @@ export interface RecordField {
220
207
  location: SourceLocation;
221
208
  }
222
209
 
223
- export interface RecordExpression {
210
+ interface RecordExpression {
224
211
  kind: "Record" | "RecordSet";
225
212
  fields: RecordField[];
226
213
  location: SourceLocation;
@@ -235,60 +222,58 @@ interface ExceptUpdate {
235
222
  value: Expression;
236
223
  }
237
224
 
238
- export interface ExceptExpression {
225
+ interface ExceptExpression {
239
226
  kind: "Except";
240
227
  function: Expression;
241
228
  updates: ExceptUpdate[];
242
229
  location: SourceLocation;
243
230
  }
244
231
 
245
- export interface ExceptAtExpression {
232
+ interface ExceptAtExpression {
246
233
  kind: "ExceptAt";
247
234
  location: SourceLocation;
248
235
  }
249
236
 
250
- export interface FunctionApplicationExpression {
237
+ interface FunctionApplicationExpression {
251
238
  kind: "FunctionApplication";
252
239
  function: Expression;
253
240
  args: Expression[];
254
241
  location: SourceLocation;
255
242
  }
256
243
 
257
- // SANY parses [e1, ..., en] as a function application without the function, and its semantic
258
- // checker rejects it.
259
- export interface BracketExpression {
244
+ interface BracketExpression {
260
245
  kind: "Bracket";
261
246
  args: Expression[];
262
247
  location: SourceLocation;
263
248
  }
264
249
 
265
- export interface FieldAccessExpression {
250
+ interface FieldAccessExpression {
266
251
  kind: "FieldAccess";
267
252
  record: Expression;
268
253
  field: string;
269
254
  location: SourceLocation;
270
255
  }
271
256
 
272
- export interface ProductExpression {
257
+ interface ProductExpression {
273
258
  kind: "Product";
274
259
  factors: Expression[];
275
260
  location: SourceLocation;
276
261
  }
277
262
 
278
- export interface TemporalExpression {
263
+ interface TemporalExpression {
279
264
  kind: "Always" | "Eventually";
280
265
  expression: Expression;
281
266
  location: SourceLocation;
282
267
  }
283
268
 
284
- export interface ActionExpression {
269
+ interface ActionExpression {
285
270
  kind: "BoxAction" | "AngleAction";
286
271
  action: Expression;
287
272
  subscript: Expression;
288
273
  location: SourceLocation;
289
274
  }
290
275
 
291
- export interface FairnessExpression {
276
+ interface FairnessExpression {
292
277
  kind: "WeakFairness" | "StrongFairness";
293
278
  subscript: Expression;
294
279
  action: Expression;
@@ -301,6 +286,7 @@ export interface LabelExpression {
301
286
  name: string;
302
287
  params: string[];
303
288
  paramRanges?: SourceRange[];
289
+ head?: SourceRange;
304
290
  body: Expression;
305
291
  location: SourceLocation;
306
292
  }
@@ -312,7 +298,7 @@ export type Selector =
312
298
  | { kind: "At" }
313
299
  | { kind: "Colon" };
314
300
 
315
- export interface SubexpressionExpression {
301
+ interface SubexpressionExpression {
316
302
  kind: "Subexpression";
317
303
  selectors: Selector[];
318
304
  selectorRanges?: SourceRange[];
@@ -369,6 +355,7 @@ export interface OperatorDefinition {
369
355
  params: OperatorParam[];
370
356
  body: Expression;
371
357
  bodyRange?: SourceRange;
358
+ head?: SourceRange;
372
359
  isLocal: boolean;
373
360
  isRecursive: boolean;
374
361
  location: SourceLocation;
@@ -381,7 +368,6 @@ export interface FunctionDefinition {
381
368
  body: Expression;
382
369
  isLocal: boolean;
383
370
  isRecursive: boolean;
384
- // Whether the body applies the function, which SANY makes a recursive function definition.
385
371
  isSelfReferential?: boolean;
386
372
  location: SourceLocation;
387
373
  }
@@ -438,7 +424,6 @@ export interface AssumeProve {
438
424
 
439
425
  export type Fact = Expression | { kind: "ModuleFact"; name: string; location: SourceLocation };
440
426
 
441
- // keyword is the range of the USE or HIDE token and any ONLY after it.
442
427
  export interface UseOrHide {
443
428
  kind: "Use" | "Hide";
444
429
  isOnly: boolean;
@@ -448,7 +433,6 @@ export interface UseOrHide {
448
433
  location: SourceLocation;
449
434
  }
450
435
 
451
- // keyword is the range of the BY, OBVIOUS, or OMITTED token.
452
436
  export type Proof =
453
437
  | { kind: "Obvious" | "Omitted"; keyword: SourceRange; location: SourceLocation }
454
438
  | {
@@ -490,8 +474,6 @@ export type StepBody =
490
474
  | { kind: "Assert"; isSuffices: boolean; statement: Expression | AssumeProve }
491
475
  | { kind: "Qed" };
492
476
 
493
- // head is the range of the step number and its statement, without the proof, and statement is the
494
- // range of the statement alone.
495
477
  export interface ProofStep {
496
478
  name: string | undefined;
497
479
  token: string;
@@ -509,10 +491,9 @@ export interface Theorem {
509
491
  location: SourceLocation;
510
492
  }
511
493
 
512
- // The units of a module in source order, for consumers that need the order across kinds.
513
494
  export type ModuleUnit =
514
495
  | { kind: "Constants" | "Variables"; declarations: Declaration[]; location: SourceLocation }
515
- | { kind: "Recursive"; declarations: Declaration[] }
496
+ | { kind: "Recursive"; declarations: Declaration[]; location: SourceLocation }
516
497
  | { kind: "Definition"; definition: Definition }
517
498
  | { kind: "Instance"; instance: Instance }
518
499
  | { kind: "Assumption"; assumption: Assumption }
@@ -536,6 +517,11 @@ export interface Module {
536
517
  units: ModuleUnit[];
537
518
  }
538
519
 
520
+ export const getDefinitionExpressions = (definition: Definition) =>
521
+ definition.kind === "Function"
522
+ ? [...definition.bounds.map((bound) => bound.set), definition.body]
523
+ : [definition.body];
524
+
539
525
  export const getChildren = (expression: Expression): Expression[] => {
540
526
  switch (expression.kind) {
541
527
  case "Number":
@@ -566,14 +552,7 @@ export const getChildren = (expression: Expression): Expression[] => {
566
552
  ...(expression.other ? [expression.other] : []),
567
553
  ];
568
554
  case "Let":
569
- return [
570
- ...expression.definitions.flatMap((definition) =>
571
- definition.kind === "Function"
572
- ? [...definition.bounds.map((bound) => bound.set), definition.body]
573
- : [definition.body],
574
- ),
575
- expression.body,
576
- ];
555
+ return [...expression.definitions.flatMap(getDefinitionExpressions), expression.body];
577
556
  case "Forall":
578
557
  case "Exists":
579
558
  return [...expression.bounds.map((bound) => bound.set), expression.body];
@@ -624,6 +603,13 @@ export const getChildren = (expression: Expression): Expression[] => {
624
603
  }
625
604
  };
626
605
 
606
+ export const getReferencedName = (expression: Expression) => {
607
+ if (expression.kind === "Identifier") return expression.name;
608
+ if (expression.kind === "Apply" || expression.kind === "OperatorReference")
609
+ return expression.operator;
610
+ return undefined;
611
+ };
612
+
627
613
  export const isLocallyResolved = (expression: Expression) =>
628
614
  (expression.kind === "Identifier" || expression.kind === "Apply") &&
629
615
  expression.resolution?.kind === "Local";