tla-ts 0.0.10-dev.094b9b512 → 0.0.10-dev.1ebc153bd
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/dist/compile.cjs +3 -3
- package/dist/compile.js +1 -1
- package/dist/deciders.cjs +37 -36
- package/dist/deciders.js +38 -37
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +5 -1
- package/dist/index.d.ts +5 -1
- 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 +146 -58
- package/dist/prove.js +145 -57
- package/dist/run.cjs +43 -43
- package/dist/run.js +45 -45
- package/dist/tlapm.cjs +1 -1
- package/dist/tlapm.js +2 -2
- package/dist/transfer.cjs +40 -37
- package/dist/transfer.js +38 -35
- package/dist/worker.cjs +6 -6
- package/dist/worker.js +6 -6
- package/package.json +1 -1
- package/src/ast.ts +4 -3
- package/src/bags.ts +46 -28
- package/src/check-trace.ts +2 -16
- package/src/check.ts +349 -91
- package/src/cli/runtime-invariants.ts +20 -56
- package/src/cli/tlapm.ts +268 -71
- package/src/cli/tlc-arguments.ts +2 -2
- package/src/cli/tlc-output.ts +4 -5
- package/src/cli/tlc-usage.ts +0 -1
- package/src/cli/tlc.ts +26 -7
- package/src/cli/xml-exporter.ts +1 -1
- package/src/codegen.ts +9 -5
- package/src/dependencies.ts +72 -11
- package/src/dfid.ts +9 -2
- package/src/environment.ts +65 -36
- package/src/errors.ts +8 -1
- package/src/evaluate.ts +92 -32
- package/src/exit-codes.ts +5 -2
- package/src/instances.ts +5 -5
- package/src/java-overrides.ts +2 -2
- package/src/levels.ts +138 -90
- package/src/liveness-checker.ts +572 -204
- package/src/liveness.ts +47 -32
- package/src/obligations/action.ts +0 -2
- package/src/obligations/anonymize.ts +2 -6
- package/src/obligations/equality.ts +0 -2
- package/src/obligations/expression.ts +0 -2
- package/src/obligations/format.ts +0 -2
- package/src/obligations/generate.ts +0 -2
- package/src/obligations/index.ts +9 -8
- package/src/obligations/levels.ts +0 -2
- package/src/obligations/module.ts +0 -2
- package/src/obligations/normalize.ts +1 -6
- package/src/obligations/operators.ts +0 -2
- package/src/obligations/pragma.ts +2 -2
- package/src/obligations/printer.ts +5 -7
- package/src/obligations/proof.ts +0 -2
- package/src/obligations/regroup.ts +0 -2
- package/src/obligations/simplify.ts +0 -2
- package/src/obligations/subexpression.ts +1 -4
- package/src/obligations/substitution.ts +0 -2
- package/src/obligations/temporal.ts +0 -2
- package/src/obligations/tuples.ts +0 -2
- package/src/parallel-worker.ts +8 -2
- package/src/parallel.ts +7 -2
- package/src/parser.ts +256 -185
- package/src/pretty-print.ts +1 -1
- package/src/prover/deciders.ts +1 -8
- package/src/prover/isabelle/encode.ts +0 -2
- package/src/prover/isabelle/isar/attrib.ts +86 -55
- package/src/prover/isabelle/isar/context.ts +25 -26
- package/src/prover/isabelle/isar/induct.ts +2 -12
- package/src/prover/isabelle/isar/method.ts +6 -10
- package/src/prover/isabelle/isar/proof.ts +40 -39
- package/src/prover/isabelle/isar/rule-cases.ts +14 -22
- package/src/prover/isabelle/isar/theory.ts +16 -17
- package/src/prover/isabelle/isar/toplevel.ts +46 -56
- package/src/prover/isabelle/isar/type-check.ts +0 -2
- package/src/prover/isabelle/provers/blast/blast.ts +0 -2
- package/src/prover/isabelle/provers/blast/branch.ts +0 -2
- package/src/prover/isabelle/provers/blast/prove.ts +0 -2
- package/src/prover/isabelle/provers/blast/rules.ts +0 -2
- package/src/prover/isabelle/provers/blast/state.ts +0 -2
- package/src/prover/isabelle/provers/blast/term.ts +0 -2
- package/src/prover/isabelle/provers/clasimp.ts +1 -3
- package/src/prover/isabelle/provers/classical.ts +1 -3
- package/src/prover/isabelle/provers/hypsubst.ts +2 -4
- package/src/prover/isabelle/pure/bicompose.ts +0 -2
- package/src/prover/isabelle/pure/consts.ts +0 -2
- package/src/prover/isabelle/pure/conv.ts +0 -2
- package/src/prover/isabelle/pure/drule.ts +0 -2
- package/src/prover/isabelle/pure/envir.ts +0 -2
- package/src/prover/isabelle/pure/goal.ts +0 -2
- package/src/prover/isabelle/pure/logic.ts +0 -2
- package/src/prover/isabelle/pure/name.ts +0 -2
- package/src/prover/isabelle/pure/net.ts +0 -2
- package/src/prover/isabelle/pure/object-logic.ts +0 -2
- package/src/prover/isabelle/pure/pattern.ts +0 -2
- package/src/prover/isabelle/pure/raw-simplifier.ts +0 -2
- package/src/prover/isabelle/pure/rewriter.ts +3 -5
- package/src/prover/isabelle/pure/search.ts +0 -2
- package/src/prover/isabelle/pure/seq.ts +0 -2
- package/src/prover/isabelle/pure/simplifier.ts +0 -2
- package/src/prover/isabelle/pure/table.ts +0 -2
- package/src/prover/isabelle/pure/tactic.ts +0 -2
- package/src/prover/isabelle/pure/tactical.ts +0 -2
- package/src/prover/isabelle/pure/term-ord.ts +0 -2
- package/src/prover/isabelle/pure/term.ts +3 -5
- package/src/prover/isabelle/pure/thm.ts +0 -2
- package/src/prover/isabelle/pure/type.ts +0 -2
- package/src/prover/isabelle/pure/unify.ts +0 -2
- package/src/prover/isabelle/pure/variable.ts +0 -2
- package/src/prover/isabelle/tla/classical-setup.ts +0 -2
- package/src/prover/isabelle/tla/simpdata.ts +0 -2
- package/src/prover/isabelle/tools/intuitionistic.ts +0 -2
- package/src/prover/ocaml.ts +4 -1
- package/src/prover/prep/action.ts +1 -0
- package/src/prover/prep/md5.ts +26 -29
- package/src/prover/prep/methods.ts +55 -6
- package/src/prover/prep/normalize.ts +4 -1
- package/src/prover/prove.ts +58 -32
- package/src/prover/ptl/decide.ts +43 -63
- package/src/prover/smt/context.ts +10 -14
- package/src/prover/smt/data.ts +51 -45
- package/src/prover/smt/encode.ts +1 -2
- package/src/prover/smt/rewrite.ts +3 -7
- package/src/prover/smt/simplify.ts +1 -1
- package/src/prover/smt/solver/ackermannize-bv-tactic.ts +0 -2
- package/src/prover/smt/solver/ackr-helper.ts +0 -3
- package/src/prover/smt/solver/ackr-model-converter.ts +1 -8
- package/src/prover/smt/solver/act-cache.ts +0 -1
- package/src/prover/smt/solver/add-bounds-tactic.ts +0 -1
- package/src/prover/smt/solver/aig-tactic.ts +25 -16
- package/src/prover/smt/solver/aig.ts +2 -3
- package/src/prover/smt/solver/arith-rewriter.ts +4 -7
- package/src/prover/smt/solver/arith-terms.ts +0 -2
- package/src/prover/smt/solver/array-decl-plugin.ts +0 -1
- package/src/prover/smt/solver/array-rewriter.ts +1 -4
- package/src/prover/smt/solver/asserted-formulas.ts +67 -3
- package/src/prover/smt/solver/ast-lt.ts +2 -3
- package/src/prover/smt/solver/ast-util.ts +4 -5
- package/src/prover/smt/solver/ast.ts +171 -168
- package/src/prover/smt/solver/auf-solver.ts +0 -1
- package/src/prover/smt/solver/bit-blast-tactic.ts +2 -11
- package/src/prover/smt/solver/bit-blaster.ts +0 -3
- package/src/prover/smt/solver/blast-term-ite.ts +47 -0
- package/src/prover/smt/solver/bound-manager.ts +39 -29
- package/src/prover/smt/solver/bound-simplifier.ts +2 -5
- package/src/prover/smt/solver/bv-bound-chk.ts +2 -10
- package/src/prover/smt/solver/bv-decl-plugin.ts +13 -11
- package/src/prover/smt/solver/bv-divrem-bounds.ts +0 -2
- package/src/prover/smt/solver/bv-rewriter.ts +15 -19
- package/src/prover/smt/solver/bv1-blast.ts +1 -11
- package/src/prover/smt/solver/bv2fpa-converter.ts +0 -1
- package/src/prover/smt/solver/bv2int-rewriter.ts +0 -1
- package/src/prover/smt/solver/bv2real-rewriter.ts +0 -1
- package/src/prover/smt/solver/card2bv.ts +3 -7
- package/src/prover/smt/solver/case-split-queue.ts +0 -2
- package/src/prover/smt/solver/cg-table.ts +19 -16
- package/src/prover/smt/solver/check-logic.ts +6 -2
- package/src/prover/smt/solver/clause.ts +0 -1
- package/src/prover/smt/solver/cofactor-elim-term-ite.ts +2 -5
- package/src/prover/smt/solver/conflict-resolution.ts +8 -8
- package/src/prover/smt/solver/context.ts +45 -15
- package/src/prover/smt/solver/ctx-simplify.ts +1 -3
- package/src/prover/smt/solver/ctx-solver-simplify.ts +0 -2
- package/src/prover/smt/solver/datatype-decl-plugin.ts +22 -17
- package/src/prover/smt/solver/datatype-rewriter.ts +0 -1
- package/src/prover/smt/solver/demodulator.ts +2 -5
- package/src/prover/smt/solver/dependent-expr-state.ts +25 -7
- package/src/prover/smt/solver/der.ts +0 -1
- package/src/prover/smt/solver/diff-neq.ts +1 -3
- package/src/prover/smt/solver/distribute-forall.ts +1 -11
- package/src/prover/smt/solver/dom-simplify.ts +1 -3
- package/src/prover/smt/solver/dt2bv-tactic.ts +2 -9
- package/src/prover/smt/solver/dyn-ack.ts +0 -1
- package/src/prover/smt/solver/e-matching.ts +6 -7
- package/src/prover/smt/solver/elim-small-bv-tactic.ts +0 -1
- package/src/prover/smt/solver/elim-term-ite-tactic.ts +48 -0
- package/src/prover/smt/solver/elim-uncnstr.ts +7 -23
- package/src/prover/smt/solver/enode.ts +16 -10
- package/src/prover/smt/solver/eq2bv-tactic.ts +0 -1
- package/src/prover/smt/solver/euf/arith-axioms.ts +0 -1
- package/src/prover/smt/solver/euf/arith-internalize.ts +2 -8
- package/src/prover/smt/solver/euf/arith-solver.ts +0 -6
- package/src/prover/smt/solver/euf/array-axioms.ts +0 -1
- package/src/prover/smt/solver/euf/array-internalize.ts +21 -12
- package/src/prover/smt/solver/euf/array-solver.ts +0 -2
- package/src/prover/smt/solver/euf/bv-ackerman.ts +0 -2
- package/src/prover/smt/solver/euf/bv-internalize.ts +1 -3
- package/src/prover/smt/solver/euf/bv-solver.ts +0 -2
- package/src/prover/smt/solver/euf/dt-solver.ts +19 -21
- package/src/prover/smt/solver/euf/egraph.ts +69 -53
- package/src/prover/smt/solver/euf/euf-solver.ts +38 -37
- package/src/prover/smt/solver/euf/fpa-solver.ts +37 -53
- package/src/prover/smt/solver/euf/mam.ts +7 -55
- package/src/prover/smt/solver/euf/q-ematch.ts +27 -98
- package/src/prover/smt/solver/euf/q-mbi.ts +4 -4
- package/src/prover/smt/solver/euf/q-model-fixer.ts +1 -4
- package/src/prover/smt/solver/euf/q-solver.ts +3 -3
- package/src/prover/smt/solver/euf/th-solver.ts +1 -16
- package/src/prover/smt/solver/euf/th-solvers.ts +0 -1
- package/src/prover/smt/solver/expr-ref.ts +0 -1
- package/src/prover/smt/solver/expr-safe-replace.ts +0 -1
- package/src/prover/smt/solver/expr2polynomial.ts +204 -80
- package/src/prover/smt/solver/factor.ts +37 -26
- package/src/prover/smt/solver/fd-solver.ts +3 -5
- package/src/prover/smt/solver/fingerprints.ts +0 -1
- package/src/prover/smt/solver/fix-dl-var.ts +2 -4
- package/src/prover/smt/solver/flat-literals.ts +0 -1
- package/src/prover/smt/solver/fm-tactic.ts +25 -14
- package/src/prover/smt/solver/fpa-decl-plugin.ts +0 -1
- package/src/prover/smt/solver/fpa-rewriter.ts +12 -14
- package/src/prover/smt/solver/fpa2bv-converter.ts +13 -8
- package/src/prover/smt/solver/fpa2bv-rewriter.ts +1 -1
- package/src/prover/smt/solver/fpa2bv-tactic.ts +1 -3
- package/src/prover/smt/solver/goal.ts +6 -4
- package/src/prover/smt/solver/goal2nlsat.ts +57 -32
- package/src/prover/smt/solver/guard-set.ts +0 -1
- package/src/prover/smt/solver/hash.ts +0 -1
- package/src/prover/smt/solver/hashtable.ts +4 -1
- package/src/prover/smt/solver/inf-eps.ts +1 -2
- package/src/prover/smt/solver/inj-axiom.ts +0 -1
- package/src/prover/smt/solver/internalizer.ts +41 -3
- package/src/prover/smt/solver/lackr.ts +0 -2
- package/src/prover/smt/solver/lbool.ts +0 -1
- package/src/prover/smt/solver/lia2card.ts +1 -2
- package/src/prover/smt/solver/lia2pb.ts +18 -5
- package/src/prover/smt/solver/literal.ts +0 -1
- package/src/prover/smt/solver/logic-tactics.ts +9 -6
- package/src/prover/smt/solver/lp/bound-propagator.ts +0 -1
- package/src/prover/smt/solver/lp/constraints.ts +0 -1
- package/src/prover/smt/solver/lp/containers.ts +7 -2
- package/src/prover/smt/solver/lp/core-solver.ts +0 -3
- package/src/prover/smt/solver/lp/cross-nested.ts +1 -4
- package/src/prover/smt/solver/lp/dep-intervals.ts +0 -3
- package/src/prover/smt/solver/lp/dependency.ts +0 -2
- package/src/prover/smt/solver/lp/dioph-eq.ts +0 -2
- package/src/prover/smt/solver/lp/explanation.ts +0 -1
- package/src/prover/smt/solver/lp/gomory.ts +0 -1
- package/src/prover/smt/solver/lp/hnf-cutter.ts +0 -1
- package/src/prover/smt/solver/lp/hnf.ts +0 -3
- package/src/prover/smt/solver/lp/int-cube.ts +0 -1
- package/src/prover/smt/solver/lp/int-solver.ts +0 -2
- package/src/prover/smt/solver/lp/lar-solver.ts +1 -2
- package/src/prover/smt/solver/lp/lar-term.ts +0 -1
- package/src/prover/smt/solver/lp/lp-settings.ts +1 -2
- package/src/prover/smt/solver/lp/maximize-term.ts +0 -3
- package/src/prover/smt/solver/lp/nex-creator.ts +3 -3
- package/src/prover/smt/solver/lp/nex.ts +2 -2
- package/src/prover/smt/solver/lp/nla-backoff.ts +0 -2
- package/src/prover/smt/solver/lp/nla-basics.ts +46 -3
- package/src/prover/smt/solver/lp/nla-core.ts +26 -7
- package/src/prover/smt/solver/lp/nla-divisions.ts +0 -2
- package/src/prover/smt/solver/lp/nla-emonics.ts +0 -1
- package/src/prover/smt/solver/lp/nla-factorization.ts +0 -1
- package/src/prover/smt/solver/lp/nla-grobner.ts +158 -82
- package/src/prover/smt/solver/lp/nla-horner.ts +0 -2
- package/src/prover/smt/solver/lp/nla-intervals.ts +0 -1
- package/src/prover/smt/solver/lp/nla-monomial-bounds.ts +0 -2
- package/src/prover/smt/solver/lp/nla-monotone.ts +0 -1
- package/src/prover/smt/solver/lp/nla-order.ts +0 -2
- package/src/prover/smt/solver/lp/nla-patcher.ts +0 -1
- package/src/prover/smt/solver/lp/nla-powers.ts +144 -108
- package/src/prover/smt/solver/lp/nla-tangents.ts +0 -2
- package/src/prover/smt/solver/lp/nla-throttle.ts +0 -1
- package/src/prover/smt/solver/lp/nla-transcendentals.ts +50 -19
- package/src/prover/smt/solver/lp/nla-types.ts +0 -2
- package/src/prover/smt/solver/lp/nla-var-eqs.ts +0 -1
- package/src/prover/smt/solver/lp/nra-solver.ts +138 -97
- package/src/prover/smt/solver/lp/numeric-pair.ts +0 -1
- package/src/prover/smt/solver/lp/pdd-interval.ts +6 -3
- package/src/prover/smt/solver/lp/pdd-simplifier.ts +60 -21
- package/src/prover/smt/solver/lp/pdd-solver.ts +72 -41
- package/src/prover/smt/solver/lp/pdd.ts +725 -290
- package/src/prover/smt/solver/lp/random-updater.ts +0 -2
- package/src/prover/smt/solver/lp/static-matrix.ts +0 -1
- package/src/prover/smt/solver/lp/union-find.ts +1 -2
- package/src/prover/smt/solver/macro-finder.ts +1 -4
- package/src/prover/smt/solver/mam-compiler.ts +14 -15
- package/src/prover/smt/solver/mam-interpreter.ts +0 -1
- package/src/prover/smt/solver/max-bv-sharing-tactic.ts +1 -13
- package/src/prover/smt/solver/max-cliques.ts +0 -2
- package/src/prover/smt/solver/maxcore.ts +6 -15
- package/src/prover/smt/solver/maximize-ac-sharing.ts +0 -2
- package/src/prover/smt/solver/maxlex.ts +0 -8
- package/src/prover/smt/solver/maxsmt-base.ts +7 -1
- package/src/prover/smt/solver/maxsmt.ts +0 -1
- package/src/prover/smt/solver/mbp/mbp-arith.ts +2 -12
- package/src/prover/smt/solver/mbp/mbp-basic-tg.ts +0 -1
- package/src/prover/smt/solver/mbp/mbp-plugin.ts +10 -3
- package/src/prover/smt/solver/mbp/mbp-qel.ts +0 -1
- package/src/prover/smt/solver/mbp/mbp-solve-plugin.ts +1 -10
- package/src/prover/smt/solver/mbp/mbp-term-graph.ts +1 -19
- package/src/prover/smt/solver/model-based-opt.ts +1 -2
- package/src/prover/smt/solver/model-checker.ts +2 -3
- package/src/prover/smt/solver/model-evaluator.ts +9 -6
- package/src/prover/smt/solver/model-finder.ts +0 -1
- package/src/prover/smt/solver/model-generator.ts +3 -2
- package/src/prover/smt/solver/model-macro-solver.ts +3 -4
- package/src/prover/smt/solver/model-printer.ts +0 -1
- package/src/prover/smt/solver/mpf.ts +2 -5
- package/src/prover/smt/solver/mus.ts +2 -4
- package/src/prover/smt/solver/muz/dl-context.ts +67 -19
- package/src/prover/smt/solver/muz/dl-mk-bit-blast.ts +0 -1
- package/src/prover/smt/solver/muz/dl-mk-coi-filter.ts +68 -22
- package/src/prover/smt/solver/muz/dl-mk-elim-term-ite.ts +7 -3
- package/src/prover/smt/solver/muz/dl-mk-interp-tail-simplifier.ts +0 -6
- package/src/prover/smt/solver/muz/dl-mk-rule-inliner.ts +39 -11
- package/src/prover/smt/solver/muz/dl-mk-slice.ts +78 -16
- package/src/prover/smt/solver/muz/dl-mk-subsumption-checker.ts +9 -4
- package/src/prover/smt/solver/muz/dl-rule-set.ts +0 -30
- package/src/prover/smt/solver/muz/dl-rule-transformer.ts +0 -4
- package/src/prover/smt/solver/muz/dl-rule.ts +93 -57
- package/src/prover/smt/solver/muz/hnf.ts +6 -6
- package/src/prover/smt/solver/muz/horn-subsume-model-converter.ts +176 -0
- package/src/prover/smt/solver/muz/horn-tactic.ts +15 -6
- package/src/prover/smt/solver/muz/rule-properties.ts +195 -37
- package/src/prover/smt/solver/muz/spacer-context.ts +111 -102
- package/src/prover/smt/solver/muz/spacer-dl-interface.ts +15 -4
- package/src/prover/smt/solver/muz/spacer-generalizers.ts +0 -3
- package/src/prover/smt/solver/muz/spacer-manager.ts +0 -6
- package/src/prover/smt/solver/muz/spacer-pdr.ts +4 -4
- package/src/prover/smt/solver/muz/spacer-prop-solver.ts +4 -15
- package/src/prover/smt/solver/muz/spacer-util.ts +2 -29
- package/src/prover/smt/solver/muz/substitution.ts +88 -39
- package/src/prover/smt/solver/nla2bv-tactic.ts +0 -1
- package/src/prover/smt/solver/nlqsat.ts +5 -5
- package/src/prover/smt/solver/nlsat/algebraic.ts +197 -96
- package/src/prover/smt/solver/nlsat/atoms.ts +52 -35
- package/src/prover/smt/solver/nlsat/evaluator.ts +0 -1
- package/src/prover/smt/solver/nlsat/explain.ts +379 -217
- package/src/prover/smt/solver/nlsat/interval-set.ts +0 -1
- package/src/prover/smt/solver/nlsat/levelwise.ts +460 -241
- package/src/prover/smt/solver/nlsat/mpbq.ts +0 -1
- package/src/prover/smt/solver/nlsat/polynomial.ts +2366 -683
- package/src/prover/smt/solver/nlsat/solver.ts +118 -105
- package/src/prover/smt/solver/nlsat/transcendental-eval.ts +2 -3
- package/src/prover/smt/solver/nlsat/transcendentals.ts +41 -19
- package/src/prover/smt/solver/nlsat/types.ts +0 -2
- package/src/prover/smt/solver/nlsat/upolynomial-factorization.ts +8 -7
- package/src/prover/smt/solver/nlsat/upolynomial.ts +41 -20
- package/src/prover/smt/solver/nlsat-tactic.ts +1 -2
- package/src/prover/smt/solver/nnf.ts +6 -3
- package/src/prover/smt/solver/normalize-bounds.ts +0 -1
- package/src/prover/smt/solver/occf.ts +0 -1
- package/src/prover/smt/solver/opt-context.ts +19 -13
- package/src/prover/smt/solver/opt-nlsat.ts +97 -77
- package/src/prover/smt/solver/opt-pareto.ts +0 -2
- package/src/prover/smt/solver/opt-preprocess.ts +1 -2
- package/src/prover/smt/solver/opt-solver.ts +22 -11
- package/src/prover/smt/solver/opt-value.ts +0 -1
- package/src/prover/smt/solver/optsmt.ts +13 -12
- package/src/prover/smt/solver/parallel-tactic.ts +0 -2
- package/src/prover/smt/solver/pattern-inference.ts +2 -3
- package/src/prover/smt/solver/pb-rewriter.ts +15 -30
- package/src/prover/smt/solver/pb2bv-tactic.ts +0 -2
- package/src/prover/smt/solver/poly-rewriter.ts +76 -21
- package/src/prover/smt/solver/probes.ts +91 -28
- package/src/prover/smt/solver/propagate-values.ts +4 -1
- package/src/prover/smt/solver/proto-model.ts +9 -12
- package/src/prover/smt/solver/pull-quant.ts +0 -1
- package/src/prover/smt/solver/purify-arith.ts +50 -16
- package/src/prover/smt/solver/qe-arith-plugin.ts +4 -7
- package/src/prover/smt/solver/qe-lite-der.ts +0 -1
- package/src/prover/smt/solver/qe-lite-fm.ts +0 -1
- package/src/prover/smt/solver/qe-lite.ts +2 -3
- package/src/prover/smt/solver/qe-mbp.ts +13 -24
- package/src/prover/smt/solver/qe.ts +48 -57
- package/src/prover/smt/solver/qel.ts +0 -1
- package/src/prover/smt/solver/qi-queue.ts +0 -1
- package/src/prover/smt/solver/qsat.ts +71 -97
- package/src/prover/smt/solver/quant-hoist.ts +2 -1
- package/src/prover/smt/solver/quant-tactics.ts +0 -1
- package/src/prover/smt/solver/quantifier-analyzer.ts +9 -10
- package/src/prover/smt/solver/quantifier-manager.ts +14 -10
- package/src/prover/smt/solver/quasi-macros.ts +9 -20
- package/src/prover/smt/solver/random-gen.ts +0 -1
- package/src/prover/smt/solver/rational.ts +17 -1
- package/src/prover/smt/solver/recfun-decl-plugin.ts +35 -21
- package/src/prover/smt/solver/recfun-rewriter.ts +1 -2
- package/src/prover/smt/solver/reduce-args.ts +0 -1
- package/src/prover/smt/solver/reduce-bv-size.ts +0 -1
- package/src/prover/smt/solver/ref-vector.ts +0 -1
- package/src/prover/smt/solver/relevancy.ts +0 -1
- package/src/prover/smt/solver/rewriter-tpl.ts +6 -3
- package/src/prover/smt/solver/rewriter.ts +1 -2
- package/src/prover/smt/solver/rlimit.ts +17 -1
- package/src/prover/smt/solver/sat/asymm-branch.ts +59 -48
- package/src/prover/smt/solver/sat/big.ts +0 -1
- package/src/prover/smt/solver/sat/clause-use-list.ts +0 -8
- package/src/prover/smt/solver/sat/clause.ts +2 -20
- package/src/prover/smt/solver/sat/cleaner.ts +0 -2
- package/src/prover/smt/solver/sat/config.ts +6 -9
- package/src/prover/smt/solver/sat/consequences.ts +1 -2
- package/src/prover/smt/solver/sat/elim-eqs.ts +0 -2
- package/src/prover/smt/solver/sat/goal2sat.ts +1 -3
- package/src/prover/smt/solver/sat/inc-sat-solver.ts +30 -15
- package/src/prover/smt/solver/sat/model-converter.ts +2 -22
- package/src/prover/smt/solver/sat/pb-constraint.ts +0 -3
- package/src/prover/smt/solver/sat/pb-solver.ts +50 -26
- package/src/prover/smt/solver/sat/probing.ts +22 -21
- package/src/prover/smt/solver/sat/sat-tactic.ts +4 -4
- package/src/prover/smt/solver/sat/sat2goal.ts +9 -15
- package/src/prover/smt/solver/sat/scc.ts +1 -2
- package/src/prover/smt/solver/sat/simplifier.ts +16 -60
- package/src/prover/smt/solver/sat/solver.ts +47 -70
- package/src/prover/smt/solver/sat/var-queue.ts +0 -2
- package/src/prover/smt/solver/sat/watch-list.ts +7 -3
- package/src/prover/smt/solver/search-tree.ts +0 -1
- package/src/prover/smt/solver/seq-axioms.ts +21 -39
- package/src/prover/smt/solver/seq-decl-plugin.ts +10 -14
- package/src/prover/smt/solver/seq-derive.ts +11 -16
- package/src/prover/smt/solver/seq-eq-approx.ts +0 -2
- package/src/prover/smt/solver/seq-eq-solver.ts +9 -10
- package/src/prover/smt/solver/seq-factory.ts +2 -4
- package/src/prover/smt/solver/seq-monadic.ts +7 -7
- package/src/prover/smt/solver/seq-range-predicate.ts +18 -8
- package/src/prover/smt/solver/seq-re-rewriter.ts +5 -130
- package/src/prover/smt/solver/seq-re-util.ts +8 -27
- package/src/prover/smt/solver/seq-regex-bisim.ts +2 -3
- package/src/prover/smt/solver/seq-regex-live.ts +6 -8
- package/src/prover/smt/solver/seq-rewriter.ts +32 -35
- package/src/prover/smt/solver/seq-skolem.ts +0 -24
- package/src/prover/smt/solver/seq-subset.ts +0 -1
- package/src/prover/smt/solver/seq-view-witness.ts +4 -6
- package/src/prover/smt/solver/smt-consequences.ts +0 -2
- package/src/prover/smt/solver/smt-kernel.ts +9 -5
- package/src/prover/smt/solver/smt-logics.ts +0 -1
- package/src/prover/smt/solver/smt-setup.ts +86 -20
- package/src/prover/smt/solver/smt2-printer.ts +0 -2
- package/src/prover/smt/solver/smtlib-parser.ts +1681 -721
- package/src/prover/smt/solver/smtlib-script.ts +1273 -793
- package/src/prover/smt/solver/solve-eqs.ts +13 -23
- package/src/prover/smt/solver/solver.ts +1 -2
- package/src/prover/smt/solver/static-features.ts +0 -5
- package/src/prover/smt/solver/sticky-generations.ts +0 -1
- package/src/prover/smt/solver/tactic.ts +269 -130
- package/src/prover/smt/solver/term-enumeration.ts +0 -1
- package/src/prover/smt/solver/theory-array.ts +25 -60
- package/src/prover/smt/solver/theory-bv.ts +15 -54
- package/src/prover/smt/solver/theory-char.ts +0 -1
- package/src/prover/smt/solver/theory-datatype.ts +0 -1
- package/src/prover/smt/solver/theory-finite-set.ts +2 -2
- package/src/prover/smt/solver/theory-fpa.ts +46 -79
- package/src/prover/smt/solver/theory-lra-axioms.ts +0 -1
- package/src/prover/smt/solver/theory-lra-bounds.ts +0 -1
- package/src/prover/smt/solver/theory-lra-final-check.ts +1 -2
- package/src/prover/smt/solver/theory-lra-internalize.ts +9 -1
- package/src/prover/smt/solver/theory-lra-model.ts +0 -1
- package/src/prover/smt/solver/theory-lra-propagate.ts +6 -5
- package/src/prover/smt/solver/theory-lra-state.ts +0 -1
- package/src/prover/smt/solver/theory-lra.ts +0 -7
- package/src/prover/smt/solver/theory-pb.ts +34 -15
- package/src/prover/smt/solver/theory-polymorphism.ts +3 -4
- package/src/prover/smt/solver/theory-recfun.ts +2 -3
- package/src/prover/smt/solver/theory-seq-regex.ts +3 -7
- package/src/prover/smt/solver/theory-seq-solve.ts +6 -8
- package/src/prover/smt/solver/theory-seq-state.ts +8 -36
- package/src/prover/smt/solver/theory-seq.ts +32 -55
- package/src/prover/smt/solver/theory.ts +16 -2
- package/src/prover/smt/solver/tseitin-cnf.ts +3 -5
- package/src/prover/smt/solver/var-subst.ts +6 -6
- package/src/prover/smt/table.ts +3 -2
- package/src/prover/tlapm/cache.ts +8 -8
- package/src/prover/zenon/decide.ts +9 -13
- package/src/prover/zenon/encode.ts +0 -2
- package/src/prover/zenon/eqrel.ts +0 -2
- package/src/prover/zenon/equality-rules.ts +24 -2
- package/src/prover/zenon/expr.ts +21 -2
- package/src/prover/zenon/index-table.ts +7 -4
- package/src/prover/zenon/isar-case.ts +1 -3
- package/src/prover/zenon/isar.ts +2 -4
- package/src/prover/zenon/llproof.ts +0 -2
- package/src/prover/zenon/mltoll.ts +0 -2
- package/src/prover/zenon/node.ts +12 -13
- package/src/prover/zenon/parse.ts +0 -2
- package/src/prover/zenon/phrase.ts +1 -3
- package/src/prover/zenon/proof.ts +0 -2
- package/src/prover/zenon/propositional-rules.ts +0 -2
- package/src/prover/zenon/rules.ts +2 -3
- package/src/prover/zenon/search.ts +0 -2
- package/src/prover/zenon/tla/functions.ts +0 -2
- package/src/prover/zenon/tla/llproof.ts +0 -2
- package/src/prover/zenon/tla/records.ts +0 -2
- package/src/prover/zenon/tla/rewrites.ts +0 -2
- package/src/prover/zenon/tla/sets.ts +1 -3
- package/src/prover/zenon/tla/terms.ts +0 -2
- package/src/prover/zenon/tla/tla.ts +0 -2
- package/src/resolve.ts +625 -189
- package/src/runtime.ts +7 -1
- package/src/sany/builtins.ts +10 -10
- package/src/sany/generation.ts +2 -13
- package/src/sany/generator-definitions.ts +3 -1
- package/src/sany/generator-expressions.ts +36 -30
- package/src/sany/generator-proofs.ts +5 -3
- package/src/sany/generator.ts +2 -1
- package/src/sany/levels.ts +0 -2
- package/src/sany/lexer.ts +3 -3
- package/src/sany/linter.ts +0 -2
- package/src/sany/modules.ts +4 -2
- package/src/sany/nodes.ts +1 -1
- package/src/sany/selectors.ts +11 -6
- package/src/sany/xml.ts +2 -3
- package/src/search.ts +209 -56
- package/src/simulate.ts +3 -0
- package/src/spec-description.ts +2 -2
- package/src/standard-definitions.ts +4 -0
- package/src/state-graph.ts +0 -2
- package/src/subexpressions.ts +265 -94
- package/src/successors.ts +2 -1
- package/src/symmetry.ts +3 -3
- package/src/tableau.ts +2 -2
- package/src/tlc/fingerprint.ts +81 -9
- package/src/tlc/jar-data.ts +10 -0
- package/src/tlc/messages.ts +3 -3
- package/src/tlc/order.ts +14 -3
- package/src/tlc/summary.ts +29 -14
- package/src/tlc/tlc-operators.ts +3 -1
- package/src/tlc/tlcext-operators.ts +61 -16
- package/src/tlc/trace-spec.ts +5 -5
- package/src/typed-tier.ts +6541 -0
- package/src/typescript/types.ts +2 -2
- package/src/values.ts +46 -27
- package/src/prover/smt/solver/seq-regex-witness.ts +0 -100
- package/src/prover/smt/solver/z3-license.txt +0 -10
- package/src/prover/zenon/LICENSE +0 -32
|
@@ -41,10 +41,9 @@ export type StatementElement =
|
|
|
41
41
|
export type MethodText =
|
|
42
42
|
| { readonly kind: "source"; readonly name: string; readonly args: readonly OuterToken[] }
|
|
43
43
|
| {
|
|
44
|
-
readonly kind: "then" | "
|
|
44
|
+
readonly kind: "then" | "orelse" | "try" | "repeat1";
|
|
45
45
|
readonly texts: readonly MethodText[];
|
|
46
|
-
}
|
|
47
|
-
| { readonly kind: "select"; readonly count: number; readonly text: MethodText };
|
|
46
|
+
};
|
|
48
47
|
|
|
49
48
|
export type Command =
|
|
50
49
|
| {
|
|
@@ -100,6 +99,11 @@ export const syntaxError = (token: OuterToken | undefined) =>
|
|
|
100
99
|
`Outer syntax error at: ${token === undefined ? "end of input" : token.text}`,
|
|
101
100
|
);
|
|
102
101
|
|
|
102
|
+
export const innerText = (token: OuterToken) =>
|
|
103
|
+
token.kind === "cartouche"
|
|
104
|
+
? token.text.slice("\\<open>".length, -"\\<close>".length)
|
|
105
|
+
: token.text;
|
|
106
|
+
|
|
103
107
|
const isWordChar = (char: string) => /[A-Za-z0-9_'.]/.test(char);
|
|
104
108
|
|
|
105
109
|
const readString = (text: string, start: number): [string, number] => {
|
|
@@ -294,13 +298,9 @@ export const parseTheory = (text: string): TheoryText => {
|
|
|
294
298
|
peek()?.kind === "string" || peek()?.kind === "cartouche" || peek()?.kind === "var" || isName();
|
|
295
299
|
const inner = () => {
|
|
296
300
|
const token = peek();
|
|
297
|
-
if (token?.kind === "cartouche") {
|
|
301
|
+
if (token?.kind === "cartouche" || token?.kind === "var") {
|
|
298
302
|
position += 1;
|
|
299
|
-
return token
|
|
300
|
-
}
|
|
301
|
-
if (token?.kind === "var") {
|
|
302
|
-
position += 1;
|
|
303
|
-
return token.text;
|
|
303
|
+
return innerText(token);
|
|
304
304
|
}
|
|
305
305
|
return token?.kind === "string" ? expectString() : expectName();
|
|
306
306
|
};
|
|
@@ -432,12 +432,7 @@ export const parseTheory = (text: string): TheoryText => {
|
|
|
432
432
|
position += 1;
|
|
433
433
|
return { kind: "repeat1", texts: [text] };
|
|
434
434
|
}
|
|
435
|
-
if (isSymbol("["))
|
|
436
|
-
position += 1;
|
|
437
|
-
const count = isSymbol("]") ? 1 : Number(expectName());
|
|
438
|
-
expectSymbol("]");
|
|
439
|
-
return { kind: "select", count, text };
|
|
440
|
-
}
|
|
435
|
+
if (isSymbol("[")) throw new TlaIsabelleError("ERROR", "Unsupported method combinator: [");
|
|
441
436
|
return text;
|
|
442
437
|
};
|
|
443
438
|
const method3 = (): MethodText => {
|
|
@@ -453,7 +448,7 @@ export const parseTheory = (text: string): TheoryText => {
|
|
|
453
448
|
};
|
|
454
449
|
const enumeration = (
|
|
455
450
|
separator: string,
|
|
456
|
-
kind: "then" | "
|
|
451
|
+
kind: "then" | "orelse",
|
|
457
452
|
read: () => MethodText,
|
|
458
453
|
): MethodText => {
|
|
459
454
|
const texts = [read()];
|
|
@@ -464,7 +459,11 @@ export const parseTheory = (text: string): TheoryText => {
|
|
|
464
459
|
return texts.length === 1 ? texts[0] : { kind, texts };
|
|
465
460
|
};
|
|
466
461
|
const method2 = () => enumeration(",", "then", method3);
|
|
467
|
-
const method1 = () =>
|
|
462
|
+
const method1 = () => {
|
|
463
|
+
const text = method2();
|
|
464
|
+
if (isSymbol(";")) throw new TlaIsabelleError("ERROR", "Unsupported method combinator: ;");
|
|
465
|
+
return text;
|
|
466
|
+
};
|
|
468
467
|
const method0 = (): MethodText => enumeration("|", "orelse", method1);
|
|
469
468
|
const isMethodStart = () =>
|
|
470
469
|
isSymbol("(") ||
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
// Runs a theory's commands one after the other, as Isabelle's Pure/Isar/toplevel.ML does, with the
|
|
2
|
-
// theory commands of Pure/Isar/specification.ML. Copyright (c) 1986-2025 University of Cambridge,
|
|
3
|
-
// Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
4
|
-
|
|
5
1
|
import { TlaIsabelleError } from "../../../errors";
|
|
6
2
|
import { typargsOf } from "../pure/consts";
|
|
7
3
|
import { zeroVarIndexes } from "../pure/drule";
|
|
@@ -29,10 +25,9 @@ import {
|
|
|
29
25
|
transitive,
|
|
30
26
|
type Thm,
|
|
31
27
|
} from "../pure/thm";
|
|
32
|
-
import { addUnsafeDest, withClaset } from "../provers/classical";
|
|
33
28
|
import { getLogicFact, getProofContext } from "../tla/context";
|
|
34
29
|
import type { ConstInfo, TlaLogic } from "../tla/logic";
|
|
35
|
-
import {
|
|
30
|
+
import { applyAttributes, getThms } from "./attrib";
|
|
36
31
|
import {
|
|
37
32
|
addAssumptions,
|
|
38
33
|
addFixes,
|
|
@@ -103,6 +98,11 @@ const addConst = (theory: Theory, base: string, type: Typ): Theory => {
|
|
|
103
98
|
};
|
|
104
99
|
};
|
|
105
100
|
|
|
101
|
+
interface NamedFact {
|
|
102
|
+
readonly name: string;
|
|
103
|
+
readonly thms: readonly Thm[];
|
|
104
|
+
}
|
|
105
|
+
|
|
106
106
|
const putTheoryFacts = (theory: Theory, name: string, thms: readonly Thm[]): Theory => ({
|
|
107
107
|
...theory,
|
|
108
108
|
facts: new Map([...theory.facts, [name, thms]]),
|
|
@@ -134,7 +134,16 @@ const define = (
|
|
|
134
134
|
context: IsarContext,
|
|
135
135
|
command: Extract<Command, { kind: "definition" }>,
|
|
136
136
|
): Theory => {
|
|
137
|
-
const [prop] = readStatement(
|
|
137
|
+
const [prop] = readStatement(
|
|
138
|
+
command.name === undefined || command.type === undefined
|
|
139
|
+
? context
|
|
140
|
+
: {
|
|
141
|
+
...context,
|
|
142
|
+
types: new Map([...context.types, [command.name, parseType(command.type)]]),
|
|
143
|
+
},
|
|
144
|
+
[command.part],
|
|
145
|
+
"default",
|
|
146
|
+
).props.flat();
|
|
138
147
|
const [head, args, rhs] = destDef(destEquals(metaRewriteConv(theory.tactics, prop).prop)[1]);
|
|
139
148
|
if (command.name !== undefined && command.name !== head.name)
|
|
140
149
|
throw error(`Head of definition ${head.name} differs from declaration ${command.name}`);
|
|
@@ -153,52 +162,29 @@ const define = (
|
|
|
153
162
|
applied.maxidx + 1,
|
|
154
163
|
applied,
|
|
155
164
|
);
|
|
165
|
+
const [declared, thms] = applyAttributes(context, command.part.attributes, [
|
|
166
|
+
zeroVarIndexes(generalized),
|
|
167
|
+
]);
|
|
156
168
|
return putTheoryFacts(
|
|
157
|
-
addConst(theory, head.name, head.type),
|
|
169
|
+
{ ...addConst(theory, head.name, head.type), tactics: declared.tactics },
|
|
158
170
|
command.part.name ?? `${head.name}_def`,
|
|
159
|
-
|
|
171
|
+
thms,
|
|
160
172
|
);
|
|
161
173
|
};
|
|
162
174
|
|
|
163
|
-
//
|
|
164
|
-
const declare = (
|
|
165
|
-
tactics: ProofContext,
|
|
166
|
-
context: IsarContext,
|
|
167
|
-
references: readonly FactReference[],
|
|
168
|
-
): ProofContext =>
|
|
175
|
+
// Specification.theorems: the declarations of each fact's attributes, whose results it drops.
|
|
176
|
+
const declare = (context: IsarContext, references: readonly FactReference[]): ProofContext =>
|
|
169
177
|
references.reduce(
|
|
170
178
|
(current, reference) =>
|
|
171
|
-
getFact(
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
([declared, thm], attribute) => {
|
|
175
|
-
if (attribute.name !== "dest")
|
|
176
|
-
return [declared, applyAttribute(context, attribute, thm)];
|
|
177
|
-
if (attribute.args.length > 0) throw error("Unsupported dest attribute arguments");
|
|
178
|
-
const classical = declared.classical;
|
|
179
|
-
return [
|
|
180
|
-
{
|
|
181
|
-
...declared,
|
|
182
|
-
classical: withClaset(
|
|
183
|
-
classical,
|
|
184
|
-
addUnsafeDest(classical, thm, declared.atomizeRules),
|
|
185
|
-
),
|
|
186
|
-
},
|
|
187
|
-
thm,
|
|
188
|
-
];
|
|
189
|
-
},
|
|
190
|
-
[inner, fact],
|
|
191
|
-
)[0],
|
|
192
|
-
current,
|
|
193
|
-
),
|
|
194
|
-
tactics,
|
|
195
|
-
);
|
|
179
|
+
applyAttributes(current, reference.attributes, getFact(current, reference.name))[0],
|
|
180
|
+
context,
|
|
181
|
+
).tactics;
|
|
196
182
|
|
|
197
183
|
// Specification.theorem: the statement's elements, then the goal whose results the theory keeps.
|
|
198
184
|
const startTheorem = (
|
|
199
185
|
outer: IsarContext,
|
|
200
186
|
command: Extract<Command, { kind: "theorem" }>,
|
|
201
|
-
store: (
|
|
187
|
+
store: (tactics: ProofContext, facts: readonly NamedFact[]) => void,
|
|
202
188
|
): State => {
|
|
203
189
|
const fixed = command.elements.reduce((context, element) => {
|
|
204
190
|
if (element.kind !== "fixes") return context;
|
|
@@ -223,9 +209,13 @@ const startTheorem = (
|
|
|
223
209
|
);
|
|
224
210
|
let offset = 0;
|
|
225
211
|
const named = assumes.reduce((context, part, index) => {
|
|
226
|
-
const group =
|
|
212
|
+
const [declared, group] = applyAttributes(
|
|
213
|
+
context,
|
|
214
|
+
part.attributes,
|
|
215
|
+
prems.slice(offset, offset + assumeProps[index].length),
|
|
216
|
+
);
|
|
227
217
|
offset += assumeProps[index].length;
|
|
228
|
-
return part.name === undefined ?
|
|
218
|
+
return part.name === undefined ? declared : putFacts(declared, part.name, group);
|
|
229
219
|
}, assumed);
|
|
230
220
|
const elementsContext =
|
|
231
221
|
prems.length === 0 ? named : putFacts(named, command.isLong ? "assms" : "that", prems);
|
|
@@ -237,13 +227,13 @@ const startTheorem = (
|
|
|
237
227
|
normHhfProtect(outer.tactics.limits, exportThm(resultContext, outer, false, result)),
|
|
238
228
|
),
|
|
239
229
|
);
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
],
|
|
245
|
-
|
|
246
|
-
);
|
|
230
|
+
const part = command.shows[0];
|
|
231
|
+
const [notedContext, noted] = applyAttributes(outer, part.attributes, normalized);
|
|
232
|
+
const [namedContext, named] = applyAttributes(notedContext, command.attributes, noted);
|
|
233
|
+
store(namedContext.tactics, [
|
|
234
|
+
...(part.name === undefined ? [] : [{ name: part.name, thms: noted }]),
|
|
235
|
+
...(command.name === undefined ? [] : [{ name: command.name, thms: named }]),
|
|
236
|
+
]);
|
|
247
237
|
});
|
|
248
238
|
};
|
|
249
239
|
|
|
@@ -323,14 +313,14 @@ export const runTheory = (logic: TlaLogic, text: TheoryText, limits: Limits) =>
|
|
|
323
313
|
theory = define(theory, initContext(logic, theory), command);
|
|
324
314
|
break;
|
|
325
315
|
case "declare":
|
|
326
|
-
theory = {
|
|
327
|
-
...theory,
|
|
328
|
-
tactics: declare(theory.tactics, initContext(logic, theory), command.facts),
|
|
329
|
-
};
|
|
316
|
+
theory = { ...theory, tactics: declare(initContext(logic, theory), command.facts) };
|
|
330
317
|
break;
|
|
331
318
|
case "theorem":
|
|
332
|
-
state = startTheorem(initContext(logic, theory), command, (
|
|
333
|
-
theory =
|
|
319
|
+
state = startTheorem(initContext(logic, theory), command, (tactics, facts) => {
|
|
320
|
+
theory = facts.reduce((current, fact) => putTheoryFacts(current, fact.name, fact.thms), {
|
|
321
|
+
...theory,
|
|
322
|
+
tactics,
|
|
323
|
+
});
|
|
334
324
|
});
|
|
335
325
|
break;
|
|
336
326
|
default:
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Pure/type_infer_context.ML, Pure/type_infer.ML and Pure/consts.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { TlaIsabelleError } from "../../../errors";
|
|
4
2
|
import { bumpString } from "../pure/name";
|
|
5
3
|
import {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Provers/blast.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { isIsabelleError, TlaIsabelleError } from "../../../../errors";
|
|
4
2
|
import { selectGoal } from "../../pure/goal";
|
|
5
3
|
import { destImplies, isAllAbs, stripParams } from "../../pure/logic";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Provers/blast.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { orElseGoal, thenGoal, type GoalTactic } from "../../pure/tactical";
|
|
4
2
|
import { assumeTac, eqAssumeTac, ematchTac } from "../../pure/tactic";
|
|
5
3
|
import {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Provers/blast.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import type { Seq } from "../../pure/seq";
|
|
4
2
|
import type { GoalTactic } from "../../pure/tactical";
|
|
5
3
|
import { checkInterrupt } from "../../pure/interrupt";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Provers/blast.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { TlaIsabelleError } from "../../../../errors";
|
|
4
2
|
import { revcutRl, zeroVarIndexes } from "../../pure/drule";
|
|
5
3
|
import { unifyTermNet } from "../../pure/net";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Provers/blast.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { bumpInit, bumpString } from "../../pure/name";
|
|
4
2
|
import type { GoalTactic } from "../../pure/tactical";
|
|
5
3
|
import type { Limits } from "../../pure/interrupt";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Provers/clasimp.ML and Pure/tactic.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { trivForallEquality } from "../pure/drule";
|
|
4
2
|
import { selectGoal } from "../pure/goal";
|
|
5
3
|
import { addSimps, emptySimpset, type SimpContext } from "../pure/raw-simplifier";
|
|
@@ -93,7 +91,7 @@ const pruneParamsTac = (simp: SimpContext): Tactic => {
|
|
|
93
91
|
const empty = { ...simp, simpset: emptySimpset };
|
|
94
92
|
const context = { ...empty, simpset: addSimps(empty, [trivForallEquality]) };
|
|
95
93
|
return primitive((state) =>
|
|
96
|
-
Array.from({ length: nprems(state) }, (
|
|
94
|
+
Array.from({ length: nprems(state) }, (_value, offset) => offset + 1).reduce(
|
|
97
95
|
(current, index) =>
|
|
98
96
|
gconvRule(
|
|
99
97
|
(term) =>
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Provers/classical.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { TlaIsabelleError } from "../../../errors";
|
|
4
2
|
import { revcutRl, thinRl, zeroVarIndexes, makeElim } from "../pure/drule";
|
|
5
3
|
import { selectGoal } from "../pure/goal";
|
|
@@ -207,7 +205,7 @@ export const addUnsafeIntro = (
|
|
|
207
205
|
};
|
|
208
206
|
};
|
|
209
207
|
|
|
210
|
-
const addUnsafeElim = (
|
|
208
|
+
export const addUnsafeElim = (
|
|
211
209
|
context: ClassicalContext,
|
|
212
210
|
rule: Thm,
|
|
213
211
|
atomizeRules: readonly Thm[],
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Provers/hypsubst.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { isIsabelleError, TlaIsabelleError } from "../../../errors";
|
|
4
2
|
import { asmRl, compIncr, revcutRl, thinRl, zeroVarIndexes } from "../pure/drule";
|
|
5
3
|
import { aeconv, etaContract } from "../pure/envir";
|
|
@@ -247,9 +245,9 @@ const instSubstTac = (context: HypsubstContext, isLeft: boolean, rule: Thm): Goa
|
|
|
247
245
|
chosen.kind === "Bound"
|
|
248
246
|
? substBounds(
|
|
249
247
|
[
|
|
250
|
-
...Array.from({ length: chosen.index }, (
|
|
248
|
+
...Array.from({ length: chosen.index }, (_value, position) => mkBound(position + 1)),
|
|
251
249
|
mkBound(0),
|
|
252
|
-
...Array.from({ length: params.length - chosen.index - 1 }, (
|
|
250
|
+
...Array.from({ length: params.length - chosen.index - 1 }, (_value, position) =>
|
|
253
251
|
mkBound(chosen.index + 2 + position),
|
|
254
252
|
),
|
|
255
253
|
],
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Pure/thm.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { TlaIsabelleError } from "../../../errors";
|
|
4
2
|
import { normTerm, type Envir } from "./envir";
|
|
5
3
|
import { allConst, isAllAbs, isImplies, mkImplies } from "./logic";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Pure/conv.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { TlaIsabelleError } from "../../../errors";
|
|
4
2
|
import { destEquals, destImplies, implies, isAllAbs, isImplies } from "./logic";
|
|
5
3
|
import { declareName, makeNameContext, variantName, type NameContext } from "./name";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Pure/goal.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { TlaIsabelleError } from "../../../errors";
|
|
4
2
|
import { compNoFlatten, protectD, protectI } from "./drule";
|
|
5
3
|
import { emptySeq } from "./seq";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Pure/name.ML and Pure/General/symbol.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
const explodeSymbols = (text: string): string[] => text.match(/\\<\^?[A-Za-z0-9_']*>|[^]/gu) ?? [];
|
|
4
2
|
|
|
5
3
|
const isRawSymbolic = (symbol: string) => symbol.startsWith("\\<") && !symbol.startsWith("\\<^");
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Pure/Isar/object_logic.ML and Pure/tactic.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { TlaIsabelleError } from "../../../errors";
|
|
4
2
|
import { fconvRule, gconvRule, paramsConv, premsConv } from "./conv";
|
|
5
3
|
import { hasMetaPrems } from "./logic";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Pure/pattern.ML and Pure/more_pattern.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { TlaIsabelleError } from "../../../errors";
|
|
4
2
|
import { aeconv, genvar, headNorm, lookup, lookup1, update, type Envir, type TEnv } from "./envir";
|
|
5
3
|
import type { Binder } from "./logic";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Pure/raw_simplifier.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { TlaIsabelleError } from "../../../errors";
|
|
4
2
|
import { emptyTEnv, etaContract } from "./envir";
|
|
5
3
|
import { symmetricThm } from "./drule";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Pure/raw_simplifier.ML and Pure/conv.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { isIsabelleError, TlaIsabelleError } from "../../../errors";
|
|
4
2
|
import { gconvRule, impCongRule } from "./conv";
|
|
5
3
|
import { betaEtaConversion, impCong, swapPremsEq } from "./drule";
|
|
@@ -85,9 +83,9 @@ const rhsOf = (thm: Thm) => destEquals(thm.prop)[1];
|
|
|
85
83
|
|
|
86
84
|
const instantiateMatch = (env: MatchEnv, rule: Thm): Thm => {
|
|
87
85
|
const typed = instantiateTypes(env.tyenv, rule);
|
|
88
|
-
const insts: Instantiation[] = tableEntries(env.tenv).map((
|
|
89
|
-
variable: mkVar(
|
|
90
|
-
term:
|
|
86
|
+
const insts: Instantiation[] = tableEntries(env.tenv).map((entry) => ({
|
|
87
|
+
variable: mkVar(entry[0].name, entry[0].index, substType(env.tyenv, entry[1].type)),
|
|
88
|
+
term: entry[1].term,
|
|
91
89
|
}));
|
|
92
90
|
return instantiate(insts, typed);
|
|
93
91
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Pure/search.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { listOfSeq, makeSeq, seqOfList } from "./seq";
|
|
4
2
|
import { eqThm, hasFewerPrems, noTac, orElse, type GoalTactic, type Tactic } from "./tactical";
|
|
5
3
|
import { termOrd } from "./term-ord";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Pure/General/seq.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
export type Cell<Item> = readonly [Item, Seq<Item>] | undefined;
|
|
4
2
|
|
|
5
3
|
type Step<Item> = Cell<Item> | Seq<Item>;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Pure/simplifier.ML and Pure/goal.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { genAll, isNormHhf, normHhfEq, protectCong } from "./drule";
|
|
4
2
|
import { preferGoal } from "./goal";
|
|
5
3
|
import { congKey, makeSimpContext, type SimpContext, type Solver } from "./raw-simplifier";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Pure/tactic.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { makeElim } from "./drule";
|
|
4
2
|
import { checkInterrupt, type Limits } from "./interrupt";
|
|
5
3
|
import { stripAssumsConcl, stripAssumsHyp } from "./logic";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Pure/term_ord.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { fastIndexnameOrd, fastStringOrd, indexnameOrd } from "./table";
|
|
4
2
|
import { dummyT, sizeOfTerm, type Term, type Typ } from "./term";
|
|
5
3
|
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Pure/term.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { TlaIsabelleError } from "../../../errors";
|
|
4
2
|
|
|
5
3
|
export type Sort = readonly string[];
|
|
@@ -638,10 +636,10 @@ const mapAbsVars = (rename: (name: string) => string, term: Term): Term => {
|
|
|
638
636
|
|
|
639
637
|
export const renameAbs = (pattern: Term, object: Term, term: Term): Term | undefined => {
|
|
640
638
|
const renaming = new Map<string, string>();
|
|
641
|
-
matchBvs(pattern, object, []).forEach((
|
|
642
|
-
if (!renaming.has(
|
|
639
|
+
matchBvs(pattern, object, []).forEach((pair) => {
|
|
640
|
+
if (!renaming.has(pair[0])) renaming.set(pair[0], pair[1]);
|
|
643
641
|
});
|
|
644
|
-
if ([...renaming].every((
|
|
642
|
+
if ([...renaming].every((pair) => pair[0] === pair[1])) return undefined;
|
|
645
643
|
const renamed = mapAbsVars((name) => renaming.get(name) ?? name, term);
|
|
646
644
|
return renamed === term ? undefined : renamed;
|
|
647
645
|
};
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Pure/unify.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { checkInterrupt, type Limits } from "./interrupt";
|
|
4
2
|
import { TlaIsabelleError } from "../../../errors";
|
|
5
3
|
import {
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Pure/variable.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { variantList } from "./name";
|
|
4
2
|
import { addFreeNames, addVars, mkFree } from "./term";
|
|
5
3
|
import { generalize, instantiate, type Thm } from "./thm";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle/TLA+'s simplifier_setup.ML and PredicateLogic.thy, BSD licensed, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { TlaIsabelleError } from "../../../errors";
|
|
4
2
|
import { genAll, reflexiveThm } from "../pure/drule";
|
|
5
3
|
import { emptyNet, insertTermNet, type Net } from "../pure/net";
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// Ported from Isabelle2025's Tools/intuitionistic.ML and Pure/Isar/context_rules.ML. Copyright (c) 1986-2025 University of Cambridge, Technische Universitaet Muenchen, and contributors, see LICENSE.
|
|
2
|
-
|
|
3
1
|
import { remdupsRl } from "../pure/drule";
|
|
4
2
|
import { selectGoal } from "../pure/goal";
|
|
5
3
|
import { unifyTermNet } from "../pure/net";
|
package/src/prover/ocaml.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
|
|
1
|
+
// A bigint is an OCaml int beyond what a number holds exactly.
|
|
2
|
+
type OcamlValue = number | bigint | string | OcamlValue[];
|
|
2
3
|
|
|
3
4
|
export const compareStrings = (left: string, right: string) =>
|
|
4
5
|
left < right ? -1 : left > right ? 1 : 0;
|
|
5
6
|
|
|
6
7
|
export const compareValues = (left: OcamlValue, right: OcamlValue): number => {
|
|
7
8
|
if (typeof left === "number" && typeof right === "number") return left - right;
|
|
9
|
+
if (typeof left === "bigint" && typeof right === "bigint")
|
|
10
|
+
return left < right ? -1 : left > right ? 1 : 0;
|
|
8
11
|
if (typeof left === "string" && typeof right === "string") return compareStrings(left, right);
|
|
9
12
|
if (!Array.isArray(left) || !Array.isArray(right)) return 0;
|
|
10
13
|
const index = left.findIndex(
|
|
@@ -466,6 +466,7 @@ const commuteSequent = createSequentMap(commuteSymbols, "all");
|
|
|
466
466
|
const coalesceSequent = createSequentMap(coalesceModal, "visible");
|
|
467
467
|
|
|
468
468
|
export const processObligation = (sequent: Sequent): Sequent => {
|
|
469
|
+
// Levels.compute_level, whose levels the passes below read on demand: only its errors matter.
|
|
469
470
|
getLevelInfo(undefined, { kind: "Sequent", sequent });
|
|
470
471
|
const keys = sequent.context;
|
|
471
472
|
const expanded = expandUnchangedSequent(keys, expandActionSequent(keys, sequent));
|