tla-ts 0.0.9 → 0.0.10-dev.63a6693bd
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 +29 -1
- package/dist/compile.cjs +23 -0
- package/dist/compile.js +23 -0
- package/dist/deciders.cjs +29 -29
- package/dist/deciders.js +42 -42
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +106 -10
- package/dist/index.d.ts +106 -10
- package/dist/index.js +1 -1
- package/dist/parallel-worker.cjs +1 -1
- package/dist/parallel-worker.js +1 -1
- package/dist/prove-worker.cjs +1 -1
- package/dist/prove-worker.js +1 -1
- package/dist/prove.cjs +117 -37
- package/dist/prove.js +116 -36
- package/dist/run.cjs +143 -31
- package/dist/run.js +143 -31
- package/dist/tlapm.cjs +2 -2
- package/dist/tlapm.js +2 -2
- package/dist/transfer.cjs +129 -104
- package/dist/transfer.js +129 -104
- package/dist/worker.cjs +7 -7
- package/dist/worker.js +7 -7
- package/package.json +3 -1
- package/src/ast.ts +48 -62
- package/src/bags.ts +99 -102
- package/src/builtins.ts +28 -75
- package/src/bundled-modules.ts +1 -8
- package/src/check-failure.ts +116 -0
- package/src/check-trace.ts +282 -0
- package/src/check.ts +599 -754
- package/src/cli/options.ts +12 -32
- package/src/cli/run.ts +0 -2
- package/src/cli/runtime-invariants.ts +136 -0
- package/src/cli/shared.ts +19 -12
- package/src/cli/tlapm.ts +14 -25
- package/src/cli/tlc-arguments.ts +652 -0
- package/src/cli/tlc-output.ts +687 -0
- package/src/cli/tlc-usage.ts +361 -0
- package/src/cli/tlc.ts +309 -658
- package/src/cli/typescript.ts +23 -0
- package/src/cli/xml-exporter.ts +27 -49
- package/src/cli.ts +0 -1
- package/src/codegen.ts +196 -74
- package/src/config.ts +140 -109
- package/src/coverage.ts +830 -0
- package/src/dependencies.ts +14 -53
- package/src/dfid.ts +618 -0
- package/src/environment-config.ts +315 -0
- package/src/environment.ts +169 -335
- package/src/errors.ts +71 -55
- package/src/evaluate.ts +598 -340
- package/src/exit-codes.ts +37 -3
- package/src/fingerprints.ts +75 -11
- package/src/index.ts +3 -0
- package/src/instances.ts +126 -21
- package/src/java-hash.ts +7 -0
- package/src/java-overrides.ts +4 -19
- package/src/json-reader.ts +455 -0
- package/src/json.ts +252 -139
- package/src/levels.ts +46 -58
- package/src/lexer.ts +80 -100
- package/src/liveness-checker.ts +103 -153
- package/src/liveness.ts +150 -109
- package/src/obligations/action.ts +8 -39
- package/src/obligations/anonymize.ts +88 -82
- package/src/obligations/equality.ts +1 -1
- package/src/obligations/expression.ts +20 -21
- package/src/obligations/format.ts +1 -9
- package/src/obligations/generate.ts +46 -49
- package/src/obligations/index.ts +2 -13
- package/src/obligations/levels.ts +4 -8
- package/src/obligations/module.ts +28 -53
- package/src/obligations/normalize.ts +7 -25
- package/src/obligations/operators.ts +1 -2
- package/src/obligations/pragma.ts +1 -10
- package/src/obligations/printer.ts +47 -46
- package/src/obligations/proof.ts +1 -5
- package/src/obligations/regroup.ts +1 -4
- package/src/obligations/simplify.ts +42 -58
- package/src/obligations/source.ts +48 -78
- package/src/obligations/subexpression.ts +5 -11
- package/src/obligations/substitution.ts +1 -3
- package/src/obligations/temporal.ts +13 -19
- package/src/obligations/tuples.ts +3 -9
- package/src/parallel-worker.ts +30 -60
- package/src/parallel.ts +57 -71
- package/src/parser.ts +584 -316
- package/src/pcal/ast.ts +53 -86
- package/src/pcal/parse.ts +144 -219
- package/src/pcal/tokenize.ts +91 -131
- package/src/pcal/translate.ts +83 -130
- package/src/pcal/validate.ts +48 -68
- package/src/pretty-print.ts +7 -8
- package/src/prover/decide-pool.ts +8 -13
- package/src/prover/deciders.ts +3 -7
- package/src/prover/first-order.ts +0 -11
- package/src/prover/isabelle/decide.ts +0 -6
- package/src/prover/isabelle/encode.ts +11 -23
- package/src/prover/isabelle/isar/inner-syntax.ts +114 -115
- package/src/prover/isabelle/isar/method.ts +29 -53
- package/src/prover/isabelle/isar/proof.ts +1 -10
- package/src/prover/isabelle/isar/statement.ts +1 -6
- package/src/prover/isabelle/isar/theory.ts +26 -36
- package/src/prover/isabelle/isar/type-check.ts +17 -31
- package/src/prover/isabelle/provers/blast/blast.ts +17 -104
- package/src/prover/isabelle/provers/blast/branch.ts +1 -32
- package/src/prover/isabelle/provers/blast/prove.ts +1 -35
- package/src/prover/isabelle/provers/blast/rules.ts +6 -44
- package/src/prover/isabelle/provers/blast/state.ts +2 -28
- package/src/prover/isabelle/provers/blast/term.ts +9 -36
- package/src/prover/isabelle/provers/clasimp.ts +1 -13
- package/src/prover/isabelle/provers/classical.ts +14 -42
- package/src/prover/isabelle/provers/hypsubst.ts +28 -51
- package/src/prover/isabelle/pure/bicompose.ts +25 -38
- package/src/prover/isabelle/pure/consts.ts +1 -7
- package/src/prover/isabelle/pure/conv.ts +3 -17
- package/src/prover/isabelle/pure/drule.ts +33 -42
- package/src/prover/isabelle/pure/envir.ts +3 -52
- package/src/prover/isabelle/pure/goal.ts +1 -7
- package/src/prover/isabelle/pure/interrupt.ts +0 -5
- package/src/prover/isabelle/pure/list.ts +0 -3
- package/src/prover/isabelle/pure/logic.ts +2 -15
- package/src/prover/isabelle/pure/name.ts +2 -9
- package/src/prover/isabelle/pure/net.ts +3 -59
- package/src/prover/isabelle/pure/object-logic.ts +3 -10
- package/src/prover/isabelle/pure/pattern.ts +2 -19
- package/src/prover/isabelle/pure/raw-simplifier.ts +17 -62
- package/src/prover/isabelle/pure/rewriter.ts +31 -67
- package/src/prover/isabelle/pure/search.ts +3 -10
- package/src/prover/isabelle/pure/seq.ts +1 -10
- package/src/prover/isabelle/pure/simplifier.ts +4 -12
- package/src/prover/isabelle/pure/table.ts +3 -32
- package/src/prover/isabelle/pure/tactic.ts +12 -22
- package/src/prover/isabelle/pure/tactical.ts +48 -47
- package/src/prover/isabelle/pure/term-ord.ts +2 -6
- package/src/prover/isabelle/pure/term.ts +2 -43
- package/src/prover/isabelle/pure/thm.ts +27 -47
- package/src/prover/isabelle/pure/type.ts +2 -15
- package/src/prover/isabelle/pure/unify.ts +20 -30
- package/src/prover/isabelle/pure/variable.ts +3 -7
- package/src/prover/isabelle/tla/classical-setup.ts +17 -24
- package/src/prover/isabelle/tla/context.ts +15 -18
- package/src/prover/isabelle/tla/logic.ts +14 -32
- package/src/prover/isabelle/tla/simpdata.ts +46 -43
- package/src/prover/isabelle/tools/intuitionistic.ts +1 -10
- package/src/prover/ocaml.ts +0 -6
- package/src/prover/prep/action.ts +14 -54
- package/src/prover/prep/enabled-axioms.ts +12 -19
- package/src/prover/prep/fingerprint.ts +2 -21
- package/src/prover/prep/level-comparison.ts +8 -12
- package/src/prover/prep/md5.ts +0 -2
- package/src/prover/prep/methods.ts +33 -39
- package/src/prover/prep/normalize.ts +4 -28
- package/src/prover/prove-worker.ts +0 -2
- package/src/prover/prove.ts +87 -100
- package/src/prover/ptl/decide.ts +7 -12
- package/src/prover/ptl/encode.ts +14 -36
- package/src/prover/ptl/sat.ts +24 -32
- package/src/prover/ptl/tableau.ts +12 -26
- package/src/prover/smt/axioms.ts +0 -7
- package/src/prover/smt/context.ts +20 -28
- package/src/prover/smt/data.ts +433 -424
- package/src/prover/smt/encode.ts +43 -52
- package/src/prover/smt/extensionality.ts +0 -10
- package/src/prover/smt/flatten.ts +3 -22
- package/src/prover/smt/format.ts +5 -10
- package/src/prover/smt/instances.ts +0 -10
- package/src/prover/smt/rewrite.ts +663 -667
- package/src/prover/smt/solver/act-cache.ts +0 -15
- package/src/prover/smt/solver/arith-rewriter.ts +3 -48
- package/src/prover/smt/solver/array.ts +1 -3
- package/src/prover/smt/solver/asserted-formulas.ts +1 -43
- package/src/prover/smt/solver/ast-lt.ts +1 -11
- package/src/prover/smt/solver/ast-util.ts +1 -6
- package/src/prover/smt/solver/ast.ts +1 -165
- package/src/prover/smt/solver/auf-solver.ts +8 -44
- package/src/prover/smt/solver/case-split-queue.ts +1 -9
- package/src/prover/smt/solver/cg-table.ts +1 -18
- package/src/prover/smt/solver/clause.ts +1 -27
- package/src/prover/smt/solver/conflict-resolution.ts +0 -9
- package/src/prover/smt/solver/context.ts +7 -64
- package/src/prover/smt/solver/ctx-simplify.ts +14 -41
- package/src/prover/smt/solver/der.ts +2 -21
- package/src/prover/smt/solver/dyn-ack.ts +1 -11
- package/src/prover/smt/solver/e-matching.ts +4 -35
- package/src/prover/smt/solver/enode.ts +1 -21
- package/src/prover/smt/solver/expr-ref.ts +1 -5
- package/src/prover/smt/solver/expr-safe-replace.ts +1 -6
- package/src/prover/smt/solver/fingerprints.ts +1 -12
- package/src/prover/smt/solver/flat-literals.ts +1 -9
- package/src/prover/smt/solver/goal.ts +2 -14
- package/src/prover/smt/solver/hash.ts +0 -8
- package/src/prover/smt/solver/hashtable.ts +1 -12
- package/src/prover/smt/solver/internalizer.ts +7 -100
- package/src/prover/smt/solver/lbool.ts +1 -2
- package/src/prover/smt/solver/literal.ts +0 -3
- package/src/prover/smt/solver/lp/bound-propagator.ts +8 -26
- package/src/prover/smt/solver/lp/constraints.ts +2 -8
- package/src/prover/smt/solver/lp/containers.ts +12 -30
- package/src/prover/smt/solver/lp/core-solver.ts +10 -31
- package/src/prover/smt/solver/lp/cross-nested.ts +6 -20
- package/src/prover/smt/solver/lp/dep-intervals.ts +7 -22
- package/src/prover/smt/solver/lp/dependency.ts +1 -4
- package/src/prover/smt/solver/lp/dioph-eq.ts +9 -102
- package/src/prover/smt/solver/lp/explanation.ts +1 -6
- package/src/prover/smt/solver/lp/gomory.ts +9 -22
- package/src/prover/smt/solver/lp/hnf-cutter.ts +17 -23
- package/src/prover/smt/solver/lp/hnf.ts +11 -26
- package/src/prover/smt/solver/lp/int-cube.ts +15 -36
- package/src/prover/smt/solver/lp/int-solver.ts +4 -34
- package/src/prover/smt/solver/lp/lar-solver.ts +32 -81
- package/src/prover/smt/solver/lp/lar-term.ts +1 -5
- package/src/prover/smt/solver/lp/lp-settings.ts +1 -14
- package/src/prover/smt/solver/lp/maximize-term.ts +20 -45
- package/src/prover/smt/solver/lp/nex-creator.ts +5 -28
- package/src/prover/smt/solver/lp/nex.ts +1 -6
- package/src/prover/smt/solver/lp/nla-backoff.ts +1 -4
- package/src/prover/smt/solver/lp/nla-basics.ts +5 -30
- package/src/prover/smt/solver/lp/nla-core.ts +36 -135
- package/src/prover/smt/solver/lp/nla-divisions.ts +32 -42
- package/src/prover/smt/solver/lp/nla-emonics.ts +4 -21
- package/src/prover/smt/solver/lp/nla-factorization.ts +1 -4
- package/src/prover/smt/solver/lp/nla-grobner.ts +15 -69
- package/src/prover/smt/solver/lp/nla-horner.ts +3 -11
- package/src/prover/smt/solver/lp/nla-intervals.ts +2 -12
- package/src/prover/smt/solver/lp/nla-monomial-bounds.ts +16 -41
- package/src/prover/smt/solver/lp/nla-monotone.ts +2 -6
- package/src/prover/smt/solver/lp/nla-order.ts +2 -13
- package/src/prover/smt/solver/lp/nla-patcher.ts +4 -7
- package/src/prover/smt/solver/lp/nla-tangents.ts +1 -9
- package/src/prover/smt/solver/lp/nla-throttle.ts +1 -6
- package/src/prover/smt/solver/lp/nla-types.ts +1 -11
- package/src/prover/smt/solver/lp/nla-var-eqs.ts +4 -25
- package/src/prover/smt/solver/lp/nra-solver.ts +5 -52
- package/src/prover/smt/solver/lp/numeric-pair.ts +1 -4
- package/src/prover/smt/solver/lp/pdd-interval.ts +1 -3
- package/src/prover/smt/solver/lp/pdd-simplifier.ts +2 -14
- package/src/prover/smt/solver/lp/pdd-solver.ts +4 -33
- package/src/prover/smt/solver/lp/pdd.ts +7 -70
- package/src/prover/smt/solver/lp/random-updater.ts +1 -8
- package/src/prover/smt/solver/lp/static-matrix.ts +9 -19
- package/src/prover/smt/solver/lp/union-find.ts +1 -6
- package/src/prover/smt/solver/mam-compiler.ts +18 -58
- package/src/prover/smt/solver/mam-interpreter.ts +1 -21
- package/src/prover/smt/solver/maximize-ac-sharing.ts +2 -17
- package/src/prover/smt/solver/model-checker.ts +3 -37
- package/src/prover/smt/solver/model-evaluator.ts +3 -29
- package/src/prover/smt/solver/model-finder.ts +15 -32
- package/src/prover/smt/solver/model-generator.ts +1 -12
- package/src/prover/smt/solver/model-macro-solver.ts +23 -88
- package/src/prover/smt/solver/nlsat/algebraic.ts +63 -159
- package/src/prover/smt/solver/nlsat/atoms.ts +25 -23
- package/src/prover/smt/solver/nlsat/evaluator.ts +17 -22
- package/src/prover/smt/solver/nlsat/explain.ts +10 -69
- package/src/prover/smt/solver/nlsat/interval-set.ts +9 -50
- package/src/prover/smt/solver/nlsat/levelwise.ts +49 -135
- package/src/prover/smt/solver/nlsat/mpbq.ts +3 -14
- package/src/prover/smt/solver/nlsat/polynomial.ts +29 -159
- package/src/prover/smt/solver/nlsat/solver.ts +18 -90
- package/src/prover/smt/solver/nlsat/types.ts +1 -8
- package/src/prover/smt/solver/nlsat/upolynomial-factorization.ts +2 -45
- package/src/prover/smt/solver/nlsat/upolynomial.ts +11 -92
- package/src/prover/smt/solver/nnf.ts +3 -38
- package/src/prover/smt/solver/pattern-inference.ts +2 -15
- package/src/prover/smt/solver/poly-rewriter.ts +3 -23
- package/src/prover/smt/solver/propagate-values.ts +1 -10
- package/src/prover/smt/solver/proto-model.ts +3 -52
- package/src/prover/smt/solver/pull-quant.ts +1 -12
- package/src/prover/smt/solver/qe-lite-der.ts +1 -29
- package/src/prover/smt/solver/qe-lite-fm.ts +2 -25
- package/src/prover/smt/solver/qe-lite.ts +3 -33
- package/src/prover/smt/solver/qi-queue.ts +1 -16
- package/src/prover/smt/solver/quant-tactics.ts +5 -22
- package/src/prover/smt/solver/quantifier-analyzer.ts +27 -47
- package/src/prover/smt/solver/quantifier-manager.ts +2 -13
- package/src/prover/smt/solver/random-gen.ts +1 -2
- package/src/prover/smt/solver/rational.ts +1 -8
- package/src/prover/smt/solver/ref-vector.ts +1 -6
- package/src/prover/smt/solver/relevancy.ts +2 -15
- package/src/prover/smt/solver/rewriter-tpl.ts +3 -147
- package/src/prover/smt/solver/rewriter.ts +3 -85
- package/src/prover/smt/solver/rlimit.ts +2 -20
- package/src/prover/smt/solver/smtlib-parser.ts +80 -131
- package/src/prover/smt/solver/solver.ts +23 -34
- package/src/prover/smt/solver/sort.ts +1 -5
- package/src/prover/smt/solver/sticky-generations.ts +0 -5
- package/src/prover/smt/solver/theory-lra-axioms.ts +3 -24
- package/src/prover/smt/solver/theory-lra-bounds.ts +1 -7
- package/src/prover/smt/solver/theory-lra-final-check.ts +4 -22
- package/src/prover/smt/solver/theory-lra-internalize.ts +6 -43
- package/src/prover/smt/solver/theory-lra-model.ts +4 -19
- package/src/prover/smt/solver/theory-lra-propagate.ts +1 -15
- package/src/prover/smt/solver/theory-lra-state.ts +3 -8
- package/src/prover/smt/solver/theory-lra.ts +1 -8
- package/src/prover/smt/solver/var-subst.ts +2 -26
- package/src/prover/smt/table.ts +0 -8
- package/src/prover/tlapm/cache.ts +45 -40
- package/src/prover/tlapm/ocaml-marshal.ts +19 -21
- package/src/prover/tlapm/tlapm.ts +21 -20
- package/src/prover/verdict.ts +7 -2
- package/src/prover/zenon/check/check.ts +1 -11
- package/src/prover/zenon/check/definitions.ts +5 -15
- package/src/prover/zenon/check/equality.ts +0 -8
- package/src/prover/zenon/check/functions.ts +0 -4
- package/src/prover/zenon/check/keys.ts +0 -7
- package/src/prover/zenon/check/propositional.ts +0 -3
- package/src/prover/zenon/check/records.ts +1 -6
- package/src/prover/zenon/check/relations.ts +2 -14
- package/src/prover/zenon/check/rewrites.ts +2 -21
- package/src/prover/zenon/check/sets.ts +40 -61
- package/src/prover/zenon/check/terms.ts +1 -19
- package/src/prover/zenon/check/tla.ts +0 -6
- package/src/prover/zenon/decide.ts +0 -12
- package/src/prover/zenon/encode.ts +1 -8
- package/src/prover/zenon/eqrel.ts +2 -13
- package/src/prover/zenon/equality-rules.ts +0 -4
- package/src/prover/zenon/expr.ts +8 -26
- package/src/prover/zenon/index-table.ts +26 -57
- package/src/prover/zenon/isar-case.ts +9 -19
- package/src/prover/zenon/isar.ts +36 -64
- package/src/prover/zenon/limits.ts +0 -4
- package/src/prover/zenon/llproof.ts +2 -20
- package/src/prover/zenon/mltoll.ts +66 -104
- package/src/prover/zenon/node.ts +1 -11
- package/src/prover/zenon/ocaml.ts +1 -17
- package/src/prover/zenon/parse.ts +4 -12
- package/src/prover/zenon/phrase.ts +1 -11
- package/src/prover/zenon/proof.ts +0 -9
- package/src/prover/zenon/propositional-rules.ts +0 -5
- package/src/prover/zenon/rules.ts +2 -6
- package/src/prover/zenon/search.ts +5 -31
- package/src/prover/zenon/tla/functions.ts +59 -31
- package/src/prover/zenon/tla/llproof.ts +67 -76
- package/src/prover/zenon/tla/records.ts +57 -33
- package/src/prover/zenon/tla/rewrites.ts +12 -19
- package/src/prover/zenon/tla/sets.ts +83 -53
- package/src/prover/zenon/tla/terms.ts +0 -6
- package/src/prover/zenon/tla/tla.ts +66 -64
- package/src/randomization.ts +81 -35
- package/src/resolve.ts +67 -184
- package/src/runtime.ts +22 -22
- package/src/sany/builtins.ts +2 -5
- 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 +191 -2764
- package/src/sany/levels.ts +6 -34
- package/src/sany/lexer.ts +58 -77
- package/src/sany/linter.ts +1 -9
- package/src/sany/modules.ts +1 -5
- package/src/sany/nodes.ts +5 -43
- package/src/sany/parse-error.ts +39 -117
- package/src/sany/report.ts +32 -69
- package/src/sany/selectors.ts +49 -76
- package/src/sany/source.ts +1 -17
- package/src/sany/xml.ts +35 -117
- package/src/search.ts +541 -163
- package/src/simulate.ts +709 -0
- package/src/spec-description.ts +192 -100
- package/src/standard-definitions.ts +0 -4
- package/src/standard-modules.ts +264 -95
- package/src/state-graph.ts +52 -31
- package/src/subexpressions.ts +69 -52
- package/src/substitution-levels.ts +7 -7
- package/src/successors.ts +266 -99
- package/src/symmetry.ts +33 -25
- package/src/tableau.ts +27 -24
- package/src/tlc/fingerprint.ts +183 -67
- package/src/tlc/jar-data.ts +112 -6
- package/src/tlc/messages.ts +125 -54
- package/src/tlc/order.ts +39 -69
- package/src/tlc/random.ts +37 -49
- package/src/tlc/replay.ts +553 -228
- package/src/tlc/summary.ts +36 -47
- package/src/tlc/tlc-operators.ts +78 -44
- package/src/tlc/tlcext-operators.ts +139 -122
- package/src/tlc/trace-spec.ts +249 -0
- package/src/tlc/value-stream.ts +139 -0
- package/src/tlc/version.ts +1 -4
- package/src/transfer.ts +22 -25
- package/src/typescript/actions.ts +479 -0
- package/src/typescript/collections.ts +614 -0
- package/src/typescript/compile.ts +63 -0
- package/src/typescript/context.ts +94 -0
- package/src/typescript/emit.ts +121 -0
- package/src/typescript/expressions.ts +496 -0
- package/src/typescript/formula.ts +154 -0
- package/src/typescript/functions.ts +284 -0
- package/src/typescript/model.ts +162 -0
- package/src/typescript/names.ts +114 -0
- package/src/typescript/program.ts +48 -0
- package/src/typescript/properties.ts +139 -0
- package/src/typescript/scope.ts +112 -0
- package/src/typescript/steps.ts +167 -0
- package/src/typescript/types.ts +171 -0
- package/src/values.ts +832 -484
- package/src/worker.ts +7 -8
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,
|
|
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`),u=c(`tlc2.tool.EvalException`),d=e=>e instanceof RangeError&&e.message===`Maximum call stack size exceeded`||e instanceof SyntaxError&&e.message.endsWith(`: Stack overflow`);var f=class extends Error{constructor(e,t){super(e,{cause:t}),this.name=`TlaError`}},p=class extends f{failure;sany;constructor(e,t,n,r){super(e,t),this.name=`TlaSyntaxError`,this.failure=n,this.sany=r}},m=class extends p{location;parseError;constructor(e,t,n){super(e),this.location=t,this.parseError=n}},ee=class extends m{constructor(e,t,n=!0){super(`Cannot find source file for module ${e} imported in module ${t}.`,n?t:void 0)}};const h=(e,t=!1,n,r=[])=>new p(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}),g=(e,t)=>h([{location:`In module ${t}`,message:`Cannot find source file for module ${e} imported in module ${t}.`}],!0),_=e=>`*** Warnings: ${e.length}\n\n${e.map(e=>`${e.location}\n\n${e.message}\n\n\n`).join(`
|
|
12
|
+
`)}`,v=e=>`line ${e.start.line}, col ${e.start.column} to line ${e.end.line}, col ${e.end.column} of module ${e.module}`,y=(e,t)=>h([{location:v(t),message:e}]);var b=class extends f{constructor(e,t){super(e,t),this.name=`TlaConfigError`}},x=class extends f{constructor(e,t){super(e,t),this.name=`TlaEvaluationError`}};const S=`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 C=class extends x{constructor(){super(S)}};const w=()=>i(new C,e.error);var T=class extends x{},E=class extends x{state;action;variables;constructor(e,t,n,r){super(e),this.state=t,this.action=n,this.variables=r}},D=class extends x{variable;constructor(e,t){super(e),this.variable=t}},O=class extends x{exitCode;constructor(t,n=e.error){super(t),this.exitCode=n}},k=class extends x{constructor(t){super(t),i(this,e.error)}},A=class extends T{constructor(){super(`PickSuccessor reached the end of standard input without an answer whether to extend the behavior.`)}},j=class extends x{constructor(t){super(`The directory ${t} holds no checkpoint to recover from.`),i(this,e.error)}},M=class extends x{},N=class extends x{};const P=`Too many possible next states for the last state in the trace.`;var F=class extends x{constructor(){super(P)}},I=class extends x{code;constructor(e,t){super(t),this.code=e}},L=class extends x{state;constructor(e){super(`current state is not a legal state`),this.state=e}},R=class extends f{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)})`}},te=class extends R{constructor(e=`Assert_failure`){super(`Oops, this seems to be a bug in TLAPM.`,{exception:e})}},z=class extends f{constructor(e,t){super(e,t),this.name=`TlaProverError`}},B=class extends f{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 f{constructor(e,t){super(e,t),this.name=`TlaUnsupportedError`}},W=class extends f{constructor(e,t){super(e,t),this.name=`SmtUnsupportedError`}},G=class extends f{constructor(){super(`the SMT solver was canceled`),this.name=`SmtCanceledError`}},K=class extends f{constructor(e){super(e),this.name=`SmtInvariantError`}},q=class extends f{constructor(e){super(`nlsat does not implement ${e}`),this.name=`NlsatUnsupportedError`}},J=class extends f{constructor(){super(`the pdd manager ran out of nodes`),this.name=`PddMemoryOutError`}},Y=class extends f{constructor(e,t){super(e,t),this.name=`SmtParseError`}},X=class extends U{unwound;constructor(e,t){super(e),this.name=`TlaJavaException`,this.unwound=t}};const Z=t=>a(t)??(t instanceof p?e.specParseError:t instanceof b?e.configParseError:t instanceof x?e.specEvaluationFailure:e.error);var Q=class extends f{node;constructor(e,t){super(e),this.name=`PcalError`,this.node=t}},ne=class extends f{constructor(e){super(e),this.name=`PcalRuntimeError`}},re=class extends f{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`}},ie=class extends f{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 $=`node:worker_threads`,ae=()=>typeof Worker==`function`||typeof process<`u`&&process.versions?.node!==void 0,oe=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
|
+
$))).Worker(e);return r.on(`message`,t),r.on(`error`,n),{postMessage:(e,t)=>r.postMessage(e,t),terminate:()=>void r.terminate()}},se=async()=>typeof globalThis.postMessage==`function`?globalThis:(await import(
|
|
19
19
|
/* @vite-ignore */
|
|
20
20
|
/* webpackIgnore: true */
|
|
21
|
-
|
|
21
|
+
$)).parentPort,ce=()=>{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
|
|
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 H}}),Object.defineProperty(exports,"A",{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,"B",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"C",{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,"D",{enumerable:!0,get:function(){return ee}}),Object.defineProperty(exports,"E",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"F",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"G",{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,"H",{enumerable:!0,get:function(){return te}}),Object.defineProperty(exports,"I",{enumerable:!0,get:function(){return ie}}),Object.defineProperty(exports,"J",{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,"K",{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,"L",{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,"M",{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,"N",{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,"O",{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,"P",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"Q",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"R",{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,"S",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"T",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"U",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"V",{enumerable:!0,get:function(){return B}}),Object.defineProperty(exports,"W",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"X",{enumerable:!0,get:function(){return _}}),Object.defineProperty(exports,"Y",{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,"Z",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"at",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return ne}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return G}}),Object.defineProperty(exports,"et",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return oe}}),Object.defineProperty(exports,"it",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"j",{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,"k",{enumerable:!0,get:function(){return R}}),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 se}}),Object.defineProperty(exports,"nt",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return re}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"q",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return ae}}),Object.defineProperty(exports,"rt",{enumerable:!0,get:function(){return n}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return ce}}),Object.defineProperty(exports,"tt",{enumerable:!0,get:function(){return e}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"w",{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,"x",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"z",{enumerable:!0,get:function(){return U}});
|
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,
|
|
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`),u=c(`tlc2.tool.EvalException`),d=e=>e instanceof RangeError&&e.message===`Maximum call stack size exceeded`||e instanceof SyntaxError&&e.message.endsWith(`: Stack overflow`);var f=class extends Error{constructor(e,t){super(e,{cause:t}),this.name=`TlaError`}},p=class extends f{failure;sany;constructor(e,t,n,r){super(e,t),this.name=`TlaSyntaxError`,this.failure=n,this.sany=r}},m=class extends p{location;parseError;constructor(e,t,n){super(e),this.location=t,this.parseError=n}},ee=class extends m{constructor(e,t,n=!0){super(`Cannot find source file for module ${e} imported in module ${t}.`,n?t:void 0)}};const h=(e,t=!1,n,r=[])=>new p(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}),g=(e,t)=>h([{location:`In module ${t}`,message:`Cannot find source file for module ${e} imported in module ${t}.`}],!0),_=e=>`*** Warnings: ${e.length}\n\n${e.map(e=>`${e.location}\n\n${e.message}\n\n\n`).join(`
|
|
12
|
+
`)}`,v=e=>`line ${e.start.line}, col ${e.start.column} to line ${e.end.line}, col ${e.end.column} of module ${e.module}`,y=(e,t)=>h([{location:v(t),message:e}]);var b=class extends f{constructor(e,t){super(e,t),this.name=`TlaConfigError`}},x=class extends f{constructor(e,t){super(e,t),this.name=`TlaEvaluationError`}};const S=`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 C=class extends x{constructor(){super(S)}};const w=()=>i(new C,e.error);var T=class extends x{},E=class extends x{state;action;variables;constructor(e,t,n,r){super(e),this.state=t,this.action=n,this.variables=r}},D=class extends x{variable;constructor(e,t){super(e),this.variable=t}},O=class extends x{exitCode;constructor(t,n=e.error){super(t),this.exitCode=n}},k=class extends x{constructor(t){super(t),i(this,e.error)}},A=class extends T{constructor(){super(`PickSuccessor reached the end of standard input without an answer whether to extend the behavior.`)}},j=class extends x{constructor(t){super(`The directory ${t} holds no checkpoint to recover from.`),i(this,e.error)}},M=class extends x{},N=class extends x{};const P=`Too many possible next states for the last state in the trace.`;var F=class extends x{constructor(){super(P)}},I=class extends x{code;constructor(e,t){super(t),this.code=e}},L=class extends x{state;constructor(e){super(`current state is not a legal state`),this.state=e}},R=class extends f{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)})`}},te=class extends R{constructor(e=`Assert_failure`){super(`Oops, this seems to be a bug in TLAPM.`,{exception:e})}},z=class extends f{constructor(e,t){super(e,t),this.name=`TlaProverError`}},B=class extends f{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 f{constructor(e,t){super(e,t),this.name=`TlaUnsupportedError`}},W=class extends f{constructor(e,t){super(e,t),this.name=`SmtUnsupportedError`}},G=class extends f{constructor(){super(`the SMT solver was canceled`),this.name=`SmtCanceledError`}},K=class extends f{constructor(e){super(e),this.name=`SmtInvariantError`}},q=class extends f{constructor(e){super(`nlsat does not implement ${e}`),this.name=`NlsatUnsupportedError`}},J=class extends f{constructor(){super(`the pdd manager ran out of nodes`),this.name=`PddMemoryOutError`}},Y=class extends f{constructor(e,t){super(e,t),this.name=`SmtParseError`}},X=class extends U{unwound;constructor(e,t){super(e),this.name=`TlaJavaException`,this.unwound=t}};const Z=t=>a(t)??(t instanceof p?e.specParseError:t instanceof b?e.configParseError:t instanceof x?e.specEvaluationFailure:e.error);var Q=class extends f{node;constructor(e,t){super(e),this.name=`PcalError`,this.node=t}},ne=class extends f{constructor(e){super(e),this.name=`PcalRuntimeError`}},re=class extends f{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`}},ie=class extends f{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 $=`node:worker_threads`,ae=()=>typeof Worker==`function`||typeof process<`u`&&process.versions?.node!==void 0,oe=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
|
+
$))).Worker(e);return r.on(`message`,t),r.on(`error`,n),{postMessage:(e,t)=>r.postMessage(e,t),terminate:()=>void r.terminate()}},se=async()=>typeof globalThis.postMessage==`function`?globalThis:(await import(
|
|
19
19
|
/* @vite-ignore */
|
|
20
20
|
/* webpackIgnore: true */
|
|
21
|
-
|
|
21
|
+
$)).parentPort,ce=()=>{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{
|
|
24
|
+
`bun:jsc`):void 0;return async()=>{(await e)?.edenGC(),await new Promise(e=>typeof setImmediate==`function`?setImmediate(e):setTimeout(e,0))}};export{H as $,z as A,I as B,E as C,ee as D,j as E,F,g as G,te as H,ie as I,w as J,h as K,D as L,N as M,C as N,O,p as P,c as Q,T as R,L as S,X as T,u as U,B as V,l as W,_ as X,v as Y,Z,b as _,q as a,s as at,x as b,ne as c,G as d,d as et,K as f,M as g,P as h,oe as i,i as it,m as j,R as k,J as l,W as m,se as n,a as nt,re as o,Y as p,y as q,ae as r,n as rt,Q as s,ce as t,e as tt,S as u,A as v,V as w,k as x,f as y,U as z};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "tla-ts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10-dev.63a6693bd",
|
|
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
|
-
|
|
30
|
+
interface StringExpression {
|
|
31
31
|
kind: "String";
|
|
32
32
|
value: string;
|
|
33
33
|
location: SourceLocation;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
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
|
-
|
|
48
|
-
// reports as written.
|
|
49
|
-
export interface ApplyExpression {
|
|
45
|
+
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
|
-
|
|
58
|
+
interface OperatorReferenceExpression {
|
|
68
59
|
kind: "OperatorReference";
|
|
69
60
|
operator: string;
|
|
70
61
|
spelling?: string;
|
|
71
62
|
location: SourceLocation;
|
|
72
63
|
}
|
|
73
64
|
|
|
74
|
-
|
|
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
|
-
|
|
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
|
-
|
|
82
|
+
interface PrimeExpression {
|
|
96
83
|
kind: "Prime";
|
|
97
84
|
expression: Expression;
|
|
98
85
|
location: SourceLocation;
|
|
99
86
|
}
|
|
100
87
|
|
|
101
|
-
|
|
88
|
+
interface UnchangedExpression {
|
|
102
89
|
kind: "Unchanged";
|
|
103
90
|
expression: Expression;
|
|
104
91
|
location: SourceLocation;
|
|
105
92
|
}
|
|
106
93
|
|
|
107
|
-
|
|
94
|
+
interface EnabledExpression {
|
|
108
95
|
kind: "Enabled";
|
|
109
96
|
expression: Expression;
|
|
110
97
|
location: SourceLocation;
|
|
111
98
|
}
|
|
112
99
|
|
|
113
|
-
|
|
100
|
+
interface IfExpression {
|
|
114
101
|
kind: "If";
|
|
115
102
|
condition: Expression;
|
|
116
103
|
consequent: Expression;
|
|
@@ -123,14 +110,15 @@ export interface CaseArm {
|
|
|
123
110
|
body: Expression;
|
|
124
111
|
}
|
|
125
112
|
|
|
126
|
-
|
|
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
|
|
|
133
|
-
|
|
121
|
+
interface LetExpression {
|
|
134
122
|
kind: "Let";
|
|
135
123
|
definitions: Definition[];
|
|
136
124
|
instances?: Instance[];
|
|
@@ -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
|
-
|
|
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
|
-
|
|
155
|
+
interface ChooseExpression {
|
|
169
156
|
kind: "Choose";
|
|
170
157
|
pattern: BoundPattern;
|
|
171
158
|
set: Expression | undefined;
|
|
@@ -173,33 +160,33 @@ export interface ChooseExpression {
|
|
|
173
160
|
location: SourceLocation;
|
|
174
161
|
}
|
|
175
162
|
|
|
176
|
-
|
|
163
|
+
interface SetEnumerationExpression {
|
|
177
164
|
kind: "SetEnumeration";
|
|
178
165
|
elements: Expression[];
|
|
179
166
|
location: SourceLocation;
|
|
180
167
|
}
|
|
181
168
|
|
|
182
|
-
|
|
169
|
+
interface SetFilterExpression {
|
|
183
170
|
kind: "SetFilter";
|
|
184
171
|
bound: Bound;
|
|
185
172
|
predicate: Expression;
|
|
186
173
|
location: SourceLocation;
|
|
187
174
|
}
|
|
188
175
|
|
|
189
|
-
|
|
176
|
+
interface SetMapExpression {
|
|
190
177
|
kind: "SetMap";
|
|
191
178
|
expression: Expression;
|
|
192
179
|
bounds: Bound[];
|
|
193
180
|
location: SourceLocation;
|
|
194
181
|
}
|
|
195
182
|
|
|
196
|
-
|
|
183
|
+
interface TupleExpression {
|
|
197
184
|
kind: "Tuple";
|
|
198
185
|
elements: Expression[];
|
|
199
186
|
location: SourceLocation;
|
|
200
187
|
}
|
|
201
188
|
|
|
202
|
-
|
|
189
|
+
interface FunctionConstructionExpression {
|
|
203
190
|
kind: "FunctionConstruction";
|
|
204
191
|
bounds: Bound[];
|
|
205
192
|
body: Expression;
|
|
@@ -207,7 +194,7 @@ export interface FunctionConstructionExpression {
|
|
|
207
194
|
isRecursive?: boolean;
|
|
208
195
|
}
|
|
209
196
|
|
|
210
|
-
|
|
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
|
-
|
|
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
|
-
|
|
225
|
+
interface ExceptExpression {
|
|
239
226
|
kind: "Except";
|
|
240
227
|
function: Expression;
|
|
241
228
|
updates: ExceptUpdate[];
|
|
242
229
|
location: SourceLocation;
|
|
243
230
|
}
|
|
244
231
|
|
|
245
|
-
|
|
232
|
+
interface ExceptAtExpression {
|
|
246
233
|
kind: "ExceptAt";
|
|
247
234
|
location: SourceLocation;
|
|
248
235
|
}
|
|
249
236
|
|
|
250
|
-
|
|
237
|
+
interface FunctionApplicationExpression {
|
|
251
238
|
kind: "FunctionApplication";
|
|
252
239
|
function: Expression;
|
|
253
240
|
args: Expression[];
|
|
254
241
|
location: SourceLocation;
|
|
255
242
|
}
|
|
256
243
|
|
|
257
|
-
|
|
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
|
-
|
|
250
|
+
interface FieldAccessExpression {
|
|
266
251
|
kind: "FieldAccess";
|
|
267
252
|
record: Expression;
|
|
268
253
|
field: string;
|
|
269
254
|
location: SourceLocation;
|
|
270
255
|
}
|
|
271
256
|
|
|
272
|
-
|
|
257
|
+
interface ProductExpression {
|
|
273
258
|
kind: "Product";
|
|
274
259
|
factors: Expression[];
|
|
275
260
|
location: SourceLocation;
|
|
276
261
|
}
|
|
277
262
|
|
|
278
|
-
|
|
263
|
+
interface TemporalExpression {
|
|
279
264
|
kind: "Always" | "Eventually";
|
|
280
265
|
expression: Expression;
|
|
281
266
|
location: SourceLocation;
|
|
282
267
|
}
|
|
283
268
|
|
|
284
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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";
|