tla-ts 0.0.10-dev.b4a856304 → 0.0.10-dev.c92e6a4ea
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.
- package/README.md +2 -1
- package/dist/compile.cjs +6 -6
- package/dist/compile.js +10 -10
- package/dist/deciders.cjs +41 -37
- package/dist/deciders.js +57 -53
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +37 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.js +1 -1
- package/dist/parallel-worker.cjs +1 -1
- package/dist/parallel-worker.js +1 -1
- package/dist/prove.cjs +2683 -427
- package/dist/prove.js +2681 -425
- package/dist/run.cjs +45 -44
- package/dist/run.js +45 -44
- package/dist/tlapm.cjs +2 -2
- package/dist/tlapm.js +2 -2
- package/dist/transfer.cjs +44 -41
- package/dist/transfer.js +45 -42
- package/dist/worker.cjs +7 -7
- package/dist/worker.js +7 -7
- package/package.json +1 -1
- package/src/ast.ts +41 -41
- package/src/bags.ts +2 -5
- package/src/builtins.ts +5 -21
- package/src/check-failure.ts +116 -0
- package/src/check-trace.ts +268 -0
- package/src/check.ts +578 -757
- package/src/cli/options.ts +6 -31
- package/src/cli/run.ts +0 -2
- package/src/cli/runtime-invariants.ts +27 -62
- package/src/cli/shared.ts +1 -5
- package/src/cli/tlapm.ts +433 -70
- package/src/cli/tlc-arguments.ts +246 -240
- package/src/cli/tlc-output.ts +686 -0
- package/src/cli/tlc-usage.ts +3 -5
- package/src/cli/tlc.ts +59 -707
- package/src/cli/xml-exporter.ts +23 -33
- package/src/codegen.ts +5 -10
- package/src/coverage.ts +3 -10
- package/src/dependencies.ts +30 -14
- package/src/dfid.ts +16 -16
- package/src/environment-config.ts +315 -0
- package/src/environment.ts +73 -338
- package/src/errors.ts +33 -5
- package/src/evaluate.ts +34 -107
- package/src/exit-codes.ts +3 -0
- package/src/fingerprints.ts +65 -1
- package/src/instances.ts +47 -10
- package/src/java-hash.ts +7 -0
- package/src/java-overrides.ts +4 -9
- package/src/json-reader.ts +1 -2
- package/src/json.ts +8 -18
- package/src/levels.ts +46 -57
- package/src/lexer.ts +76 -85
- package/src/liveness-checker.ts +634 -306
- package/src/liveness.ts +104 -120
- package/src/obligations/action.ts +14 -17
- package/src/obligations/anonymize.ts +37 -16
- package/src/obligations/enabled-axioms.ts +218 -0
- package/src/obligations/equality.ts +1 -3
- package/src/obligations/expression.ts +36 -8
- package/src/obligations/format.ts +0 -2
- package/src/obligations/generate.ts +66 -54
- package/src/obligations/index.ts +38 -8
- package/src/obligations/levels.ts +24 -11
- package/src/obligations/module.ts +28 -41
- package/src/obligations/normalize.ts +26 -14
- package/src/obligations/operators.ts +0 -2
- package/src/obligations/pragma.ts +53 -16
- package/src/obligations/printer.ts +43 -13
- package/src/obligations/proof.ts +3 -2
- package/src/obligations/regroup.ts +0 -2
- package/src/obligations/simplify.ts +55 -50
- package/src/obligations/source.ts +118 -74
- package/src/obligations/subexpression.ts +45 -18
- package/src/obligations/substitution.ts +1 -3
- package/src/obligations/temporal.ts +5 -7
- package/src/obligations/tuples.ts +0 -2
- package/src/parallel-worker.ts +17 -31
- package/src/parallel.ts +55 -80
- package/src/parser.ts +722 -385
- package/src/pcal/ast.ts +53 -65
- package/src/pcal/parse.ts +144 -191
- package/src/pcal/tokenize.ts +91 -115
- package/src/pcal/translate.ts +83 -98
- package/src/pcal/validate.ts +48 -50
- package/src/pretty-print.ts +7 -7
- package/src/prover/decide-pool.ts +3 -3
- package/src/prover/deciders.ts +12 -9
- package/src/prover/isabelle/decide.ts +3 -25
- package/src/prover/isabelle/encode.ts +72 -42
- package/src/prover/isabelle/isar/attrib.ts +250 -0
- package/src/prover/isabelle/isar/context.ts +335 -0
- package/src/prover/isabelle/isar/induct.ts +382 -0
- package/src/prover/isabelle/isar/inner-syntax.ts +158 -7
- package/src/prover/isabelle/isar/method.ts +509 -212
- package/src/prover/isabelle/isar/proof.ts +570 -14
- package/src/prover/isabelle/isar/rule-cases.ts +224 -0
- package/src/prover/isabelle/isar/theory.ts +487 -76
- package/src/prover/isabelle/isar/toplevel.ts +331 -0
- package/src/prover/isabelle/isar/type-check.ts +89 -14
- package/src/prover/isabelle/provers/blast/blast.ts +7 -65
- package/src/prover/isabelle/provers/blast/branch.ts +0 -2
- package/src/prover/isabelle/provers/blast/prove.ts +0 -2
- package/src/prover/isabelle/provers/blast/rules.ts +0 -2
- package/src/prover/isabelle/provers/blast/state.ts +0 -2
- package/src/prover/isabelle/provers/blast/term.ts +0 -2
- package/src/prover/isabelle/provers/clasimp.ts +0 -2
- package/src/prover/isabelle/provers/classical.ts +45 -20
- package/src/prover/isabelle/provers/hypsubst.ts +17 -28
- package/src/prover/isabelle/pure/bicompose.ts +9 -27
- package/src/prover/isabelle/pure/consts.ts +0 -2
- package/src/prover/isabelle/pure/conv.ts +2 -10
- package/src/prover/isabelle/pure/drule.ts +72 -6
- package/src/prover/isabelle/pure/envir.ts +0 -2
- package/src/prover/isabelle/pure/goal.ts +1 -3
- package/src/prover/isabelle/pure/logic.ts +1 -3
- package/src/prover/isabelle/pure/name.ts +0 -2
- package/src/prover/isabelle/pure/net.ts +0 -2
- package/src/prover/isabelle/pure/object-logic.ts +13 -7
- package/src/prover/isabelle/pure/pattern.ts +0 -2
- package/src/prover/isabelle/pure/raw-simplifier.ts +4 -15
- package/src/prover/isabelle/pure/rewriter.ts +6 -17
- package/src/prover/isabelle/pure/search.ts +0 -2
- package/src/prover/isabelle/pure/seq.ts +0 -2
- package/src/prover/isabelle/pure/simplifier.ts +26 -7
- package/src/prover/isabelle/pure/table.ts +2 -3
- package/src/prover/isabelle/pure/tactic.ts +0 -2
- package/src/prover/isabelle/pure/tactical.ts +42 -37
- package/src/prover/isabelle/pure/term-ord.ts +0 -2
- package/src/prover/isabelle/pure/term.ts +0 -2
- package/src/prover/isabelle/pure/thm.ts +14 -13
- package/src/prover/isabelle/pure/type.ts +0 -2
- package/src/prover/isabelle/pure/unify.ts +0 -2
- package/src/prover/isabelle/pure/variable.ts +0 -2
- package/src/prover/isabelle/tla/classical-setup.ts +18 -16
- package/src/prover/isabelle/tla/context.ts +58 -11
- package/src/prover/isabelle/tla/logic-data.ts +1 -1
- package/src/prover/isabelle/tla/logic.ts +49 -21
- package/src/prover/isabelle/tla/simpdata.ts +1 -12
- package/src/prover/isabelle/tools/intuitionistic.ts +28 -12
- package/src/prover/ocaml.ts +4 -1
- package/src/prover/prep/action.ts +30 -31
- package/src/prover/prep/enabled-axioms.ts +11 -2
- package/src/prover/prep/fingerprint.ts +2 -5
- package/src/prover/prep/methods.ts +181 -51
- package/src/prover/prep/normalize.ts +38 -9
- package/src/prover/prove.ts +395 -94
- package/src/prover/ptl/decide.ts +95 -50
- package/src/prover/ptl/encode.ts +2 -3
- package/src/prover/ptl/tableau.ts +28 -2
- package/src/prover/smt/arithmetic.ts +310 -0
- package/src/prover/smt/axioms.ts +12 -8
- package/src/prover/smt/context.ts +43 -8
- package/src/prover/smt/data.ts +498 -379
- package/src/prover/smt/encode.ts +148 -57
- package/src/prover/smt/extensionality.ts +5 -3
- package/src/prover/smt/flatten.ts +4 -6
- package/src/prover/smt/format.ts +28 -4
- package/src/prover/smt/instances.ts +7 -1
- package/src/prover/smt/layout.ts +91 -0
- package/src/prover/smt/rewrite.ts +1021 -618
- package/src/prover/smt/simplify.ts +441 -0
- package/src/prover/smt/solver/ackermannize-bv-tactic.ts +61 -0
- package/src/prover/smt/solver/ackr-helper.ts +179 -0
- package/src/prover/smt/solver/ackr-model-converter.ts +105 -0
- package/src/prover/smt/solver/act-cache.ts +0 -1
- package/src/prover/smt/solver/add-bounds-tactic.ts +59 -0
- package/src/prover/smt/solver/aig-tactic.ts +52 -0
- package/src/prover/smt/solver/aig.ts +889 -0
- package/src/prover/smt/solver/arith-rewriter.ts +613 -6
- package/src/prover/smt/solver/arith-terms.ts +121 -0
- package/src/prover/smt/solver/array-decl-plugin.ts +175 -0
- package/src/prover/smt/solver/array-rewriter.ts +309 -0
- package/src/prover/smt/solver/asserted-formulas.ts +87 -16
- package/src/prover/smt/solver/ast-lt.ts +166 -12
- package/src/prover/smt/solver/ast-util.ts +160 -2
- package/src/prover/smt/solver/ast.ts +1427 -41
- package/src/prover/smt/solver/auf-solver.ts +2 -6
- package/src/prover/smt/solver/bit-blast-tactic.ts +582 -0
- package/src/prover/smt/solver/bit-blaster.ts +871 -0
- package/src/prover/smt/solver/bound-manager.ts +196 -0
- package/src/prover/smt/solver/bound-simplifier.ts +600 -0
- package/src/prover/smt/solver/bv-bound-chk.ts +492 -0
- package/src/prover/smt/solver/bv-decl-plugin.ts +338 -0
- package/src/prover/smt/solver/bv-divrem-bounds.ts +95 -0
- package/src/prover/smt/solver/bv-rewriter.ts +1901 -0
- package/src/prover/smt/solver/bv1-blast.ts +214 -0
- package/src/prover/smt/solver/bv2fpa-converter.ts +174 -0
- package/src/prover/smt/solver/bv2int-rewriter.ts +544 -0
- package/src/prover/smt/solver/bv2real-rewriter.ts +533 -0
- package/src/prover/smt/solver/card2bv.ts +110 -0
- package/src/prover/smt/solver/case-split-queue.ts +0 -2
- package/src/prover/smt/solver/cg-table.ts +39 -25
- package/src/prover/smt/solver/check-logic.ts +330 -0
- package/src/prover/smt/solver/clause.ts +0 -1
- package/src/prover/smt/solver/cofactor-elim-term-ite.ts +278 -0
- package/src/prover/smt/solver/conflict-resolution.ts +78 -2
- package/src/prover/smt/solver/context.ts +516 -115
- package/src/prover/smt/solver/ctx-simplify.ts +20 -10
- package/src/prover/smt/solver/ctx-solver-simplify.ts +122 -0
- package/src/prover/smt/solver/datatype-decl-plugin.ts +572 -0
- package/src/prover/smt/solver/datatype-rewriter.ts +82 -0
- package/src/prover/smt/solver/demodulator.ts +786 -0
- package/src/prover/smt/solver/dependent-expr-state.ts +81 -0
- package/src/prover/smt/solver/der.ts +38 -10
- package/src/prover/smt/solver/diff-neq.ts +206 -0
- package/src/prover/smt/solver/distribute-forall.ts +57 -0
- package/src/prover/smt/solver/dom-simplify.ts +511 -0
- package/src/prover/smt/solver/dt2bv-tactic.ts +260 -0
- package/src/prover/smt/solver/dyn-ack.ts +0 -1
- package/src/prover/smt/solver/e-matching.ts +7 -8
- package/src/prover/smt/solver/elim-small-bv-tactic.ts +129 -0
- package/src/prover/smt/solver/elim-uncnstr.ts +545 -0
- package/src/prover/smt/solver/enode.ts +100 -3
- package/src/prover/smt/solver/eq2bv-tactic.ts +218 -0
- package/src/prover/smt/solver/euf/arith-axioms.ts +403 -0
- package/src/prover/smt/solver/euf/arith-internalize.ts +653 -0
- package/src/prover/smt/solver/euf/arith-solver.ts +889 -0
- package/src/prover/smt/solver/euf/array-axioms.ts +527 -0
- package/src/prover/smt/solver/euf/array-internalize.ts +428 -0
- package/src/prover/smt/solver/euf/array-solver.ts +306 -0
- package/src/prover/smt/solver/euf/bv-ackerman.ts +162 -0
- package/src/prover/smt/solver/euf/bv-internalize.ts +748 -0
- package/src/prover/smt/solver/euf/bv-solver.ts +449 -0
- package/src/prover/smt/solver/euf/dt-solver.ts +618 -0
- package/src/prover/smt/solver/euf/egraph.ts +908 -0
- package/src/prover/smt/solver/euf/euf-solver.ts +1205 -0
- package/src/prover/smt/solver/euf/fpa-solver.ts +317 -0
- package/src/prover/smt/solver/euf/mam.ts +1050 -0
- package/src/prover/smt/solver/euf/q-ematch.ts +830 -0
- package/src/prover/smt/solver/euf/q-mbi.ts +587 -0
- package/src/prover/smt/solver/euf/q-model-fixer.ts +296 -0
- package/src/prover/smt/solver/euf/q-solver.ts +361 -0
- package/src/prover/smt/solver/euf/th-solver.ts +335 -0
- package/src/prover/smt/solver/euf/th-solvers.ts +30 -0
- package/src/prover/smt/solver/expr-ref.ts +0 -1
- package/src/prover/smt/solver/expr-safe-replace.ts +26 -2
- package/src/prover/smt/solver/expr2polynomial.ts +146 -0
- package/src/prover/smt/solver/factor.ts +141 -0
- package/src/prover/smt/solver/fd-solver.ts +265 -0
- package/src/prover/smt/solver/fingerprints.ts +15 -15
- package/src/prover/smt/solver/fix-dl-var.ts +148 -0
- package/src/prover/smt/solver/flat-literals.ts +0 -1
- package/src/prover/smt/solver/fm-tactic.ts +884 -0
- package/src/prover/smt/solver/fpa-decl-plugin.ts +618 -0
- package/src/prover/smt/solver/fpa-rewriter.ts +640 -0
- package/src/prover/smt/solver/fpa2bv-converter.ts +2249 -0
- package/src/prover/smt/solver/fpa2bv-rewriter.ts +348 -0
- package/src/prover/smt/solver/fpa2bv-tactic.ts +73 -0
- package/src/prover/smt/solver/goal.ts +175 -15
- package/src/prover/smt/solver/goal2nlsat.ts +189 -0
- package/src/prover/smt/solver/guard-set.ts +219 -0
- package/src/prover/smt/solver/hash.ts +0 -1
- package/src/prover/smt/solver/hashtable.ts +30 -16
- package/src/prover/smt/solver/inf-eps.ts +63 -0
- package/src/prover/smt/solver/inj-axiom.ts +101 -0
- package/src/prover/smt/solver/internalizer.ts +110 -38
- package/src/prover/smt/solver/lackr.ts +381 -0
- package/src/prover/smt/solver/lbool.ts +0 -1
- package/src/prover/smt/solver/lia2card.ts +268 -0
- package/src/prover/smt/solver/lia2pb.ts +154 -0
- package/src/prover/smt/solver/literal.ts +0 -1
- package/src/prover/smt/solver/logic-tactics.ts +345 -0
- package/src/prover/smt/solver/lp/bound-propagator.ts +0 -1
- package/src/prover/smt/solver/lp/constraints.ts +0 -1
- package/src/prover/smt/solver/lp/containers.ts +7 -2
- package/src/prover/smt/solver/lp/core-solver.ts +18 -3
- package/src/prover/smt/solver/lp/cross-nested.ts +1 -4
- package/src/prover/smt/solver/lp/dep-intervals.ts +0 -3
- package/src/prover/smt/solver/lp/dependency.ts +0 -2
- package/src/prover/smt/solver/lp/dioph-eq.ts +1 -10
- package/src/prover/smt/solver/lp/explanation.ts +0 -1
- package/src/prover/smt/solver/lp/gomory.ts +0 -1
- package/src/prover/smt/solver/lp/hnf-cutter.ts +1 -2
- package/src/prover/smt/solver/lp/hnf.ts +0 -3
- package/src/prover/smt/solver/lp/int-cube.ts +3 -4
- package/src/prover/smt/solver/lp/int-solver.ts +0 -2
- package/src/prover/smt/solver/lp/lar-solver.ts +40 -4
- package/src/prover/smt/solver/lp/lar-term.ts +0 -1
- package/src/prover/smt/solver/lp/lp-settings.ts +0 -1
- package/src/prover/smt/solver/lp/maximize-term.ts +59 -10
- package/src/prover/smt/solver/lp/nex-creator.ts +3 -3
- package/src/prover/smt/solver/lp/nex.ts +2 -2
- package/src/prover/smt/solver/lp/nla-backoff.ts +0 -2
- package/src/prover/smt/solver/lp/nla-basics.ts +46 -3
- package/src/prover/smt/solver/lp/nla-core.ts +67 -16
- package/src/prover/smt/solver/lp/nla-divisions.ts +0 -2
- package/src/prover/smt/solver/lp/nla-emonics.ts +0 -1
- package/src/prover/smt/solver/lp/nla-factorization.ts +0 -1
- package/src/prover/smt/solver/lp/nla-grobner.ts +165 -83
- package/src/prover/smt/solver/lp/nla-horner.ts +0 -2
- package/src/prover/smt/solver/lp/nla-intervals.ts +0 -1
- package/src/prover/smt/solver/lp/nla-monomial-bounds.ts +0 -2
- package/src/prover/smt/solver/lp/nla-monotone.ts +0 -1
- package/src/prover/smt/solver/lp/nla-order.ts +0 -2
- package/src/prover/smt/solver/lp/nla-patcher.ts +0 -1
- package/src/prover/smt/solver/lp/nla-powers.ts +220 -0
- package/src/prover/smt/solver/lp/nla-tangents.ts +0 -2
- package/src/prover/smt/solver/lp/nla-throttle.ts +0 -1
- package/src/prover/smt/solver/lp/nla-transcendentals.ts +324 -0
- package/src/prover/smt/solver/lp/nla-types.ts +0 -2
- package/src/prover/smt/solver/lp/nla-var-eqs.ts +0 -1
- package/src/prover/smt/solver/lp/nra-solver.ts +122 -64
- package/src/prover/smt/solver/lp/numeric-pair.ts +0 -1
- package/src/prover/smt/solver/lp/pdd-interval.ts +6 -3
- package/src/prover/smt/solver/lp/pdd-simplifier.ts +60 -21
- package/src/prover/smt/solver/lp/pdd-solver.ts +72 -41
- package/src/prover/smt/solver/lp/pdd.ts +725 -289
- package/src/prover/smt/solver/lp/random-updater.ts +0 -2
- package/src/prover/smt/solver/lp/static-matrix.ts +0 -1
- package/src/prover/smt/solver/lp/union-find.ts +7 -2
- package/src/prover/smt/solver/macro-finder.ts +530 -0
- package/src/prover/smt/solver/mam-compiler.ts +122 -90
- package/src/prover/smt/solver/mam-interpreter.ts +0 -1
- package/src/prover/smt/solver/max-bv-sharing-tactic.ts +17 -0
- package/src/prover/smt/solver/max-cliques.ts +105 -0
- package/src/prover/smt/solver/maxcore.ts +309 -0
- package/src/prover/smt/solver/maximize-ac-sharing.ts +8 -6
- package/src/prover/smt/solver/maxlex.ts +115 -0
- package/src/prover/smt/solver/maxsmt-base.ts +105 -0
- package/src/prover/smt/solver/maxsmt.ts +92 -0
- package/src/prover/smt/solver/mbp/mbp-arith.ts +467 -0
- package/src/prover/smt/solver/mbp/mbp-basic-tg.ts +101 -0
- package/src/prover/smt/solver/mbp/mbp-plugin.ts +287 -0
- package/src/prover/smt/solver/mbp/mbp-qel.ts +48 -0
- package/src/prover/smt/solver/mbp/mbp-solve-plugin.ts +271 -0
- package/src/prover/smt/solver/mbp/mbp-term-graph.ts +606 -0
- package/src/prover/smt/solver/model-based-opt.ts +844 -0
- package/src/prover/smt/solver/model-checker.ts +18 -27
- package/src/prover/smt/solver/model-evaluator.ts +188 -12
- package/src/prover/smt/solver/model-finder.ts +12 -18
- package/src/prover/smt/solver/model-generator.ts +56 -29
- package/src/prover/smt/solver/model-macro-solver.ts +49 -46
- package/src/prover/smt/solver/model-printer.ts +214 -0
- package/src/prover/smt/solver/mpf.ts +711 -0
- package/src/prover/smt/solver/mus.ts +51 -0
- package/src/prover/smt/solver/muz/dl-context.ts +404 -0
- package/src/prover/smt/solver/muz/dl-mk-bit-blast.ts +97 -0
- package/src/prover/smt/solver/muz/dl-mk-coi-filter.ts +167 -0
- package/src/prover/smt/solver/muz/dl-mk-elim-term-ite.ts +125 -0
- package/src/prover/smt/solver/muz/dl-mk-interp-tail-simplifier.ts +299 -0
- package/src/prover/smt/solver/muz/dl-mk-rule-inliner.ts +455 -0
- package/src/prover/smt/solver/muz/dl-mk-slice.ts +340 -0
- package/src/prover/smt/solver/muz/dl-mk-subsumption-checker.ts +163 -0
- package/src/prover/smt/solver/muz/dl-rule-set.ts +273 -0
- package/src/prover/smt/solver/muz/dl-rule-transformer.ts +123 -0
- package/src/prover/smt/solver/muz/dl-rule.ts +496 -0
- package/src/prover/smt/solver/muz/hnf.ts +201 -0
- package/src/prover/smt/solver/muz/horn-subsume-model-converter.ts +176 -0
- package/src/prover/smt/solver/muz/horn-tactic.ts +201 -0
- package/src/prover/smt/solver/muz/rule-properties.ts +337 -0
- package/src/prover/smt/solver/muz/spacer-context.ts +1406 -0
- package/src/prover/smt/solver/muz/spacer-dl-interface.ts +52 -0
- package/src/prover/smt/solver/muz/spacer-generalizers.ts +241 -0
- package/src/prover/smt/solver/muz/spacer-manager.ts +127 -0
- package/src/prover/smt/solver/muz/spacer-pdr.ts +218 -0
- package/src/prover/smt/solver/muz/spacer-prop-solver.ts +333 -0
- package/src/prover/smt/solver/muz/spacer-util.ts +282 -0
- package/src/prover/smt/solver/muz/substitution.ts +203 -0
- package/src/prover/smt/solver/nla2bv-tactic.ts +285 -0
- package/src/prover/smt/solver/nlqsat.ts +484 -0
- package/src/prover/smt/solver/nlsat/algebraic.ts +125 -12
- package/src/prover/smt/solver/nlsat/atoms.ts +20 -6
- package/src/prover/smt/solver/nlsat/evaluator.ts +0 -1
- package/src/prover/smt/solver/nlsat/explain.ts +63 -23
- package/src/prover/smt/solver/nlsat/interval-set.ts +1 -2
- package/src/prover/smt/solver/nlsat/levelwise.ts +3 -9
- package/src/prover/smt/solver/nlsat/mpbq.ts +45 -1
- package/src/prover/smt/solver/nlsat/polynomial.ts +13 -6
- package/src/prover/smt/solver/nlsat/solver.ts +236 -45
- package/src/prover/smt/solver/nlsat/transcendental-eval.ts +310 -0
- package/src/prover/smt/solver/nlsat/transcendentals.ts +367 -0
- package/src/prover/smt/solver/nlsat/types.ts +0 -2
- package/src/prover/smt/solver/nlsat/upolynomial-factorization.ts +1 -4
- package/src/prover/smt/solver/nlsat/upolynomial.ts +0 -2
- package/src/prover/smt/solver/nlsat-tactic.ts +82 -0
- package/src/prover/smt/solver/nnf.ts +105 -23
- package/src/prover/smt/solver/normalize-bounds.ts +53 -0
- package/src/prover/smt/solver/occf.ts +97 -0
- package/src/prover/smt/solver/opt-context.ts +787 -0
- package/src/prover/smt/solver/opt-nlsat.ts +375 -0
- package/src/prover/smt/solver/opt-pareto.ts +282 -0
- package/src/prover/smt/solver/opt-preprocess.ts +101 -0
- package/src/prover/smt/solver/opt-solver.ts +308 -0
- package/src/prover/smt/solver/opt-value.ts +55 -0
- package/src/prover/smt/solver/optsmt.ts +692 -0
- package/src/prover/smt/solver/parallel-tactic.ts +299 -0
- package/src/prover/smt/solver/pattern-inference.ts +19 -11
- package/src/prover/smt/solver/pb-rewriter.ts +284 -0
- package/src/prover/smt/solver/pb2bv-tactic.ts +540 -0
- package/src/prover/smt/solver/poly-rewriter.ts +202 -57
- package/src/prover/smt/solver/probes.ts +512 -0
- package/src/prover/smt/solver/propagate-values.ts +37 -21
- package/src/prover/smt/solver/proto-model.ts +648 -19
- package/src/prover/smt/solver/pull-quant.ts +28 -12
- package/src/prover/smt/solver/purify-arith.ts +632 -0
- package/src/prover/smt/solver/qe-arith-plugin.ts +1098 -0
- package/src/prover/smt/solver/qe-lite-der.ts +2 -3
- package/src/prover/smt/solver/qe-lite-fm.ts +3 -4
- package/src/prover/smt/solver/qe-lite.ts +37 -17
- package/src/prover/smt/solver/qe-mbp.ts +270 -0
- package/src/prover/smt/solver/qe.ts +1498 -0
- package/src/prover/smt/solver/qel.ts +25 -0
- package/src/prover/smt/solver/qi-queue.ts +0 -1
- package/src/prover/smt/solver/qsat.ts +814 -0
- package/src/prover/smt/solver/quant-hoist.ts +196 -0
- package/src/prover/smt/solver/quant-tactics.ts +16 -56
- package/src/prover/smt/solver/quantifier-analyzer.ts +19 -20
- package/src/prover/smt/solver/quantifier-manager.ts +8 -16
- package/src/prover/smt/solver/quasi-macros.ts +243 -0
- package/src/prover/smt/solver/random-gen.ts +0 -1
- package/src/prover/smt/solver/rational.ts +45 -1
- package/src/prover/smt/solver/recfun-decl-plugin.ts +261 -0
- package/src/prover/smt/solver/recfun-rewriter.ts +107 -0
- package/src/prover/smt/solver/reduce-args.ts +225 -0
- package/src/prover/smt/solver/reduce-bv-size.ts +119 -0
- package/src/prover/smt/solver/ref-vector.ts +0 -1
- package/src/prover/smt/solver/relevancy.ts +1 -2
- package/src/prover/smt/solver/rewriter-tpl.ts +77 -10
- package/src/prover/smt/solver/rewriter.ts +475 -36
- package/src/prover/smt/solver/rlimit.ts +38 -2
- package/src/prover/smt/solver/sat/asymm-branch.ts +325 -0
- package/src/prover/smt/solver/sat/big.ts +177 -0
- package/src/prover/smt/solver/sat/clause-use-list.ts +71 -0
- package/src/prover/smt/solver/sat/clause.ts +203 -0
- package/src/prover/smt/solver/sat/cleaner.ts +94 -0
- package/src/prover/smt/solver/sat/config.ts +122 -0
- package/src/prover/smt/solver/sat/consequences.ts +203 -0
- package/src/prover/smt/solver/sat/elim-eqs.ts +142 -0
- package/src/prover/smt/solver/sat/goal2sat.ts +526 -0
- package/src/prover/smt/solver/sat/inc-sat-solver.ts +378 -0
- package/src/prover/smt/solver/sat/model-converter.ts +136 -0
- package/src/prover/smt/solver/sat/pb-constraint.ts +261 -0
- package/src/prover/smt/solver/sat/pb-solver.ts +1577 -0
- package/src/prover/smt/solver/sat/probing.ts +170 -0
- package/src/prover/smt/solver/sat/sat-tactic.ts +43 -0
- package/src/prover/smt/solver/sat/sat2goal.ts +165 -0
- package/src/prover/smt/solver/sat/scc.ts +142 -0
- package/src/prover/smt/solver/sat/simplifier.ts +1618 -0
- package/src/prover/smt/solver/sat/solver.ts +2127 -0
- package/src/prover/smt/solver/sat/var-queue.ts +117 -0
- package/src/prover/smt/solver/sat/watch-list.ts +140 -0
- package/src/prover/smt/solver/search-tree.ts +284 -0
- package/src/prover/smt/solver/seq-axioms.ts +1010 -0
- package/src/prover/smt/solver/seq-decl-plugin.ts +819 -0
- package/src/prover/smt/solver/seq-derive.ts +1298 -0
- package/src/prover/smt/solver/seq-eq-approx.ts +236 -0
- package/src/prover/smt/solver/seq-eq-solver.ts +439 -0
- package/src/prover/smt/solver/seq-factory.ts +89 -0
- package/src/prover/smt/solver/seq-monadic.ts +728 -0
- package/src/prover/smt/solver/seq-range-predicate.ts +235 -0
- package/src/prover/smt/solver/seq-re-rewriter.ts +1170 -0
- package/src/prover/smt/solver/seq-re-util.ts +758 -0
- package/src/prover/smt/solver/seq-regex-bisim.ts +144 -0
- package/src/prover/smt/solver/seq-regex-live.ts +200 -0
- package/src/prover/smt/solver/seq-rewriter.ts +2402 -0
- package/src/prover/smt/solver/seq-skolem.ts +317 -0
- package/src/prover/smt/solver/seq-subset.ts +165 -0
- package/src/prover/smt/solver/seq-view-witness.ts +353 -0
- package/src/prover/smt/solver/smt-consequences.ts +297 -0
- package/src/prover/smt/solver/smt-kernel.ts +83 -0
- package/src/prover/smt/solver/smt-logics.ts +66 -0
- package/src/prover/smt/solver/smt-setup.ts +496 -0
- package/src/prover/smt/solver/smt2-printer.ts +765 -0
- package/src/prover/smt/solver/smtlib-parser.ts +3126 -316
- package/src/prover/smt/solver/smtlib-script.ts +1631 -0
- package/src/prover/smt/solver/solve-eqs.ts +929 -0
- package/src/prover/smt/solver/solver.ts +113 -22
- package/src/prover/smt/solver/static-features.ts +314 -0
- package/src/prover/smt/solver/sticky-generations.ts +0 -1
- package/src/prover/smt/solver/tactic.ts +1986 -0
- package/src/prover/smt/solver/term-enumeration.ts +205 -0
- package/src/prover/smt/solver/theory-array.ts +1240 -0
- package/src/prover/smt/solver/theory-bv.ts +1200 -0
- package/src/prover/smt/solver/theory-char.ts +355 -0
- package/src/prover/smt/solver/theory-datatype.ts +598 -0
- package/src/prover/smt/solver/theory-finite-set.ts +30 -0
- package/src/prover/smt/solver/theory-fpa.ts +389 -0
- package/src/prover/smt/solver/theory-lra-axioms.ts +53 -2
- package/src/prover/smt/solver/theory-lra-bounds.ts +31 -6
- package/src/prover/smt/solver/theory-lra-final-check.ts +56 -70
- package/src/prover/smt/solver/theory-lra-internalize.ts +94 -27
- package/src/prover/smt/solver/theory-lra-model.ts +20 -35
- package/src/prover/smt/solver/theory-lra-propagate.ts +24 -26
- package/src/prover/smt/solver/theory-lra-state.ts +6 -22
- package/src/prover/smt/solver/theory-lra.ts +188 -1
- package/src/prover/smt/solver/theory-pb.ts +934 -0
- package/src/prover/smt/solver/theory-polymorphism.ts +58 -0
- package/src/prover/smt/solver/theory-recfun.ts +307 -0
- package/src/prover/smt/solver/theory-seq-regex.ts +867 -0
- package/src/prover/smt/solver/theory-seq-solve.ts +1373 -0
- package/src/prover/smt/solver/theory-seq-state.ts +871 -0
- package/src/prover/smt/solver/theory-seq.ts +961 -0
- package/src/prover/smt/solver/theory.ts +189 -0
- package/src/prover/smt/solver/tseitin-cnf.ts +485 -0
- package/src/prover/smt/solver/var-subst.ts +36 -14
- package/src/prover/smt/table.ts +3 -2
- package/src/prover/smt/types.ts +146 -0
- package/src/prover/tlapm/cache.ts +50 -19
- package/src/prover/tlapm/tlapm.ts +15 -9
- package/src/prover/tlapm-library.ts +3208 -0
- package/src/prover/verdict.ts +9 -0
- package/src/prover/zenon/check/check.ts +1 -2
- package/src/prover/zenon/check/records.ts +1 -1
- package/src/prover/zenon/check/relations.ts +2 -1
- package/src/prover/zenon/check/rewrites.ts +2 -15
- package/src/prover/zenon/check/sets.ts +40 -58
- package/src/prover/zenon/check/terms.ts +1 -2
- package/src/prover/zenon/decide.ts +10 -7
- package/src/prover/zenon/encode.ts +0 -2
- package/src/prover/zenon/eqrel.ts +2 -2
- package/src/prover/zenon/equality-rules.ts +24 -2
- package/src/prover/zenon/expr.ts +28 -2
- package/src/prover/zenon/index-table.ts +11 -21
- package/src/prover/zenon/isar-case.ts +0 -2
- package/src/prover/zenon/isar.ts +35 -37
- package/src/prover/zenon/llproof.ts +2 -13
- package/src/prover/zenon/mltoll.ts +12 -30
- package/src/prover/zenon/node.ts +20 -5
- package/src/prover/zenon/parse.ts +9 -8
- package/src/prover/zenon/phrase.ts +0 -2
- package/src/prover/zenon/proof.ts +0 -2
- package/src/prover/zenon/propositional-rules.ts +0 -2
- package/src/prover/zenon/rules.ts +2 -3
- package/src/prover/zenon/search.ts +11 -19
- package/src/prover/zenon/tla/functions.ts +2 -4
- package/src/prover/zenon/tla/llproof.ts +9 -13
- package/src/prover/zenon/tla/records.ts +1 -8
- package/src/prover/zenon/tla/rewrites.ts +0 -2
- package/src/prover/zenon/tla/sets.ts +22 -22
- package/src/prover/zenon/tla/terms.ts +0 -2
- package/src/prover/zenon/tla/tla.ts +7 -8
- package/src/randomization.ts +1 -4
- package/src/resolve.ts +67 -143
- package/src/runtime.ts +17 -18
- package/src/sany/builtins.ts +1 -3
- package/src/sany/generation.ts +394 -0
- package/src/sany/generator-def-entries.ts +210 -0
- package/src/sany/generator-definitions.ts +686 -0
- package/src/sany/generator-expressions.ts +1100 -0
- package/src/sany/generator-proofs.ts +662 -0
- package/src/sany/generator.ts +160 -2683
- package/src/sany/levels.ts +5 -11
- package/src/sany/lexer.ts +57 -60
- package/src/sany/linter.ts +0 -3
- package/src/sany/nodes.ts +6 -13
- package/src/sany/report.ts +3 -6
- package/src/sany/selectors.ts +35 -38
- package/src/sany/xml.ts +23 -55
- package/src/search.ts +244 -53
- package/src/simulate.ts +202 -184
- package/src/spec-description.ts +56 -82
- package/src/standard-definitions.ts +4 -3
- package/src/standard-modules.ts +17 -44
- package/src/state-graph.ts +3 -17
- package/src/subexpressions.ts +38 -47
- package/src/substitution-levels.ts +5 -4
- package/src/successors.ts +20 -43
- package/src/symmetry.ts +6 -21
- package/src/tableau.ts +2 -2
- package/src/tlc/fingerprint.ts +96 -30
- package/src/tlc/jar-data.ts +0 -1
- package/src/tlc/messages.ts +22 -36
- package/src/tlc/order.ts +36 -50
- package/src/tlc/random.ts +22 -34
- package/src/tlc/replay.ts +21 -48
- package/src/tlc/summary.ts +64 -58
- package/src/tlc/tlc-operators.ts +6 -17
- package/src/tlc/tlcext-operators.ts +70 -29
- package/src/tlc/trace-spec.ts +26 -51
- package/src/tlc/value-stream.ts +9 -13
- package/src/tlc/version.ts +0 -1
- package/src/typed-tier.ts +6535 -0
- package/src/typescript/actions.ts +2 -4
- package/src/typescript/collections.ts +34 -20
- package/src/typescript/compile.ts +1 -3
- package/src/typescript/formula.ts +5 -3
- package/src/typescript/model.ts +4 -5
- package/src/typescript/steps.ts +20 -18
- package/src/values.ts +136 -338
- package/src/prover/isabelle/isar/statement.ts +0 -52
- package/src/prover/smt/solver/z3-license.txt +0 -10
- package/src/prover/tlaps-module.ts +0 -510
- 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=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,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`),
|
|
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)),storeState:t.storeState,getStateCounts:t.getStateCounts,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
|
-
`),void 0,void 0,{errors:e,warnings:r,isFatal:t,parseError:n}),
|
|
12
|
-
`)}`,
|
|
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}`,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
|
|
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
|
-
|
|
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
|
-
|
|
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,"$",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"A",{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=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,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`),
|
|
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)),storeState:t.storeState,getStateCounts:t.getStateCounts,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
|
-
`),void 0,void 0,{errors:e,warnings:r,isFatal:t,parseError:n}),
|
|
12
|
-
`)}`,
|
|
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}`,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
|
|
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
|
-
|
|
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
|
-
|
|
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{c as $,
|
|
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
package/src/ast.ts
CHANGED
|
@@ -27,13 +27,13 @@ export interface DecimalExpression {
|
|
|
27
27
|
location: SourceLocation;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
30
|
+
interface StringExpression {
|
|
31
31
|
kind: "String";
|
|
32
32
|
value: string;
|
|
33
33
|
location: SourceLocation;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
36
|
+
interface IdentifierExpression {
|
|
37
37
|
kind: "Identifier";
|
|
38
38
|
name: string;
|
|
39
39
|
spelling?: string;
|
|
@@ -42,8 +42,6 @@ export interface IdentifierExpression {
|
|
|
42
42
|
resolution?: LocalResolution;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
// spelling holds the text of an operator written as a synonym, such as (+) for \oplus, which SANY
|
|
46
|
-
// reports as written.
|
|
47
45
|
export interface ApplyExpression {
|
|
48
46
|
kind: "Apply";
|
|
49
47
|
operator: string;
|
|
@@ -57,14 +55,14 @@ export interface ApplyExpression {
|
|
|
57
55
|
resolution?: LocalResolution;
|
|
58
56
|
}
|
|
59
57
|
|
|
60
|
-
|
|
58
|
+
interface OperatorReferenceExpression {
|
|
61
59
|
kind: "OperatorReference";
|
|
62
60
|
operator: string;
|
|
63
61
|
spelling?: string;
|
|
64
62
|
location: SourceLocation;
|
|
65
63
|
}
|
|
66
64
|
|
|
67
|
-
|
|
65
|
+
interface LambdaExpression {
|
|
68
66
|
kind: "Lambda";
|
|
69
67
|
params: string[];
|
|
70
68
|
paramRanges?: SourceRange[];
|
|
@@ -73,35 +71,33 @@ export interface LambdaExpression {
|
|
|
73
71
|
location: SourceLocation;
|
|
74
72
|
}
|
|
75
73
|
|
|
76
|
-
|
|
74
|
+
interface JunctionExpression {
|
|
77
75
|
kind: "And" | "Or";
|
|
78
76
|
operands: Expression[];
|
|
79
77
|
isBulleted?: boolean;
|
|
80
|
-
// SANY parses A /\ B /\ C as (A /\ B) /\ C, whose node of each prefix of two or more operands ends
|
|
81
|
-
// after the parentheses of its last operand.
|
|
82
78
|
prefixEnds?: SourceLocation[];
|
|
83
79
|
location: SourceLocation;
|
|
84
80
|
}
|
|
85
81
|
|
|
86
|
-
|
|
82
|
+
interface PrimeExpression {
|
|
87
83
|
kind: "Prime";
|
|
88
84
|
expression: Expression;
|
|
89
85
|
location: SourceLocation;
|
|
90
86
|
}
|
|
91
87
|
|
|
92
|
-
|
|
88
|
+
interface UnchangedExpression {
|
|
93
89
|
kind: "Unchanged";
|
|
94
90
|
expression: Expression;
|
|
95
91
|
location: SourceLocation;
|
|
96
92
|
}
|
|
97
93
|
|
|
98
|
-
|
|
94
|
+
interface EnabledExpression {
|
|
99
95
|
kind: "Enabled";
|
|
100
96
|
expression: Expression;
|
|
101
97
|
location: SourceLocation;
|
|
102
98
|
}
|
|
103
99
|
|
|
104
|
-
|
|
100
|
+
interface IfExpression {
|
|
105
101
|
kind: "If";
|
|
106
102
|
condition: Expression;
|
|
107
103
|
consequent: Expression;
|
|
@@ -114,7 +110,7 @@ export interface CaseArm {
|
|
|
114
110
|
body: Expression;
|
|
115
111
|
}
|
|
116
112
|
|
|
117
|
-
|
|
113
|
+
interface CaseExpression {
|
|
118
114
|
kind: "Case";
|
|
119
115
|
arms: CaseArm[];
|
|
120
116
|
other: Expression | undefined;
|
|
@@ -146,7 +142,7 @@ export interface QuantifierExpression {
|
|
|
146
142
|
location: SourceLocation;
|
|
147
143
|
}
|
|
148
144
|
|
|
149
|
-
|
|
145
|
+
interface UnboundedQuantifierExpression {
|
|
150
146
|
kind: "UnboundedQuantifier";
|
|
151
147
|
quantifier: "Forall" | "Exists";
|
|
152
148
|
names: string[];
|
|
@@ -156,7 +152,7 @@ export interface UnboundedQuantifierExpression {
|
|
|
156
152
|
location: SourceLocation;
|
|
157
153
|
}
|
|
158
154
|
|
|
159
|
-
|
|
155
|
+
interface ChooseExpression {
|
|
160
156
|
kind: "Choose";
|
|
161
157
|
pattern: BoundPattern;
|
|
162
158
|
set: Expression | undefined;
|
|
@@ -164,27 +160,27 @@ export interface ChooseExpression {
|
|
|
164
160
|
location: SourceLocation;
|
|
165
161
|
}
|
|
166
162
|
|
|
167
|
-
|
|
163
|
+
interface SetEnumerationExpression {
|
|
168
164
|
kind: "SetEnumeration";
|
|
169
165
|
elements: Expression[];
|
|
170
166
|
location: SourceLocation;
|
|
171
167
|
}
|
|
172
168
|
|
|
173
|
-
|
|
169
|
+
interface SetFilterExpression {
|
|
174
170
|
kind: "SetFilter";
|
|
175
171
|
bound: Bound;
|
|
176
172
|
predicate: Expression;
|
|
177
173
|
location: SourceLocation;
|
|
178
174
|
}
|
|
179
175
|
|
|
180
|
-
|
|
176
|
+
interface SetMapExpression {
|
|
181
177
|
kind: "SetMap";
|
|
182
178
|
expression: Expression;
|
|
183
179
|
bounds: Bound[];
|
|
184
180
|
location: SourceLocation;
|
|
185
181
|
}
|
|
186
182
|
|
|
187
|
-
|
|
183
|
+
interface TupleExpression {
|
|
188
184
|
kind: "Tuple";
|
|
189
185
|
elements: Expression[];
|
|
190
186
|
location: SourceLocation;
|
|
@@ -198,7 +194,7 @@ export interface FunctionConstructionExpression {
|
|
|
198
194
|
isRecursive?: boolean;
|
|
199
195
|
}
|
|
200
196
|
|
|
201
|
-
|
|
197
|
+
interface FunctionSetExpression {
|
|
202
198
|
kind: "FunctionSet";
|
|
203
199
|
domain: Expression;
|
|
204
200
|
range: Expression;
|
|
@@ -211,7 +207,7 @@ export interface RecordField {
|
|
|
211
207
|
location: SourceLocation;
|
|
212
208
|
}
|
|
213
209
|
|
|
214
|
-
|
|
210
|
+
interface RecordExpression {
|
|
215
211
|
kind: "Record" | "RecordSet";
|
|
216
212
|
fields: RecordField[];
|
|
217
213
|
location: SourceLocation;
|
|
@@ -226,59 +222,58 @@ interface ExceptUpdate {
|
|
|
226
222
|
value: Expression;
|
|
227
223
|
}
|
|
228
224
|
|
|
229
|
-
|
|
225
|
+
interface ExceptExpression {
|
|
230
226
|
kind: "Except";
|
|
231
227
|
function: Expression;
|
|
232
228
|
updates: ExceptUpdate[];
|
|
233
229
|
location: SourceLocation;
|
|
234
230
|
}
|
|
235
231
|
|
|
236
|
-
|
|
232
|
+
interface ExceptAtExpression {
|
|
237
233
|
kind: "ExceptAt";
|
|
238
234
|
location: SourceLocation;
|
|
239
235
|
}
|
|
240
236
|
|
|
241
|
-
|
|
237
|
+
interface FunctionApplicationExpression {
|
|
242
238
|
kind: "FunctionApplication";
|
|
243
239
|
function: Expression;
|
|
244
240
|
args: Expression[];
|
|
245
241
|
location: SourceLocation;
|
|
246
242
|
}
|
|
247
243
|
|
|
248
|
-
|
|
249
|
-
export interface BracketExpression {
|
|
244
|
+
interface BracketExpression {
|
|
250
245
|
kind: "Bracket";
|
|
251
246
|
args: Expression[];
|
|
252
247
|
location: SourceLocation;
|
|
253
248
|
}
|
|
254
249
|
|
|
255
|
-
|
|
250
|
+
interface FieldAccessExpression {
|
|
256
251
|
kind: "FieldAccess";
|
|
257
252
|
record: Expression;
|
|
258
253
|
field: string;
|
|
259
254
|
location: SourceLocation;
|
|
260
255
|
}
|
|
261
256
|
|
|
262
|
-
|
|
257
|
+
interface ProductExpression {
|
|
263
258
|
kind: "Product";
|
|
264
259
|
factors: Expression[];
|
|
265
260
|
location: SourceLocation;
|
|
266
261
|
}
|
|
267
262
|
|
|
268
|
-
|
|
263
|
+
interface TemporalExpression {
|
|
269
264
|
kind: "Always" | "Eventually";
|
|
270
265
|
expression: Expression;
|
|
271
266
|
location: SourceLocation;
|
|
272
267
|
}
|
|
273
268
|
|
|
274
|
-
|
|
269
|
+
interface ActionExpression {
|
|
275
270
|
kind: "BoxAction" | "AngleAction";
|
|
276
271
|
action: Expression;
|
|
277
272
|
subscript: Expression;
|
|
278
273
|
location: SourceLocation;
|
|
279
274
|
}
|
|
280
275
|
|
|
281
|
-
|
|
276
|
+
interface FairnessExpression {
|
|
282
277
|
kind: "WeakFairness" | "StrongFairness";
|
|
283
278
|
subscript: Expression;
|
|
284
279
|
action: Expression;
|
|
@@ -303,7 +298,7 @@ export type Selector =
|
|
|
303
298
|
| { kind: "At" }
|
|
304
299
|
| { kind: "Colon" };
|
|
305
300
|
|
|
306
|
-
|
|
301
|
+
interface SubexpressionExpression {
|
|
307
302
|
kind: "Subexpression";
|
|
308
303
|
selectors: Selector[];
|
|
309
304
|
selectorRanges?: SourceRange[];
|
|
@@ -522,6 +517,11 @@ export interface Module {
|
|
|
522
517
|
units: ModuleUnit[];
|
|
523
518
|
}
|
|
524
519
|
|
|
520
|
+
export const getDefinitionExpressions = (definition: Definition) =>
|
|
521
|
+
definition.kind === "Function"
|
|
522
|
+
? [...definition.bounds.map((bound) => bound.set), definition.body]
|
|
523
|
+
: [definition.body];
|
|
524
|
+
|
|
525
525
|
export const getChildren = (expression: Expression): Expression[] => {
|
|
526
526
|
switch (expression.kind) {
|
|
527
527
|
case "Number":
|
|
@@ -552,14 +552,7 @@ export const getChildren = (expression: Expression): Expression[] => {
|
|
|
552
552
|
...(expression.other ? [expression.other] : []),
|
|
553
553
|
];
|
|
554
554
|
case "Let":
|
|
555
|
-
return [
|
|
556
|
-
...expression.definitions.flatMap((definition) =>
|
|
557
|
-
definition.kind === "Function"
|
|
558
|
-
? [...definition.bounds.map((bound) => bound.set), definition.body]
|
|
559
|
-
: [definition.body],
|
|
560
|
-
),
|
|
561
|
-
expression.body,
|
|
562
|
-
];
|
|
555
|
+
return [...expression.definitions.flatMap(getDefinitionExpressions), expression.body];
|
|
563
556
|
case "Forall":
|
|
564
557
|
case "Exists":
|
|
565
558
|
return [...expression.bounds.map((bound) => bound.set), expression.body];
|
|
@@ -610,6 +603,13 @@ export const getChildren = (expression: Expression): Expression[] => {
|
|
|
610
603
|
}
|
|
611
604
|
};
|
|
612
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
|
+
|
|
613
613
|
export const isLocallyResolved = (expression: Expression) =>
|
|
614
614
|
(expression.kind === "Identifier" || expression.kind === "Apply") &&
|
|
615
615
|
expression.resolution?.kind === "Local";
|
package/src/bags.ts
CHANGED
|
@@ -85,8 +85,6 @@ const findCount = (functionValue: FunctionValue, element: Value) => {
|
|
|
85
85
|
return position === -1 ? undefined : functionValue.range[position];
|
|
86
86
|
};
|
|
87
87
|
|
|
88
|
-
// Bags.java casts each count to IntValue, so a count that isn't an integer fails with a
|
|
89
|
-
// ClassCastException.
|
|
90
88
|
const toCount = (value: Value) => {
|
|
91
89
|
if (typeof value === "number") return value;
|
|
92
90
|
const javaClass = `tlc2.value.impl.${getJavaClassName(value)}`;
|
|
@@ -101,7 +99,7 @@ const addCounts = (left: Value, right: Value) => {
|
|
|
101
99
|
return sum;
|
|
102
100
|
};
|
|
103
101
|
|
|
104
|
-
// Bags.java subtracts counts as Java ints, which wrap
|
|
102
|
+
// Deviation from TLC: Bags.java subtracts counts as Java ints, which wrap; this overflows like -.
|
|
105
103
|
const subtractCounts = (functionValue: FunctionValue, index: number, other: FunctionValue) => {
|
|
106
104
|
const count = toCount(functionValue.range[index]);
|
|
107
105
|
const removed = findCount(other, functionValue.domain[index]);
|
|
@@ -123,7 +121,6 @@ const getPairs = (functionValue: FunctionValue) =>
|
|
|
123
121
|
|
|
124
122
|
const EMPTY_BAG = createSortedFunction([], []);
|
|
125
123
|
|
|
126
|
-
// SubBag compares the counts with the >= of Naturals, which Integers replaces when TLC loads it.
|
|
127
124
|
export const createBagsOperators = (builtins: ReadonlyMap<string, Builtin>): Builtin[] => [
|
|
128
125
|
defineConstant("EmptyBag", EMPTY_BAG),
|
|
129
126
|
defineOperator("IsABag", 1, (args) => {
|
|
@@ -242,7 +239,7 @@ export const createBagsOperators = (builtins: ReadonlyMap<string, Builtin>): Bui
|
|
|
242
239
|
(subBags, key, index) =>
|
|
243
240
|
subBags.flatMap((entries) => [
|
|
244
241
|
entries,
|
|
245
|
-
...Array.from({ length: counts[index] }, (
|
|
242
|
+
...Array.from({ length: counts[index] }, (_value, copies): [Value, Value][] => [
|
|
246
243
|
...entries,
|
|
247
244
|
[key, copies + 1],
|
|
248
245
|
]),
|
package/src/builtins.ts
CHANGED
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
TlaEndOfInputError,
|
|
3
|
-
TlaEvaluationError,
|
|
4
|
-
TlaModuleError,
|
|
5
|
-
TlaNullPointerError,
|
|
6
|
-
} from "./errors";
|
|
1
|
+
import { TlaEndOfInputError, TlaEvaluationError, TlaModuleError } from "./errors";
|
|
7
2
|
import type { Builtin, BuiltinArgument, Context, OperatorValue } from "./evaluate";
|
|
8
3
|
import {
|
|
9
4
|
formatValue,
|
|
@@ -18,8 +13,6 @@ import {
|
|
|
18
13
|
type Value,
|
|
19
14
|
} from "./values";
|
|
20
15
|
|
|
21
|
-
// TLC evaluates these in its core, or its Java code takes integers, so a wrong argument is an
|
|
22
|
-
// evaluation failure. Every other standard-module operator raises an EvalException.
|
|
23
16
|
const CORE_OPERATOR_NAMES = new Set([
|
|
24
17
|
"=",
|
|
25
18
|
"#",
|
|
@@ -226,15 +219,11 @@ export const getJavaClassName = (value: Value) => {
|
|
|
226
219
|
|
|
227
220
|
export const getKindString = (value: Value) => KIND_STRINGS[getJavaClassName(value)];
|
|
228
221
|
|
|
229
|
-
const
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
new TlaEvaluationError(getJavaOverrideMessage(signature, message));
|
|
222
|
+
const createJavaOverrideError = (signature: string, message: string) =>
|
|
223
|
+
new TlaEvaluationError(
|
|
224
|
+
`Attempted to apply the operator overridden by the Java method\n${signature},\nbut it produced the following error:\n${message}`,
|
|
225
|
+
);
|
|
234
226
|
|
|
235
|
-
// TLC reports a failure inside an operator's Java method as a failure of the method, except an
|
|
236
|
-
// EvalException the method raises itself, and a NullPointerException as an EvalException. A method
|
|
237
|
-
// that evaluates its own arguments reports every failure as a failure of the method.
|
|
238
227
|
export const overrideWithJava = (builtin: Builtin, signature: string): Builtin => {
|
|
239
228
|
const reportAsJavaFailure =
|
|
240
229
|
<Arguments extends unknown[]>(compute: (...args: Arguments) => Value) =>
|
|
@@ -247,14 +236,10 @@ export const overrideWithJava = (builtin: Builtin, signature: string): Builtin =
|
|
|
247
236
|
throw error;
|
|
248
237
|
}
|
|
249
238
|
const isFingerprinted = isFingerprintedSince(depth);
|
|
250
|
-
// The wrapping error replaces the FingerprintException.
|
|
251
239
|
if (setTrace.sets) setTrace.sets.length = depth;
|
|
252
240
|
const isWrapped =
|
|
253
241
|
builtin.isLazy === true || !(error instanceof TlaModuleError) || isFingerprinted;
|
|
254
242
|
if (!isWrapped) throw error;
|
|
255
|
-
if (builtin.isLazy !== true && error instanceof TlaNullPointerError) {
|
|
256
|
-
throw new TlaModuleError(getJavaOverrideMessage(signature, error.message));
|
|
257
|
-
}
|
|
258
243
|
throw createJavaOverrideError(signature, error.message);
|
|
259
244
|
}
|
|
260
245
|
};
|
|
@@ -311,7 +296,6 @@ const getIntegerArgument = (value: Value, position: string, name: string) => {
|
|
|
311
296
|
return value;
|
|
312
297
|
};
|
|
313
298
|
|
|
314
|
-
// The error of an argument that isn't an integer names the operator as TLC's method does.
|
|
315
299
|
export const defineComparison = (
|
|
316
300
|
name: string,
|
|
317
301
|
compare: (left: number, right: number) => boolean,
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
import type { Expression } from "./ast";
|
|
2
|
+
import { getErrorExitCode, isStackOverflow, TlaEvaluationError, TlaModuleError } from "./errors";
|
|
3
|
+
import {
|
|
4
|
+
createTracingEnvironment,
|
|
5
|
+
type CallStack,
|
|
6
|
+
type Environment,
|
|
7
|
+
type FingerprintFailure,
|
|
8
|
+
} from "./evaluate";
|
|
9
|
+
import { EXIT_STATUS, getExitCode, getMessageExitStatus } from "./exit-codes";
|
|
10
|
+
import { getCodedMessage, type FailureMessage } from "./tlc/messages";
|
|
11
|
+
import { getFingerprintError, getHeldValues, markFingerprinted, type Value } from "./values";
|
|
12
|
+
|
|
13
|
+
export interface ReplayFailure {
|
|
14
|
+
callStack: Expression[];
|
|
15
|
+
fingerprint: FingerprintFailure | undefined;
|
|
16
|
+
replayError?: TlaEvaluationError;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface FailureOptions {
|
|
20
|
+
/** What TLC was doing: "behavior-graph" is a failed next state whose call stack comes from adding the state to the behavior graph, "liveness" a failed liveness check. */
|
|
21
|
+
phase?: "initial" | "next" | "behavior-graph" | "liveness";
|
|
22
|
+
initialState?: Value[];
|
|
23
|
+
outDegrees?: number[];
|
|
24
|
+
callStack?: Expression[];
|
|
25
|
+
fingerprint?: FingerprintFailure;
|
|
26
|
+
replayError?: TlaEvaluationError;
|
|
27
|
+
traceFailure?: FailureMessage;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const getInitialExitCode = (error: TlaEvaluationError) => {
|
|
31
|
+
const coded = getCodedMessage(error.message);
|
|
32
|
+
return coded &&
|
|
33
|
+
!coded.isEvalException &&
|
|
34
|
+
getMessageExitStatus(coded.code) === EXIT_STATUS.configParseError
|
|
35
|
+
? EXIT_STATUS.configParseError
|
|
36
|
+
: getErrorExitCode(error);
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
const getReplayExitCode = (error: TlaEvaluationError): number => {
|
|
40
|
+
const inner = error.cause;
|
|
41
|
+
if (inner instanceof TlaEvaluationError) return getReplayExitCode(inner);
|
|
42
|
+
return error instanceof TlaModuleError ? error.exitCode : EXIT_STATUS.specEvaluationFailure;
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
export const getFailureExitCode = (
|
|
46
|
+
error: TlaEvaluationError,
|
|
47
|
+
failureOptions: FailureOptions,
|
|
48
|
+
is174: boolean,
|
|
49
|
+
) => {
|
|
50
|
+
const isReplayed = failureOptions.callStack !== undefined;
|
|
51
|
+
switch (failureOptions.phase) {
|
|
52
|
+
case "initial":
|
|
53
|
+
if (isReplayed) return EXIT_STATUS.specEvaluationFailure;
|
|
54
|
+
return is174 ? EXIT_STATUS.success : getInitialExitCode(error);
|
|
55
|
+
case "behavior-graph":
|
|
56
|
+
return (
|
|
57
|
+
getExitCode(error) ?? (error instanceof TlaModuleError ? error.exitCode : EXIT_STATUS.error)
|
|
58
|
+
);
|
|
59
|
+
case "liveness":
|
|
60
|
+
return getErrorExitCode(error);
|
|
61
|
+
default:
|
|
62
|
+
if (!isReplayed) return getErrorExitCode(error);
|
|
63
|
+
return failureOptions.fingerprint
|
|
64
|
+
? EXIT_STATUS.specEvaluationFailure
|
|
65
|
+
: getReplayExitCode(failureOptions.replayError ?? error);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
export const getReplayFailure = (
|
|
70
|
+
environment: Environment,
|
|
71
|
+
replay: (tracing: Environment) => void,
|
|
72
|
+
): ReplayFailure | undefined => {
|
|
73
|
+
const tracing = createTracingEnvironment(environment);
|
|
74
|
+
const callStack = tracing.callStack;
|
|
75
|
+
try {
|
|
76
|
+
replay(tracing);
|
|
77
|
+
return undefined;
|
|
78
|
+
} catch (error) {
|
|
79
|
+
if (isStackOverflow(error)) return { callStack: [], fingerprint: undefined };
|
|
80
|
+
if (!(error instanceof TlaEvaluationError) || !callStack) return undefined;
|
|
81
|
+
return {
|
|
82
|
+
callStack: callStack.expressions,
|
|
83
|
+
fingerprint: callStack.fingerprint,
|
|
84
|
+
replayError: error,
|
|
85
|
+
};
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
const findFailedSources = (value: Value, sources: CallStack["sources"]): Expression[] => {
|
|
90
|
+
if (typeof value !== "object") return [];
|
|
91
|
+
const source = sources.get(value);
|
|
92
|
+
const failed = getHeldValues(value).find((held) => getFingerprintError(held) !== undefined);
|
|
93
|
+
return [
|
|
94
|
+
...(source ? [source] : []),
|
|
95
|
+
...(failed === undefined ? [] : findFailedSources(failed, sources)),
|
|
96
|
+
];
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
export const fingerprintReplayed = (
|
|
100
|
+
state: Value[],
|
|
101
|
+
fingerprintState: Value[],
|
|
102
|
+
callStack: CallStack | undefined,
|
|
103
|
+
) => {
|
|
104
|
+
for (const value of fingerprintState) {
|
|
105
|
+
const error = getFingerprintError(value);
|
|
106
|
+
if (!error) continue;
|
|
107
|
+
const sources = callStack ? findFailedSources(value, callStack.sources) : [];
|
|
108
|
+
if (callStack && sources.length > 0) {
|
|
109
|
+
callStack.expressions.length = 0;
|
|
110
|
+
callStack.isFrozen = true;
|
|
111
|
+
callStack.fingerprint = { sources, reason: error.message };
|
|
112
|
+
}
|
|
113
|
+
throw error;
|
|
114
|
+
}
|
|
115
|
+
state.forEach(markFingerprinted);
|
|
116
|
+
};
|