tla-ts 0.0.9 → 0.0.10-dev.63a6693bd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +29 -1
- package/dist/compile.cjs +23 -0
- package/dist/compile.js +23 -0
- package/dist/deciders.cjs +29 -29
- package/dist/deciders.js +42 -42
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +106 -10
- package/dist/index.d.ts +106 -10
- package/dist/index.js +1 -1
- package/dist/parallel-worker.cjs +1 -1
- package/dist/parallel-worker.js +1 -1
- package/dist/prove-worker.cjs +1 -1
- package/dist/prove-worker.js +1 -1
- package/dist/prove.cjs +117 -37
- package/dist/prove.js +116 -36
- package/dist/run.cjs +143 -31
- package/dist/run.js +143 -31
- package/dist/tlapm.cjs +2 -2
- package/dist/tlapm.js +2 -2
- package/dist/transfer.cjs +129 -104
- package/dist/transfer.js +129 -104
- package/dist/worker.cjs +7 -7
- package/dist/worker.js +7 -7
- package/package.json +3 -1
- package/src/ast.ts +48 -62
- package/src/bags.ts +99 -102
- package/src/builtins.ts +28 -75
- package/src/bundled-modules.ts +1 -8
- package/src/check-failure.ts +116 -0
- package/src/check-trace.ts +282 -0
- package/src/check.ts +599 -754
- package/src/cli/options.ts +12 -32
- package/src/cli/run.ts +0 -2
- package/src/cli/runtime-invariants.ts +136 -0
- package/src/cli/shared.ts +19 -12
- package/src/cli/tlapm.ts +14 -25
- package/src/cli/tlc-arguments.ts +652 -0
- package/src/cli/tlc-output.ts +687 -0
- package/src/cli/tlc-usage.ts +361 -0
- package/src/cli/tlc.ts +309 -658
- package/src/cli/typescript.ts +23 -0
- package/src/cli/xml-exporter.ts +27 -49
- package/src/cli.ts +0 -1
- package/src/codegen.ts +196 -74
- package/src/config.ts +140 -109
- package/src/coverage.ts +830 -0
- package/src/dependencies.ts +14 -53
- package/src/dfid.ts +618 -0
- package/src/environment-config.ts +315 -0
- package/src/environment.ts +169 -335
- package/src/errors.ts +71 -55
- package/src/evaluate.ts +598 -340
- package/src/exit-codes.ts +37 -3
- package/src/fingerprints.ts +75 -11
- package/src/index.ts +3 -0
- package/src/instances.ts +126 -21
- package/src/java-hash.ts +7 -0
- package/src/java-overrides.ts +4 -19
- package/src/json-reader.ts +455 -0
- package/src/json.ts +252 -139
- package/src/levels.ts +46 -58
- package/src/lexer.ts +80 -100
- package/src/liveness-checker.ts +103 -153
- package/src/liveness.ts +150 -109
- package/src/obligations/action.ts +8 -39
- package/src/obligations/anonymize.ts +88 -82
- package/src/obligations/equality.ts +1 -1
- package/src/obligations/expression.ts +20 -21
- package/src/obligations/format.ts +1 -9
- package/src/obligations/generate.ts +46 -49
- package/src/obligations/index.ts +2 -13
- package/src/obligations/levels.ts +4 -8
- package/src/obligations/module.ts +28 -53
- package/src/obligations/normalize.ts +7 -25
- package/src/obligations/operators.ts +1 -2
- package/src/obligations/pragma.ts +1 -10
- package/src/obligations/printer.ts +47 -46
- package/src/obligations/proof.ts +1 -5
- package/src/obligations/regroup.ts +1 -4
- package/src/obligations/simplify.ts +42 -58
- package/src/obligations/source.ts +48 -78
- package/src/obligations/subexpression.ts +5 -11
- package/src/obligations/substitution.ts +1 -3
- package/src/obligations/temporal.ts +13 -19
- package/src/obligations/tuples.ts +3 -9
- package/src/parallel-worker.ts +30 -60
- package/src/parallel.ts +57 -71
- package/src/parser.ts +584 -316
- package/src/pcal/ast.ts +53 -86
- package/src/pcal/parse.ts +144 -219
- package/src/pcal/tokenize.ts +91 -131
- package/src/pcal/translate.ts +83 -130
- package/src/pcal/validate.ts +48 -68
- package/src/pretty-print.ts +7 -8
- package/src/prover/decide-pool.ts +8 -13
- package/src/prover/deciders.ts +3 -7
- package/src/prover/first-order.ts +0 -11
- package/src/prover/isabelle/decide.ts +0 -6
- package/src/prover/isabelle/encode.ts +11 -23
- package/src/prover/isabelle/isar/inner-syntax.ts +114 -115
- package/src/prover/isabelle/isar/method.ts +29 -53
- package/src/prover/isabelle/isar/proof.ts +1 -10
- package/src/prover/isabelle/isar/statement.ts +1 -6
- package/src/prover/isabelle/isar/theory.ts +26 -36
- package/src/prover/isabelle/isar/type-check.ts +17 -31
- package/src/prover/isabelle/provers/blast/blast.ts +17 -104
- package/src/prover/isabelle/provers/blast/branch.ts +1 -32
- package/src/prover/isabelle/provers/blast/prove.ts +1 -35
- package/src/prover/isabelle/provers/blast/rules.ts +6 -44
- package/src/prover/isabelle/provers/blast/state.ts +2 -28
- package/src/prover/isabelle/provers/blast/term.ts +9 -36
- package/src/prover/isabelle/provers/clasimp.ts +1 -13
- package/src/prover/isabelle/provers/classical.ts +14 -42
- package/src/prover/isabelle/provers/hypsubst.ts +28 -51
- package/src/prover/isabelle/pure/bicompose.ts +25 -38
- package/src/prover/isabelle/pure/consts.ts +1 -7
- package/src/prover/isabelle/pure/conv.ts +3 -17
- package/src/prover/isabelle/pure/drule.ts +33 -42
- package/src/prover/isabelle/pure/envir.ts +3 -52
- package/src/prover/isabelle/pure/goal.ts +1 -7
- package/src/prover/isabelle/pure/interrupt.ts +0 -5
- package/src/prover/isabelle/pure/list.ts +0 -3
- package/src/prover/isabelle/pure/logic.ts +2 -15
- package/src/prover/isabelle/pure/name.ts +2 -9
- package/src/prover/isabelle/pure/net.ts +3 -59
- package/src/prover/isabelle/pure/object-logic.ts +3 -10
- package/src/prover/isabelle/pure/pattern.ts +2 -19
- package/src/prover/isabelle/pure/raw-simplifier.ts +17 -62
- package/src/prover/isabelle/pure/rewriter.ts +31 -67
- package/src/prover/isabelle/pure/search.ts +3 -10
- package/src/prover/isabelle/pure/seq.ts +1 -10
- package/src/prover/isabelle/pure/simplifier.ts +4 -12
- package/src/prover/isabelle/pure/table.ts +3 -32
- package/src/prover/isabelle/pure/tactic.ts +12 -22
- package/src/prover/isabelle/pure/tactical.ts +48 -47
- package/src/prover/isabelle/pure/term-ord.ts +2 -6
- package/src/prover/isabelle/pure/term.ts +2 -43
- package/src/prover/isabelle/pure/thm.ts +27 -47
- package/src/prover/isabelle/pure/type.ts +2 -15
- package/src/prover/isabelle/pure/unify.ts +20 -30
- package/src/prover/isabelle/pure/variable.ts +3 -7
- package/src/prover/isabelle/tla/classical-setup.ts +17 -24
- package/src/prover/isabelle/tla/context.ts +15 -18
- package/src/prover/isabelle/tla/logic.ts +14 -32
- package/src/prover/isabelle/tla/simpdata.ts +46 -43
- package/src/prover/isabelle/tools/intuitionistic.ts +1 -10
- package/src/prover/ocaml.ts +0 -6
- package/src/prover/prep/action.ts +14 -54
- package/src/prover/prep/enabled-axioms.ts +12 -19
- package/src/prover/prep/fingerprint.ts +2 -21
- package/src/prover/prep/level-comparison.ts +8 -12
- package/src/prover/prep/md5.ts +0 -2
- package/src/prover/prep/methods.ts +33 -39
- package/src/prover/prep/normalize.ts +4 -28
- package/src/prover/prove-worker.ts +0 -2
- package/src/prover/prove.ts +87 -100
- package/src/prover/ptl/decide.ts +7 -12
- package/src/prover/ptl/encode.ts +14 -36
- package/src/prover/ptl/sat.ts +24 -32
- package/src/prover/ptl/tableau.ts +12 -26
- package/src/prover/smt/axioms.ts +0 -7
- package/src/prover/smt/context.ts +20 -28
- package/src/prover/smt/data.ts +433 -424
- package/src/prover/smt/encode.ts +43 -52
- package/src/prover/smt/extensionality.ts +0 -10
- package/src/prover/smt/flatten.ts +3 -22
- package/src/prover/smt/format.ts +5 -10
- package/src/prover/smt/instances.ts +0 -10
- package/src/prover/smt/rewrite.ts +663 -667
- package/src/prover/smt/solver/act-cache.ts +0 -15
- package/src/prover/smt/solver/arith-rewriter.ts +3 -48
- package/src/prover/smt/solver/array.ts +1 -3
- package/src/prover/smt/solver/asserted-formulas.ts +1 -43
- package/src/prover/smt/solver/ast-lt.ts +1 -11
- package/src/prover/smt/solver/ast-util.ts +1 -6
- package/src/prover/smt/solver/ast.ts +1 -165
- package/src/prover/smt/solver/auf-solver.ts +8 -44
- package/src/prover/smt/solver/case-split-queue.ts +1 -9
- package/src/prover/smt/solver/cg-table.ts +1 -18
- package/src/prover/smt/solver/clause.ts +1 -27
- package/src/prover/smt/solver/conflict-resolution.ts +0 -9
- package/src/prover/smt/solver/context.ts +7 -64
- package/src/prover/smt/solver/ctx-simplify.ts +14 -41
- package/src/prover/smt/solver/der.ts +2 -21
- package/src/prover/smt/solver/dyn-ack.ts +1 -11
- package/src/prover/smt/solver/e-matching.ts +4 -35
- package/src/prover/smt/solver/enode.ts +1 -21
- package/src/prover/smt/solver/expr-ref.ts +1 -5
- package/src/prover/smt/solver/expr-safe-replace.ts +1 -6
- package/src/prover/smt/solver/fingerprints.ts +1 -12
- package/src/prover/smt/solver/flat-literals.ts +1 -9
- package/src/prover/smt/solver/goal.ts +2 -14
- package/src/prover/smt/solver/hash.ts +0 -8
- package/src/prover/smt/solver/hashtable.ts +1 -12
- package/src/prover/smt/solver/internalizer.ts +7 -100
- package/src/prover/smt/solver/lbool.ts +1 -2
- package/src/prover/smt/solver/literal.ts +0 -3
- package/src/prover/smt/solver/lp/bound-propagator.ts +8 -26
- package/src/prover/smt/solver/lp/constraints.ts +2 -8
- package/src/prover/smt/solver/lp/containers.ts +12 -30
- package/src/prover/smt/solver/lp/core-solver.ts +10 -31
- package/src/prover/smt/solver/lp/cross-nested.ts +6 -20
- package/src/prover/smt/solver/lp/dep-intervals.ts +7 -22
- package/src/prover/smt/solver/lp/dependency.ts +1 -4
- package/src/prover/smt/solver/lp/dioph-eq.ts +9 -102
- package/src/prover/smt/solver/lp/explanation.ts +1 -6
- package/src/prover/smt/solver/lp/gomory.ts +9 -22
- package/src/prover/smt/solver/lp/hnf-cutter.ts +17 -23
- package/src/prover/smt/solver/lp/hnf.ts +11 -26
- package/src/prover/smt/solver/lp/int-cube.ts +15 -36
- package/src/prover/smt/solver/lp/int-solver.ts +4 -34
- package/src/prover/smt/solver/lp/lar-solver.ts +32 -81
- package/src/prover/smt/solver/lp/lar-term.ts +1 -5
- package/src/prover/smt/solver/lp/lp-settings.ts +1 -14
- package/src/prover/smt/solver/lp/maximize-term.ts +20 -45
- package/src/prover/smt/solver/lp/nex-creator.ts +5 -28
- package/src/prover/smt/solver/lp/nex.ts +1 -6
- package/src/prover/smt/solver/lp/nla-backoff.ts +1 -4
- package/src/prover/smt/solver/lp/nla-basics.ts +5 -30
- package/src/prover/smt/solver/lp/nla-core.ts +36 -135
- package/src/prover/smt/solver/lp/nla-divisions.ts +32 -42
- package/src/prover/smt/solver/lp/nla-emonics.ts +4 -21
- package/src/prover/smt/solver/lp/nla-factorization.ts +1 -4
- package/src/prover/smt/solver/lp/nla-grobner.ts +15 -69
- package/src/prover/smt/solver/lp/nla-horner.ts +3 -11
- package/src/prover/smt/solver/lp/nla-intervals.ts +2 -12
- package/src/prover/smt/solver/lp/nla-monomial-bounds.ts +16 -41
- package/src/prover/smt/solver/lp/nla-monotone.ts +2 -6
- package/src/prover/smt/solver/lp/nla-order.ts +2 -13
- package/src/prover/smt/solver/lp/nla-patcher.ts +4 -7
- package/src/prover/smt/solver/lp/nla-tangents.ts +1 -9
- package/src/prover/smt/solver/lp/nla-throttle.ts +1 -6
- package/src/prover/smt/solver/lp/nla-types.ts +1 -11
- package/src/prover/smt/solver/lp/nla-var-eqs.ts +4 -25
- package/src/prover/smt/solver/lp/nra-solver.ts +5 -52
- package/src/prover/smt/solver/lp/numeric-pair.ts +1 -4
- package/src/prover/smt/solver/lp/pdd-interval.ts +1 -3
- package/src/prover/smt/solver/lp/pdd-simplifier.ts +2 -14
- package/src/prover/smt/solver/lp/pdd-solver.ts +4 -33
- package/src/prover/smt/solver/lp/pdd.ts +7 -70
- package/src/prover/smt/solver/lp/random-updater.ts +1 -8
- package/src/prover/smt/solver/lp/static-matrix.ts +9 -19
- package/src/prover/smt/solver/lp/union-find.ts +1 -6
- package/src/prover/smt/solver/mam-compiler.ts +18 -58
- package/src/prover/smt/solver/mam-interpreter.ts +1 -21
- package/src/prover/smt/solver/maximize-ac-sharing.ts +2 -17
- package/src/prover/smt/solver/model-checker.ts +3 -37
- package/src/prover/smt/solver/model-evaluator.ts +3 -29
- package/src/prover/smt/solver/model-finder.ts +15 -32
- package/src/prover/smt/solver/model-generator.ts +1 -12
- package/src/prover/smt/solver/model-macro-solver.ts +23 -88
- package/src/prover/smt/solver/nlsat/algebraic.ts +63 -159
- package/src/prover/smt/solver/nlsat/atoms.ts +25 -23
- package/src/prover/smt/solver/nlsat/evaluator.ts +17 -22
- package/src/prover/smt/solver/nlsat/explain.ts +10 -69
- package/src/prover/smt/solver/nlsat/interval-set.ts +9 -50
- package/src/prover/smt/solver/nlsat/levelwise.ts +49 -135
- package/src/prover/smt/solver/nlsat/mpbq.ts +3 -14
- package/src/prover/smt/solver/nlsat/polynomial.ts +29 -159
- package/src/prover/smt/solver/nlsat/solver.ts +18 -90
- package/src/prover/smt/solver/nlsat/types.ts +1 -8
- package/src/prover/smt/solver/nlsat/upolynomial-factorization.ts +2 -45
- package/src/prover/smt/solver/nlsat/upolynomial.ts +11 -92
- package/src/prover/smt/solver/nnf.ts +3 -38
- package/src/prover/smt/solver/pattern-inference.ts +2 -15
- package/src/prover/smt/solver/poly-rewriter.ts +3 -23
- package/src/prover/smt/solver/propagate-values.ts +1 -10
- package/src/prover/smt/solver/proto-model.ts +3 -52
- package/src/prover/smt/solver/pull-quant.ts +1 -12
- package/src/prover/smt/solver/qe-lite-der.ts +1 -29
- package/src/prover/smt/solver/qe-lite-fm.ts +2 -25
- package/src/prover/smt/solver/qe-lite.ts +3 -33
- package/src/prover/smt/solver/qi-queue.ts +1 -16
- package/src/prover/smt/solver/quant-tactics.ts +5 -22
- package/src/prover/smt/solver/quantifier-analyzer.ts +27 -47
- package/src/prover/smt/solver/quantifier-manager.ts +2 -13
- package/src/prover/smt/solver/random-gen.ts +1 -2
- package/src/prover/smt/solver/rational.ts +1 -8
- package/src/prover/smt/solver/ref-vector.ts +1 -6
- package/src/prover/smt/solver/relevancy.ts +2 -15
- package/src/prover/smt/solver/rewriter-tpl.ts +3 -147
- package/src/prover/smt/solver/rewriter.ts +3 -85
- package/src/prover/smt/solver/rlimit.ts +2 -20
- package/src/prover/smt/solver/smtlib-parser.ts +80 -131
- package/src/prover/smt/solver/solver.ts +23 -34
- package/src/prover/smt/solver/sort.ts +1 -5
- package/src/prover/smt/solver/sticky-generations.ts +0 -5
- package/src/prover/smt/solver/theory-lra-axioms.ts +3 -24
- package/src/prover/smt/solver/theory-lra-bounds.ts +1 -7
- package/src/prover/smt/solver/theory-lra-final-check.ts +4 -22
- package/src/prover/smt/solver/theory-lra-internalize.ts +6 -43
- package/src/prover/smt/solver/theory-lra-model.ts +4 -19
- package/src/prover/smt/solver/theory-lra-propagate.ts +1 -15
- package/src/prover/smt/solver/theory-lra-state.ts +3 -8
- package/src/prover/smt/solver/theory-lra.ts +1 -8
- package/src/prover/smt/solver/var-subst.ts +2 -26
- package/src/prover/smt/table.ts +0 -8
- package/src/prover/tlapm/cache.ts +45 -40
- package/src/prover/tlapm/ocaml-marshal.ts +19 -21
- package/src/prover/tlapm/tlapm.ts +21 -20
- package/src/prover/verdict.ts +7 -2
- package/src/prover/zenon/check/check.ts +1 -11
- package/src/prover/zenon/check/definitions.ts +5 -15
- package/src/prover/zenon/check/equality.ts +0 -8
- package/src/prover/zenon/check/functions.ts +0 -4
- package/src/prover/zenon/check/keys.ts +0 -7
- package/src/prover/zenon/check/propositional.ts +0 -3
- package/src/prover/zenon/check/records.ts +1 -6
- package/src/prover/zenon/check/relations.ts +2 -14
- package/src/prover/zenon/check/rewrites.ts +2 -21
- package/src/prover/zenon/check/sets.ts +40 -61
- package/src/prover/zenon/check/terms.ts +1 -19
- package/src/prover/zenon/check/tla.ts +0 -6
- package/src/prover/zenon/decide.ts +0 -12
- package/src/prover/zenon/encode.ts +1 -8
- package/src/prover/zenon/eqrel.ts +2 -13
- package/src/prover/zenon/equality-rules.ts +0 -4
- package/src/prover/zenon/expr.ts +8 -26
- package/src/prover/zenon/index-table.ts +26 -57
- package/src/prover/zenon/isar-case.ts +9 -19
- package/src/prover/zenon/isar.ts +36 -64
- package/src/prover/zenon/limits.ts +0 -4
- package/src/prover/zenon/llproof.ts +2 -20
- package/src/prover/zenon/mltoll.ts +66 -104
- package/src/prover/zenon/node.ts +1 -11
- package/src/prover/zenon/ocaml.ts +1 -17
- package/src/prover/zenon/parse.ts +4 -12
- package/src/prover/zenon/phrase.ts +1 -11
- package/src/prover/zenon/proof.ts +0 -9
- package/src/prover/zenon/propositional-rules.ts +0 -5
- package/src/prover/zenon/rules.ts +2 -6
- package/src/prover/zenon/search.ts +5 -31
- package/src/prover/zenon/tla/functions.ts +59 -31
- package/src/prover/zenon/tla/llproof.ts +67 -76
- package/src/prover/zenon/tla/records.ts +57 -33
- package/src/prover/zenon/tla/rewrites.ts +12 -19
- package/src/prover/zenon/tla/sets.ts +83 -53
- package/src/prover/zenon/tla/terms.ts +0 -6
- package/src/prover/zenon/tla/tla.ts +66 -64
- package/src/randomization.ts +81 -35
- package/src/resolve.ts +67 -184
- package/src/runtime.ts +22 -22
- package/src/sany/builtins.ts +2 -5
- package/src/sany/generation.ts +394 -0
- package/src/sany/generator-def-entries.ts +210 -0
- package/src/sany/generator-definitions.ts +686 -0
- package/src/sany/generator-expressions.ts +1100 -0
- package/src/sany/generator-proofs.ts +662 -0
- package/src/sany/generator.ts +191 -2764
- package/src/sany/levels.ts +6 -34
- package/src/sany/lexer.ts +58 -77
- package/src/sany/linter.ts +1 -9
- package/src/sany/modules.ts +1 -5
- package/src/sany/nodes.ts +5 -43
- package/src/sany/parse-error.ts +39 -117
- package/src/sany/report.ts +32 -69
- package/src/sany/selectors.ts +49 -76
- package/src/sany/source.ts +1 -17
- package/src/sany/xml.ts +35 -117
- package/src/search.ts +541 -163
- package/src/simulate.ts +709 -0
- package/src/spec-description.ts +192 -100
- package/src/standard-definitions.ts +0 -4
- package/src/standard-modules.ts +264 -95
- package/src/state-graph.ts +52 -31
- package/src/subexpressions.ts +69 -52
- package/src/substitution-levels.ts +7 -7
- package/src/successors.ts +266 -99
- package/src/symmetry.ts +33 -25
- package/src/tableau.ts +27 -24
- package/src/tlc/fingerprint.ts +183 -67
- package/src/tlc/jar-data.ts +112 -6
- package/src/tlc/messages.ts +125 -54
- package/src/tlc/order.ts +39 -69
- package/src/tlc/random.ts +37 -49
- package/src/tlc/replay.ts +553 -228
- package/src/tlc/summary.ts +36 -47
- package/src/tlc/tlc-operators.ts +78 -44
- package/src/tlc/tlcext-operators.ts +139 -122
- package/src/tlc/trace-spec.ts +249 -0
- package/src/tlc/value-stream.ts +139 -0
- package/src/tlc/version.ts +1 -4
- package/src/transfer.ts +22 -25
- package/src/typescript/actions.ts +479 -0
- package/src/typescript/collections.ts +614 -0
- package/src/typescript/compile.ts +63 -0
- package/src/typescript/context.ts +94 -0
- package/src/typescript/emit.ts +121 -0
- package/src/typescript/expressions.ts +496 -0
- package/src/typescript/formula.ts +154 -0
- package/src/typescript/functions.ts +284 -0
- package/src/typescript/model.ts +162 -0
- package/src/typescript/names.ts +114 -0
- package/src/typescript/program.ts +48 -0
- package/src/typescript/properties.ts +139 -0
- package/src/typescript/scope.ts +112 -0
- package/src/typescript/steps.ts +167 -0
- package/src/typescript/types.ts +171 -0
- package/src/values.ts +832 -484
- package/src/worker.ts +7 -8
package/dist/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.P,exports.TlaUnsupportedError=e.z,exports.check=n.v,exports.formatValue=t.kt,exports.parseConfig=t.$t,exports.parseModule=t.y,exports.prove=n.a;
|
package/dist/index.d.cts
CHANGED
|
@@ -6,6 +6,7 @@
|
|
|
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 "@typescript/typescript6";
|
|
9
10
|
interface LocalResolution {
|
|
10
11
|
kind: "Local";
|
|
11
12
|
}
|
|
@@ -106,6 +107,7 @@ interface CaseExpression {
|
|
|
106
107
|
kind: "Case";
|
|
107
108
|
arms: CaseArm[];
|
|
108
109
|
other: Expression | undefined;
|
|
110
|
+
otherRange?: SourceRange;
|
|
109
111
|
location: SourceLocation;
|
|
110
112
|
}
|
|
111
113
|
interface LetExpression {
|
|
@@ -261,6 +263,7 @@ interface LabelExpression {
|
|
|
261
263
|
name: string;
|
|
262
264
|
params: string[];
|
|
263
265
|
paramRanges?: SourceRange[];
|
|
266
|
+
head?: SourceRange;
|
|
264
267
|
body: Expression;
|
|
265
268
|
location: SourceLocation;
|
|
266
269
|
}
|
|
@@ -298,6 +301,7 @@ interface OperatorDefinition {
|
|
|
298
301
|
params: OperatorParam[];
|
|
299
302
|
body: Expression;
|
|
300
303
|
bodyRange?: SourceRange;
|
|
304
|
+
head?: SourceRange;
|
|
301
305
|
isLocal: boolean;
|
|
302
306
|
isRecursive: boolean;
|
|
303
307
|
location: SourceLocation;
|
|
@@ -439,6 +443,7 @@ type ModuleUnit = {
|
|
|
439
443
|
} | {
|
|
440
444
|
kind: "Recursive";
|
|
441
445
|
declarations: Declaration[];
|
|
446
|
+
location: SourceLocation;
|
|
442
447
|
} | {
|
|
443
448
|
kind: "Definition";
|
|
444
449
|
definition: Definition;
|
|
@@ -511,6 +516,7 @@ interface ModelConfig {
|
|
|
511
516
|
actionConstraints: string[];
|
|
512
517
|
constants: ConstantAssignment[];
|
|
513
518
|
substitutions: Substitution[];
|
|
519
|
+
rawConstants: string[];
|
|
514
520
|
checkDeadlock: boolean;
|
|
515
521
|
symmetry: string | undefined;
|
|
516
522
|
view: string | undefined;
|
|
@@ -529,6 +535,13 @@ interface SyntaxFailure {
|
|
|
529
535
|
line: number;
|
|
530
536
|
column: number;
|
|
531
537
|
isEnd: boolean;
|
|
538
|
+
proof?: {
|
|
539
|
+
stop: {
|
|
540
|
+
line: number;
|
|
541
|
+
column: number;
|
|
542
|
+
};
|
|
543
|
+
exception: string;
|
|
544
|
+
};
|
|
532
545
|
}
|
|
533
546
|
interface SanyError {
|
|
534
547
|
location: string;
|
|
@@ -570,6 +583,8 @@ interface LazySet {
|
|
|
570
583
|
interface SetValue {
|
|
571
584
|
kind: "Set";
|
|
572
585
|
elements: Value[];
|
|
586
|
+
writtenElements: Value[] | undefined;
|
|
587
|
+
isNormalized: boolean;
|
|
573
588
|
hash: number;
|
|
574
589
|
fingerprint: number;
|
|
575
590
|
isFingerprinted: boolean;
|
|
@@ -586,6 +601,7 @@ interface FunctionValue {
|
|
|
586
601
|
fingerprint: number;
|
|
587
602
|
writtenKeys: Value[] | undefined;
|
|
588
603
|
functionClass: FunctionClass | undefined;
|
|
604
|
+
lambdaDomain: Value | undefined;
|
|
589
605
|
isFingerprinted: boolean;
|
|
590
606
|
}
|
|
591
607
|
interface IntervalValue {
|
|
@@ -632,7 +648,7 @@ interface FilteredSetSource {
|
|
|
632
648
|
interface FilteredSetValue extends LazySet {
|
|
633
649
|
kind: "FilteredSet";
|
|
634
650
|
base: Value;
|
|
635
|
-
test: (element: Value) => boolean;
|
|
651
|
+
test: (element: Value, isMember: boolean) => boolean;
|
|
636
652
|
source?: FilteredSetSource;
|
|
637
653
|
}
|
|
638
654
|
interface UnionValue extends LazySet {
|
|
@@ -651,6 +667,7 @@ interface LazyFunctionValue {
|
|
|
651
667
|
kind: "LazyFunction";
|
|
652
668
|
domain: Value;
|
|
653
669
|
apply: (argument: Value) => Value;
|
|
670
|
+
boundTupleLengths?: (number | undefined)[];
|
|
654
671
|
source?: LazyFunctionSource;
|
|
655
672
|
functionClass?: FunctionClass;
|
|
656
673
|
enumerated?: FunctionValue;
|
|
@@ -659,22 +676,47 @@ interface LazyFunctionValue {
|
|
|
659
676
|
type Value = boolean | number | string | ModelValue | SetValue | MixedSetValue | FunctionValue | IntervalValue | InfiniteSetValue | SubsetValue | FunctionSetValue | RecordSetValue | ProductSetValue | SequenceSetValue | SetOperationValue | FilteredSetValue | UnionValue | LazyFunctionValue;
|
|
660
677
|
type FunctionClass = "lambda" | "tuple" | "record";
|
|
661
678
|
export declare const formatValue: (value: Value, isStrict?: boolean, isNormalized?: boolean) => string;
|
|
662
|
-
interface FingerprintFailure {
|
|
663
|
-
sources: Expression[];
|
|
664
|
-
reason: string;
|
|
665
|
-
}
|
|
666
679
|
interface JavaOverride {
|
|
667
680
|
module: string;
|
|
668
681
|
operator: string;
|
|
669
682
|
signature: string;
|
|
670
683
|
isMatched: boolean;
|
|
671
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
|
+
}
|
|
672
711
|
interface StateDump {
|
|
673
712
|
path: string;
|
|
674
713
|
dot?: boolean;
|
|
675
714
|
colorize?: boolean;
|
|
676
715
|
actionLabels?: boolean;
|
|
677
716
|
snapshot?: boolean;
|
|
717
|
+
constrained?: boolean;
|
|
718
|
+
stuttering?: boolean;
|
|
719
|
+
strict?: boolean;
|
|
678
720
|
}
|
|
679
721
|
interface FailureMessage {
|
|
680
722
|
code: number;
|
|
@@ -689,19 +731,48 @@ interface CheckOptions {
|
|
|
689
731
|
onPrint?: (text: string) => void;
|
|
690
732
|
onPause?: () => void;
|
|
691
733
|
readFile?: (path: string) => string | undefined;
|
|
692
|
-
writeFile?: (path: string, content: string) => void;
|
|
734
|
+
writeFile?: (path: string, content: string | Uint8Array) => void;
|
|
735
|
+
makeDirectory?: (path: string) => void;
|
|
693
736
|
seed?: bigint;
|
|
694
737
|
workers?: number;
|
|
695
|
-
|
|
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. */
|
|
696
749
|
dump?: StateDump;
|
|
750
|
+
/** TLC's -tool, which changes the messages of TLC's errors. */
|
|
697
751
|
isTool?: boolean;
|
|
752
|
+
/** TLC's -continue: reports each violation through onProgress and goes on. */
|
|
698
753
|
isContinued?: boolean;
|
|
699
|
-
|
|
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. */
|
|
700
758
|
isSanyReported?: boolean;
|
|
759
|
+
/** False for TLC's -nowarning, which changes how TLC computes some successors. */
|
|
701
760
|
isWarningEnabled?: boolean;
|
|
761
|
+
/** TLC's -coverage, in minutes. */
|
|
762
|
+
coverage?: number;
|
|
702
763
|
version?: TlcVersion;
|
|
703
764
|
onProgress?: (progress: CheckProgress) => void;
|
|
704
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
|
+
}
|
|
705
776
|
interface InitialStatesProgress {
|
|
706
777
|
kind: "initial-states-progress";
|
|
707
778
|
count: number;
|
|
@@ -739,7 +810,9 @@ type CheckProgress = {
|
|
|
739
810
|
} | {
|
|
740
811
|
kind: "liveness-started";
|
|
741
812
|
branches: number;
|
|
813
|
+
/** Whether TLC checks the complete state graph. */
|
|
742
814
|
isComplete: boolean;
|
|
815
|
+
/** How many states of the graph each branch has. */
|
|
743
816
|
states: number;
|
|
744
817
|
statistics: SearchStatistics;
|
|
745
818
|
} | {
|
|
@@ -758,25 +831,33 @@ type CheckProgress = {
|
|
|
758
831
|
} | ({
|
|
759
832
|
kind: "java-override";
|
|
760
833
|
} & JavaOverride);
|
|
761
|
-
interface SearchStatistics extends Pick<CheckResult, "generatedStates" | "distinctStates" | "queuedStates" | "depth"> {}
|
|
834
|
+
interface SearchStatistics extends Pick<CheckResult, "generatedStates" | "distinctStates" | "queuedStates" | "depth" | "coverage"> {}
|
|
762
835
|
type CheckStatus = "success" | "assumption-violation" | "invariant-violation" | "property-violation" | "liveness-violation" | "postcondition-violation" | "deadlock" | "error";
|
|
763
836
|
interface TraceStep {
|
|
764
837
|
action: string | undefined;
|
|
838
|
+
/** TLC's name, parameters and location for the action that took this step. */
|
|
765
839
|
label: string | undefined;
|
|
766
840
|
state: Record<string, Value>;
|
|
841
|
+
/** What the spec prints before this step as TLC rebuilds the trace, and before it for the first. */
|
|
767
842
|
output?: OutputLine[];
|
|
768
843
|
}
|
|
769
844
|
interface Violation {
|
|
770
845
|
name: string;
|
|
846
|
+
/** Every temporal property that a liveness counterexample violates, in the configuration's order. */
|
|
771
847
|
properties?: string[];
|
|
772
848
|
trace: TraceStep[];
|
|
849
|
+
/** What the spec prints after the trace, as TLC finds the lasso's step back or rebuilds the trace. */
|
|
773
850
|
traceOutput?: OutputLine[];
|
|
851
|
+
/** What the postconditions print, which TLC checks after the lasso's step back. */
|
|
852
|
+
postconditionOutput?: OutputLine[];
|
|
774
853
|
loopStart: number | undefined;
|
|
775
854
|
loopLabel?: string;
|
|
776
855
|
message?: string;
|
|
777
856
|
counts?: string;
|
|
778
857
|
unwitnessed?: Postcondition;
|
|
858
|
+
/** A POSTCONDITION that is false or fails, which TLC checks as it prints the counterexample. */
|
|
779
859
|
postcondition?: Postcondition;
|
|
860
|
+
/** What TLC warns about after a counterexample, with its code. */
|
|
780
861
|
warning?: {
|
|
781
862
|
code: number;
|
|
782
863
|
text: string;
|
|
@@ -788,6 +869,7 @@ interface Postcondition {
|
|
|
788
869
|
message: string;
|
|
789
870
|
counts?: string;
|
|
790
871
|
}
|
|
872
|
+
/** An evaluation that failed during the search, with the behavior up to the state TLC was working on. */
|
|
791
873
|
interface EvaluationFailure {
|
|
792
874
|
code: number;
|
|
793
875
|
message: string;
|
|
@@ -796,11 +878,17 @@ interface EvaluationFailure {
|
|
|
796
878
|
traceOutput?: OutputLine[];
|
|
797
879
|
initialState: Record<string, Value> | undefined;
|
|
798
880
|
exitCode: number;
|
|
881
|
+
/** The expressions TLC was evaluating, outermost first, when its replay finds them. */
|
|
799
882
|
callStack: Expression[] | undefined;
|
|
883
|
+
/** Whether TLC prints the call stack before the error, as it does for a failed liveness check. */
|
|
800
884
|
isCallStackFirst?: boolean;
|
|
885
|
+
/** The FingerprintException the replay raises, which TLC reports in place of the call stack. */
|
|
801
886
|
fingerprint?: FingerprintFailure;
|
|
887
|
+
/** How TLC reports failing again as it prints the trace, since it can't fingerprint the state. */
|
|
802
888
|
traceFailure?: FailureMessage;
|
|
889
|
+
/** A POSTCONDITION that is false or fails after the trace, which TLC checks as it prints one. */
|
|
803
890
|
postcondition?: Postcondition;
|
|
891
|
+
/** Whether TLC stops before it prints the statistics, as it does for an illegal initial state. */
|
|
804
892
|
isWithoutStatistics?: boolean;
|
|
805
893
|
}
|
|
806
894
|
interface InitialStates {
|
|
@@ -815,12 +903,20 @@ interface CheckResult {
|
|
|
815
903
|
distinctStates: number;
|
|
816
904
|
queuedStates: number;
|
|
817
905
|
depth: number;
|
|
906
|
+
/** Once TLC computed all the initial states without a violation or an error. */
|
|
818
907
|
initialStates: InitialStates | undefined;
|
|
908
|
+
/** How many expanded states found each number of new states, when TLC prints the outdegree. */
|
|
819
909
|
outDegrees: number[] | undefined;
|
|
910
|
+
/** The smallest distance between two fingerprints, when TLC estimates a collision from them. */
|
|
820
911
|
fingerprintDistance: bigint | undefined;
|
|
912
|
+
/** A temporal property TLC finds violated as it adds a deadlocked state, reported after. */
|
|
821
913
|
additionalViolation?: Violation;
|
|
914
|
+
/** Where TLC's worker fails to add the state to the behavior graph after it reports a violation. */
|
|
822
915
|
liveCallStack?: Expression[];
|
|
916
|
+
/** The outdegrees when TLC's workers stop on a violation that TLC 1.7.4 reports as a success. */
|
|
823
917
|
violationOutDegrees?: number[];
|
|
918
|
+
traceSpec?: string;
|
|
919
|
+
coverage?: CoverageReport;
|
|
824
920
|
}
|
|
825
921
|
export declare const check: (options: CheckOptions) => Promise<CheckResult>;
|
|
826
922
|
export declare const parseModule: (source: string) => Module;
|
|
@@ -856,4 +952,4 @@ interface ProveOptions {
|
|
|
856
952
|
workers?: number;
|
|
857
953
|
}
|
|
858
954
|
export declare const prove: (options: ProveOptions) => Promise<ProveResult>;
|
|
859
|
-
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
|
@@ -6,6 +6,7 @@
|
|
|
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 ts from "@typescript/typescript6";
|
|
9
10
|
interface LocalResolution {
|
|
10
11
|
kind: "Local";
|
|
11
12
|
}
|
|
@@ -106,6 +107,7 @@ interface CaseExpression {
|
|
|
106
107
|
kind: "Case";
|
|
107
108
|
arms: CaseArm[];
|
|
108
109
|
other: Expression | undefined;
|
|
110
|
+
otherRange?: SourceRange;
|
|
109
111
|
location: SourceLocation;
|
|
110
112
|
}
|
|
111
113
|
interface LetExpression {
|
|
@@ -261,6 +263,7 @@ interface LabelExpression {
|
|
|
261
263
|
name: string;
|
|
262
264
|
params: string[];
|
|
263
265
|
paramRanges?: SourceRange[];
|
|
266
|
+
head?: SourceRange;
|
|
264
267
|
body: Expression;
|
|
265
268
|
location: SourceLocation;
|
|
266
269
|
}
|
|
@@ -298,6 +301,7 @@ interface OperatorDefinition {
|
|
|
298
301
|
params: OperatorParam[];
|
|
299
302
|
body: Expression;
|
|
300
303
|
bodyRange?: SourceRange;
|
|
304
|
+
head?: SourceRange;
|
|
301
305
|
isLocal: boolean;
|
|
302
306
|
isRecursive: boolean;
|
|
303
307
|
location: SourceLocation;
|
|
@@ -439,6 +443,7 @@ type ModuleUnit = {
|
|
|
439
443
|
} | {
|
|
440
444
|
kind: "Recursive";
|
|
441
445
|
declarations: Declaration[];
|
|
446
|
+
location: SourceLocation;
|
|
442
447
|
} | {
|
|
443
448
|
kind: "Definition";
|
|
444
449
|
definition: Definition;
|
|
@@ -511,6 +516,7 @@ interface ModelConfig {
|
|
|
511
516
|
actionConstraints: string[];
|
|
512
517
|
constants: ConstantAssignment[];
|
|
513
518
|
substitutions: Substitution[];
|
|
519
|
+
rawConstants: string[];
|
|
514
520
|
checkDeadlock: boolean;
|
|
515
521
|
symmetry: string | undefined;
|
|
516
522
|
view: string | undefined;
|
|
@@ -529,6 +535,13 @@ interface SyntaxFailure {
|
|
|
529
535
|
line: number;
|
|
530
536
|
column: number;
|
|
531
537
|
isEnd: boolean;
|
|
538
|
+
proof?: {
|
|
539
|
+
stop: {
|
|
540
|
+
line: number;
|
|
541
|
+
column: number;
|
|
542
|
+
};
|
|
543
|
+
exception: string;
|
|
544
|
+
};
|
|
532
545
|
}
|
|
533
546
|
interface SanyError {
|
|
534
547
|
location: string;
|
|
@@ -570,6 +583,8 @@ interface LazySet {
|
|
|
570
583
|
interface SetValue {
|
|
571
584
|
kind: "Set";
|
|
572
585
|
elements: Value[];
|
|
586
|
+
writtenElements: Value[] | undefined;
|
|
587
|
+
isNormalized: boolean;
|
|
573
588
|
hash: number;
|
|
574
589
|
fingerprint: number;
|
|
575
590
|
isFingerprinted: boolean;
|
|
@@ -586,6 +601,7 @@ interface FunctionValue {
|
|
|
586
601
|
fingerprint: number;
|
|
587
602
|
writtenKeys: Value[] | undefined;
|
|
588
603
|
functionClass: FunctionClass | undefined;
|
|
604
|
+
lambdaDomain: Value | undefined;
|
|
589
605
|
isFingerprinted: boolean;
|
|
590
606
|
}
|
|
591
607
|
interface IntervalValue {
|
|
@@ -632,7 +648,7 @@ interface FilteredSetSource {
|
|
|
632
648
|
interface FilteredSetValue extends LazySet {
|
|
633
649
|
kind: "FilteredSet";
|
|
634
650
|
base: Value;
|
|
635
|
-
test: (element: Value) => boolean;
|
|
651
|
+
test: (element: Value, isMember: boolean) => boolean;
|
|
636
652
|
source?: FilteredSetSource;
|
|
637
653
|
}
|
|
638
654
|
interface UnionValue extends LazySet {
|
|
@@ -651,6 +667,7 @@ interface LazyFunctionValue {
|
|
|
651
667
|
kind: "LazyFunction";
|
|
652
668
|
domain: Value;
|
|
653
669
|
apply: (argument: Value) => Value;
|
|
670
|
+
boundTupleLengths?: (number | undefined)[];
|
|
654
671
|
source?: LazyFunctionSource;
|
|
655
672
|
functionClass?: FunctionClass;
|
|
656
673
|
enumerated?: FunctionValue;
|
|
@@ -659,22 +676,47 @@ interface LazyFunctionValue {
|
|
|
659
676
|
type Value = boolean | number | string | ModelValue | SetValue | MixedSetValue | FunctionValue | IntervalValue | InfiniteSetValue | SubsetValue | FunctionSetValue | RecordSetValue | ProductSetValue | SequenceSetValue | SetOperationValue | FilteredSetValue | UnionValue | LazyFunctionValue;
|
|
660
677
|
type FunctionClass = "lambda" | "tuple" | "record";
|
|
661
678
|
export declare const formatValue: (value: Value, isStrict?: boolean, isNormalized?: boolean) => string;
|
|
662
|
-
interface FingerprintFailure {
|
|
663
|
-
sources: Expression[];
|
|
664
|
-
reason: string;
|
|
665
|
-
}
|
|
666
679
|
interface JavaOverride {
|
|
667
680
|
module: string;
|
|
668
681
|
operator: string;
|
|
669
682
|
signature: string;
|
|
670
683
|
isMatched: boolean;
|
|
671
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
|
+
}
|
|
672
711
|
interface StateDump {
|
|
673
712
|
path: string;
|
|
674
713
|
dot?: boolean;
|
|
675
714
|
colorize?: boolean;
|
|
676
715
|
actionLabels?: boolean;
|
|
677
716
|
snapshot?: boolean;
|
|
717
|
+
constrained?: boolean;
|
|
718
|
+
stuttering?: boolean;
|
|
719
|
+
strict?: boolean;
|
|
678
720
|
}
|
|
679
721
|
interface FailureMessage {
|
|
680
722
|
code: number;
|
|
@@ -689,19 +731,48 @@ interface CheckOptions {
|
|
|
689
731
|
onPrint?: (text: string) => void;
|
|
690
732
|
onPause?: () => void;
|
|
691
733
|
readFile?: (path: string) => string | undefined;
|
|
692
|
-
writeFile?: (path: string, content: string) => void;
|
|
734
|
+
writeFile?: (path: string, content: string | Uint8Array) => void;
|
|
735
|
+
makeDirectory?: (path: string) => void;
|
|
693
736
|
seed?: bigint;
|
|
694
737
|
workers?: number;
|
|
695
|
-
|
|
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. */
|
|
696
749
|
dump?: StateDump;
|
|
750
|
+
/** TLC's -tool, which changes the messages of TLC's errors. */
|
|
697
751
|
isTool?: boolean;
|
|
752
|
+
/** TLC's -continue: reports each violation through onProgress and goes on. */
|
|
698
753
|
isContinued?: boolean;
|
|
699
|
-
|
|
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. */
|
|
700
758
|
isSanyReported?: boolean;
|
|
759
|
+
/** False for TLC's -nowarning, which changes how TLC computes some successors. */
|
|
701
760
|
isWarningEnabled?: boolean;
|
|
761
|
+
/** TLC's -coverage, in minutes. */
|
|
762
|
+
coverage?: number;
|
|
702
763
|
version?: TlcVersion;
|
|
703
764
|
onProgress?: (progress: CheckProgress) => void;
|
|
704
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
|
+
}
|
|
705
776
|
interface InitialStatesProgress {
|
|
706
777
|
kind: "initial-states-progress";
|
|
707
778
|
count: number;
|
|
@@ -739,7 +810,9 @@ type CheckProgress = {
|
|
|
739
810
|
} | {
|
|
740
811
|
kind: "liveness-started";
|
|
741
812
|
branches: number;
|
|
813
|
+
/** Whether TLC checks the complete state graph. */
|
|
742
814
|
isComplete: boolean;
|
|
815
|
+
/** How many states of the graph each branch has. */
|
|
743
816
|
states: number;
|
|
744
817
|
statistics: SearchStatistics;
|
|
745
818
|
} | {
|
|
@@ -758,25 +831,33 @@ type CheckProgress = {
|
|
|
758
831
|
} | ({
|
|
759
832
|
kind: "java-override";
|
|
760
833
|
} & JavaOverride);
|
|
761
|
-
interface SearchStatistics extends Pick<CheckResult, "generatedStates" | "distinctStates" | "queuedStates" | "depth"> {}
|
|
834
|
+
interface SearchStatistics extends Pick<CheckResult, "generatedStates" | "distinctStates" | "queuedStates" | "depth" | "coverage"> {}
|
|
762
835
|
type CheckStatus = "success" | "assumption-violation" | "invariant-violation" | "property-violation" | "liveness-violation" | "postcondition-violation" | "deadlock" | "error";
|
|
763
836
|
interface TraceStep {
|
|
764
837
|
action: string | undefined;
|
|
838
|
+
/** TLC's name, parameters and location for the action that took this step. */
|
|
765
839
|
label: string | undefined;
|
|
766
840
|
state: Record<string, Value>;
|
|
841
|
+
/** What the spec prints before this step as TLC rebuilds the trace, and before it for the first. */
|
|
767
842
|
output?: OutputLine[];
|
|
768
843
|
}
|
|
769
844
|
interface Violation {
|
|
770
845
|
name: string;
|
|
846
|
+
/** Every temporal property that a liveness counterexample violates, in the configuration's order. */
|
|
771
847
|
properties?: string[];
|
|
772
848
|
trace: TraceStep[];
|
|
849
|
+
/** What the spec prints after the trace, as TLC finds the lasso's step back or rebuilds the trace. */
|
|
773
850
|
traceOutput?: OutputLine[];
|
|
851
|
+
/** What the postconditions print, which TLC checks after the lasso's step back. */
|
|
852
|
+
postconditionOutput?: OutputLine[];
|
|
774
853
|
loopStart: number | undefined;
|
|
775
854
|
loopLabel?: string;
|
|
776
855
|
message?: string;
|
|
777
856
|
counts?: string;
|
|
778
857
|
unwitnessed?: Postcondition;
|
|
858
|
+
/** A POSTCONDITION that is false or fails, which TLC checks as it prints the counterexample. */
|
|
779
859
|
postcondition?: Postcondition;
|
|
860
|
+
/** What TLC warns about after a counterexample, with its code. */
|
|
780
861
|
warning?: {
|
|
781
862
|
code: number;
|
|
782
863
|
text: string;
|
|
@@ -788,6 +869,7 @@ interface Postcondition {
|
|
|
788
869
|
message: string;
|
|
789
870
|
counts?: string;
|
|
790
871
|
}
|
|
872
|
+
/** An evaluation that failed during the search, with the behavior up to the state TLC was working on. */
|
|
791
873
|
interface EvaluationFailure {
|
|
792
874
|
code: number;
|
|
793
875
|
message: string;
|
|
@@ -796,11 +878,17 @@ interface EvaluationFailure {
|
|
|
796
878
|
traceOutput?: OutputLine[];
|
|
797
879
|
initialState: Record<string, Value> | undefined;
|
|
798
880
|
exitCode: number;
|
|
881
|
+
/** The expressions TLC was evaluating, outermost first, when its replay finds them. */
|
|
799
882
|
callStack: Expression[] | undefined;
|
|
883
|
+
/** Whether TLC prints the call stack before the error, as it does for a failed liveness check. */
|
|
800
884
|
isCallStackFirst?: boolean;
|
|
885
|
+
/** The FingerprintException the replay raises, which TLC reports in place of the call stack. */
|
|
801
886
|
fingerprint?: FingerprintFailure;
|
|
887
|
+
/** How TLC reports failing again as it prints the trace, since it can't fingerprint the state. */
|
|
802
888
|
traceFailure?: FailureMessage;
|
|
889
|
+
/** A POSTCONDITION that is false or fails after the trace, which TLC checks as it prints one. */
|
|
803
890
|
postcondition?: Postcondition;
|
|
891
|
+
/** Whether TLC stops before it prints the statistics, as it does for an illegal initial state. */
|
|
804
892
|
isWithoutStatistics?: boolean;
|
|
805
893
|
}
|
|
806
894
|
interface InitialStates {
|
|
@@ -815,12 +903,20 @@ interface CheckResult {
|
|
|
815
903
|
distinctStates: number;
|
|
816
904
|
queuedStates: number;
|
|
817
905
|
depth: number;
|
|
906
|
+
/** Once TLC computed all the initial states without a violation or an error. */
|
|
818
907
|
initialStates: InitialStates | undefined;
|
|
908
|
+
/** How many expanded states found each number of new states, when TLC prints the outdegree. */
|
|
819
909
|
outDegrees: number[] | undefined;
|
|
910
|
+
/** The smallest distance between two fingerprints, when TLC estimates a collision from them. */
|
|
820
911
|
fingerprintDistance: bigint | undefined;
|
|
912
|
+
/** A temporal property TLC finds violated as it adds a deadlocked state, reported after. */
|
|
821
913
|
additionalViolation?: Violation;
|
|
914
|
+
/** Where TLC's worker fails to add the state to the behavior graph after it reports a violation. */
|
|
822
915
|
liveCallStack?: Expression[];
|
|
916
|
+
/** The outdegrees when TLC's workers stop on a violation that TLC 1.7.4 reports as a success. */
|
|
823
917
|
violationOutDegrees?: number[];
|
|
918
|
+
traceSpec?: string;
|
|
919
|
+
coverage?: CoverageReport;
|
|
824
920
|
}
|
|
825
921
|
export declare const check: (options: CheckOptions) => Promise<CheckResult>;
|
|
826
922
|
export declare const parseModule: (source: string) => Module;
|
|
@@ -856,4 +952,4 @@ interface ProveOptions {
|
|
|
856
952
|
workers?: number;
|
|
857
953
|
}
|
|
858
954
|
export declare const prove: (options: ProveOptions) => Promise<ProveResult>;
|
|
859
|
-
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{P as e,_ as t,b as n,y as r,z as i}from"./worker.js";import{$t as a,kt as o,y as s}from"./transfer.js";import{a as c,v as l}from"./prove.js";export{t as TlaConfigError,r as TlaError,n as TlaEvaluationError,e as TlaSyntaxError,i as TlaUnsupportedError,l as check,o as formatValue,a as parseConfig,s as parseModule,c 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.c(n.config,{...n,loadModule:a,loadClass:e=>o.get(e),seed:void 0},()=>{},!0),c=s.specification,l=c.environment,u=t.u(n.config,l,c.variableLocations,()=>s.order.getDeclarationOrder(`variable`)),d=u?.spec.next;if(!u||d===void 0)return r.postMessage({type:`abort`});let f=n.index,p=t.Tt(),m=t.t(l.variables.length),h=n.fingerprints,g=n.requests,_=n.remaining,v=u.isSymmetric?t.L():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.G(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.q(n.state,y),!v.insert(y[0],y[1])))continue;p(n.state);let a=u.getFingerprintState(n.state);if(t.q(a,y),t.U(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.Pt();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{G as n,L as r,Pt as i,Tt as a,U as o,c as s,n as c,nt as l,q as u,t as d,u as f}from"./transfer.js";const p=(e,p)=>{let m=new Map(e.modules),h=e=>m.get(e),g=new Map(e.classes),_=s(e.config,{...e,loadModule:h,loadClass:e=>g.get(e),seed:void 0},()=>{},!0),v=_.specification,y=v.environment,b=f(e.config,y,v.variableLocations,()=>_.order.getDeclarationOrder(`variable`)),x=b?.spec.next;if(!b||x===void 0)return p.postMessage({type:`abort`});let S=e.index,C=a(),w=d(y.variables.length),T=e.fingerprints,E=e.requests,D=e.remaining,O=b.isSymmetric?r():void 0,k=/* @__PURE__ */ new Int32Array(2),A=()=>{},j=e=>{};e.ports.forEach(e=>{e?.addEventListener(`message`,e=>j(e.data)),e?.start?.()});let M=w(e.seed).map(C),N=t(),P=(t,n)=>{let r=Atomics.load(E,S)-1,i=Math.floor((t.end-t.origin-1)/2),a=c(),o=t.states.slice(t.end-i,t.end),s=i>0&&o.every(a.encode);s&&(t.end-=i);let l=s?a.finish():c().finish();e.ports[r]?.postMessage(l,[l.words.buffer]),Atomics.store(E,S,n),Atomics.notify(E,S)},F=e=>{Atomics.store(D,S,0),Atomics.compareExchange(E,S,0,-1)!==0&&P(e,-1)},I=e=>{Atomics.store(D,S,e.end-e.origin),Atomics.store(E,S,0)},L=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(E,S)>0&&P(t,0),Atomics.store(D,S,t.end-t.origin-1),t.successors=l(x,r,y,b.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(n(T))return`paused`;let e=i[t.index];if(b.findViolatedActionProperty(r,e.state))return;if(!b.satisfiesActionConstraints(r,e.state)){if(b.findViolatedInvariant(e.state,r))return;continue}if(O&&(u(e.state,k),!O.insert(k[0],k[1])))continue;C(e.state);let a=b.getFingerprintState(e.state);if(u(a,k),o(T,k[0],k[1])){if(b.findViolatedInvariant(e.state,r))return;b.satisfiesConstraints(e.state,r)&&(t.next.push(e.state),t.fingerprintStates.push(a),t.added++)}}t.outDegrees[Math.min(t.added,31)]++,t.successors=void 0,t.index=0,t.added=0}return`done`},R=async t=>{let n=/* @__PURE__ */ new Set;for(;;){let r=e.ports.reduce((e,t,r)=>!t||n.has(r)||Atomics.load(D,r)<2?e:e===void 0||Atomics.load(D,r)>Atomics.load(D,e)?r:e,void 0);if(r===void 0)return!1;let i=Atomics.compareExchange(E,r,0,S+1);if(i===-1&&n.add(r),i>0&&Atomics.wait(E,r,i),i!==0)continue;let a=await new Promise(e=>j=e);if(a.count===0)n.add(r);else return t.states=w(a).map(C),t.origin=0,t.end=t.states.length,I(t),!0}},z=e=>p.postMessage(e,e.type===`level`?[e.fingerprints.buffer]:[]),B=async()=>{let e={states:M,origin:0,end:M.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=L(e);if(t===void 0)return;if(t===`break`)await N(),e.breakAt=performance.now()+100;else if(F(e),t===`paused`){let t=new Promise(e=>A=e);z({type:`paused`}),await t,I(e)}else if(!await R(e))break}let t=i();return t===void 0?(M=e.next,Atomics.store(D,S,M.length),{type:`level`,generated:e.generated,added:e.next.length,outDegrees:e.outDegrees,fingerprints:b.getStoredFingerprints(e.next,e.fingerprintStates)}):{type:`abort`,string:t}},V=()=>{B().then(e=>z(e??{type:`abort`}),()=>z({type:`abort`}))};p.addEventListener(`message`,e=>{let t=e.data;t.type===`level`&&V(),t.type===`resize`&&(T=t.fingerprints,A())}),Atomics.store(D,S,M.length),z({type:`ready`})};e().then(e=>{let t=n=>{let r=n.data;if(r.type===`start`){e.removeEventListener?.(`message`,t);try{p(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.A)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{A 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?.()});
|