tla-ts 0.0.9-dev.8298a52 → 0.0.10-dev.06b481ee0
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 +8 -0
- 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 +121 -12
- package/dist/index.d.ts +121 -12
- 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 +2746 -410
- package/dist/prove.js +2745 -409
- package/dist/run.cjs +144 -31
- package/dist/run.js +144 -31
- package/dist/tlapm.cjs +2 -2
- package/dist/tlapm.js +2 -2
- package/dist/transfer.cjs +134 -104
- package/dist/transfer.js +134 -104
- package/dist/worker.cjs +7 -7
- package/dist/worker.js +7 -7
- package/package.json +1 -1
- package/src/ast.ts +56 -60
- package/src/bags.ts +128 -110
- package/src/builtins.ts +31 -77
- package/src/bundled-modules.ts +1 -8
- package/src/check-failure.ts +118 -0
- package/src/check-trace.ts +320 -0
- package/src/check.ts +1155 -900
- package/src/cli/options.ts +12 -32
- package/src/cli/run.ts +0 -2
- package/src/cli/runtime-invariants.ts +100 -0
- package/src/cli/shared.ts +19 -12
- package/src/cli/tlapm.ts +433 -82
- package/src/cli/tlc-arguments.ts +652 -0
- package/src/cli/tlc-output.ts +701 -0
- package/src/cli/tlc-usage.ts +360 -0
- package/src/cli/tlc.ts +318 -656
- package/src/cli/typescript.ts +0 -3
- package/src/cli/xml-exporter.ts +27 -49
- package/src/cli.ts +0 -1
- package/src/codegen.ts +217 -82
- package/src/config.ts +140 -109
- package/src/coverage.ts +1019 -0
- package/src/dependencies.ts +101 -66
- package/src/dfid.ts +683 -0
- package/src/environment-config.ts +315 -0
- package/src/environment.ts +260 -371
- package/src/errors.ts +93 -58
- package/src/evaluate.ts +848 -374
- package/src/exit-codes.ts +63 -13
- package/src/fingerprints.ts +75 -11
- package/src/index.ts +3 -0
- package/src/instances.ts +97 -43
- package/src/java-hash.ts +21 -0
- package/src/java-overrides.ts +6 -21
- package/src/json-reader.ts +455 -0
- package/src/json.ts +252 -139
- package/src/levels.ts +231 -154
- package/src/lexer.ts +83 -101
- package/src/liveness-checker.ts +743 -325
- package/src/liveness.ts +224 -131
- package/src/obligations/action.ts +17 -44
- package/src/obligations/anonymize.ts +120 -95
- package/src/obligations/enabled-axioms.ts +218 -0
- package/src/obligations/equality.ts +1 -3
- package/src/obligations/expression.ts +37 -26
- package/src/obligations/format.ts +0 -10
- package/src/obligations/generate.ts +66 -64
- package/src/obligations/index.ts +39 -20
- package/src/obligations/levels.ts +27 -18
- package/src/obligations/module.ts +28 -55
- package/src/obligations/normalize.ts +31 -41
- package/src/obligations/operators.ts +0 -3
- package/src/obligations/pragma.ts +52 -24
- package/src/obligations/printer.ts +94 -63
- package/src/obligations/proof.ts +3 -6
- package/src/obligations/regroup.ts +0 -5
- package/src/obligations/simplify.ts +57 -63
- package/src/obligations/source.ts +121 -95
- package/src/obligations/subexpression.ts +49 -28
- package/src/obligations/substitution.ts +1 -5
- package/src/obligations/temporal.ts +12 -20
- package/src/obligations/tuples.ts +2 -10
- package/src/parallel-worker.ts +34 -57
- package/src/parallel.ts +62 -72
- package/src/parser.ts +1184 -531
- 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 +12 -13
- package/src/prover/first-order.ts +0 -11
- package/src/prover/isabelle/decide.ts +3 -31
- package/src/prover/isabelle/encode.ts +82 -64
- 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 +262 -117
- package/src/prover/isabelle/isar/method.ts +510 -226
- package/src/prover/isabelle/isar/proof.ts +570 -23
- package/src/prover/isabelle/isar/rule-cases.ts +226 -0
- package/src/prover/isabelle/isar/theory.ts +488 -88
- package/src/prover/isabelle/isar/toplevel.ts +331 -0
- package/src/prover/isabelle/isar/type-check.ts +99 -38
- package/src/prover/isabelle/provers/blast/blast.ts +16 -105
- package/src/prover/isabelle/provers/blast/branch.ts +0 -33
- package/src/prover/isabelle/provers/blast/prove.ts +0 -36
- package/src/prover/isabelle/provers/blast/rules.ts +5 -45
- package/src/prover/isabelle/provers/blast/state.ts +1 -29
- package/src/prover/isabelle/provers/blast/term.ts +8 -37
- package/src/prover/isabelle/provers/clasimp.ts +1 -15
- package/src/prover/isabelle/provers/classical.ts +58 -61
- package/src/prover/isabelle/provers/hypsubst.ts +29 -54
- package/src/prover/isabelle/pure/bicompose.ts +24 -39
- package/src/prover/isabelle/pure/consts.ts +0 -8
- package/src/prover/isabelle/pure/conv.ts +2 -18
- package/src/prover/isabelle/pure/drule.ts +95 -45
- package/src/prover/isabelle/pure/envir.ts +2 -53
- package/src/prover/isabelle/pure/goal.ts +1 -9
- 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 +1 -16
- package/src/prover/isabelle/pure/name.ts +1 -10
- package/src/prover/isabelle/pure/net.ts +2 -60
- package/src/prover/isabelle/pure/object-logic.ts +15 -16
- package/src/prover/isabelle/pure/pattern.ts +1 -20
- package/src/prover/isabelle/pure/raw-simplifier.ts +16 -63
- package/src/prover/isabelle/pure/rewriter.ts +34 -77
- package/src/prover/isabelle/pure/search.ts +2 -11
- package/src/prover/isabelle/pure/seq.ts +0 -11
- package/src/prover/isabelle/pure/simplifier.ts +27 -16
- package/src/prover/isabelle/pure/table.ts +2 -33
- package/src/prover/isabelle/pure/tactic.ts +11 -23
- package/src/prover/isabelle/pure/tactical.ts +47 -48
- package/src/prover/isabelle/pure/term-ord.ts +1 -7
- package/src/prover/isabelle/pure/term.ts +4 -47
- package/src/prover/isabelle/pure/thm.ts +26 -48
- package/src/prover/isabelle/pure/type.ts +1 -16
- package/src/prover/isabelle/pure/unify.ts +19 -31
- package/src/prover/isabelle/pure/variable.ts +2 -8
- package/src/prover/isabelle/tla/classical-setup.ts +17 -25
- package/src/prover/isabelle/tla/context.ts +65 -26
- package/src/prover/isabelle/tla/logic-data.ts +1 -1
- package/src/prover/isabelle/tla/logic.ts +53 -32
- package/src/prover/isabelle/tla/simpdata.ts +45 -44
- package/src/prover/isabelle/tools/intuitionistic.ts +28 -21
- package/src/prover/ocaml.ts +4 -7
- package/src/prover/prep/action.ts +33 -66
- package/src/prover/prep/enabled-axioms.ts +22 -20
- package/src/prover/prep/fingerprint.ts +2 -21
- package/src/prover/prep/level-comparison.ts +8 -12
- package/src/prover/prep/md5.ts +26 -31
- package/src/prover/prep/methods.ts +189 -86
- package/src/prover/prep/normalize.ts +42 -37
- package/src/prover/prove-worker.ts +0 -2
- package/src/prover/prove.ts +398 -133
- package/src/prover/ptl/decide.ts +96 -56
- package/src/prover/ptl/encode.ts +15 -38
- package/src/prover/ptl/sat.ts +24 -32
- package/src/prover/ptl/tableau.ts +40 -28
- package/src/prover/smt/arithmetic.ts +310 -0
- package/src/prover/smt/axioms.ts +12 -15
- package/src/prover/smt/context.ts +60 -32
- package/src/prover/smt/data.ts +517 -401
- package/src/prover/smt/encode.ts +155 -85
- package/src/prover/smt/extensionality.ts +5 -13
- package/src/prover/smt/flatten.ts +7 -28
- package/src/prover/smt/format.ts +33 -14
- package/src/prover/smt/instances.ts +7 -11
- package/src/prover/smt/layout.ts +91 -0
- package/src/prover/smt/rewrite.ts +1021 -658
- 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 -16
- 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 +626 -56
- 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 +319 -0
- package/src/prover/smt/solver/array.ts +1 -3
- package/src/prover/smt/solver/asserted-formulas.ts +241 -99
- package/src/prover/smt/solver/ast-lt.ts +165 -21
- package/src/prover/smt/solver/ast-util.ts +160 -7
- package/src/prover/smt/solver/ast.ts +1480 -184
- package/src/prover/smt/solver/auf-solver.ts +30 -56
- package/src/prover/smt/solver/bit-blast-tactic.ts +608 -0
- package/src/prover/smt/solver/bit-blaster.ts +871 -0
- package/src/prover/smt/solver/blast-term-ite.ts +47 -0
- package/src/prover/smt/solver/bound-manager.ts +196 -0
- package/src/prover/smt/solver/bound-simplifier.ts +598 -0
- package/src/prover/smt/solver/bv-bound-chk.ts +492 -0
- package/src/prover/smt/solver/bv-decl-plugin.ts +341 -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 +127 -0
- package/src/prover/smt/solver/case-split-queue.ts +0 -10
- package/src/prover/smt/solver/cg-table.ts +39 -42
- package/src/prover/smt/solver/check-logic.ts +330 -0
- package/src/prover/smt/solver/clause.ts +0 -27
- package/src/prover/smt/solver/cofactor-elim-term-ite.ts +293 -0
- package/src/prover/smt/solver/conflict-resolution.ts +78 -11
- package/src/prover/smt/solver/context.ts +600 -187
- package/src/prover/smt/solver/ctx-simplify.ts +34 -52
- package/src/prover/smt/solver/ctx-solver-simplify.ts +122 -0
- package/src/prover/smt/solver/datatype-decl-plugin.ts +580 -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 +93 -0
- package/src/prover/smt/solver/der.ts +39 -30
- package/src/prover/smt/solver/diff-neq.ts +205 -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 +296 -0
- package/src/prover/smt/solver/dyn-ack.ts +0 -11
- package/src/prover/smt/solver/e-matching.ts +9 -41
- package/src/prover/smt/solver/elim-bounds.ts +89 -0
- package/src/prover/smt/solver/elim-small-bv-tactic.ts +129 -0
- package/src/prover/smt/solver/elim-term-ite-tactic.ts +48 -0
- package/src/prover/smt/solver/elim-uncnstr.ts +542 -0
- package/src/prover/smt/solver/enode.ts +100 -23
- 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 +901 -0
- package/src/prover/smt/solver/euf/euf-solver.ts +1204 -0
- package/src/prover/smt/solver/euf/fpa-solver.ts +317 -0
- package/src/prover/smt/solver/euf/mam.ts +1046 -0
- package/src/prover/smt/solver/euf/q-ematch.ts +829 -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 +328 -0
- package/src/prover/smt/solver/euf/th-solvers.ts +30 -0
- package/src/prover/smt/solver/expr-ref.ts +0 -5
- package/src/prover/smt/solver/expr-safe-replace.ts +26 -7
- package/src/prover/smt/solver/expr2polynomial.ts +271 -0
- package/src/prover/smt/solver/factor.ts +163 -0
- package/src/prover/smt/solver/fd-solver.ts +734 -0
- package/src/prover/smt/solver/fingerprints.ts +15 -26
- package/src/prover/smt/solver/fix-dl-var.ts +147 -0
- package/src/prover/smt/solver/flat-literals.ts +0 -9
- 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 +639 -0
- package/src/prover/smt/solver/fpa2bv-converter.ts +2251 -0
- package/src/prover/smt/solver/fpa2bv-rewriter.ts +349 -0
- package/src/prover/smt/solver/fpa2bv-tactic.ts +73 -0
- package/src/prover/smt/solver/goal.ts +179 -28
- package/src/prover/smt/solver/goal2nlsat.ts +216 -0
- package/src/prover/smt/solver/guard-set.ts +219 -0
- package/src/prover/smt/solver/hash.ts +0 -9
- package/src/prover/smt/solver/hashtable.ts +30 -23
- 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 +113 -133
- package/src/prover/smt/solver/lackr.ts +381 -0
- package/src/prover/smt/solver/lbool.ts +0 -2
- 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 -4
- package/src/prover/smt/solver/logic-tactics.ts +355 -0
- package/src/prover/smt/solver/lp/bound-propagator.ts +7 -26
- package/src/prover/smt/solver/lp/constraints.ts +1 -8
- package/src/prover/smt/solver/lp/containers.ts +18 -31
- package/src/prover/smt/solver/lp/core-solver.ts +35 -37
- package/src/prover/smt/solver/lp/cross-nested.ts +4 -21
- package/src/prover/smt/solver/lp/dep-intervals.ts +6 -24
- package/src/prover/smt/solver/lp/dependency.ts +0 -5
- package/src/prover/smt/solver/lp/dioph-eq.ts +8 -103
- package/src/prover/smt/solver/lp/explanation.ts +0 -6
- package/src/prover/smt/solver/lp/gomory.ts +8 -22
- package/src/prover/smt/solver/lp/hnf-cutter.ts +16 -23
- package/src/prover/smt/solver/lp/hnf.ts +10 -28
- package/src/prover/smt/solver/lp/int-cube.ts +17 -39
- package/src/prover/smt/solver/lp/int-solver.ts +3 -35
- package/src/prover/smt/solver/lp/lar-solver.ts +70 -83
- package/src/prover/smt/solver/lp/lar-term.ts +0 -5
- package/src/prover/smt/solver/lp/lp-settings.ts +6 -16
- package/src/prover/smt/solver/lp/maximize-term.ts +76 -52
- package/src/prover/smt/solver/lp/nex-creator.ts +7 -30
- package/src/prover/smt/solver/lp/nex.ts +2 -7
- package/src/prover/smt/solver/lp/nla-backoff.ts +0 -5
- package/src/prover/smt/solver/lp/nla-basics.ts +48 -30
- package/src/prover/smt/solver/lp/nla-core.ts +92 -136
- package/src/prover/smt/solver/lp/nla-divisions.ts +31 -43
- package/src/prover/smt/solver/lp/nla-emonics.ts +3 -21
- package/src/prover/smt/solver/lp/nla-factorization.ts +0 -4
- package/src/prover/smt/solver/lp/nla-grobner.ts +177 -149
- package/src/prover/smt/solver/lp/nla-horner.ts +2 -12
- package/src/prover/smt/solver/lp/nla-intervals.ts +1 -12
- package/src/prover/smt/solver/lp/nla-monomial-bounds.ts +15 -42
- package/src/prover/smt/solver/lp/nla-monotone.ts +1 -6
- package/src/prover/smt/solver/lp/nla-order.ts +0 -13
- package/src/prover/smt/solver/lp/nla-patcher.ts +3 -7
- package/src/prover/smt/solver/lp/nla-powers.ts +220 -0
- package/src/prover/smt/solver/lp/nla-tangents.ts +0 -10
- package/src/prover/smt/solver/lp/nla-throttle.ts +0 -6
- package/src/prover/smt/solver/lp/nla-transcendentals.ts +324 -0
- package/src/prover/smt/solver/lp/nla-types.ts +0 -12
- package/src/prover/smt/solver/lp/nla-var-eqs.ts +4 -26
- package/src/prover/smt/solver/lp/nra-solver.ts +164 -147
- package/src/prover/smt/solver/lp/numeric-pair.ts +0 -4
- package/src/prover/smt/solver/lp/pdd-interval.ts +6 -5
- package/src/prover/smt/solver/lp/pdd-simplifier.ts +61 -34
- package/src/prover/smt/solver/lp/pdd-solver.ts +74 -72
- package/src/prover/smt/solver/lp/pdd.ts +730 -358
- package/src/prover/smt/solver/lp/random-updater.ts +0 -9
- package/src/prover/smt/solver/lp/static-matrix.ts +8 -19
- package/src/prover/smt/solver/lp/union-find.ts +5 -5
- package/src/prover/smt/solver/macro-finder.ts +530 -0
- package/src/prover/smt/solver/mam-compiler.ts +129 -139
- package/src/prover/smt/solver/mam-interpreter.ts +0 -21
- 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 +310 -0
- package/src/prover/smt/solver/maximize-ac-sharing.ts +8 -21
- package/src/prover/smt/solver/maxlex.ts +115 -0
- package/src/prover/smt/solver/maxsmt-base.ts +106 -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 +20 -63
- package/src/prover/smt/solver/model-evaluator.ts +192 -40
- package/src/prover/smt/solver/model-finder.ts +14 -32
- package/src/prover/smt/solver/model-generator.ts +104 -46
- package/src/prover/smt/solver/model-macro-solver.ts +60 -114
- package/src/prover/smt/solver/model-printer.ts +214 -0
- package/src/prover/smt/solver/mpf.ts +709 -0
- package/src/prover/smt/solver/mus.ts +50 -0
- package/src/prover/smt/solver/muz/dl-context.ts +382 -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 +495 -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 +214 -0
- package/src/prover/smt/solver/muz/rule-properties.ts +359 -0
- package/src/prover/smt/solver/muz/spacer-context.ts +1404 -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 +219 -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 +357 -236
- package/src/prover/smt/solver/nlsat/atoms.ts +73 -54
- package/src/prover/smt/solver/nlsat/evaluator.ts +16 -22
- package/src/prover/smt/solver/nlsat/explain.ts +429 -275
- package/src/prover/smt/solver/nlsat/interval-set.ts +9 -51
- package/src/prover/smt/solver/nlsat/levelwise.ts +477 -344
- package/src/prover/smt/solver/nlsat/mpbq.ts +47 -14
- package/src/prover/smt/solver/nlsat/polynomial.ts +2385 -832
- package/src/prover/smt/solver/nlsat/solver.ts +297 -156
- package/src/prover/smt/solver/nlsat/transcendental-eval.ts +310 -0
- package/src/prover/smt/solver/nlsat/transcendentals.ts +391 -0
- package/src/prover/smt/solver/nlsat/types.ts +0 -9
- package/src/prover/smt/solver/nlsat/upolynomial-factorization.ts +9 -51
- package/src/prover/smt/solver/nlsat/upolynomial.ts +49 -109
- package/src/prover/smt/solver/nlsat-tactic.ts +82 -0
- package/src/prover/smt/solver/nnf.ts +112 -61
- 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 +801 -0
- package/src/prover/smt/solver/opt-nlsat.ts +386 -0
- package/src/prover/smt/solver/opt-pareto.ts +301 -0
- package/src/prover/smt/solver/opt-preprocess.ts +101 -0
- package/src/prover/smt/solver/opt-solver.ts +312 -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 +21 -26
- package/src/prover/smt/solver/pb-rewriter.ts +281 -0
- package/src/prover/smt/solver/pb2bv-tactic.ts +540 -0
- package/src/prover/smt/solver/poly-rewriter.ts +261 -79
- package/src/prover/smt/solver/probes.ts +577 -0
- package/src/prover/smt/solver/propagate-values.ts +37 -30
- package/src/prover/smt/solver/proto-model.ts +650 -66
- package/src/prover/smt/solver/pull-quant.ts +28 -23
- package/src/prover/smt/solver/purify-arith.ts +632 -0
- package/src/prover/smt/solver/push-app-ite.ts +37 -0
- package/src/prover/smt/solver/qe-arith-plugin.ts +1096 -0
- package/src/prover/smt/solver/qe-lite-der.ts +2 -31
- package/src/prover/smt/solver/qe-lite-fm.ts +4 -28
- package/src/prover/smt/solver/qe-lite.ts +41 -51
- package/src/prover/smt/solver/qe-mbp.ts +270 -0
- package/src/prover/smt/solver/qe.ts +1499 -0
- package/src/prover/smt/solver/qel.ts +25 -0
- package/src/prover/smt/solver/qi-queue.ts +0 -16
- package/src/prover/smt/solver/qsat.ts +829 -0
- package/src/prover/smt/solver/quant-hoist.ts +196 -0
- package/src/prover/smt/solver/quant-tactics.ts +17 -74
- package/src/prover/smt/solver/quantifier-analyzer.ts +26 -47
- package/src/prover/smt/solver/quantifier-manager.ts +22 -32
- package/src/prover/smt/solver/quasi-macros.ts +243 -0
- package/src/prover/smt/solver/random-gen.ts +0 -2
- package/src/prover/smt/solver/rational.ts +45 -8
- package/src/prover/smt/solver/recfun-decl-plugin.ts +262 -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 -6
- package/src/prover/smt/solver/relevancy.ts +2 -16
- package/src/prover/smt/solver/rewriter-tpl.ts +59 -135
- package/src/prover/smt/solver/rewriter.ts +507 -144
- package/src/prover/smt/solver/rlimit.ts +46 -24
- 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 +579 -0
- package/src/prover/smt/solver/sat/inc-sat-solver.ts +464 -0
- package/src/prover/smt/solver/sat/model-converter.ts +136 -0
- package/src/prover/smt/solver/sat/pb-constraint.ts +268 -0
- package/src/prover/smt/solver/sat/pb-solver.ts +1596 -0
- package/src/prover/smt/solver/sat/probing.ts +170 -0
- package/src/prover/smt/solver/sat/sat-tactic.ts +53 -0
- package/src/prover/smt/solver/sat/sat2goal.ts +189 -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 +2107 -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 +995 -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 +730 -0
- package/src/prover/smt/solver/seq-range-predicate.ts +235 -0
- package/src/prover/smt/solver/seq-re-rewriter.ts +1171 -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 +2404 -0
- package/src/prover/smt/solver/seq-skolem.ts +294 -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 +124 -0
- package/src/prover/smt/solver/smt-logics.ts +66 -0
- package/src/prover/smt/solver/smt-setup.ts +589 -0
- package/src/prover/smt/solver/smt2-printer.ts +765 -0
- package/src/prover/smt/solver/smtlib-parser.ts +3546 -406
- package/src/prover/smt/solver/smtlib-script.ts +2134 -0
- package/src/prover/smt/solver/solve-eqs.ts +928 -0
- package/src/prover/smt/solver/solver.ts +129 -38
- package/src/prover/smt/solver/sort.ts +1 -5
- package/src/prover/smt/solver/static-features.ts +314 -0
- package/src/prover/smt/solver/sticky-generations.ts +0 -6
- package/src/prover/smt/solver/tactic.ts +2141 -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 +1210 -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 +55 -25
- package/src/prover/smt/solver/theory-lra-bounds.ts +31 -11
- package/src/prover/smt/solver/theory-lra-final-check.ts +60 -91
- package/src/prover/smt/solver/theory-lra-internalize.ts +96 -53
- package/src/prover/smt/solver/theory-lra-model.ts +23 -53
- package/src/prover/smt/solver/theory-lra-propagate.ts +34 -42
- package/src/prover/smt/solver/theory-lra-state.ts +7 -28
- package/src/prover/smt/solver/theory-lra.ts +189 -9
- package/src/prover/smt/solver/theory-pb.ts +951 -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 +852 -0
- package/src/prover/smt/solver/theory-seq.ts +961 -0
- package/src/prover/smt/solver/theory-without-terms.ts +24 -0
- package/src/prover/smt/solver/theory.ts +189 -0
- package/src/prover/smt/solver/tseitin-cnf.ts +486 -0
- package/src/prover/smt/solver/var-subst.ts +37 -39
- package/src/prover/smt/table.ts +3 -10
- package/src/prover/smt/types.ts +146 -0
- package/src/prover/tlapm/cache.ts +74 -48
- package/src/prover/tlapm/ocaml-marshal.ts +19 -21
- package/src/prover/tlapm/tlapm.ts +21 -20
- package/src/prover/tlapm-library.ts +3208 -0
- package/src/prover/verdict.ts +9 -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 +10 -19
- package/src/prover/zenon/encode.ts +0 -9
- package/src/prover/zenon/eqrel.ts +2 -15
- package/src/prover/zenon/equality-rules.ts +24 -6
- package/src/prover/zenon/expr.ts +29 -28
- package/src/prover/zenon/index-table.ts +33 -61
- package/src/prover/zenon/isar-case.ts +9 -21
- package/src/prover/zenon/isar.ts +37 -67
- package/src/prover/zenon/limits.ts +0 -4
- package/src/prover/zenon/llproof.ts +2 -22
- package/src/prover/zenon/mltoll.ts +66 -106
- package/src/prover/zenon/node.ts +20 -15
- package/src/prover/zenon/ocaml.ts +1 -17
- package/src/prover/zenon/parse.ts +9 -13
- package/src/prover/zenon/phrase.ts +2 -14
- package/src/prover/zenon/proof.ts +0 -11
- package/src/prover/zenon/propositional-rules.ts +0 -7
- package/src/prover/zenon/rules.ts +3 -8
- package/src/prover/zenon/search.ts +11 -35
- package/src/prover/zenon/tla/functions.ts +59 -33
- package/src/prover/zenon/tla/llproof.ts +67 -78
- package/src/prover/zenon/tla/records.ts +57 -35
- package/src/prover/zenon/tla/rewrites.ts +12 -21
- package/src/prover/zenon/tla/sets.ts +88 -59
- package/src/prover/zenon/tla/terms.ts +0 -8
- package/src/prover/zenon/tla/tla.ts +66 -66
- package/src/randomization.ts +81 -35
- package/src/resolve.ts +1132 -430
- package/src/runtime.ts +33 -23
- package/src/sany/builtins.ts +11 -14
- package/src/sany/generation.ts +383 -0
- package/src/sany/generator-def-entries.ts +210 -0
- package/src/sany/generator-definitions.ts +688 -0
- package/src/sany/generator-expressions.ts +1108 -0
- package/src/sany/generator-proofs.ts +665 -0
- package/src/sany/generator.ts +192 -2764
- package/src/sany/levels.ts +5 -35
- package/src/sany/lexer.ts +61 -80
- package/src/sany/linter.ts +0 -10
- package/src/sany/modules.ts +5 -7
- package/src/sany/nodes.ts +6 -44
- package/src/sany/parse-error.ts +39 -117
- package/src/sany/report.ts +32 -69
- package/src/sany/selectors.ts +60 -82
- package/src/sany/source.ts +1 -17
- package/src/sany/xml.ts +37 -120
- package/src/search.ts +913 -227
- package/src/simulate.ts +765 -0
- package/src/spec-description.ts +198 -104
- package/src/standard-definitions.ts +4 -4
- package/src/standard-modules.ts +302 -99
- package/src/state-graph.ts +52 -33
- package/src/subexpressions.ts +578 -166
- package/src/substitution-levels.ts +7 -7
- package/src/successors.ts +296 -105
- package/src/symmetry.ts +37 -28
- package/src/tableau.ts +29 -26
- package/src/tlc/fingerprint.ts +267 -79
- package/src/tlc/jar-data.ts +122 -6
- package/src/tlc/messages.ts +127 -56
- package/src/tlc/order.ts +53 -72
- package/src/tlc/random.ts +38 -49
- package/src/tlc/replay.ts +579 -230
- package/src/tlc/summary.ts +64 -60
- package/src/tlc/tlc-operators.ts +83 -47
- package/src/tlc/tlcext-operators.ts +205 -127
- package/src/tlc/trace-spec.ts +235 -0
- package/src/tlc/value-stream.ts +139 -0
- package/src/tlc/version.ts +1 -4
- package/src/trace-liveness.ts +529 -0
- package/src/transfer.ts +22 -25
- package/src/typed-tier.ts +6556 -0
- package/src/typescript/actions.ts +10 -25
- package/src/typescript/collections.ts +34 -35
- package/src/typescript/compile.ts +1 -8
- package/src/typescript/context.ts +0 -12
- package/src/typescript/emit.ts +0 -1
- package/src/typescript/expressions.ts +0 -12
- package/src/typescript/formula.ts +9 -15
- package/src/typescript/functions.ts +6 -17
- package/src/typescript/model.ts +14 -16
- package/src/typescript/names.ts +0 -2
- package/src/typescript/program.ts +0 -3
- package/src/typescript/properties.ts +6 -8
- package/src/typescript/scope.ts +0 -5
- package/src/typescript/steps.ts +20 -28
- package/src/typescript/types.ts +3 -10
- package/src/values.ts +917 -522
- package/src/worker.ts +7 -8
- package/src/prover/isabelle/isar/statement.ts +0 -57
- 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/index.cjs
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
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
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./worker.cjs"),t=require("./transfer.cjs"),n=require("./prove.cjs");exports.TlaConfigError=e.
|
|
9
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./worker.cjs"),t=require("./transfer.cjs"),n=require("./prove.cjs");exports.TlaConfigError=e.v,exports.TlaError=e.b,exports.TlaEvaluationError=e.x,exports.TlaSyntaxError=e.I,exports.TlaUnsupportedError=e.V,exports.check=n.S,exports.formatValue=t.qt,exports.parseConfig=t.wn,exports.parseModule=t.bt,exports.prove=n.o;
|
package/dist/index.d.cts
CHANGED
|
@@ -107,12 +107,14 @@ interface CaseExpression {
|
|
|
107
107
|
kind: "Case";
|
|
108
108
|
arms: CaseArm[];
|
|
109
109
|
other: Expression | undefined;
|
|
110
|
+
otherRange?: SourceRange;
|
|
110
111
|
location: SourceLocation;
|
|
111
112
|
}
|
|
112
113
|
interface LetExpression {
|
|
113
114
|
kind: "Let";
|
|
114
115
|
definitions: Definition[];
|
|
115
116
|
instances?: Instance[];
|
|
117
|
+
recursive?: Declaration[];
|
|
116
118
|
body: Expression;
|
|
117
119
|
location: SourceLocation;
|
|
118
120
|
}
|
|
@@ -262,6 +264,7 @@ interface LabelExpression {
|
|
|
262
264
|
name: string;
|
|
263
265
|
params: string[];
|
|
264
266
|
paramRanges?: SourceRange[];
|
|
267
|
+
head?: SourceRange;
|
|
265
268
|
body: Expression;
|
|
266
269
|
location: SourceLocation;
|
|
267
270
|
}
|
|
@@ -287,7 +290,12 @@ interface SubexpressionExpression {
|
|
|
287
290
|
argumentRanges?: (SourceRange | undefined)[];
|
|
288
291
|
location: SourceLocation;
|
|
289
292
|
}
|
|
290
|
-
|
|
293
|
+
interface SelectionExpression {
|
|
294
|
+
kind: "Selection";
|
|
295
|
+
expression: Expression;
|
|
296
|
+
location: SourceLocation;
|
|
297
|
+
}
|
|
298
|
+
type Expression = NumberExpression | DecimalExpression | StringExpression | IdentifierExpression | ApplyExpression | OperatorReferenceExpression | LambdaExpression | JunctionExpression | PrimeExpression | UnchangedExpression | EnabledExpression | IfExpression | CaseExpression | LetExpression | QuantifierExpression | UnboundedQuantifierExpression | ChooseExpression | SetEnumerationExpression | SetFilterExpression | SetMapExpression | TupleExpression | FunctionConstructionExpression | FunctionSetExpression | RecordExpression | ExceptExpression | ExceptAtExpression | FunctionApplicationExpression | BracketExpression | FieldAccessExpression | ProductExpression | TemporalExpression | ActionExpression | FairnessExpression | LabelExpression | SubexpressionExpression | SelectionExpression;
|
|
291
299
|
interface OperatorParam {
|
|
292
300
|
name: string;
|
|
293
301
|
arity: number;
|
|
@@ -299,6 +307,7 @@ interface OperatorDefinition {
|
|
|
299
307
|
params: OperatorParam[];
|
|
300
308
|
body: Expression;
|
|
301
309
|
bodyRange?: SourceRange;
|
|
310
|
+
head?: SourceRange;
|
|
302
311
|
isLocal: boolean;
|
|
303
312
|
isRecursive: boolean;
|
|
304
313
|
location: SourceLocation;
|
|
@@ -440,6 +449,7 @@ type ModuleUnit = {
|
|
|
440
449
|
} | {
|
|
441
450
|
kind: "Recursive";
|
|
442
451
|
declarations: Declaration[];
|
|
452
|
+
location: SourceLocation;
|
|
443
453
|
} | {
|
|
444
454
|
kind: "Definition";
|
|
445
455
|
definition: Definition;
|
|
@@ -512,6 +522,7 @@ interface ModelConfig {
|
|
|
512
522
|
actionConstraints: string[];
|
|
513
523
|
constants: ConstantAssignment[];
|
|
514
524
|
substitutions: Substitution[];
|
|
525
|
+
rawConstants: string[];
|
|
515
526
|
checkDeadlock: boolean;
|
|
516
527
|
symmetry: string | undefined;
|
|
517
528
|
view: string | undefined;
|
|
@@ -530,6 +541,14 @@ interface SyntaxFailure {
|
|
|
530
541
|
line: number;
|
|
531
542
|
column: number;
|
|
532
543
|
isEnd: boolean;
|
|
544
|
+
proof?: {
|
|
545
|
+
stop: {
|
|
546
|
+
line: number;
|
|
547
|
+
column: number;
|
|
548
|
+
};
|
|
549
|
+
exception: string;
|
|
550
|
+
printed: string;
|
|
551
|
+
};
|
|
533
552
|
}
|
|
534
553
|
interface SanyError {
|
|
535
554
|
location: string;
|
|
@@ -571,6 +590,8 @@ interface LazySet {
|
|
|
571
590
|
interface SetValue {
|
|
572
591
|
kind: "Set";
|
|
573
592
|
elements: Value[];
|
|
593
|
+
writtenElements: Value[] | undefined;
|
|
594
|
+
isNormalized: boolean;
|
|
574
595
|
hash: number;
|
|
575
596
|
fingerprint: number;
|
|
576
597
|
isFingerprinted: boolean;
|
|
@@ -587,6 +608,7 @@ interface FunctionValue {
|
|
|
587
608
|
fingerprint: number;
|
|
588
609
|
writtenKeys: Value[] | undefined;
|
|
589
610
|
functionClass: FunctionClass | undefined;
|
|
611
|
+
lambdaDomain: Value | undefined;
|
|
590
612
|
isFingerprinted: boolean;
|
|
591
613
|
}
|
|
592
614
|
interface IntervalValue {
|
|
@@ -633,7 +655,8 @@ interface FilteredSetSource {
|
|
|
633
655
|
interface FilteredSetValue extends LazySet {
|
|
634
656
|
kind: "FilteredSet";
|
|
635
657
|
base: Value;
|
|
636
|
-
test: (element: Value) => boolean;
|
|
658
|
+
test: (element: Value, isMember: boolean) => boolean;
|
|
659
|
+
startPass?: (isMaterialized: boolean) => (element: Value) => boolean;
|
|
637
660
|
source?: FilteredSetSource;
|
|
638
661
|
}
|
|
639
662
|
interface UnionValue extends LazySet {
|
|
@@ -652,6 +675,7 @@ interface LazyFunctionValue {
|
|
|
652
675
|
kind: "LazyFunction";
|
|
653
676
|
domain: Value;
|
|
654
677
|
apply: (argument: Value) => Value;
|
|
678
|
+
boundTupleLengths?: (number | undefined)[];
|
|
655
679
|
source?: LazyFunctionSource;
|
|
656
680
|
functionClass?: FunctionClass;
|
|
657
681
|
enumerated?: FunctionValue;
|
|
@@ -660,22 +684,47 @@ interface LazyFunctionValue {
|
|
|
660
684
|
type Value = boolean | number | string | ModelValue | SetValue | MixedSetValue | FunctionValue | IntervalValue | InfiniteSetValue | SubsetValue | FunctionSetValue | RecordSetValue | ProductSetValue | SequenceSetValue | SetOperationValue | FilteredSetValue | UnionValue | LazyFunctionValue;
|
|
661
685
|
type FunctionClass = "lambda" | "tuple" | "record";
|
|
662
686
|
export declare const formatValue: (value: Value, isStrict?: boolean, isNormalized?: boolean) => string;
|
|
663
|
-
interface FingerprintFailure {
|
|
664
|
-
sources: Expression[];
|
|
665
|
-
reason: string;
|
|
666
|
-
}
|
|
667
687
|
interface JavaOverride {
|
|
668
688
|
module: string;
|
|
669
689
|
operator: string;
|
|
670
690
|
signature: string;
|
|
671
691
|
isMatched: boolean;
|
|
672
692
|
}
|
|
693
|
+
interface FingerprintFailure {
|
|
694
|
+
sources: Expression[];
|
|
695
|
+
reason: string;
|
|
696
|
+
}
|
|
697
|
+
type CoverageKind = "init" | "next" | "invariant" | "constraint" | "implied";
|
|
698
|
+
interface CoverageReport {
|
|
699
|
+
variables: CoverageVariable[];
|
|
700
|
+
relations: CoverageRelationReport[];
|
|
701
|
+
}
|
|
702
|
+
interface CoverageVariable {
|
|
703
|
+
label: string;
|
|
704
|
+
distinct: number;
|
|
705
|
+
}
|
|
706
|
+
interface CoverageRelationReport {
|
|
707
|
+
kind: CoverageKind;
|
|
708
|
+
label: string;
|
|
709
|
+
distinct: number;
|
|
710
|
+
generated: number;
|
|
711
|
+
expressions: CoverageExpression[];
|
|
712
|
+
}
|
|
713
|
+
interface CoverageExpression {
|
|
714
|
+
location: string;
|
|
715
|
+
depth: number;
|
|
716
|
+
count: number;
|
|
717
|
+
cost: number;
|
|
718
|
+
}
|
|
673
719
|
interface StateDump {
|
|
674
720
|
path: string;
|
|
675
721
|
dot?: boolean;
|
|
676
722
|
colorize?: boolean;
|
|
677
723
|
actionLabels?: boolean;
|
|
678
724
|
snapshot?: boolean;
|
|
725
|
+
constrained?: boolean;
|
|
726
|
+
stuttering?: boolean;
|
|
727
|
+
strict?: boolean;
|
|
679
728
|
}
|
|
680
729
|
interface FailureMessage {
|
|
681
730
|
code: number;
|
|
@@ -690,19 +739,50 @@ interface CheckOptions {
|
|
|
690
739
|
onPrint?: (text: string) => void;
|
|
691
740
|
onPause?: () => void;
|
|
692
741
|
readFile?: (path: string) => string | undefined;
|
|
693
|
-
writeFile?: (path: string, content: string) => void;
|
|
742
|
+
writeFile?: (path: string, content: string | Uint8Array) => void;
|
|
743
|
+
makeDirectory?: (path: string) => void;
|
|
694
744
|
seed?: bigint;
|
|
695
745
|
workers?: number;
|
|
696
|
-
|
|
746
|
+
/** TLC's -lncheck: "final" checks liveness only on the complete graph, "off" never looks for a cycle. */
|
|
747
|
+
livenessCheck?: "default" | "final" | "off";
|
|
748
|
+
/** TLC's -fp: the index of the polynomial in TLC's FP64.Polys that fingerprints states. */
|
|
749
|
+
fingerprintPolynomial?: number;
|
|
750
|
+
/** False for TLC's -terse, which prints a lazy value, such as SUBSET S, without enumerating it. */
|
|
751
|
+
isLazyValueExpanded?: boolean;
|
|
752
|
+
/** TLC's -view: prints each state as the value of the configuration's VIEW. */
|
|
753
|
+
isViewPrinted?: boolean;
|
|
754
|
+
/** TLC's -maxSetSize: the most elements TLC enumerates into a set, or states into a list of them. */
|
|
755
|
+
maxSetSize?: number;
|
|
756
|
+
/** TLC's -dump: writes the reachable states, or with `dot` the state graph, through writeFile. */
|
|
697
757
|
dump?: StateDump;
|
|
758
|
+
/** TLC's -tool, which changes the messages of TLC's errors. */
|
|
698
759
|
isTool?: boolean;
|
|
760
|
+
/** TLC's -continue: reports each violation through onProgress and goes on. */
|
|
699
761
|
isContinued?: boolean;
|
|
700
|
-
|
|
762
|
+
/** Skips fingerprintDistance, which takes fingerprinting every state again after the search. */
|
|
763
|
+
isFingerprintDistanceSkipped?: boolean;
|
|
764
|
+
moduleOperators?: ModuleOperator[];
|
|
765
|
+
/** TLC's trace exploration spec, and the binary trace TLC records for it unless -noTEBin. */
|
|
766
|
+
traceSpec?: TraceSpecOptions;
|
|
767
|
+
/** Whether the caller printed SANY's report, its warnings included, before the check. */
|
|
701
768
|
isSanyReported?: boolean;
|
|
769
|
+
/** False for TLC's -nowarning, which changes how TLC computes some successors. */
|
|
702
770
|
isWarningEnabled?: boolean;
|
|
771
|
+
/** TLC's -coverage, in minutes. */
|
|
772
|
+
coverage?: number;
|
|
703
773
|
version?: TlcVersion;
|
|
704
774
|
onProgress?: (progress: CheckProgress) => void;
|
|
705
775
|
}
|
|
776
|
+
interface TraceSpecOptions {
|
|
777
|
+
module: string;
|
|
778
|
+
traceFile?: string;
|
|
779
|
+
}
|
|
780
|
+
interface ModuleOperator {
|
|
781
|
+
kind: "postcondition" | "constraint" | "view";
|
|
782
|
+
module: string;
|
|
783
|
+
operator: string;
|
|
784
|
+
constants?: Record<string, string>;
|
|
785
|
+
}
|
|
706
786
|
interface InitialStatesProgress {
|
|
707
787
|
kind: "initial-states-progress";
|
|
708
788
|
count: number;
|
|
@@ -740,7 +820,9 @@ type CheckProgress = {
|
|
|
740
820
|
} | {
|
|
741
821
|
kind: "liveness-started";
|
|
742
822
|
branches: number;
|
|
823
|
+
/** Whether TLC checks the complete state graph. */
|
|
743
824
|
isComplete: boolean;
|
|
825
|
+
/** How many states the graphs of all branches have together. */
|
|
744
826
|
states: number;
|
|
745
827
|
statistics: SearchStatistics;
|
|
746
828
|
} | {
|
|
@@ -759,25 +841,33 @@ type CheckProgress = {
|
|
|
759
841
|
} | ({
|
|
760
842
|
kind: "java-override";
|
|
761
843
|
} & JavaOverride);
|
|
762
|
-
interface SearchStatistics extends Pick<CheckResult, "generatedStates" | "distinctStates" | "queuedStates" | "depth"> {}
|
|
844
|
+
interface SearchStatistics extends Pick<CheckResult, "generatedStates" | "distinctStates" | "queuedStates" | "depth" | "coverage"> {}
|
|
763
845
|
type CheckStatus = "success" | "assumption-violation" | "invariant-violation" | "property-violation" | "liveness-violation" | "postcondition-violation" | "deadlock" | "error";
|
|
764
846
|
interface TraceStep {
|
|
765
847
|
action: string | undefined;
|
|
848
|
+
/** TLC's name, parameters and location for the action that took this step. */
|
|
766
849
|
label: string | undefined;
|
|
767
850
|
state: Record<string, Value>;
|
|
851
|
+
/** What the spec prints before this step as TLC rebuilds the trace, and before it for the first. */
|
|
768
852
|
output?: OutputLine[];
|
|
769
853
|
}
|
|
770
854
|
interface Violation {
|
|
771
855
|
name: string;
|
|
856
|
+
/** Every temporal property that a liveness counterexample violates, in the configuration's order. */
|
|
772
857
|
properties?: string[];
|
|
773
858
|
trace: TraceStep[];
|
|
859
|
+
/** What the spec prints after the trace, as TLC finds the lasso's step back or rebuilds the trace. */
|
|
774
860
|
traceOutput?: OutputLine[];
|
|
861
|
+
/** What the postconditions print, which TLC checks after the lasso's step back. */
|
|
862
|
+
postconditionOutput?: OutputLine[];
|
|
775
863
|
loopStart: number | undefined;
|
|
776
864
|
loopLabel?: string;
|
|
777
865
|
message?: string;
|
|
778
866
|
counts?: string;
|
|
779
867
|
unwitnessed?: Postcondition;
|
|
868
|
+
/** A POSTCONDITION that is false or fails, which TLC checks as it prints the counterexample. */
|
|
780
869
|
postcondition?: Postcondition;
|
|
870
|
+
/** What TLC warns about after a counterexample, with its code. */
|
|
781
871
|
warning?: {
|
|
782
872
|
code: number;
|
|
783
873
|
text: string;
|
|
@@ -789,6 +879,11 @@ interface Postcondition {
|
|
|
789
879
|
message: string;
|
|
790
880
|
counts?: string;
|
|
791
881
|
}
|
|
882
|
+
interface TraceFailure extends FailureMessage {
|
|
883
|
+
/** What the spec prints as TLC rebuilds the step it then fails to print. */
|
|
884
|
+
output: OutputLine[];
|
|
885
|
+
}
|
|
886
|
+
/** An evaluation that failed during the search, with the behavior up to the state TLC was working on. */
|
|
792
887
|
interface EvaluationFailure {
|
|
793
888
|
code: number;
|
|
794
889
|
message: string;
|
|
@@ -797,11 +892,17 @@ interface EvaluationFailure {
|
|
|
797
892
|
traceOutput?: OutputLine[];
|
|
798
893
|
initialState: Record<string, Value> | undefined;
|
|
799
894
|
exitCode: number;
|
|
895
|
+
/** The expressions TLC was evaluating, outermost first, when its replay finds them. */
|
|
800
896
|
callStack: Expression[] | undefined;
|
|
897
|
+
/** Whether TLC prints the call stack before the error, as it does for a failed liveness check. */
|
|
801
898
|
isCallStackFirst?: boolean;
|
|
899
|
+
/** The FingerprintException the replay raises, which TLC reports in place of the call stack. */
|
|
802
900
|
fingerprint?: FingerprintFailure;
|
|
803
|
-
|
|
901
|
+
/** How TLC reports failing again as it prints the trace, since it can't fingerprint the state. */
|
|
902
|
+
traceFailure?: TraceFailure;
|
|
903
|
+
/** A POSTCONDITION that is false or fails after the trace, which TLC checks as it prints one. */
|
|
804
904
|
postcondition?: Postcondition;
|
|
905
|
+
/** Whether TLC stops before it prints the statistics, as it does for an illegal initial state. */
|
|
805
906
|
isWithoutStatistics?: boolean;
|
|
806
907
|
}
|
|
807
908
|
interface InitialStates {
|
|
@@ -816,12 +917,20 @@ interface CheckResult {
|
|
|
816
917
|
distinctStates: number;
|
|
817
918
|
queuedStates: number;
|
|
818
919
|
depth: number;
|
|
920
|
+
/** Once TLC computed all the initial states without a violation or an error. */
|
|
819
921
|
initialStates: InitialStates | undefined;
|
|
922
|
+
/** How many expanded states found each number of new states, when TLC prints the outdegree. */
|
|
820
923
|
outDegrees: number[] | undefined;
|
|
924
|
+
/** The smallest distance between two fingerprints, when TLC estimates a collision from them. */
|
|
821
925
|
fingerprintDistance: bigint | undefined;
|
|
926
|
+
/** A temporal property TLC finds violated as it adds the state it stopped at to the behavior graph, reported after. */
|
|
822
927
|
additionalViolation?: Violation;
|
|
928
|
+
/** Where TLC's worker fails to add the state to the behavior graph after it reports a violation. */
|
|
823
929
|
liveCallStack?: Expression[];
|
|
930
|
+
/** The outdegrees when TLC's workers stop on a violation that TLC 1.7.4 reports as a success. */
|
|
824
931
|
violationOutDegrees?: number[];
|
|
932
|
+
traceSpec?: string;
|
|
933
|
+
coverage?: CoverageReport;
|
|
825
934
|
}
|
|
826
935
|
export declare const check: (options: CheckOptions) => Promise<CheckResult>;
|
|
827
936
|
export declare const parseModule: (source: string) => Module;
|
|
@@ -857,4 +966,4 @@ interface ProveOptions {
|
|
|
857
966
|
workers?: number;
|
|
858
967
|
}
|
|
859
968
|
export declare const prove: (options: ProveOptions) => Promise<ProveResult>;
|
|
860
|
-
export type { CheckOptions, CheckProgress, CheckResult, CheckStatus, ConfigValue, ConstantAssignment, EvaluationFailure, ModelConfig, Module, ProofObligation, ProofStatus, ProveOptions, ProveResult, ProvedObligation, Substitution, TraceStep, TrivialObligation, UnprovedObligation, Value, Violation };
|
|
969
|
+
export type { CheckOptions, CheckProgress, CheckResult, CheckStatus, ConfigValue, ConstantAssignment, CoverageReport, EvaluationFailure, ModelConfig, Module, ModuleOperator, ProofObligation, ProofStatus, ProveOptions, ProveResult, ProvedObligation, Substitution, TraceSpecOptions, TraceStep, TrivialObligation, UnprovedObligation, Value, Violation };
|
package/dist/index.d.ts
CHANGED
|
@@ -107,12 +107,14 @@ interface CaseExpression {
|
|
|
107
107
|
kind: "Case";
|
|
108
108
|
arms: CaseArm[];
|
|
109
109
|
other: Expression | undefined;
|
|
110
|
+
otherRange?: SourceRange;
|
|
110
111
|
location: SourceLocation;
|
|
111
112
|
}
|
|
112
113
|
interface LetExpression {
|
|
113
114
|
kind: "Let";
|
|
114
115
|
definitions: Definition[];
|
|
115
116
|
instances?: Instance[];
|
|
117
|
+
recursive?: Declaration[];
|
|
116
118
|
body: Expression;
|
|
117
119
|
location: SourceLocation;
|
|
118
120
|
}
|
|
@@ -262,6 +264,7 @@ interface LabelExpression {
|
|
|
262
264
|
name: string;
|
|
263
265
|
params: string[];
|
|
264
266
|
paramRanges?: SourceRange[];
|
|
267
|
+
head?: SourceRange;
|
|
265
268
|
body: Expression;
|
|
266
269
|
location: SourceLocation;
|
|
267
270
|
}
|
|
@@ -287,7 +290,12 @@ interface SubexpressionExpression {
|
|
|
287
290
|
argumentRanges?: (SourceRange | undefined)[];
|
|
288
291
|
location: SourceLocation;
|
|
289
292
|
}
|
|
290
|
-
|
|
293
|
+
interface SelectionExpression {
|
|
294
|
+
kind: "Selection";
|
|
295
|
+
expression: Expression;
|
|
296
|
+
location: SourceLocation;
|
|
297
|
+
}
|
|
298
|
+
type Expression = NumberExpression | DecimalExpression | StringExpression | IdentifierExpression | ApplyExpression | OperatorReferenceExpression | LambdaExpression | JunctionExpression | PrimeExpression | UnchangedExpression | EnabledExpression | IfExpression | CaseExpression | LetExpression | QuantifierExpression | UnboundedQuantifierExpression | ChooseExpression | SetEnumerationExpression | SetFilterExpression | SetMapExpression | TupleExpression | FunctionConstructionExpression | FunctionSetExpression | RecordExpression | ExceptExpression | ExceptAtExpression | FunctionApplicationExpression | BracketExpression | FieldAccessExpression | ProductExpression | TemporalExpression | ActionExpression | FairnessExpression | LabelExpression | SubexpressionExpression | SelectionExpression;
|
|
291
299
|
interface OperatorParam {
|
|
292
300
|
name: string;
|
|
293
301
|
arity: number;
|
|
@@ -299,6 +307,7 @@ interface OperatorDefinition {
|
|
|
299
307
|
params: OperatorParam[];
|
|
300
308
|
body: Expression;
|
|
301
309
|
bodyRange?: SourceRange;
|
|
310
|
+
head?: SourceRange;
|
|
302
311
|
isLocal: boolean;
|
|
303
312
|
isRecursive: boolean;
|
|
304
313
|
location: SourceLocation;
|
|
@@ -440,6 +449,7 @@ type ModuleUnit = {
|
|
|
440
449
|
} | {
|
|
441
450
|
kind: "Recursive";
|
|
442
451
|
declarations: Declaration[];
|
|
452
|
+
location: SourceLocation;
|
|
443
453
|
} | {
|
|
444
454
|
kind: "Definition";
|
|
445
455
|
definition: Definition;
|
|
@@ -512,6 +522,7 @@ interface ModelConfig {
|
|
|
512
522
|
actionConstraints: string[];
|
|
513
523
|
constants: ConstantAssignment[];
|
|
514
524
|
substitutions: Substitution[];
|
|
525
|
+
rawConstants: string[];
|
|
515
526
|
checkDeadlock: boolean;
|
|
516
527
|
symmetry: string | undefined;
|
|
517
528
|
view: string | undefined;
|
|
@@ -530,6 +541,14 @@ interface SyntaxFailure {
|
|
|
530
541
|
line: number;
|
|
531
542
|
column: number;
|
|
532
543
|
isEnd: boolean;
|
|
544
|
+
proof?: {
|
|
545
|
+
stop: {
|
|
546
|
+
line: number;
|
|
547
|
+
column: number;
|
|
548
|
+
};
|
|
549
|
+
exception: string;
|
|
550
|
+
printed: string;
|
|
551
|
+
};
|
|
533
552
|
}
|
|
534
553
|
interface SanyError {
|
|
535
554
|
location: string;
|
|
@@ -571,6 +590,8 @@ interface LazySet {
|
|
|
571
590
|
interface SetValue {
|
|
572
591
|
kind: "Set";
|
|
573
592
|
elements: Value[];
|
|
593
|
+
writtenElements: Value[] | undefined;
|
|
594
|
+
isNormalized: boolean;
|
|
574
595
|
hash: number;
|
|
575
596
|
fingerprint: number;
|
|
576
597
|
isFingerprinted: boolean;
|
|
@@ -587,6 +608,7 @@ interface FunctionValue {
|
|
|
587
608
|
fingerprint: number;
|
|
588
609
|
writtenKeys: Value[] | undefined;
|
|
589
610
|
functionClass: FunctionClass | undefined;
|
|
611
|
+
lambdaDomain: Value | undefined;
|
|
590
612
|
isFingerprinted: boolean;
|
|
591
613
|
}
|
|
592
614
|
interface IntervalValue {
|
|
@@ -633,7 +655,8 @@ interface FilteredSetSource {
|
|
|
633
655
|
interface FilteredSetValue extends LazySet {
|
|
634
656
|
kind: "FilteredSet";
|
|
635
657
|
base: Value;
|
|
636
|
-
test: (element: Value) => boolean;
|
|
658
|
+
test: (element: Value, isMember: boolean) => boolean;
|
|
659
|
+
startPass?: (isMaterialized: boolean) => (element: Value) => boolean;
|
|
637
660
|
source?: FilteredSetSource;
|
|
638
661
|
}
|
|
639
662
|
interface UnionValue extends LazySet {
|
|
@@ -652,6 +675,7 @@ interface LazyFunctionValue {
|
|
|
652
675
|
kind: "LazyFunction";
|
|
653
676
|
domain: Value;
|
|
654
677
|
apply: (argument: Value) => Value;
|
|
678
|
+
boundTupleLengths?: (number | undefined)[];
|
|
655
679
|
source?: LazyFunctionSource;
|
|
656
680
|
functionClass?: FunctionClass;
|
|
657
681
|
enumerated?: FunctionValue;
|
|
@@ -660,22 +684,47 @@ interface LazyFunctionValue {
|
|
|
660
684
|
type Value = boolean | number | string | ModelValue | SetValue | MixedSetValue | FunctionValue | IntervalValue | InfiniteSetValue | SubsetValue | FunctionSetValue | RecordSetValue | ProductSetValue | SequenceSetValue | SetOperationValue | FilteredSetValue | UnionValue | LazyFunctionValue;
|
|
661
685
|
type FunctionClass = "lambda" | "tuple" | "record";
|
|
662
686
|
export declare const formatValue: (value: Value, isStrict?: boolean, isNormalized?: boolean) => string;
|
|
663
|
-
interface FingerprintFailure {
|
|
664
|
-
sources: Expression[];
|
|
665
|
-
reason: string;
|
|
666
|
-
}
|
|
667
687
|
interface JavaOverride {
|
|
668
688
|
module: string;
|
|
669
689
|
operator: string;
|
|
670
690
|
signature: string;
|
|
671
691
|
isMatched: boolean;
|
|
672
692
|
}
|
|
693
|
+
interface FingerprintFailure {
|
|
694
|
+
sources: Expression[];
|
|
695
|
+
reason: string;
|
|
696
|
+
}
|
|
697
|
+
type CoverageKind = "init" | "next" | "invariant" | "constraint" | "implied";
|
|
698
|
+
interface CoverageReport {
|
|
699
|
+
variables: CoverageVariable[];
|
|
700
|
+
relations: CoverageRelationReport[];
|
|
701
|
+
}
|
|
702
|
+
interface CoverageVariable {
|
|
703
|
+
label: string;
|
|
704
|
+
distinct: number;
|
|
705
|
+
}
|
|
706
|
+
interface CoverageRelationReport {
|
|
707
|
+
kind: CoverageKind;
|
|
708
|
+
label: string;
|
|
709
|
+
distinct: number;
|
|
710
|
+
generated: number;
|
|
711
|
+
expressions: CoverageExpression[];
|
|
712
|
+
}
|
|
713
|
+
interface CoverageExpression {
|
|
714
|
+
location: string;
|
|
715
|
+
depth: number;
|
|
716
|
+
count: number;
|
|
717
|
+
cost: number;
|
|
718
|
+
}
|
|
673
719
|
interface StateDump {
|
|
674
720
|
path: string;
|
|
675
721
|
dot?: boolean;
|
|
676
722
|
colorize?: boolean;
|
|
677
723
|
actionLabels?: boolean;
|
|
678
724
|
snapshot?: boolean;
|
|
725
|
+
constrained?: boolean;
|
|
726
|
+
stuttering?: boolean;
|
|
727
|
+
strict?: boolean;
|
|
679
728
|
}
|
|
680
729
|
interface FailureMessage {
|
|
681
730
|
code: number;
|
|
@@ -690,19 +739,50 @@ interface CheckOptions {
|
|
|
690
739
|
onPrint?: (text: string) => void;
|
|
691
740
|
onPause?: () => void;
|
|
692
741
|
readFile?: (path: string) => string | undefined;
|
|
693
|
-
writeFile?: (path: string, content: string) => void;
|
|
742
|
+
writeFile?: (path: string, content: string | Uint8Array) => void;
|
|
743
|
+
makeDirectory?: (path: string) => void;
|
|
694
744
|
seed?: bigint;
|
|
695
745
|
workers?: number;
|
|
696
|
-
|
|
746
|
+
/** TLC's -lncheck: "final" checks liveness only on the complete graph, "off" never looks for a cycle. */
|
|
747
|
+
livenessCheck?: "default" | "final" | "off";
|
|
748
|
+
/** TLC's -fp: the index of the polynomial in TLC's FP64.Polys that fingerprints states. */
|
|
749
|
+
fingerprintPolynomial?: number;
|
|
750
|
+
/** False for TLC's -terse, which prints a lazy value, such as SUBSET S, without enumerating it. */
|
|
751
|
+
isLazyValueExpanded?: boolean;
|
|
752
|
+
/** TLC's -view: prints each state as the value of the configuration's VIEW. */
|
|
753
|
+
isViewPrinted?: boolean;
|
|
754
|
+
/** TLC's -maxSetSize: the most elements TLC enumerates into a set, or states into a list of them. */
|
|
755
|
+
maxSetSize?: number;
|
|
756
|
+
/** TLC's -dump: writes the reachable states, or with `dot` the state graph, through writeFile. */
|
|
697
757
|
dump?: StateDump;
|
|
758
|
+
/** TLC's -tool, which changes the messages of TLC's errors. */
|
|
698
759
|
isTool?: boolean;
|
|
760
|
+
/** TLC's -continue: reports each violation through onProgress and goes on. */
|
|
699
761
|
isContinued?: boolean;
|
|
700
|
-
|
|
762
|
+
/** Skips fingerprintDistance, which takes fingerprinting every state again after the search. */
|
|
763
|
+
isFingerprintDistanceSkipped?: boolean;
|
|
764
|
+
moduleOperators?: ModuleOperator[];
|
|
765
|
+
/** TLC's trace exploration spec, and the binary trace TLC records for it unless -noTEBin. */
|
|
766
|
+
traceSpec?: TraceSpecOptions;
|
|
767
|
+
/** Whether the caller printed SANY's report, its warnings included, before the check. */
|
|
701
768
|
isSanyReported?: boolean;
|
|
769
|
+
/** False for TLC's -nowarning, which changes how TLC computes some successors. */
|
|
702
770
|
isWarningEnabled?: boolean;
|
|
771
|
+
/** TLC's -coverage, in minutes. */
|
|
772
|
+
coverage?: number;
|
|
703
773
|
version?: TlcVersion;
|
|
704
774
|
onProgress?: (progress: CheckProgress) => void;
|
|
705
775
|
}
|
|
776
|
+
interface TraceSpecOptions {
|
|
777
|
+
module: string;
|
|
778
|
+
traceFile?: string;
|
|
779
|
+
}
|
|
780
|
+
interface ModuleOperator {
|
|
781
|
+
kind: "postcondition" | "constraint" | "view";
|
|
782
|
+
module: string;
|
|
783
|
+
operator: string;
|
|
784
|
+
constants?: Record<string, string>;
|
|
785
|
+
}
|
|
706
786
|
interface InitialStatesProgress {
|
|
707
787
|
kind: "initial-states-progress";
|
|
708
788
|
count: number;
|
|
@@ -740,7 +820,9 @@ type CheckProgress = {
|
|
|
740
820
|
} | {
|
|
741
821
|
kind: "liveness-started";
|
|
742
822
|
branches: number;
|
|
823
|
+
/** Whether TLC checks the complete state graph. */
|
|
743
824
|
isComplete: boolean;
|
|
825
|
+
/** How many states the graphs of all branches have together. */
|
|
744
826
|
states: number;
|
|
745
827
|
statistics: SearchStatistics;
|
|
746
828
|
} | {
|
|
@@ -759,25 +841,33 @@ type CheckProgress = {
|
|
|
759
841
|
} | ({
|
|
760
842
|
kind: "java-override";
|
|
761
843
|
} & JavaOverride);
|
|
762
|
-
interface SearchStatistics extends Pick<CheckResult, "generatedStates" | "distinctStates" | "queuedStates" | "depth"> {}
|
|
844
|
+
interface SearchStatistics extends Pick<CheckResult, "generatedStates" | "distinctStates" | "queuedStates" | "depth" | "coverage"> {}
|
|
763
845
|
type CheckStatus = "success" | "assumption-violation" | "invariant-violation" | "property-violation" | "liveness-violation" | "postcondition-violation" | "deadlock" | "error";
|
|
764
846
|
interface TraceStep {
|
|
765
847
|
action: string | undefined;
|
|
848
|
+
/** TLC's name, parameters and location for the action that took this step. */
|
|
766
849
|
label: string | undefined;
|
|
767
850
|
state: Record<string, Value>;
|
|
851
|
+
/** What the spec prints before this step as TLC rebuilds the trace, and before it for the first. */
|
|
768
852
|
output?: OutputLine[];
|
|
769
853
|
}
|
|
770
854
|
interface Violation {
|
|
771
855
|
name: string;
|
|
856
|
+
/** Every temporal property that a liveness counterexample violates, in the configuration's order. */
|
|
772
857
|
properties?: string[];
|
|
773
858
|
trace: TraceStep[];
|
|
859
|
+
/** What the spec prints after the trace, as TLC finds the lasso's step back or rebuilds the trace. */
|
|
774
860
|
traceOutput?: OutputLine[];
|
|
861
|
+
/** What the postconditions print, which TLC checks after the lasso's step back. */
|
|
862
|
+
postconditionOutput?: OutputLine[];
|
|
775
863
|
loopStart: number | undefined;
|
|
776
864
|
loopLabel?: string;
|
|
777
865
|
message?: string;
|
|
778
866
|
counts?: string;
|
|
779
867
|
unwitnessed?: Postcondition;
|
|
868
|
+
/** A POSTCONDITION that is false or fails, which TLC checks as it prints the counterexample. */
|
|
780
869
|
postcondition?: Postcondition;
|
|
870
|
+
/** What TLC warns about after a counterexample, with its code. */
|
|
781
871
|
warning?: {
|
|
782
872
|
code: number;
|
|
783
873
|
text: string;
|
|
@@ -789,6 +879,11 @@ interface Postcondition {
|
|
|
789
879
|
message: string;
|
|
790
880
|
counts?: string;
|
|
791
881
|
}
|
|
882
|
+
interface TraceFailure extends FailureMessage {
|
|
883
|
+
/** What the spec prints as TLC rebuilds the step it then fails to print. */
|
|
884
|
+
output: OutputLine[];
|
|
885
|
+
}
|
|
886
|
+
/** An evaluation that failed during the search, with the behavior up to the state TLC was working on. */
|
|
792
887
|
interface EvaluationFailure {
|
|
793
888
|
code: number;
|
|
794
889
|
message: string;
|
|
@@ -797,11 +892,17 @@ interface EvaluationFailure {
|
|
|
797
892
|
traceOutput?: OutputLine[];
|
|
798
893
|
initialState: Record<string, Value> | undefined;
|
|
799
894
|
exitCode: number;
|
|
895
|
+
/** The expressions TLC was evaluating, outermost first, when its replay finds them. */
|
|
800
896
|
callStack: Expression[] | undefined;
|
|
897
|
+
/** Whether TLC prints the call stack before the error, as it does for a failed liveness check. */
|
|
801
898
|
isCallStackFirst?: boolean;
|
|
899
|
+
/** The FingerprintException the replay raises, which TLC reports in place of the call stack. */
|
|
802
900
|
fingerprint?: FingerprintFailure;
|
|
803
|
-
|
|
901
|
+
/** How TLC reports failing again as it prints the trace, since it can't fingerprint the state. */
|
|
902
|
+
traceFailure?: TraceFailure;
|
|
903
|
+
/** A POSTCONDITION that is false or fails after the trace, which TLC checks as it prints one. */
|
|
804
904
|
postcondition?: Postcondition;
|
|
905
|
+
/** Whether TLC stops before it prints the statistics, as it does for an illegal initial state. */
|
|
805
906
|
isWithoutStatistics?: boolean;
|
|
806
907
|
}
|
|
807
908
|
interface InitialStates {
|
|
@@ -816,12 +917,20 @@ interface CheckResult {
|
|
|
816
917
|
distinctStates: number;
|
|
817
918
|
queuedStates: number;
|
|
818
919
|
depth: number;
|
|
920
|
+
/** Once TLC computed all the initial states without a violation or an error. */
|
|
819
921
|
initialStates: InitialStates | undefined;
|
|
922
|
+
/** How many expanded states found each number of new states, when TLC prints the outdegree. */
|
|
820
923
|
outDegrees: number[] | undefined;
|
|
924
|
+
/** The smallest distance between two fingerprints, when TLC estimates a collision from them. */
|
|
821
925
|
fingerprintDistance: bigint | undefined;
|
|
926
|
+
/** A temporal property TLC finds violated as it adds the state it stopped at to the behavior graph, reported after. */
|
|
822
927
|
additionalViolation?: Violation;
|
|
928
|
+
/** Where TLC's worker fails to add the state to the behavior graph after it reports a violation. */
|
|
823
929
|
liveCallStack?: Expression[];
|
|
930
|
+
/** The outdegrees when TLC's workers stop on a violation that TLC 1.7.4 reports as a success. */
|
|
824
931
|
violationOutDegrees?: number[];
|
|
932
|
+
traceSpec?: string;
|
|
933
|
+
coverage?: CoverageReport;
|
|
825
934
|
}
|
|
826
935
|
export declare const check: (options: CheckOptions) => Promise<CheckResult>;
|
|
827
936
|
export declare const parseModule: (source: string) => Module;
|
|
@@ -857,4 +966,4 @@ interface ProveOptions {
|
|
|
857
966
|
workers?: number;
|
|
858
967
|
}
|
|
859
968
|
export declare const prove: (options: ProveOptions) => Promise<ProveResult>;
|
|
860
|
-
export type { CheckOptions, CheckProgress, CheckResult, CheckStatus, ConfigValue, ConstantAssignment, EvaluationFailure, ModelConfig, Module, ProofObligation, ProofStatus, ProveOptions, ProveResult, ProvedObligation, Substitution, TraceStep, TrivialObligation, UnprovedObligation, Value, Violation };
|
|
969
|
+
export type { CheckOptions, CheckProgress, CheckResult, CheckStatus, ConfigValue, ConstantAssignment, CoverageReport, EvaluationFailure, ModelConfig, Module, ModuleOperator, ProofObligation, ProofStatus, ProveOptions, ProveResult, ProvedObligation, Substitution, TraceSpecOptions, TraceStep, TrivialObligation, UnprovedObligation, Value, Violation };
|
package/dist/index.js
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
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
|
-
import{
|
|
9
|
+
import{I as e,V as t,b as n,v as r,x as i}from"./worker.js";import{bt as a,qt as o,wn as s}from"./transfer.js";import{S as c,o as l}from"./prove.js";export{r as TlaConfigError,n as TlaError,i as TlaEvaluationError,e as TlaSyntaxError,t as TlaUnsupportedError,c as check,o as formatValue,s as parseConfig,a as parseModule,l as prove};
|
package/dist/parallel-worker.cjs
CHANGED
|
@@ -6,4 +6,4 @@
|
|
|
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=require("./worker.cjs"),t=require("./transfer.cjs"),n=(n,r)=>{let i=new Map(n.modules),a=e=>i.get(e),o=new Map(n.classes),s=t.
|
|
9
|
+
const e=require("./worker.cjs"),t=require("./transfer.cjs"),n=(n,r)=>{let i=new Map(n.modules),a=e=>i.get(e),o=new Map(n.classes),s=t.u(n.config,{...n,loadModule:a,loadClass:e=>o.get(e),seed:void 0},()=>{},!0),c=s.specification,l=c.environment,u=t.f(n.config,l,c.variableLocations,()=>s.order.getDeclarationOrder(`variable`),void 0,[],c.runtimeInvariants),d=u?.spec.next;if(!u||d===void 0)return r.postMessage({type:`abort`});let f=n.index,p=t.Lt(),m=t.t(l.variables.length),h=n.fingerprints,g=n.requests,_=n.remaining,v=u.isSymmetric?t.N():void 0,y=/* @__PURE__ */ new Int32Array(2),b=()=>{},x=e=>{};n.ports.forEach(e=>{e?.addEventListener(`message`,e=>x(e.data)),e?.start?.()});let S=m(n.seed).map(p),C=e.t(),w=(e,r)=>{let i=Atomics.load(g,f)-1,a=Math.floor((e.end-e.origin-1)/2),o=t.n(),s=e.states.slice(e.end-a,e.end),c=a>0&&s.every(o.encode);c&&(e.end-=a);let l=c?o.finish():t.n().finish();n.ports[i]?.postMessage(l,[l.words.buffer]),Atomics.store(g,f,r),Atomics.notify(g,f)},T=e=>{Atomics.store(_,f,0),Atomics.compareExchange(g,f,0,-1)!==0&&w(e,-1)},E=e=>{Atomics.store(_,f,e.end-e.origin),Atomics.store(g,f,0)},D=e=>{for(;e.origin<e.end;e.origin++){let r=e.states[e.origin];if(!e.successors){if(performance.now()>=e.breakAt)return`break`;if(Atomics.load(g,f)>0&&w(e,0),Atomics.store(_,f,e.end-e.origin-1),e.successors=t.nt(d,r,l,u.spec.scope),e.generated+=e.successors.length,e.successors.length===0&&n.config.checkDeadlock)return}let i=e.successors;for(;e.index<i.length;e.index++){if(t.V(h))return`paused`;let n=i[e.index];if(u.findViolatedActionProperty(r,n.state))return;if(!u.satisfiesActionConstraints(r,n.state)){if(u.findViolatedInvariant(n.state,r))return;continue}if(v&&(t.U(n.state,y),!v.insert(y[0],y[1])))continue;p(n.state);let a=u.getFingerprintState(n.state);if(t.U(a,y),t.z(h,y[0],y[1])){if(u.findViolatedInvariant(n.state,r))return;u.satisfiesConstraints(n.state,r)&&(e.next.push(n.state),e.fingerprintStates.push(a),e.added++)}}e.outDegrees[Math.min(e.added,31)]++,e.successors=void 0,e.index=0,e.added=0}return`done`},O=async e=>{let t=/* @__PURE__ */ new Set;for(;;){let r=n.ports.reduce((e,n,r)=>!n||t.has(r)||Atomics.load(_,r)<2?e:e===void 0||Atomics.load(_,r)>Atomics.load(_,e)?r:e,void 0);if(r===void 0)return!1;let i=Atomics.compareExchange(g,r,0,f+1);if(i===-1&&t.add(r),i>0&&Atomics.wait(g,r,i),i!==0)continue;let a=await new Promise(e=>x=e);if(a.count===0)t.add(r);else return e.states=m(a).map(p),e.origin=0,e.end=e.states.length,E(e),!0}},k=e=>r.postMessage(e,e.type===`level`?[e.fingerprints.buffer]:[]),A=async()=>{let e={states:S,origin:0,end:S.length,successors:void 0,index:0,added:0,generated:0,outDegrees:Array.from({length:32},()=>0),next:[],fingerprintStates:[],breakAt:performance.now()+100};for(;;){let t=D(e);if(t===void 0)return;if(t===`break`)await C(),e.breakAt=performance.now()+100;else if(T(e),t===`paused`){let t=new Promise(e=>b=e);k({type:`paused`}),await t,E(e)}else if(!await O(e))break}let n=t.en();return n===void 0?(S=e.next,Atomics.store(_,f,S.length),{type:`level`,generated:e.generated,added:e.next.length,outDegrees:e.outDegrees,fingerprints:u.getStoredFingerprints(e.next,e.fingerprintStates)}):{type:`abort`,string:n}},j=()=>{A().then(e=>k(e??{type:`abort`}),()=>k({type:`abort`}))};r.addEventListener(`message`,e=>{let t=e.data;t.type===`level`&&j(),t.type===`resize`&&(h=t.fingerprints,b())}),Atomics.store(_,f,S.length),k({type:`ready`})};e.n().then(e=>{let t=r=>{let i=r.data;if(i.type===`start`){e.removeEventListener?.(`message`,t);try{n(i,e)}catch{e.postMessage({type:`abort`})}}};e.addEventListener(`message`,t),e.start?.()});
|