tla-ts 0.0.9-dev.8298a52 → 0.0.10-dev.28c823e4b
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 +7 -0
- package/dist/compile.cjs +3 -3
- package/dist/compile.js +3 -3
- package/dist/deciders.cjs +28 -28
- package/dist/deciders.js +52 -52
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +105 -10
- package/dist/index.d.ts +105 -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 +116 -36
- package/dist/prove.js +116 -36
- package/dist/run.cjs +143 -31
- package/dist/run.js +143 -31
- package/dist/tlapm.cjs +1 -1
- 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 +1 -1
- package/src/ast.ts +4 -23
- package/src/bags.ts +99 -102
- package/src/builtins.ts +40 -78
- package/src/bundled-modules.ts +1 -8
- package/src/check.ts +564 -366
- package/src/cli/options.ts +10 -5
- package/src/cli/run.ts +0 -2
- package/src/cli/runtime-invariants.ts +136 -0
- package/src/cli/shared.ts +18 -11
- package/src/cli/tlapm.ts +0 -12
- package/src/cli/tlc-arguments.ts +640 -0
- package/src/cli/tlc-usage.ts +361 -0
- package/src/cli/tlc.ts +525 -216
- package/src/cli/typescript.ts +0 -3
- package/src/cli/xml-exporter.ts +4 -16
- package/src/cli.ts +0 -1
- package/src/codegen.ts +191 -64
- package/src/config.ts +140 -109
- package/src/coverage.ts +837 -0
- package/src/dependencies.ts +6 -40
- package/src/dfid.ts +618 -0
- package/src/environment.ts +237 -119
- package/src/errors.ts +56 -56
- package/src/evaluate.ts +543 -341
- package/src/exit-codes.ts +37 -3
- package/src/fingerprints.ts +10 -10
- package/src/index.ts +3 -0
- package/src/instances.ts +38 -31
- package/src/java-overrides.ts +4 -19
- package/src/json-reader.ts +455 -0
- package/src/json.ts +255 -139
- package/src/levels.ts +8 -17
- package/src/lexer.ts +80 -100
- package/src/liveness-checker.ts +77 -117
- package/src/liveness.ts +106 -62
- package/src/obligations/action.ts +4 -28
- package/src/obligations/anonymize.ts +84 -80
- package/src/obligations/equality.ts +1 -1
- package/src/obligations/expression.ts +2 -19
- package/src/obligations/format.ts +1 -9
- package/src/obligations/generate.ts +1 -11
- package/src/obligations/index.ts +0 -11
- package/src/obligations/levels.ts +4 -8
- package/src/obligations/module.ts +1 -15
- package/src/obligations/normalize.ts +5 -24
- 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 +3 -14
- package/src/obligations/source.ts +1 -21
- package/src/obligations/subexpression.ts +5 -11
- package/src/obligations/substitution.ts +1 -3
- package/src/obligations/temporal.ts +8 -14
- package/src/obligations/tuples.ts +3 -9
- package/src/parallel-worker.ts +24 -33
- package/src/parallel.ts +48 -40
- package/src/parser.ts +565 -282
- 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 +5 -10
- package/src/prover/deciders.ts +0 -4
- 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 +108 -114
- package/src/prover/isabelle/isar/method.ts +25 -38
- 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 +15 -26
- package/src/prover/isabelle/isar/type-check.ts +11 -25
- package/src/prover/isabelle/provers/blast/blast.ts +10 -41
- 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 +11 -25
- package/src/prover/isabelle/pure/bicompose.ts +16 -13
- package/src/prover/isabelle/pure/consts.ts +1 -7
- package/src/prover/isabelle/pure/conv.ts +1 -9
- package/src/prover/isabelle/pure/drule.ts +24 -40
- 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 +1 -14
- 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 +13 -49
- package/src/prover/isabelle/pure/rewriter.ts +26 -58
- 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 +1 -31
- package/src/prover/isabelle/pure/tactic.ts +12 -22
- package/src/prover/isabelle/pure/tactical.ts +6 -12
- 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 +13 -36
- 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 +9 -19
- package/src/prover/isabelle/tla/context.ts +8 -16
- package/src/prover/isabelle/tla/logic.ts +4 -11
- package/src/prover/isabelle/tla/simpdata.ts +46 -34
- package/src/prover/isabelle/tools/intuitionistic.ts +1 -10
- package/src/prover/ocaml.ts +0 -6
- package/src/prover/prep/action.ts +4 -36
- package/src/prover/prep/enabled-axioms.ts +12 -19
- package/src/prover/prep/fingerprint.ts +0 -16
- package/src/prover/prep/level-comparison.ts +8 -12
- package/src/prover/prep/md5.ts +0 -2
- package/src/prover/prep/methods.ts +9 -36
- package/src/prover/prep/normalize.ts +4 -28
- package/src/prover/prove-worker.ts +0 -2
- package/src/prover/prove.ts +0 -36
- 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 +19 -26
- package/src/prover/smt/data.ts +51 -54
- package/src/prover/smt/encode.ts +14 -35
- 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 +66 -101
- 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 -143
- package/src/prover/smt/solver/auf-solver.ts +6 -39
- 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 +4 -61
- 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 +3 -34
- 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 +0 -5
- 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 +6 -98
- 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 +12 -98
- 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 +35 -130
- 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 +14 -56
- 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 +2 -36
- package/src/prover/smt/solver/model-evaluator.ts +3 -29
- package/src/prover/smt/solver/model-finder.ts +3 -15
- package/src/prover/smt/solver/model-generator.ts +1 -12
- package/src/prover/smt/solver/model-macro-solver.ts +12 -69
- package/src/prover/smt/solver/nlsat/algebraic.ts +55 -151
- package/src/prover/smt/solver/nlsat/atoms.ts +5 -19
- package/src/prover/smt/solver/nlsat/evaluator.ts +17 -22
- package/src/prover/smt/solver/nlsat/explain.ts +3 -47
- package/src/prover/smt/solver/nlsat/interval-set.ts +9 -50
- package/src/prover/smt/solver/nlsat/levelwise.ts +48 -129
- package/src/prover/smt/solver/nlsat/mpbq.ts +3 -14
- package/src/prover/smt/solver/nlsat/polynomial.ts +17 -156
- package/src/prover/smt/solver/nlsat/solver.ts +7 -67
- package/src/prover/smt/solver/nlsat/types.ts +1 -8
- package/src/prover/smt/solver/nlsat/upolynomial-factorization.ts +1 -44
- 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 -48
- 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 +17 -37
- package/src/prover/smt/solver/quantifier-manager.ts +1 -8
- 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 +2 -37
- package/src/prover/smt/solver/solver.ts +1 -16
- 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 +0 -5
- package/src/prover/smt/solver/theory-lra-final-check.ts +4 -22
- package/src/prover/smt/solver/theory-lra-internalize.ts +1 -27
- 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 +20 -25
- package/src/prover/tlapm/ocaml-marshal.ts +19 -21
- package/src/prover/tlapm/tlapm.ts +12 -17
- package/src/prover/verdict.ts +0 -2
- package/src/prover/zenon/check/check.ts +0 -9
- 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 +0 -5
- package/src/prover/zenon/check/relations.ts +0 -13
- package/src/prover/zenon/check/rewrites.ts +0 -6
- package/src/prover/zenon/check/sets.ts +0 -3
- package/src/prover/zenon/check/terms.ts +0 -17
- 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 +0 -13
- package/src/prover/zenon/equality-rules.ts +0 -4
- package/src/prover/zenon/expr.ts +1 -26
- package/src/prover/zenon/index-table.ts +17 -38
- package/src/prover/zenon/isar-case.ts +9 -19
- package/src/prover/zenon/isar.ts +1 -29
- package/src/prover/zenon/limits.ts +0 -4
- package/src/prover/zenon/llproof.ts +0 -9
- package/src/prover/zenon/mltoll.ts +54 -76
- package/src/prover/zenon/node.ts +1 -11
- package/src/prover/zenon/ocaml.ts +1 -17
- package/src/prover/zenon/parse.ts +2 -7
- 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 +1 -17
- package/src/prover/zenon/tla/functions.ts +57 -29
- package/src/prover/zenon/tla/llproof.ts +63 -70
- package/src/prover/zenon/tla/records.ts +56 -27
- package/src/prover/zenon/tla/rewrites.ts +12 -19
- package/src/prover/zenon/tla/sets.ts +68 -39
- package/src/prover/zenon/tla/terms.ts +0 -6
- package/src/prover/zenon/tla/tla.ts +59 -58
- package/src/randomization.ts +81 -35
- package/src/resolve.ts +12 -112
- package/src/runtime.ts +22 -22
- package/src/sany/builtins.ts +2 -5
- package/src/sany/generator.ts +149 -252
- package/src/sany/levels.ts +6 -34
- package/src/sany/lexer.ts +41 -61
- package/src/sany/linter.ts +1 -9
- package/src/sany/modules.ts +1 -5
- package/src/sany/nodes.ts +0 -31
- package/src/sany/parse-error.ts +39 -117
- package/src/sany/report.ts +29 -63
- package/src/sany/selectors.ts +15 -39
- package/src/sany/source.ts +1 -17
- package/src/sany/xml.ts +13 -63
- package/src/search.ts +495 -155
- package/src/simulate.ts +685 -0
- package/src/spec-description.ts +176 -69
- package/src/standard-definitions.ts +0 -4
- package/src/standard-modules.ts +254 -69
- package/src/state-graph.ts +50 -24
- package/src/subexpressions.ts +69 -52
- package/src/substitution-levels.ts +2 -3
- package/src/successors.ts +260 -91
- 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 +110 -44
- package/src/tlc/order.ts +37 -60
- package/src/tlc/random.ts +33 -45
- package/src/tlc/replay.ts +549 -217
- package/src/tlc/summary.ts +36 -47
- package/src/tlc/tlc-operators.ts +76 -41
- package/src/tlc/tlcext-operators.ts +139 -122
- package/src/tlc/trace-spec.ts +269 -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 +8 -21
- package/src/typescript/collections.ts +0 -15
- package/src/typescript/compile.ts +0 -5
- 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 +4 -12
- package/src/typescript/functions.ts +6 -17
- package/src/typescript/model.ts +10 -11
- 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 +0 -10
- package/src/typescript/types.ts +1 -8
- package/src/values.ts +749 -330
- package/src/worker.ts +7 -8
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._,exports.TlaError=e.y,exports.TlaEvaluationError=e.b,exports.TlaSyntaxError=e.F,exports.TlaUnsupportedError=e.B,exports.check=n.m,exports.formatValue=t.Dt,exports.parseConfig=t.$t,exports.parseModule=t.V,exports.prove=n.r;
|
package/dist/index.d.cts
CHANGED
|
@@ -107,6 +107,7 @@ 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 {
|
|
@@ -262,6 +263,7 @@ interface LabelExpression {
|
|
|
262
263
|
name: string;
|
|
263
264
|
params: string[];
|
|
264
265
|
paramRanges?: SourceRange[];
|
|
266
|
+
head?: SourceRange;
|
|
265
267
|
body: Expression;
|
|
266
268
|
location: SourceLocation;
|
|
267
269
|
}
|
|
@@ -299,6 +301,7 @@ interface OperatorDefinition {
|
|
|
299
301
|
params: OperatorParam[];
|
|
300
302
|
body: Expression;
|
|
301
303
|
bodyRange?: SourceRange;
|
|
304
|
+
head?: SourceRange;
|
|
302
305
|
isLocal: boolean;
|
|
303
306
|
isRecursive: boolean;
|
|
304
307
|
location: SourceLocation;
|
|
@@ -440,6 +443,7 @@ type ModuleUnit = {
|
|
|
440
443
|
} | {
|
|
441
444
|
kind: "Recursive";
|
|
442
445
|
declarations: Declaration[];
|
|
446
|
+
location: SourceLocation;
|
|
443
447
|
} | {
|
|
444
448
|
kind: "Definition";
|
|
445
449
|
definition: Definition;
|
|
@@ -512,6 +516,7 @@ interface ModelConfig {
|
|
|
512
516
|
actionConstraints: string[];
|
|
513
517
|
constants: ConstantAssignment[];
|
|
514
518
|
substitutions: Substitution[];
|
|
519
|
+
rawConstants: string[];
|
|
515
520
|
checkDeadlock: boolean;
|
|
516
521
|
symmetry: string | undefined;
|
|
517
522
|
view: string | undefined;
|
|
@@ -530,6 +535,13 @@ interface SyntaxFailure {
|
|
|
530
535
|
line: number;
|
|
531
536
|
column: number;
|
|
532
537
|
isEnd: boolean;
|
|
538
|
+
proof?: {
|
|
539
|
+
stop: {
|
|
540
|
+
line: number;
|
|
541
|
+
column: number;
|
|
542
|
+
};
|
|
543
|
+
exception: string;
|
|
544
|
+
};
|
|
533
545
|
}
|
|
534
546
|
interface SanyError {
|
|
535
547
|
location: string;
|
|
@@ -571,6 +583,8 @@ interface LazySet {
|
|
|
571
583
|
interface SetValue {
|
|
572
584
|
kind: "Set";
|
|
573
585
|
elements: Value[];
|
|
586
|
+
writtenElements: Value[] | undefined;
|
|
587
|
+
isNormalized: boolean;
|
|
574
588
|
hash: number;
|
|
575
589
|
fingerprint: number;
|
|
576
590
|
isFingerprinted: boolean;
|
|
@@ -587,6 +601,7 @@ interface FunctionValue {
|
|
|
587
601
|
fingerprint: number;
|
|
588
602
|
writtenKeys: Value[] | undefined;
|
|
589
603
|
functionClass: FunctionClass | undefined;
|
|
604
|
+
lambdaDomain: Value | undefined;
|
|
590
605
|
isFingerprinted: boolean;
|
|
591
606
|
}
|
|
592
607
|
interface IntervalValue {
|
|
@@ -633,7 +648,7 @@ interface FilteredSetSource {
|
|
|
633
648
|
interface FilteredSetValue extends LazySet {
|
|
634
649
|
kind: "FilteredSet";
|
|
635
650
|
base: Value;
|
|
636
|
-
test: (element: Value) => boolean;
|
|
651
|
+
test: (element: Value, isMember: boolean) => boolean;
|
|
637
652
|
source?: FilteredSetSource;
|
|
638
653
|
}
|
|
639
654
|
interface UnionValue extends LazySet {
|
|
@@ -652,6 +667,7 @@ interface LazyFunctionValue {
|
|
|
652
667
|
kind: "LazyFunction";
|
|
653
668
|
domain: Value;
|
|
654
669
|
apply: (argument: Value) => Value;
|
|
670
|
+
boundTupleLengths?: (number | undefined)[];
|
|
655
671
|
source?: LazyFunctionSource;
|
|
656
672
|
functionClass?: FunctionClass;
|
|
657
673
|
enumerated?: FunctionValue;
|
|
@@ -660,22 +676,47 @@ interface LazyFunctionValue {
|
|
|
660
676
|
type Value = boolean | number | string | ModelValue | SetValue | MixedSetValue | FunctionValue | IntervalValue | InfiniteSetValue | SubsetValue | FunctionSetValue | RecordSetValue | ProductSetValue | SequenceSetValue | SetOperationValue | FilteredSetValue | UnionValue | LazyFunctionValue;
|
|
661
677
|
type FunctionClass = "lambda" | "tuple" | "record";
|
|
662
678
|
export declare const formatValue: (value: Value, isStrict?: boolean, isNormalized?: boolean) => string;
|
|
663
|
-
interface FingerprintFailure {
|
|
664
|
-
sources: Expression[];
|
|
665
|
-
reason: string;
|
|
666
|
-
}
|
|
667
679
|
interface JavaOverride {
|
|
668
680
|
module: string;
|
|
669
681
|
operator: string;
|
|
670
682
|
signature: string;
|
|
671
683
|
isMatched: boolean;
|
|
672
684
|
}
|
|
685
|
+
interface FingerprintFailure {
|
|
686
|
+
sources: Expression[];
|
|
687
|
+
reason: string;
|
|
688
|
+
}
|
|
689
|
+
type CoverageKind = "init" | "next" | "invariant" | "constraint" | "implied";
|
|
690
|
+
interface CoverageReport {
|
|
691
|
+
variables: CoverageVariable[];
|
|
692
|
+
relations: CoverageRelationReport[];
|
|
693
|
+
}
|
|
694
|
+
interface CoverageVariable {
|
|
695
|
+
label: string;
|
|
696
|
+
distinct: number;
|
|
697
|
+
}
|
|
698
|
+
interface CoverageRelationReport {
|
|
699
|
+
kind: CoverageKind;
|
|
700
|
+
label: string;
|
|
701
|
+
distinct: number;
|
|
702
|
+
generated: number;
|
|
703
|
+
expressions: CoverageExpression[];
|
|
704
|
+
}
|
|
705
|
+
interface CoverageExpression {
|
|
706
|
+
location: string;
|
|
707
|
+
depth: number;
|
|
708
|
+
count: number;
|
|
709
|
+
cost: number;
|
|
710
|
+
}
|
|
673
711
|
interface StateDump {
|
|
674
712
|
path: string;
|
|
675
713
|
dot?: boolean;
|
|
676
714
|
colorize?: boolean;
|
|
677
715
|
actionLabels?: boolean;
|
|
678
716
|
snapshot?: boolean;
|
|
717
|
+
constrained?: boolean;
|
|
718
|
+
stuttering?: boolean;
|
|
719
|
+
strict?: boolean;
|
|
679
720
|
}
|
|
680
721
|
interface FailureMessage {
|
|
681
722
|
code: number;
|
|
@@ -690,19 +731,48 @@ interface CheckOptions {
|
|
|
690
731
|
onPrint?: (text: string) => void;
|
|
691
732
|
onPause?: () => void;
|
|
692
733
|
readFile?: (path: string) => string | undefined;
|
|
693
|
-
writeFile?: (path: string, content: string) => void;
|
|
734
|
+
writeFile?: (path: string, content: string | Uint8Array) => void;
|
|
735
|
+
makeDirectory?: (path: string) => void;
|
|
694
736
|
seed?: bigint;
|
|
695
737
|
workers?: number;
|
|
696
|
-
|
|
738
|
+
/** TLC's -lncheck: "final" checks liveness only on the complete graph, "off" never looks for a cycle. */
|
|
739
|
+
livenessCheck?: "default" | "final" | "off";
|
|
740
|
+
/** TLC's -fp: the index of the polynomial in TLC's FP64.Polys that fingerprints states. */
|
|
741
|
+
fingerprintPolynomial?: number;
|
|
742
|
+
/** False for TLC's -terse, which prints a lazy value, such as SUBSET S, without enumerating it. */
|
|
743
|
+
isLazyValueExpanded?: boolean;
|
|
744
|
+
/** TLC's -view: prints each state as the value of the configuration's VIEW. */
|
|
745
|
+
isViewPrinted?: boolean;
|
|
746
|
+
/** TLC's -maxSetSize: the most elements TLC enumerates into a set, or states into a list of them. */
|
|
747
|
+
maxSetSize?: number;
|
|
748
|
+
/** TLC's -dump: writes the reachable states, or with `dot` the state graph, through writeFile. */
|
|
697
749
|
dump?: StateDump;
|
|
750
|
+
/** TLC's -tool, which changes the messages of TLC's errors. */
|
|
698
751
|
isTool?: boolean;
|
|
752
|
+
/** TLC's -continue: reports each violation through onProgress and goes on. */
|
|
699
753
|
isContinued?: boolean;
|
|
700
|
-
|
|
754
|
+
moduleOperators?: ModuleOperator[];
|
|
755
|
+
/** TLC's trace exploration spec, and the binary trace TLC records for it unless -noTEBin. */
|
|
756
|
+
traceSpec?: TraceSpecOptions;
|
|
757
|
+
/** Whether the caller printed SANY's report, its warnings included, before the check. */
|
|
701
758
|
isSanyReported?: boolean;
|
|
759
|
+
/** False for TLC's -nowarning, which changes how TLC computes some successors. */
|
|
702
760
|
isWarningEnabled?: boolean;
|
|
761
|
+
/** TLC's -coverage, in minutes. */
|
|
762
|
+
coverage?: number;
|
|
703
763
|
version?: TlcVersion;
|
|
704
764
|
onProgress?: (progress: CheckProgress) => void;
|
|
705
765
|
}
|
|
766
|
+
interface TraceSpecOptions {
|
|
767
|
+
module: string;
|
|
768
|
+
traceFile?: string;
|
|
769
|
+
}
|
|
770
|
+
interface ModuleOperator {
|
|
771
|
+
kind: "postcondition" | "constraint" | "view";
|
|
772
|
+
module: string;
|
|
773
|
+
operator: string;
|
|
774
|
+
constants?: Record<string, string>;
|
|
775
|
+
}
|
|
706
776
|
interface InitialStatesProgress {
|
|
707
777
|
kind: "initial-states-progress";
|
|
708
778
|
count: number;
|
|
@@ -740,7 +810,9 @@ type CheckProgress = {
|
|
|
740
810
|
} | {
|
|
741
811
|
kind: "liveness-started";
|
|
742
812
|
branches: number;
|
|
813
|
+
/** Whether TLC checks the complete state graph. */
|
|
743
814
|
isComplete: boolean;
|
|
815
|
+
/** How many states of the graph each branch has. */
|
|
744
816
|
states: number;
|
|
745
817
|
statistics: SearchStatistics;
|
|
746
818
|
} | {
|
|
@@ -759,25 +831,33 @@ type CheckProgress = {
|
|
|
759
831
|
} | ({
|
|
760
832
|
kind: "java-override";
|
|
761
833
|
} & JavaOverride);
|
|
762
|
-
interface SearchStatistics extends Pick<CheckResult, "generatedStates" | "distinctStates" | "queuedStates" | "depth"> {}
|
|
834
|
+
interface SearchStatistics extends Pick<CheckResult, "generatedStates" | "distinctStates" | "queuedStates" | "depth" | "coverage"> {}
|
|
763
835
|
type CheckStatus = "success" | "assumption-violation" | "invariant-violation" | "property-violation" | "liveness-violation" | "postcondition-violation" | "deadlock" | "error";
|
|
764
836
|
interface TraceStep {
|
|
765
837
|
action: string | undefined;
|
|
838
|
+
/** TLC's name, parameters and location for the action that took this step. */
|
|
766
839
|
label: string | undefined;
|
|
767
840
|
state: Record<string, Value>;
|
|
841
|
+
/** What the spec prints before this step as TLC rebuilds the trace, and before it for the first. */
|
|
768
842
|
output?: OutputLine[];
|
|
769
843
|
}
|
|
770
844
|
interface Violation {
|
|
771
845
|
name: string;
|
|
846
|
+
/** Every temporal property that a liveness counterexample violates, in the configuration's order. */
|
|
772
847
|
properties?: string[];
|
|
773
848
|
trace: TraceStep[];
|
|
849
|
+
/** What the spec prints after the trace, as TLC finds the lasso's step back or rebuilds the trace. */
|
|
774
850
|
traceOutput?: OutputLine[];
|
|
851
|
+
/** What the postconditions print, which TLC checks after the lasso's step back. */
|
|
852
|
+
postconditionOutput?: OutputLine[];
|
|
775
853
|
loopStart: number | undefined;
|
|
776
854
|
loopLabel?: string;
|
|
777
855
|
message?: string;
|
|
778
856
|
counts?: string;
|
|
779
857
|
unwitnessed?: Postcondition;
|
|
858
|
+
/** A POSTCONDITION that is false or fails, which TLC checks as it prints the counterexample. */
|
|
780
859
|
postcondition?: Postcondition;
|
|
860
|
+
/** What TLC warns about after a counterexample, with its code. */
|
|
781
861
|
warning?: {
|
|
782
862
|
code: number;
|
|
783
863
|
text: string;
|
|
@@ -789,6 +869,7 @@ interface Postcondition {
|
|
|
789
869
|
message: string;
|
|
790
870
|
counts?: string;
|
|
791
871
|
}
|
|
872
|
+
/** An evaluation that failed during the search, with the behavior up to the state TLC was working on. */
|
|
792
873
|
interface EvaluationFailure {
|
|
793
874
|
code: number;
|
|
794
875
|
message: string;
|
|
@@ -797,11 +878,17 @@ interface EvaluationFailure {
|
|
|
797
878
|
traceOutput?: OutputLine[];
|
|
798
879
|
initialState: Record<string, Value> | undefined;
|
|
799
880
|
exitCode: number;
|
|
881
|
+
/** The expressions TLC was evaluating, outermost first, when its replay finds them. */
|
|
800
882
|
callStack: Expression[] | undefined;
|
|
883
|
+
/** Whether TLC prints the call stack before the error, as it does for a failed liveness check. */
|
|
801
884
|
isCallStackFirst?: boolean;
|
|
885
|
+
/** The FingerprintException the replay raises, which TLC reports in place of the call stack. */
|
|
802
886
|
fingerprint?: FingerprintFailure;
|
|
887
|
+
/** How TLC reports failing again as it prints the trace, since it can't fingerprint the state. */
|
|
803
888
|
traceFailure?: FailureMessage;
|
|
889
|
+
/** A POSTCONDITION that is false or fails after the trace, which TLC checks as it prints one. */
|
|
804
890
|
postcondition?: Postcondition;
|
|
891
|
+
/** Whether TLC stops before it prints the statistics, as it does for an illegal initial state. */
|
|
805
892
|
isWithoutStatistics?: boolean;
|
|
806
893
|
}
|
|
807
894
|
interface InitialStates {
|
|
@@ -816,12 +903,20 @@ interface CheckResult {
|
|
|
816
903
|
distinctStates: number;
|
|
817
904
|
queuedStates: number;
|
|
818
905
|
depth: number;
|
|
906
|
+
/** Once TLC computed all the initial states without a violation or an error. */
|
|
819
907
|
initialStates: InitialStates | undefined;
|
|
908
|
+
/** How many expanded states found each number of new states, when TLC prints the outdegree. */
|
|
820
909
|
outDegrees: number[] | undefined;
|
|
910
|
+
/** The smallest distance between two fingerprints, when TLC estimates a collision from them. */
|
|
821
911
|
fingerprintDistance: bigint | undefined;
|
|
912
|
+
/** A temporal property TLC finds violated as it adds a deadlocked state, reported after. */
|
|
822
913
|
additionalViolation?: Violation;
|
|
914
|
+
/** Where TLC's worker fails to add the state to the behavior graph after it reports a violation. */
|
|
823
915
|
liveCallStack?: Expression[];
|
|
916
|
+
/** The outdegrees when TLC's workers stop on a violation that TLC 1.7.4 reports as a success. */
|
|
824
917
|
violationOutDegrees?: number[];
|
|
918
|
+
traceSpec?: string;
|
|
919
|
+
coverage?: CoverageReport;
|
|
825
920
|
}
|
|
826
921
|
export declare const check: (options: CheckOptions) => Promise<CheckResult>;
|
|
827
922
|
export declare const parseModule: (source: string) => Module;
|
|
@@ -857,4 +952,4 @@ interface ProveOptions {
|
|
|
857
952
|
workers?: number;
|
|
858
953
|
}
|
|
859
954
|
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 };
|
|
955
|
+
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,6 +107,7 @@ 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 {
|
|
@@ -262,6 +263,7 @@ interface LabelExpression {
|
|
|
262
263
|
name: string;
|
|
263
264
|
params: string[];
|
|
264
265
|
paramRanges?: SourceRange[];
|
|
266
|
+
head?: SourceRange;
|
|
265
267
|
body: Expression;
|
|
266
268
|
location: SourceLocation;
|
|
267
269
|
}
|
|
@@ -299,6 +301,7 @@ interface OperatorDefinition {
|
|
|
299
301
|
params: OperatorParam[];
|
|
300
302
|
body: Expression;
|
|
301
303
|
bodyRange?: SourceRange;
|
|
304
|
+
head?: SourceRange;
|
|
302
305
|
isLocal: boolean;
|
|
303
306
|
isRecursive: boolean;
|
|
304
307
|
location: SourceLocation;
|
|
@@ -440,6 +443,7 @@ type ModuleUnit = {
|
|
|
440
443
|
} | {
|
|
441
444
|
kind: "Recursive";
|
|
442
445
|
declarations: Declaration[];
|
|
446
|
+
location: SourceLocation;
|
|
443
447
|
} | {
|
|
444
448
|
kind: "Definition";
|
|
445
449
|
definition: Definition;
|
|
@@ -512,6 +516,7 @@ interface ModelConfig {
|
|
|
512
516
|
actionConstraints: string[];
|
|
513
517
|
constants: ConstantAssignment[];
|
|
514
518
|
substitutions: Substitution[];
|
|
519
|
+
rawConstants: string[];
|
|
515
520
|
checkDeadlock: boolean;
|
|
516
521
|
symmetry: string | undefined;
|
|
517
522
|
view: string | undefined;
|
|
@@ -530,6 +535,13 @@ interface SyntaxFailure {
|
|
|
530
535
|
line: number;
|
|
531
536
|
column: number;
|
|
532
537
|
isEnd: boolean;
|
|
538
|
+
proof?: {
|
|
539
|
+
stop: {
|
|
540
|
+
line: number;
|
|
541
|
+
column: number;
|
|
542
|
+
};
|
|
543
|
+
exception: string;
|
|
544
|
+
};
|
|
533
545
|
}
|
|
534
546
|
interface SanyError {
|
|
535
547
|
location: string;
|
|
@@ -571,6 +583,8 @@ interface LazySet {
|
|
|
571
583
|
interface SetValue {
|
|
572
584
|
kind: "Set";
|
|
573
585
|
elements: Value[];
|
|
586
|
+
writtenElements: Value[] | undefined;
|
|
587
|
+
isNormalized: boolean;
|
|
574
588
|
hash: number;
|
|
575
589
|
fingerprint: number;
|
|
576
590
|
isFingerprinted: boolean;
|
|
@@ -587,6 +601,7 @@ interface FunctionValue {
|
|
|
587
601
|
fingerprint: number;
|
|
588
602
|
writtenKeys: Value[] | undefined;
|
|
589
603
|
functionClass: FunctionClass | undefined;
|
|
604
|
+
lambdaDomain: Value | undefined;
|
|
590
605
|
isFingerprinted: boolean;
|
|
591
606
|
}
|
|
592
607
|
interface IntervalValue {
|
|
@@ -633,7 +648,7 @@ interface FilteredSetSource {
|
|
|
633
648
|
interface FilteredSetValue extends LazySet {
|
|
634
649
|
kind: "FilteredSet";
|
|
635
650
|
base: Value;
|
|
636
|
-
test: (element: Value) => boolean;
|
|
651
|
+
test: (element: Value, isMember: boolean) => boolean;
|
|
637
652
|
source?: FilteredSetSource;
|
|
638
653
|
}
|
|
639
654
|
interface UnionValue extends LazySet {
|
|
@@ -652,6 +667,7 @@ interface LazyFunctionValue {
|
|
|
652
667
|
kind: "LazyFunction";
|
|
653
668
|
domain: Value;
|
|
654
669
|
apply: (argument: Value) => Value;
|
|
670
|
+
boundTupleLengths?: (number | undefined)[];
|
|
655
671
|
source?: LazyFunctionSource;
|
|
656
672
|
functionClass?: FunctionClass;
|
|
657
673
|
enumerated?: FunctionValue;
|
|
@@ -660,22 +676,47 @@ interface LazyFunctionValue {
|
|
|
660
676
|
type Value = boolean | number | string | ModelValue | SetValue | MixedSetValue | FunctionValue | IntervalValue | InfiniteSetValue | SubsetValue | FunctionSetValue | RecordSetValue | ProductSetValue | SequenceSetValue | SetOperationValue | FilteredSetValue | UnionValue | LazyFunctionValue;
|
|
661
677
|
type FunctionClass = "lambda" | "tuple" | "record";
|
|
662
678
|
export declare const formatValue: (value: Value, isStrict?: boolean, isNormalized?: boolean) => string;
|
|
663
|
-
interface FingerprintFailure {
|
|
664
|
-
sources: Expression[];
|
|
665
|
-
reason: string;
|
|
666
|
-
}
|
|
667
679
|
interface JavaOverride {
|
|
668
680
|
module: string;
|
|
669
681
|
operator: string;
|
|
670
682
|
signature: string;
|
|
671
683
|
isMatched: boolean;
|
|
672
684
|
}
|
|
685
|
+
interface FingerprintFailure {
|
|
686
|
+
sources: Expression[];
|
|
687
|
+
reason: string;
|
|
688
|
+
}
|
|
689
|
+
type CoverageKind = "init" | "next" | "invariant" | "constraint" | "implied";
|
|
690
|
+
interface CoverageReport {
|
|
691
|
+
variables: CoverageVariable[];
|
|
692
|
+
relations: CoverageRelationReport[];
|
|
693
|
+
}
|
|
694
|
+
interface CoverageVariable {
|
|
695
|
+
label: string;
|
|
696
|
+
distinct: number;
|
|
697
|
+
}
|
|
698
|
+
interface CoverageRelationReport {
|
|
699
|
+
kind: CoverageKind;
|
|
700
|
+
label: string;
|
|
701
|
+
distinct: number;
|
|
702
|
+
generated: number;
|
|
703
|
+
expressions: CoverageExpression[];
|
|
704
|
+
}
|
|
705
|
+
interface CoverageExpression {
|
|
706
|
+
location: string;
|
|
707
|
+
depth: number;
|
|
708
|
+
count: number;
|
|
709
|
+
cost: number;
|
|
710
|
+
}
|
|
673
711
|
interface StateDump {
|
|
674
712
|
path: string;
|
|
675
713
|
dot?: boolean;
|
|
676
714
|
colorize?: boolean;
|
|
677
715
|
actionLabels?: boolean;
|
|
678
716
|
snapshot?: boolean;
|
|
717
|
+
constrained?: boolean;
|
|
718
|
+
stuttering?: boolean;
|
|
719
|
+
strict?: boolean;
|
|
679
720
|
}
|
|
680
721
|
interface FailureMessage {
|
|
681
722
|
code: number;
|
|
@@ -690,19 +731,48 @@ interface CheckOptions {
|
|
|
690
731
|
onPrint?: (text: string) => void;
|
|
691
732
|
onPause?: () => void;
|
|
692
733
|
readFile?: (path: string) => string | undefined;
|
|
693
|
-
writeFile?: (path: string, content: string) => void;
|
|
734
|
+
writeFile?: (path: string, content: string | Uint8Array) => void;
|
|
735
|
+
makeDirectory?: (path: string) => void;
|
|
694
736
|
seed?: bigint;
|
|
695
737
|
workers?: number;
|
|
696
|
-
|
|
738
|
+
/** TLC's -lncheck: "final" checks liveness only on the complete graph, "off" never looks for a cycle. */
|
|
739
|
+
livenessCheck?: "default" | "final" | "off";
|
|
740
|
+
/** TLC's -fp: the index of the polynomial in TLC's FP64.Polys that fingerprints states. */
|
|
741
|
+
fingerprintPolynomial?: number;
|
|
742
|
+
/** False for TLC's -terse, which prints a lazy value, such as SUBSET S, without enumerating it. */
|
|
743
|
+
isLazyValueExpanded?: boolean;
|
|
744
|
+
/** TLC's -view: prints each state as the value of the configuration's VIEW. */
|
|
745
|
+
isViewPrinted?: boolean;
|
|
746
|
+
/** TLC's -maxSetSize: the most elements TLC enumerates into a set, or states into a list of them. */
|
|
747
|
+
maxSetSize?: number;
|
|
748
|
+
/** TLC's -dump: writes the reachable states, or with `dot` the state graph, through writeFile. */
|
|
697
749
|
dump?: StateDump;
|
|
750
|
+
/** TLC's -tool, which changes the messages of TLC's errors. */
|
|
698
751
|
isTool?: boolean;
|
|
752
|
+
/** TLC's -continue: reports each violation through onProgress and goes on. */
|
|
699
753
|
isContinued?: boolean;
|
|
700
|
-
|
|
754
|
+
moduleOperators?: ModuleOperator[];
|
|
755
|
+
/** TLC's trace exploration spec, and the binary trace TLC records for it unless -noTEBin. */
|
|
756
|
+
traceSpec?: TraceSpecOptions;
|
|
757
|
+
/** Whether the caller printed SANY's report, its warnings included, before the check. */
|
|
701
758
|
isSanyReported?: boolean;
|
|
759
|
+
/** False for TLC's -nowarning, which changes how TLC computes some successors. */
|
|
702
760
|
isWarningEnabled?: boolean;
|
|
761
|
+
/** TLC's -coverage, in minutes. */
|
|
762
|
+
coverage?: number;
|
|
703
763
|
version?: TlcVersion;
|
|
704
764
|
onProgress?: (progress: CheckProgress) => void;
|
|
705
765
|
}
|
|
766
|
+
interface TraceSpecOptions {
|
|
767
|
+
module: string;
|
|
768
|
+
traceFile?: string;
|
|
769
|
+
}
|
|
770
|
+
interface ModuleOperator {
|
|
771
|
+
kind: "postcondition" | "constraint" | "view";
|
|
772
|
+
module: string;
|
|
773
|
+
operator: string;
|
|
774
|
+
constants?: Record<string, string>;
|
|
775
|
+
}
|
|
706
776
|
interface InitialStatesProgress {
|
|
707
777
|
kind: "initial-states-progress";
|
|
708
778
|
count: number;
|
|
@@ -740,7 +810,9 @@ type CheckProgress = {
|
|
|
740
810
|
} | {
|
|
741
811
|
kind: "liveness-started";
|
|
742
812
|
branches: number;
|
|
813
|
+
/** Whether TLC checks the complete state graph. */
|
|
743
814
|
isComplete: boolean;
|
|
815
|
+
/** How many states of the graph each branch has. */
|
|
744
816
|
states: number;
|
|
745
817
|
statistics: SearchStatistics;
|
|
746
818
|
} | {
|
|
@@ -759,25 +831,33 @@ type CheckProgress = {
|
|
|
759
831
|
} | ({
|
|
760
832
|
kind: "java-override";
|
|
761
833
|
} & JavaOverride);
|
|
762
|
-
interface SearchStatistics extends Pick<CheckResult, "generatedStates" | "distinctStates" | "queuedStates" | "depth"> {}
|
|
834
|
+
interface SearchStatistics extends Pick<CheckResult, "generatedStates" | "distinctStates" | "queuedStates" | "depth" | "coverage"> {}
|
|
763
835
|
type CheckStatus = "success" | "assumption-violation" | "invariant-violation" | "property-violation" | "liveness-violation" | "postcondition-violation" | "deadlock" | "error";
|
|
764
836
|
interface TraceStep {
|
|
765
837
|
action: string | undefined;
|
|
838
|
+
/** TLC's name, parameters and location for the action that took this step. */
|
|
766
839
|
label: string | undefined;
|
|
767
840
|
state: Record<string, Value>;
|
|
841
|
+
/** What the spec prints before this step as TLC rebuilds the trace, and before it for the first. */
|
|
768
842
|
output?: OutputLine[];
|
|
769
843
|
}
|
|
770
844
|
interface Violation {
|
|
771
845
|
name: string;
|
|
846
|
+
/** Every temporal property that a liveness counterexample violates, in the configuration's order. */
|
|
772
847
|
properties?: string[];
|
|
773
848
|
trace: TraceStep[];
|
|
849
|
+
/** What the spec prints after the trace, as TLC finds the lasso's step back or rebuilds the trace. */
|
|
774
850
|
traceOutput?: OutputLine[];
|
|
851
|
+
/** What the postconditions print, which TLC checks after the lasso's step back. */
|
|
852
|
+
postconditionOutput?: OutputLine[];
|
|
775
853
|
loopStart: number | undefined;
|
|
776
854
|
loopLabel?: string;
|
|
777
855
|
message?: string;
|
|
778
856
|
counts?: string;
|
|
779
857
|
unwitnessed?: Postcondition;
|
|
858
|
+
/** A POSTCONDITION that is false or fails, which TLC checks as it prints the counterexample. */
|
|
780
859
|
postcondition?: Postcondition;
|
|
860
|
+
/** What TLC warns about after a counterexample, with its code. */
|
|
781
861
|
warning?: {
|
|
782
862
|
code: number;
|
|
783
863
|
text: string;
|
|
@@ -789,6 +869,7 @@ interface Postcondition {
|
|
|
789
869
|
message: string;
|
|
790
870
|
counts?: string;
|
|
791
871
|
}
|
|
872
|
+
/** An evaluation that failed during the search, with the behavior up to the state TLC was working on. */
|
|
792
873
|
interface EvaluationFailure {
|
|
793
874
|
code: number;
|
|
794
875
|
message: string;
|
|
@@ -797,11 +878,17 @@ interface EvaluationFailure {
|
|
|
797
878
|
traceOutput?: OutputLine[];
|
|
798
879
|
initialState: Record<string, Value> | undefined;
|
|
799
880
|
exitCode: number;
|
|
881
|
+
/** The expressions TLC was evaluating, outermost first, when its replay finds them. */
|
|
800
882
|
callStack: Expression[] | undefined;
|
|
883
|
+
/** Whether TLC prints the call stack before the error, as it does for a failed liveness check. */
|
|
801
884
|
isCallStackFirst?: boolean;
|
|
885
|
+
/** The FingerprintException the replay raises, which TLC reports in place of the call stack. */
|
|
802
886
|
fingerprint?: FingerprintFailure;
|
|
887
|
+
/** How TLC reports failing again as it prints the trace, since it can't fingerprint the state. */
|
|
803
888
|
traceFailure?: FailureMessage;
|
|
889
|
+
/** A POSTCONDITION that is false or fails after the trace, which TLC checks as it prints one. */
|
|
804
890
|
postcondition?: Postcondition;
|
|
891
|
+
/** Whether TLC stops before it prints the statistics, as it does for an illegal initial state. */
|
|
805
892
|
isWithoutStatistics?: boolean;
|
|
806
893
|
}
|
|
807
894
|
interface InitialStates {
|
|
@@ -816,12 +903,20 @@ interface CheckResult {
|
|
|
816
903
|
distinctStates: number;
|
|
817
904
|
queuedStates: number;
|
|
818
905
|
depth: number;
|
|
906
|
+
/** Once TLC computed all the initial states without a violation or an error. */
|
|
819
907
|
initialStates: InitialStates | undefined;
|
|
908
|
+
/** How many expanded states found each number of new states, when TLC prints the outdegree. */
|
|
820
909
|
outDegrees: number[] | undefined;
|
|
910
|
+
/** The smallest distance between two fingerprints, when TLC estimates a collision from them. */
|
|
821
911
|
fingerprintDistance: bigint | undefined;
|
|
912
|
+
/** A temporal property TLC finds violated as it adds a deadlocked state, reported after. */
|
|
822
913
|
additionalViolation?: Violation;
|
|
914
|
+
/** Where TLC's worker fails to add the state to the behavior graph after it reports a violation. */
|
|
823
915
|
liveCallStack?: Expression[];
|
|
916
|
+
/** The outdegrees when TLC's workers stop on a violation that TLC 1.7.4 reports as a success. */
|
|
824
917
|
violationOutDegrees?: number[];
|
|
918
|
+
traceSpec?: string;
|
|
919
|
+
coverage?: CoverageReport;
|
|
825
920
|
}
|
|
826
921
|
export declare const check: (options: CheckOptions) => Promise<CheckResult>;
|
|
827
922
|
export declare const parseModule: (source: string) => Module;
|
|
@@ -857,4 +952,4 @@ interface ProveOptions {
|
|
|
857
952
|
workers?: number;
|
|
858
953
|
}
|
|
859
954
|
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 };
|
|
955
|
+
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{B as e,F as t,_ as n,b as r,y as i}from"./worker.js";import{$t as a,Dt as o,V as s}from"./transfer.js";import{m as c,r as l}from"./prove.js";export{n as TlaConfigError,i as TlaError,r as TlaEvaluationError,t as TlaSyntaxError,e as TlaUnsupportedError,c as check,o as formatValue,a as parseConfig,s 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.z(n.source,a);t.Lt(s.getStringOrder(n.config)),t.Rt(n),t.xt(n.fingerprintPolynomial??0),t.Ot();let c=t.R(n.config,{source:n.source,loadModule:a,order:s,loadClass:e=>o.get(e),print:()=>{},files:{readFile:void 0,writeFile:void 0,makeDirectory:void 0},isTool:n.isTool,traceFile:n.traceFile,isWarningEnabled:n.isWarningEnabled,version:n.version}),l=c.environment,u=t.h(n.config,l,c.variableLocations,()=>s.getDeclarationOrder(`variable`)),d=u?.spec.next;if(!u||d===void 0)return r.postMessage({type:`abort`});let f=n.index,p=t.Ct(),m=t.t(l.variables.length),h=n.fingerprints,g=n.requests,_=n.remaining,v=u.isSymmetric?t.r():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.$(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.s(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.c(n.state,y),!v.insert(y[0],y[1])))continue;p(n.state);let a=u.getFingerprintState(n.state);if(t.c(a,y),t.o(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.Nt();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?.()});
|
package/dist/parallel-worker.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{n as e,t}from"./worker.js";import{
|
|
9
|
+
import{n as e,t}from"./worker.js";import{$ as n,Ct as r,Lt as i,Nt as a,Ot as o,R as s,Rt as c,c as l,h as u,n as d,o as f,r as p,s as m,t as h,xt as g,z as _}from"./transfer.js";const v=(e,v)=>{let y=new Map(e.modules),b=e=>y.get(e),x=new Map(e.classes),S=_(e.source,b);i(S.getStringOrder(e.config)),c(e),g(e.fingerprintPolynomial??0),o();let C=s(e.config,{source:e.source,loadModule:b,order:S,loadClass:e=>x.get(e),print:()=>{},files:{readFile:void 0,writeFile:void 0,makeDirectory:void 0},isTool:e.isTool,traceFile:e.traceFile,isWarningEnabled:e.isWarningEnabled,version:e.version}),w=C.environment,T=u(e.config,w,C.variableLocations,()=>S.getDeclarationOrder(`variable`)),E=T?.spec.next;if(!T||E===void 0)return v.postMessage({type:`abort`});let D=e.index,O=r(),k=h(w.variables.length),A=e.fingerprints,j=e.requests,M=e.remaining,N=T.isSymmetric?p():void 0,P=/* @__PURE__ */ new Int32Array(2),F=()=>{},I=e=>{};e.ports.forEach(e=>{e?.addEventListener(`message`,e=>I(e.data)),e?.start?.()});let L=k(e.seed).map(O),R=t(),z=(t,n)=>{let r=Atomics.load(j,D)-1,i=Math.floor((t.end-t.origin-1)/2),a=d(),o=t.states.slice(t.end-i,t.end),s=i>0&&o.every(a.encode);s&&(t.end-=i);let c=s?a.finish():d().finish();e.ports[r]?.postMessage(c,[c.words.buffer]),Atomics.store(j,D,n),Atomics.notify(j,D)},B=e=>{Atomics.store(M,D,0),Atomics.compareExchange(j,D,0,-1)!==0&&z(e,-1)},V=e=>{Atomics.store(M,D,e.end-e.origin),Atomics.store(j,D,0)},H=t=>{for(;t.origin<t.end;t.origin++){let r=t.states[t.origin];if(!t.successors){if(performance.now()>=t.breakAt)return`break`;if(Atomics.load(j,D)>0&&z(t,0),Atomics.store(M,D,t.end-t.origin-1),t.successors=n(E,r,w,T.spec.scope),t.generated+=t.successors.length,t.successors.length===0&&e.config.checkDeadlock)return}let i=t.successors;for(;t.index<i.length;t.index++){if(m(A))return`paused`;let e=i[t.index];if(T.findViolatedActionProperty(r,e.state))return;if(!T.satisfiesActionConstraints(r,e.state)){if(T.findViolatedInvariant(e.state,r))return;continue}if(N&&(l(e.state,P),!N.insert(P[0],P[1])))continue;O(e.state);let n=T.getFingerprintState(e.state);if(l(n,P),f(A,P[0],P[1])){if(T.findViolatedInvariant(e.state,r))return;T.satisfiesConstraints(e.state,r)&&(t.next.push(e.state),t.fingerprintStates.push(n),t.added++)}}t.outDegrees[Math.min(t.added,31)]++,t.successors=void 0,t.index=0,t.added=0}return`done`},U=async t=>{let n=/* @__PURE__ */ new Set;for(;;){let r=e.ports.reduce((e,t,r)=>!t||n.has(r)||Atomics.load(M,r)<2?e:e===void 0||Atomics.load(M,r)>Atomics.load(M,e)?r:e,void 0);if(r===void 0)return!1;let i=Atomics.compareExchange(j,r,0,D+1);if(i===-1&&n.add(r),i>0&&Atomics.wait(j,r,i),i!==0)continue;let a=await new Promise(e=>I=e);if(a.count===0)n.add(r);else return t.states=k(a).map(O),t.origin=0,t.end=t.states.length,V(t),!0}},W=e=>v.postMessage(e,e.type===`level`?[e.fingerprints.buffer]:[]),G=async()=>{let e={states:L,origin:0,end:L.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=H(e);if(t===void 0)return;if(t===`break`)await R(),e.breakAt=performance.now()+100;else if(B(e),t===`paused`){let t=new Promise(e=>F=e);W({type:`paused`}),await t,V(e)}else if(!await U(e))break}let t=a();return t===void 0?(L=e.next,Atomics.store(M,D,L.length),{type:`level`,generated:e.generated,added:e.next.length,outDegrees:e.outDegrees,fingerprints:T.getStoredFingerprints(e.next,e.fingerprintStates)}):{type:`abort`,string:t}},K=()=>{G().then(e=>W(e??{type:`abort`}),()=>W({type:`abort`}))};v.addEventListener(`message`,e=>{let t=e.data;t.type===`level`&&K(),t.type===`resize`&&(A=t.fingerprints,F())}),Atomics.store(M,D,L.length),W({type:`ready`})};e().then(e=>{let t=n=>{let r=n.data;if(r.type===`start`){e.removeEventListener?.(`message`,t);try{v(r,e)}catch{e.postMessage({type:`abort`})}}};e.addEventListener(`message`,t),e.start?.()});
|
package/dist/prove-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("./deciders.cjs"),n=n=>{try{return t.t(n.prover,n.text,{timeLimitMs:n.timeLimitMs})}catch(t){if(t instanceof e.
|
|
9
|
+
const e=require("./worker.cjs"),t=require("./deciders.cjs"),n=n=>{try{return t.t(n.prover,n.text,{timeLimitMs:n.timeLimitMs})}catch(t){if(t instanceof e.j)return{error:t.message};throw t}};e.n().then(e=>{e.addEventListener(`message`,t=>e.postMessage(n(t.data))),e.start?.()});
|
package/dist/prove-worker.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{j as e,n as t}from"./worker.js";import{t as n}from"./deciders.js";const r=t=>{try{return n(t.prover,t.text,{timeLimitMs:t.timeLimitMs})}catch(t){if(t instanceof e)return{error:t.message};throw t}};t().then(e=>{e.addEventListener(`message`,t=>e.postMessage(r(t.data))),e.start?.()});
|