@stevenvo780/st-lang 4.1.0 → 4.3.0
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/belief-revision/agm.d.ts +76 -0
- package/dist/belief-revision/agm.d.ts.map +1 -0
- package/dist/belief-revision/agm.js +249 -0
- package/dist/belief-revision/agm.js.map +1 -0
- package/dist/belief-revision/index.d.ts +6 -0
- package/dist/belief-revision/index.d.ts.map +1 -0
- package/dist/belief-revision/index.js +33 -0
- package/dist/belief-revision/index.js.map +1 -0
- package/dist/belief-revision/parser.d.ts +16 -0
- package/dist/belief-revision/parser.d.ts.map +1 -0
- package/dist/belief-revision/parser.js +199 -0
- package/dist/belief-revision/parser.js.map +1 -0
- package/dist/belief-revision/sat.d.ts +19 -0
- package/dist/belief-revision/sat.d.ts.map +1 -0
- package/dist/belief-revision/sat.js +90 -0
- package/dist/belief-revision/sat.js.map +1 -0
- package/dist/belief-revision/types.d.ts +51 -0
- package/dist/belief-revision/types.d.ts.map +1 -0
- package/dist/belief-revision/types.js +10 -0
- package/dist/belief-revision/types.js.map +1 -0
- package/dist/curry-howard/index.d.ts +7 -0
- package/dist/curry-howard/index.d.ts.map +1 -0
- package/dist/curry-howard/index.js +46 -0
- package/dist/curry-howard/index.js.map +1 -0
- package/dist/curry-howard/infer.d.ts +9 -0
- package/dist/curry-howard/infer.d.ts.map +1 -0
- package/dist/curry-howard/infer.js +129 -0
- package/dist/curry-howard/infer.js.map +1 -0
- package/dist/curry-howard/proof.d.ts +7 -0
- package/dist/curry-howard/proof.d.ts.map +1 -0
- package/dist/curry-howard/proof.js +282 -0
- package/dist/curry-howard/proof.js.map +1 -0
- package/dist/curry-howard/reduce.d.ts +7 -0
- package/dist/curry-howard/reduce.d.ts.map +1 -0
- package/dist/curry-howard/reduce.js +266 -0
- package/dist/curry-howard/reduce.js.map +1 -0
- package/dist/curry-howard/types.d.ts +91 -0
- package/dist/curry-howard/types.d.ts.map +1 -0
- package/dist/curry-howard/types.js +149 -0
- package/dist/curry-howard/types.js.map +1 -0
- package/dist/fol-prover-equality/demodulate.d.ts +29 -0
- package/dist/fol-prover-equality/demodulate.d.ts.map +1 -0
- package/dist/fol-prover-equality/demodulate.js +197 -0
- package/dist/fol-prover-equality/demodulate.js.map +1 -0
- package/dist/fol-prover-equality/index.d.ts +8 -0
- package/dist/fol-prover-equality/index.d.ts.map +1 -0
- package/dist/fol-prover-equality/index.js +24 -0
- package/dist/fol-prover-equality/index.js.map +1 -0
- package/dist/fol-prover-equality/paramodulate.d.ts +46 -0
- package/dist/fol-prover-equality/paramodulate.d.ts.map +1 -0
- package/dist/fol-prover-equality/paramodulate.js +159 -0
- package/dist/fol-prover-equality/paramodulate.js.map +1 -0
- package/dist/fol-prover-equality/prove.d.ts +7 -0
- package/dist/fol-prover-equality/prove.d.ts.map +1 -0
- package/dist/fol-prover-equality/prove.js +307 -0
- package/dist/fol-prover-equality/prove.js.map +1 -0
- package/dist/fol-prover-equality/term-utils.d.ts +43 -0
- package/dist/fol-prover-equality/term-utils.d.ts.map +1 -0
- package/dist/fol-prover-equality/term-utils.js +230 -0
- package/dist/fol-prover-equality/term-utils.js.map +1 -0
- package/dist/fol-prover-equality/types.d.ts +20 -0
- package/dist/fol-prover-equality/types.d.ts.map +1 -0
- package/dist/fol-prover-equality/types.js +5 -0
- package/dist/fol-prover-equality/types.js.map +1 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +53 -1
- package/dist/index.js.map +1 -1
- package/dist/lambda-calc/church.d.ts +8 -0
- package/dist/lambda-calc/church.d.ts.map +1 -0
- package/dist/lambda-calc/church.js +67 -0
- package/dist/lambda-calc/church.js.map +1 -0
- package/dist/lambda-calc/combinators.d.ts +8 -0
- package/dist/lambda-calc/combinators.d.ts.map +1 -0
- package/dist/lambda-calc/combinators.js +24 -0
- package/dist/lambda-calc/combinators.js.map +1 -0
- package/dist/lambda-calc/index.d.ts +8 -0
- package/dist/lambda-calc/index.d.ts.map +1 -0
- package/dist/lambda-calc/index.js +48 -0
- package/dist/lambda-calc/index.js.map +1 -0
- package/dist/lambda-calc/reduce.d.ts +18 -0
- package/dist/lambda-calc/reduce.d.ts.map +1 -0
- package/dist/lambda-calc/reduce.js +174 -0
- package/dist/lambda-calc/reduce.js.map +1 -0
- package/dist/lambda-calc/substitution.d.ts +6 -0
- package/dist/lambda-calc/substitution.d.ts.map +1 -0
- package/dist/lambda-calc/substitution.js +120 -0
- package/dist/lambda-calc/substitution.js.map +1 -0
- package/dist/lambda-calc/types.d.ts +19 -0
- package/dist/lambda-calc/types.d.ts.map +1 -0
- package/dist/lambda-calc/types.js +72 -0
- package/dist/lambda-calc/types.js.map +1 -0
- package/dist/profiles/ctl/check.d.ts +13 -0
- package/dist/profiles/ctl/check.d.ts.map +1 -0
- package/dist/profiles/ctl/check.js +359 -0
- package/dist/profiles/ctl/check.js.map +1 -0
- package/dist/profiles/ctl/index.d.ts +5 -0
- package/dist/profiles/ctl/index.d.ts.map +1 -0
- package/dist/profiles/ctl/index.js +23 -0
- package/dist/profiles/ctl/index.js.map +1 -0
- package/dist/profiles/ctl/types.d.ts +74 -0
- package/dist/profiles/ctl/types.d.ts.map +1 -0
- package/dist/profiles/ctl/types.js +53 -0
- package/dist/profiles/ctl/types.js.map +1 -0
- package/dist/profiles/ctl/witness.d.ts +20 -0
- package/dist/profiles/ctl/witness.d.ts.map +1 -0
- package/dist/profiles/ctl/witness.js +149 -0
- package/dist/profiles/ctl/witness.js.map +1 -0
- package/dist/profiles/default-logic/entailment.d.ts +14 -0
- package/dist/profiles/default-logic/entailment.d.ts.map +1 -0
- package/dist/profiles/default-logic/entailment.js +36 -0
- package/dist/profiles/default-logic/entailment.js.map +1 -0
- package/dist/profiles/default-logic/extensions.d.ts +35 -0
- package/dist/profiles/default-logic/extensions.d.ts.map +1 -0
- package/dist/profiles/default-logic/extensions.js +276 -0
- package/dist/profiles/default-logic/extensions.js.map +1 -0
- package/dist/profiles/default-logic/index.d.ts +5 -0
- package/dist/profiles/default-logic/index.d.ts.map +1 -0
- package/dist/profiles/default-logic/index.js +33 -0
- package/dist/profiles/default-logic/index.js.map +1 -0
- package/dist/profiles/default-logic/types.d.ts +29 -0
- package/dist/profiles/default-logic/types.d.ts.map +1 -0
- package/dist/profiles/default-logic/types.js +25 -0
- package/dist/profiles/default-logic/types.js.map +1 -0
- package/dist/profiles/description-logic/index.d.ts +5 -0
- package/dist/profiles/description-logic/index.d.ts.map +1 -0
- package/dist/profiles/description-logic/index.js +39 -0
- package/dist/profiles/description-logic/index.js.map +1 -0
- package/dist/profiles/description-logic/nnf.d.ts +13 -0
- package/dist/profiles/description-logic/nnf.d.ts.map +1 -0
- package/dist/profiles/description-logic/nnf.js +123 -0
- package/dist/profiles/description-logic/nnf.js.map +1 -0
- package/dist/profiles/description-logic/tableau.d.ts +27 -0
- package/dist/profiles/description-logic/tableau.d.ts.map +1 -0
- package/dist/profiles/description-logic/tableau.js +491 -0
- package/dist/profiles/description-logic/tableau.js.map +1 -0
- package/dist/profiles/description-logic/types.d.ts +45 -0
- package/dist/profiles/description-logic/types.d.ts.map +1 -0
- package/dist/profiles/description-logic/types.js +71 -0
- package/dist/profiles/description-logic/types.js.map +1 -0
- package/dist/profiles/hybrid-logic/index.d.ts +5 -0
- package/dist/profiles/hybrid-logic/index.d.ts.map +1 -0
- package/dist/profiles/hybrid-logic/index.js +34 -0
- package/dist/profiles/hybrid-logic/index.js.map +1 -0
- package/dist/profiles/hybrid-logic/sat.d.ts +15 -0
- package/dist/profiles/hybrid-logic/sat.d.ts.map +1 -0
- package/dist/profiles/hybrid-logic/sat.js +142 -0
- package/dist/profiles/hybrid-logic/sat.js.map +1 -0
- package/dist/profiles/hybrid-logic/semantics.d.ts +20 -0
- package/dist/profiles/hybrid-logic/semantics.d.ts.map +1 -0
- package/dist/profiles/hybrid-logic/semantics.js +107 -0
- package/dist/profiles/hybrid-logic/semantics.js.map +1 -0
- package/dist/profiles/hybrid-logic/types.d.ts +78 -0
- package/dist/profiles/hybrid-logic/types.d.ts.map +1 -0
- package/dist/profiles/hybrid-logic/types.js +107 -0
- package/dist/profiles/hybrid-logic/types.js.map +1 -0
- package/dist/profiles/intuitionistic-nj/formula.d.ts +19 -0
- package/dist/profiles/intuitionistic-nj/formula.d.ts.map +1 -0
- package/dist/profiles/intuitionistic-nj/formula.js +99 -0
- package/dist/profiles/intuitionistic-nj/formula.js.map +1 -0
- package/dist/profiles/intuitionistic-nj/index.d.ts +5 -0
- package/dist/profiles/intuitionistic-nj/index.d.ts.map +1 -0
- package/dist/profiles/intuitionistic-nj/index.js +24 -0
- package/dist/profiles/intuitionistic-nj/index.js.map +1 -0
- package/dist/profiles/intuitionistic-nj/kripke.d.ts +17 -0
- package/dist/profiles/intuitionistic-nj/kripke.d.ts.map +1 -0
- package/dist/profiles/intuitionistic-nj/kripke.js +206 -0
- package/dist/profiles/intuitionistic-nj/kripke.js.map +1 -0
- package/dist/profiles/intuitionistic-nj/prover.d.ts +13 -0
- package/dist/profiles/intuitionistic-nj/prover.d.ts.map +1 -0
- package/dist/profiles/intuitionistic-nj/prover.js +418 -0
- package/dist/profiles/intuitionistic-nj/prover.js.map +1 -0
- package/dist/profiles/intuitionistic-nj/types.d.ts +55 -0
- package/dist/profiles/intuitionistic-nj/types.d.ts.map +1 -0
- package/dist/profiles/intuitionistic-nj/types.js +21 -0
- package/dist/profiles/intuitionistic-nj/types.js.map +1 -0
- package/dist/profiles/ltl-sat/index.d.ts +4 -0
- package/dist/profiles/ltl-sat/index.d.ts.map +1 -0
- package/dist/profiles/ltl-sat/index.js +40 -0
- package/dist/profiles/ltl-sat/index.js.map +1 -0
- package/dist/profiles/ltl-sat/sat.d.ts +8 -0
- package/dist/profiles/ltl-sat/sat.d.ts.map +1 -0
- package/dist/profiles/ltl-sat/sat.js +140 -0
- package/dist/profiles/ltl-sat/sat.js.map +1 -0
- package/dist/profiles/ltl-sat/tableau.d.ts +19 -0
- package/dist/profiles/ltl-sat/tableau.d.ts.map +1 -0
- package/dist/profiles/ltl-sat/tableau.js +358 -0
- package/dist/profiles/ltl-sat/tableau.js.map +1 -0
- package/dist/profiles/ltl-sat/types.d.ts +52 -0
- package/dist/profiles/ltl-sat/types.d.ts.map +1 -0
- package/dist/profiles/ltl-sat/types.js +101 -0
- package/dist/profiles/ltl-sat/types.js.map +1 -0
- package/dist/profiles/many-valued/index.d.ts +39 -0
- package/dist/profiles/many-valued/index.d.ts.map +1 -0
- package/dist/profiles/many-valued/index.js +250 -0
- package/dist/profiles/many-valued/index.js.map +1 -0
- package/dist/profiles/modal-frame-axioms/formula.d.ts +23 -0
- package/dist/profiles/modal-frame-axioms/formula.d.ts.map +1 -0
- package/dist/profiles/modal-frame-axioms/formula.js +158 -0
- package/dist/profiles/modal-frame-axioms/formula.js.map +1 -0
- package/dist/profiles/modal-frame-axioms/index.d.ts +6 -0
- package/dist/profiles/modal-frame-axioms/index.d.ts.map +1 -0
- package/dist/profiles/modal-frame-axioms/index.js +41 -0
- package/dist/profiles/modal-frame-axioms/index.js.map +1 -0
- package/dist/profiles/modal-frame-axioms/systems.d.ts +29 -0
- package/dist/profiles/modal-frame-axioms/systems.d.ts.map +1 -0
- package/dist/profiles/modal-frame-axioms/systems.js +96 -0
- package/dist/profiles/modal-frame-axioms/systems.js.map +1 -0
- package/dist/profiles/modal-frame-axioms/tableau.d.ts +12 -0
- package/dist/profiles/modal-frame-axioms/tableau.d.ts.map +1 -0
- package/dist/profiles/modal-frame-axioms/tableau.js +299 -0
- package/dist/profiles/modal-frame-axioms/tableau.js.map +1 -0
- package/dist/profiles/modal-frame-axioms/types.d.ts +61 -0
- package/dist/profiles/modal-frame-axioms/types.d.ts.map +1 -0
- package/dist/profiles/modal-frame-axioms/types.js +27 -0
- package/dist/profiles/modal-frame-axioms/types.js.map +1 -0
- package/dist/profiles/sequent-g3/index.d.ts +5 -0
- package/dist/profiles/sequent-g3/index.d.ts.map +1 -0
- package/dist/profiles/sequent-g3/index.js +23 -0
- package/dist/profiles/sequent-g3/index.js.map +1 -0
- package/dist/profiles/sequent-g3/latex.d.ts +7 -0
- package/dist/profiles/sequent-g3/latex.d.ts.map +1 -0
- package/dist/profiles/sequent-g3/latex.js +107 -0
- package/dist/profiles/sequent-g3/latex.js.map +1 -0
- package/dist/profiles/sequent-g3/normalize.d.ts +15 -0
- package/dist/profiles/sequent-g3/normalize.d.ts.map +1 -0
- package/dist/profiles/sequent-g3/normalize.js +121 -0
- package/dist/profiles/sequent-g3/normalize.js.map +1 -0
- package/dist/profiles/sequent-g3/prover.d.ts +16 -0
- package/dist/profiles/sequent-g3/prover.d.ts.map +1 -0
- package/dist/profiles/sequent-g3/prover.js +348 -0
- package/dist/profiles/sequent-g3/prover.js.map +1 -0
- package/dist/profiles/sequent-g3/types.d.ts +30 -0
- package/dist/profiles/sequent-g3/types.d.ts.map +1 -0
- package/dist/profiles/sequent-g3/types.js +16 -0
- package/dist/profiles/sequent-g3/types.js.map +1 -0
- package/dist/profiles/substructural/index.d.ts +4 -0
- package/dist/profiles/substructural/index.d.ts.map +1 -0
- package/dist/profiles/substructural/index.js +22 -0
- package/dist/profiles/substructural/index.js.map +1 -0
- package/dist/profiles/substructural/prover.d.ts +13 -0
- package/dist/profiles/substructural/prover.d.ts.map +1 -0
- package/dist/profiles/substructural/prover.js +481 -0
- package/dist/profiles/substructural/prover.js.map +1 -0
- package/dist/profiles/substructural/types.d.ts +72 -0
- package/dist/profiles/substructural/types.d.ts.map +1 -0
- package/dist/profiles/substructural/types.js +27 -0
- package/dist/profiles/substructural/types.js.map +1 -0
- package/dist/runtime/abduction/entails.d.ts +21 -0
- package/dist/runtime/abduction/entails.d.ts.map +1 -0
- package/dist/runtime/abduction/entails.js +308 -0
- package/dist/runtime/abduction/entails.js.map +1 -0
- package/dist/runtime/abduction/find.d.ts +18 -0
- package/dist/runtime/abduction/find.d.ts.map +1 -0
- package/dist/runtime/abduction/find.js +202 -0
- package/dist/runtime/abduction/find.js.map +1 -0
- package/dist/runtime/abduction/index.d.ts +4 -0
- package/dist/runtime/abduction/index.d.ts.map +1 -0
- package/dist/runtime/abduction/index.js +26 -0
- package/dist/runtime/abduction/index.js.map +1 -0
- package/dist/runtime/abduction/types.d.ts +78 -0
- package/dist/runtime/abduction/types.d.ts.map +1 -0
- package/dist/runtime/abduction/types.js +23 -0
- package/dist/runtime/abduction/types.js.map +1 -0
- package/dist/runtime/bayesian/factor.d.ts +22 -0
- package/dist/runtime/bayesian/factor.d.ts.map +1 -0
- package/dist/runtime/bayesian/factor.js +249 -0
- package/dist/runtime/bayesian/factor.js.map +1 -0
- package/dist/runtime/bayesian/index.d.ts +3 -0
- package/dist/runtime/bayesian/index.d.ts.map +1 -0
- package/dist/runtime/bayesian/index.js +25 -0
- package/dist/runtime/bayesian/index.js.map +1 -0
- package/dist/runtime/bayesian/inference.d.ts +6 -0
- package/dist/runtime/bayesian/inference.d.ts.map +1 -0
- package/dist/runtime/bayesian/inference.js +260 -0
- package/dist/runtime/bayesian/inference.js.map +1 -0
- package/dist/runtime/bayesian/types.d.ts +19 -0
- package/dist/runtime/bayesian/types.d.ts.map +1 -0
- package/dist/runtime/bayesian/types.js +9 -0
- package/dist/runtime/bayesian/types.js.map +1 -0
- package/dist/runtime/bisimulation/index.d.ts +4 -0
- package/dist/runtime/bisimulation/index.d.ts.map +1 -0
- package/dist/runtime/bisimulation/index.js +21 -0
- package/dist/runtime/bisimulation/index.js.map +1 -0
- package/dist/runtime/bisimulation/operations.d.ts +40 -0
- package/dist/runtime/bisimulation/operations.d.ts.map +1 -0
- package/dist/runtime/bisimulation/operations.js +219 -0
- package/dist/runtime/bisimulation/operations.js.map +1 -0
- package/dist/runtime/bisimulation/paige-tarjan.d.ts +8 -0
- package/dist/runtime/bisimulation/paige-tarjan.d.ts.map +1 -0
- package/dist/runtime/bisimulation/paige-tarjan.js +199 -0
- package/dist/runtime/bisimulation/paige-tarjan.js.map +1 -0
- package/dist/runtime/bisimulation/types.d.ts +26 -0
- package/dist/runtime/bisimulation/types.d.ts.map +1 -0
- package/dist/runtime/bisimulation/types.js +22 -0
- package/dist/runtime/bisimulation/types.js.map +1 -0
- package/dist/runtime/countermodel-min/index.d.ts +3 -0
- package/dist/runtime/countermodel-min/index.d.ts.map +1 -0
- package/dist/runtime/countermodel-min/index.js +9 -0
- package/dist/runtime/countermodel-min/index.js.map +1 -0
- package/dist/runtime/countermodel-min/minimize.d.ts +17 -0
- package/dist/runtime/countermodel-min/minimize.d.ts.map +1 -0
- package/dist/runtime/countermodel-min/minimize.js +0 -0
- package/dist/runtime/countermodel-min/minimize.js.map +1 -0
- package/dist/runtime/countermodel-min/types.d.ts +40 -0
- package/dist/runtime/countermodel-min/types.d.ts.map +1 -0
- package/dist/runtime/countermodel-min/types.js +6 -0
- package/dist/runtime/countermodel-min/types.js.map +1 -0
- package/dist/runtime/fca/context.d.ts +46 -0
- package/dist/runtime/fca/context.d.ts.map +1 -0
- package/dist/runtime/fca/context.js +155 -0
- package/dist/runtime/fca/context.js.map +1 -0
- package/dist/runtime/fca/implications.d.ts +10 -0
- package/dist/runtime/fca/implications.d.ts.map +1 -0
- package/dist/runtime/fca/implications.js +33 -0
- package/dist/runtime/fca/implications.js.map +1 -0
- package/dist/runtime/fca/index.d.ts +6 -0
- package/dist/runtime/fca/index.d.ts.map +1 -0
- package/dist/runtime/fca/index.js +39 -0
- package/dist/runtime/fca/index.js.map +1 -0
- package/dist/runtime/fca/lattice.d.ts +10 -0
- package/dist/runtime/fca/lattice.d.ts.map +1 -0
- package/dist/runtime/fca/lattice.js +86 -0
- package/dist/runtime/fca/lattice.js.map +1 -0
- package/dist/runtime/fca/next-closure.d.ts +12 -0
- package/dist/runtime/fca/next-closure.d.ts.map +1 -0
- package/dist/runtime/fca/next-closure.js +99 -0
- package/dist/runtime/fca/next-closure.js.map +1 -0
- package/dist/runtime/fca/types.d.ts +31 -0
- package/dist/runtime/fca/types.d.ts.map +1 -0
- package/dist/runtime/fca/types.js +30 -0
- package/dist/runtime/fca/types.js.map +1 -0
- package/dist/runtime/mus/extract.d.ts +34 -0
- package/dist/runtime/mus/extract.d.ts.map +1 -0
- package/dist/runtime/mus/extract.js +243 -0
- package/dist/runtime/mus/extract.js.map +1 -0
- package/dist/runtime/mus/index.d.ts +4 -0
- package/dist/runtime/mus/index.d.ts.map +1 -0
- package/dist/runtime/mus/index.js +12 -0
- package/dist/runtime/mus/index.js.map +1 -0
- package/dist/runtime/mus/quickxplain.d.ts +10 -0
- package/dist/runtime/mus/quickxplain.d.ts.map +1 -0
- package/dist/runtime/mus/quickxplain.js +100 -0
- package/dist/runtime/mus/quickxplain.js.map +1 -0
- package/dist/runtime/mus/types.d.ts +59 -0
- package/dist/runtime/mus/types.d.ts.map +1 -0
- package/dist/runtime/mus/types.js +20 -0
- package/dist/runtime/mus/types.js.map +1 -0
- package/dist/runtime/proof-minify/index.d.ts +3 -0
- package/dist/runtime/proof-minify/index.d.ts.map +1 -0
- package/dist/runtime/proof-minify/index.js +13 -0
- package/dist/runtime/proof-minify/index.js.map +1 -0
- package/dist/runtime/proof-minify/minify.d.ts +13 -0
- package/dist/runtime/proof-minify/minify.d.ts.map +1 -0
- package/dist/runtime/proof-minify/minify.js +540 -0
- package/dist/runtime/proof-minify/minify.js.map +1 -0
- package/dist/runtime/proof-minify/types.d.ts +89 -0
- package/dist/runtime/proof-minify/types.d.ts.map +1 -0
- package/dist/runtime/proof-minify/types.js +16 -0
- package/dist/runtime/proof-minify/types.js.map +1 -0
- package/dist/runtime/symbolic-diff/constructors.d.ts +16 -0
- package/dist/runtime/symbolic-diff/constructors.d.ts.map +1 -0
- package/dist/runtime/symbolic-diff/constructors.js +75 -0
- package/dist/runtime/symbolic-diff/constructors.js.map +1 -0
- package/dist/runtime/symbolic-diff/differentiate.d.ts +22 -0
- package/dist/runtime/symbolic-diff/differentiate.d.ts.map +1 -0
- package/dist/runtime/symbolic-diff/differentiate.js +107 -0
- package/dist/runtime/symbolic-diff/differentiate.js.map +1 -0
- package/dist/runtime/symbolic-diff/evaluate.d.ts +3 -0
- package/dist/runtime/symbolic-diff/evaluate.d.ts.map +1 -0
- package/dist/runtime/symbolic-diff/evaluate.js +47 -0
- package/dist/runtime/symbolic-diff/evaluate.js.map +1 -0
- package/dist/runtime/symbolic-diff/index.d.ts +9 -0
- package/dist/runtime/symbolic-diff/index.d.ts.map +1 -0
- package/dist/runtime/symbolic-diff/index.js +34 -0
- package/dist/runtime/symbolic-diff/index.js.map +1 -0
- package/dist/runtime/symbolic-diff/parse.d.ts +16 -0
- package/dist/runtime/symbolic-diff/parse.d.ts.map +1 -0
- package/dist/runtime/symbolic-diff/parse.js +206 -0
- package/dist/runtime/symbolic-diff/parse.js.map +1 -0
- package/dist/runtime/symbolic-diff/simplify.d.ts +11 -0
- package/dist/runtime/symbolic-diff/simplify.d.ts.map +1 -0
- package/dist/runtime/symbolic-diff/simplify.js +214 -0
- package/dist/runtime/symbolic-diff/simplify.js.map +1 -0
- package/dist/runtime/symbolic-diff/stringify.d.ts +3 -0
- package/dist/runtime/symbolic-diff/stringify.d.ts.map +1 -0
- package/dist/runtime/symbolic-diff/stringify.js +69 -0
- package/dist/runtime/symbolic-diff/stringify.js.map +1 -0
- package/dist/runtime/symbolic-diff/types.d.ts +35 -0
- package/dist/runtime/symbolic-diff/types.d.ts.map +1 -0
- package/dist/runtime/symbolic-diff/types.js +9 -0
- package/dist/runtime/symbolic-diff/types.js.map +1 -0
- package/dist/runtime/term-rewriting/critical-pairs.d.ts +38 -0
- package/dist/runtime/term-rewriting/critical-pairs.d.ts.map +1 -0
- package/dist/runtime/term-rewriting/critical-pairs.js +109 -0
- package/dist/runtime/term-rewriting/critical-pairs.js.map +1 -0
- package/dist/runtime/term-rewriting/index.d.ts +9 -0
- package/dist/runtime/term-rewriting/index.d.ts.map +1 -0
- package/dist/runtime/term-rewriting/index.js +38 -0
- package/dist/runtime/term-rewriting/index.js.map +1 -0
- package/dist/runtime/term-rewriting/knuth-bendix.d.ts +29 -0
- package/dist/runtime/term-rewriting/knuth-bendix.d.ts.map +1 -0
- package/dist/runtime/term-rewriting/knuth-bendix.js +196 -0
- package/dist/runtime/term-rewriting/knuth-bendix.js.map +1 -0
- package/dist/runtime/term-rewriting/lpo.d.ts +17 -0
- package/dist/runtime/term-rewriting/lpo.d.ts.map +1 -0
- package/dist/runtime/term-rewriting/lpo.js +158 -0
- package/dist/runtime/term-rewriting/lpo.js.map +1 -0
- package/dist/runtime/term-rewriting/rewrite.d.ts +44 -0
- package/dist/runtime/term-rewriting/rewrite.d.ts.map +1 -0
- package/dist/runtime/term-rewriting/rewrite.js +189 -0
- package/dist/runtime/term-rewriting/rewrite.js.map +1 -0
- package/dist/runtime/term-rewriting/term-utils.d.ts +64 -0
- package/dist/runtime/term-rewriting/term-utils.d.ts.map +1 -0
- package/dist/runtime/term-rewriting/term-utils.js +360 -0
- package/dist/runtime/term-rewriting/term-utils.js.map +1 -0
- package/dist/runtime/term-rewriting/types.d.ts +66 -0
- package/dist/runtime/term-rewriting/types.d.ts.map +1 -0
- package/dist/runtime/term-rewriting/types.js +21 -0
- package/dist/runtime/term-rewriting/types.js.map +1 -0
- package/dist/solver/cdcl-v2-incremental/index.d.ts +3 -0
- package/dist/solver/cdcl-v2-incremental/index.d.ts.map +1 -0
- package/dist/solver/cdcl-v2-incremental/index.js +16 -0
- package/dist/solver/cdcl-v2-incremental/index.js.map +1 -0
- package/dist/solver/cdcl-v2-incremental/solver.d.ts +83 -0
- package/dist/solver/cdcl-v2-incremental/solver.d.ts.map +1 -0
- package/dist/solver/cdcl-v2-incremental/solver.js +727 -0
- package/dist/solver/cdcl-v2-incremental/solver.js.map +1 -0
- package/dist/solver/cdcl-v2-incremental/types.d.ts +47 -0
- package/dist/solver/cdcl-v2-incremental/types.d.ts.map +1 -0
- package/dist/solver/cdcl-v2-incremental/types.js +13 -0
- package/dist/solver/cdcl-v2-incremental/types.js.map +1 -0
- package/dist/tests/abduction/abduction.test.d.ts +2 -0
- package/dist/tests/abduction/abduction.test.d.ts.map +1 -0
- package/dist/tests/abduction/abduction.test.js +380 -0
- package/dist/tests/abduction/abduction.test.js.map +1 -0
- package/dist/tests/bayesian/bayesian.test.d.ts +2 -0
- package/dist/tests/bayesian/bayesian.test.d.ts.map +1 -0
- package/dist/tests/bayesian/bayesian.test.js +328 -0
- package/dist/tests/bayesian/bayesian.test.js.map +1 -0
- package/dist/tests/belief-revision/agm.test.d.ts +2 -0
- package/dist/tests/belief-revision/agm.test.d.ts.map +1 -0
- package/dist/tests/belief-revision/agm.test.js +173 -0
- package/dist/tests/belief-revision/agm.test.js.map +1 -0
- package/dist/tests/bisimulation/paige-tarjan.test.d.ts +2 -0
- package/dist/tests/bisimulation/paige-tarjan.test.d.ts.map +1 -0
- package/dist/tests/bisimulation/paige-tarjan.test.js +254 -0
- package/dist/tests/bisimulation/paige-tarjan.test.js.map +1 -0
- package/dist/tests/countermodel-min/minimize.test.d.ts +2 -0
- package/dist/tests/countermodel-min/minimize.test.d.ts.map +1 -0
- package/dist/tests/countermodel-min/minimize.test.js +241 -0
- package/dist/tests/countermodel-min/minimize.test.js.map +1 -0
- package/dist/tests/ctl/check.test.d.ts +2 -0
- package/dist/tests/ctl/check.test.d.ts.map +1 -0
- package/dist/tests/ctl/check.test.js +337 -0
- package/dist/tests/ctl/check.test.js.map +1 -0
- package/dist/tests/curry-howard/infer.test.d.ts +2 -0
- package/dist/tests/curry-howard/infer.test.d.ts.map +1 -0
- package/dist/tests/curry-howard/infer.test.js +93 -0
- package/dist/tests/curry-howard/infer.test.js.map +1 -0
- package/dist/tests/curry-howard/proof.test.d.ts +2 -0
- package/dist/tests/curry-howard/proof.test.d.ts.map +1 -0
- package/dist/tests/curry-howard/proof.test.js +105 -0
- package/dist/tests/curry-howard/proof.test.js.map +1 -0
- package/dist/tests/curry-howard/reduce.test.d.ts +2 -0
- package/dist/tests/curry-howard/reduce.test.d.ts.map +1 -0
- package/dist/tests/curry-howard/reduce.test.js +109 -0
- package/dist/tests/curry-howard/reduce.test.js.map +1 -0
- package/dist/tests/default-logic/extensions.test.d.ts +2 -0
- package/dist/tests/default-logic/extensions.test.d.ts.map +1 -0
- package/dist/tests/default-logic/extensions.test.js +323 -0
- package/dist/tests/default-logic/extensions.test.js.map +1 -0
- package/dist/tests/description-logic/alc.test.d.ts +2 -0
- package/dist/tests/description-logic/alc.test.d.ts.map +1 -0
- package/dist/tests/description-logic/alc.test.js +253 -0
- package/dist/tests/description-logic/alc.test.js.map +1 -0
- package/dist/tests/fca/fca.test.d.ts +2 -0
- package/dist/tests/fca/fca.test.d.ts.map +1 -0
- package/dist/tests/fca/fca.test.js +317 -0
- package/dist/tests/fca/fca.test.js.map +1 -0
- package/dist/tests/fol-prover-equality/prove.test.d.ts +2 -0
- package/dist/tests/fol-prover-equality/prove.test.d.ts.map +1 -0
- package/dist/tests/fol-prover-equality/prove.test.js +179 -0
- package/dist/tests/fol-prover-equality/prove.test.js.map +1 -0
- package/dist/tests/hybrid-logic/semantics.test.d.ts +2 -0
- package/dist/tests/hybrid-logic/semantics.test.d.ts.map +1 -0
- package/dist/tests/hybrid-logic/semantics.test.js +169 -0
- package/dist/tests/hybrid-logic/semantics.test.js.map +1 -0
- package/dist/tests/intuitionistic-nj/nj.test.d.ts +2 -0
- package/dist/tests/intuitionistic-nj/nj.test.d.ts.map +1 -0
- package/dist/tests/intuitionistic-nj/nj.test.js +216 -0
- package/dist/tests/intuitionistic-nj/nj.test.js.map +1 -0
- package/dist/tests/lambda-calc/lambda-calc.test.d.ts +2 -0
- package/dist/tests/lambda-calc/lambda-calc.test.d.ts.map +1 -0
- package/dist/tests/lambda-calc/lambda-calc.test.js +164 -0
- package/dist/tests/lambda-calc/lambda-calc.test.js.map +1 -0
- package/dist/tests/ltl-sat/sat.test.d.ts +2 -0
- package/dist/tests/ltl-sat/sat.test.d.ts.map +1 -0
- package/dist/tests/ltl-sat/sat.test.js +160 -0
- package/dist/tests/ltl-sat/sat.test.js.map +1 -0
- package/dist/tests/many-valued/many-valued.test.d.ts +2 -0
- package/dist/tests/many-valued/many-valued.test.d.ts.map +1 -0
- package/dist/tests/many-valued/many-valued.test.js +150 -0
- package/dist/tests/many-valued/many-valued.test.js.map +1 -0
- package/dist/tests/modal-frame-axioms/frame-axioms.test.d.ts +2 -0
- package/dist/tests/modal-frame-axioms/frame-axioms.test.d.ts.map +1 -0
- package/dist/tests/modal-frame-axioms/frame-axioms.test.js +236 -0
- package/dist/tests/modal-frame-axioms/frame-axioms.test.js.map +1 -0
- package/dist/tests/mus/extract.test.d.ts +2 -0
- package/dist/tests/mus/extract.test.d.ts.map +1 -0
- package/dist/tests/mus/extract.test.js +352 -0
- package/dist/tests/mus/extract.test.js.map +1 -0
- package/dist/tests/proof-minify/minify.test.d.ts +2 -0
- package/dist/tests/proof-minify/minify.test.d.ts.map +1 -0
- package/dist/tests/proof-minify/minify.test.js +281 -0
- package/dist/tests/proof-minify/minify.test.js.map +1 -0
- package/dist/tests/sat-v2-incremental/basic.test.d.ts +2 -0
- package/dist/tests/sat-v2-incremental/basic.test.d.ts.map +1 -0
- package/dist/tests/sat-v2-incremental/basic.test.js +352 -0
- package/dist/tests/sat-v2-incremental/basic.test.js.map +1 -0
- package/dist/tests/sequent-g3/prover.test.d.ts +2 -0
- package/dist/tests/sequent-g3/prover.test.d.ts.map +1 -0
- package/dist/tests/sequent-g3/prover.test.js +205 -0
- package/dist/tests/sequent-g3/prover.test.js.map +1 -0
- package/dist/tests/substructural/prover.test.d.ts +2 -0
- package/dist/tests/substructural/prover.test.d.ts.map +1 -0
- package/dist/tests/substructural/prover.test.js +271 -0
- package/dist/tests/substructural/prover.test.js.map +1 -0
- package/dist/tests/symbolic-diff/symbolic-diff.test.d.ts +2 -0
- package/dist/tests/symbolic-diff/symbolic-diff.test.d.ts.map +1 -0
- package/dist/tests/symbolic-diff/symbolic-diff.test.js +278 -0
- package/dist/tests/symbolic-diff/symbolic-diff.test.js.map +1 -0
- package/dist/tests/term-rewriting/critical-pairs.test.d.ts +2 -0
- package/dist/tests/term-rewriting/critical-pairs.test.d.ts.map +1 -0
- package/dist/tests/term-rewriting/critical-pairs.test.js +34 -0
- package/dist/tests/term-rewriting/critical-pairs.test.js.map +1 -0
- package/dist/tests/term-rewriting/knuth-bendix.test.d.ts +2 -0
- package/dist/tests/term-rewriting/knuth-bendix.test.d.ts.map +1 -0
- package/dist/tests/term-rewriting/knuth-bendix.test.js +94 -0
- package/dist/tests/term-rewriting/knuth-bendix.test.js.map +1 -0
- package/dist/tests/term-rewriting/lpo.test.d.ts +2 -0
- package/dist/tests/term-rewriting/lpo.test.d.ts.map +1 -0
- package/dist/tests/term-rewriting/lpo.test.js +57 -0
- package/dist/tests/term-rewriting/lpo.test.js.map +1 -0
- package/dist/tests/term-rewriting/rewrite.test.d.ts +2 -0
- package/dist/tests/term-rewriting/rewrite.test.d.ts.map +1 -0
- package/dist/tests/term-rewriting/rewrite.test.js +56 -0
- package/dist/tests/term-rewriting/rewrite.test.js.map +1 -0
- package/dist/tests/term-rewriting/term-utils.test.d.ts +2 -0
- package/dist/tests/term-rewriting/term-utils.test.d.ts.map +1 -0
- package/dist/tests/term-rewriting/term-utils.test.js +58 -0
- package/dist/tests/term-rewriting/term-utils.test.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.cloneClause = exports.termsEqual = exports.termKey = exports.isEqualityLiteral = void 0;
|
|
4
|
+
exports.paramodulate = paramodulate;
|
|
5
|
+
exports.paramodulateWithSubst = paramodulateWithSubst;
|
|
6
|
+
exports.paramodulateAll = paramodulateAll;
|
|
7
|
+
exports.reflexivityResolve = reflexivityResolve;
|
|
8
|
+
const unify_1 = require("../fol-prover/unify");
|
|
9
|
+
const term_utils_1 = require("./term-utils");
|
|
10
|
+
Object.defineProperty(exports, "cloneClause", { enumerable: true, get: function () { return term_utils_1.cloneClause; } });
|
|
11
|
+
Object.defineProperty(exports, "isEqualityLiteral", { enumerable: true, get: function () { return term_utils_1.isEqualityLiteral; } });
|
|
12
|
+
Object.defineProperty(exports, "termKey", { enumerable: true, get: function () { return term_utils_1.termKey; } });
|
|
13
|
+
Object.defineProperty(exports, "termsEqual", { enumerable: true, get: function () { return term_utils_1.termsEqual; } });
|
|
14
|
+
/**
|
|
15
|
+
* Paramodulation:
|
|
16
|
+
*
|
|
17
|
+
* from C ∨ (s = t) (eqClause, eq_idx points to the s=t literal)
|
|
18
|
+
* and D[u] (target clause, target_idx points to literal containing u,
|
|
19
|
+
* target_pos points inside that literal's args)
|
|
20
|
+
* if unify(s, u) = σ then (C ∨ D[u → t])·σ
|
|
21
|
+
*
|
|
22
|
+
* The direction is fixed: args[0] = s (lhs), args[1] = t (rhs). To paramodulate
|
|
23
|
+
* "in the other direction" callers should retry with the equation flipped (see
|
|
24
|
+
* `paramodulateAll` for the symmetric enumeration).
|
|
25
|
+
*
|
|
26
|
+
* Returns null when the literals can't paramodulate (wrong kind, unification fails, etc.).
|
|
27
|
+
*/
|
|
28
|
+
function paramodulate(c1Raw, eq_idx, c2Raw, target_idx, target_pos) {
|
|
29
|
+
const out = paramodulateWithSubst(c1Raw, eq_idx, c2Raw, target_idx, target_pos);
|
|
30
|
+
return out ? out.resolvent : null;
|
|
31
|
+
}
|
|
32
|
+
function paramodulateWithSubst(c1Raw, eq_idx, c2Raw, target_idx, target_pos) {
|
|
33
|
+
// Standardize variables apart between the two parents.
|
|
34
|
+
const c1 = (0, term_utils_1.freshenClause)(c1Raw);
|
|
35
|
+
const c2 = (0, term_utils_1.freshenClause)(c2Raw);
|
|
36
|
+
const eqLit = c1[eq_idx];
|
|
37
|
+
if (eqLit === undefined)
|
|
38
|
+
return null;
|
|
39
|
+
if (!(0, term_utils_1.isEqualityLiteral)(eqLit))
|
|
40
|
+
return null;
|
|
41
|
+
if (eqLit.negated)
|
|
42
|
+
return null;
|
|
43
|
+
const s = eqLit.args[0];
|
|
44
|
+
const t = eqLit.args[1];
|
|
45
|
+
if (s === undefined || t === undefined)
|
|
46
|
+
return null;
|
|
47
|
+
const target = c2[target_idx];
|
|
48
|
+
if (target === undefined)
|
|
49
|
+
return null;
|
|
50
|
+
const u = (0, term_utils_1.getLiteralSubterm)(target, target_pos);
|
|
51
|
+
if (u === null)
|
|
52
|
+
return null;
|
|
53
|
+
// Don't try to paramodulate into a bare variable subterm — that produces
|
|
54
|
+
// an explosion of useless rewrites equivalent to factoring.
|
|
55
|
+
if (u.kind === 'var')
|
|
56
|
+
return null;
|
|
57
|
+
const sigma = new Map();
|
|
58
|
+
const unified = (0, unify_1.unify)(s, u, sigma);
|
|
59
|
+
if (unified === null)
|
|
60
|
+
return null;
|
|
61
|
+
// Build C·σ (rest of clause 1 minus the equation literal)
|
|
62
|
+
const rest1 = c1.filter((_, k) => k !== eq_idx).map((lit) => (0, unify_1.applyLiteral)(lit, sigma));
|
|
63
|
+
// Build the rewritten target: replace u with t at target_pos, then apply σ.
|
|
64
|
+
const rewritten = (0, term_utils_1.replaceLiteralSubterm)(target, target_pos, (0, unify_1.applyTerm)(t, sigma));
|
|
65
|
+
const rewrittenSigma = (0, unify_1.applyLiteral)(rewritten, sigma);
|
|
66
|
+
const rest2 = c2.filter((_, k) => k !== target_idx).map((lit) => (0, unify_1.applyLiteral)(lit, sigma));
|
|
67
|
+
const merged = factor([...rest1, rewrittenSigma, ...rest2]);
|
|
68
|
+
return { resolvent: merged, substitution: sigma };
|
|
69
|
+
}
|
|
70
|
+
function paramodulateAll(idxA, cA, idxB, cB) {
|
|
71
|
+
const out = [];
|
|
72
|
+
collectParamods(idxA, cA, idxB, cB, false, out);
|
|
73
|
+
if (idxA !== idxB)
|
|
74
|
+
collectParamods(idxB, cB, idxA, cA, false, out);
|
|
75
|
+
return out;
|
|
76
|
+
}
|
|
77
|
+
function collectParamods(idxEq, cEq, idxTgt, cTgt, _unusedFlip, out) {
|
|
78
|
+
for (let i = 0; i < cEq.length; i++) {
|
|
79
|
+
const lit = cEq[i];
|
|
80
|
+
if (lit === undefined)
|
|
81
|
+
continue;
|
|
82
|
+
if (!(0, term_utils_1.isEqualityLiteral)(lit) || lit.negated)
|
|
83
|
+
continue;
|
|
84
|
+
const lhs = lit.args[0];
|
|
85
|
+
const rhs = lit.args[1];
|
|
86
|
+
if (lhs === undefined || rhs === undefined)
|
|
87
|
+
continue;
|
|
88
|
+
for (const flip of [false, true]) {
|
|
89
|
+
// Build a virtual clause where, when flip=true, the equation is t = s instead of s = t.
|
|
90
|
+
const directedEq = flip
|
|
91
|
+
? cEq.map((l, k) => k === i
|
|
92
|
+
? {
|
|
93
|
+
negated: l.negated,
|
|
94
|
+
predicate: l.predicate,
|
|
95
|
+
args: [(0, term_utils_1.cloneTerm)(rhs), (0, term_utils_1.cloneTerm)(lhs)],
|
|
96
|
+
}
|
|
97
|
+
: l)
|
|
98
|
+
: cEq;
|
|
99
|
+
for (let j = 0; j < cTgt.length; j++) {
|
|
100
|
+
const tgtLit = cTgt[j];
|
|
101
|
+
if (tgtLit === undefined)
|
|
102
|
+
continue;
|
|
103
|
+
for (const pos of (0, term_utils_1.allLiteralPositions)(tgtLit)) {
|
|
104
|
+
const result = paramodulateWithSubst(directedEq, i, cTgt, j, pos);
|
|
105
|
+
if (result === null)
|
|
106
|
+
continue;
|
|
107
|
+
out.push({
|
|
108
|
+
fromEqClause: idxEq,
|
|
109
|
+
fromTargetClause: idxTgt,
|
|
110
|
+
eqIdx: i,
|
|
111
|
+
targetIdx: j,
|
|
112
|
+
targetPos: pos,
|
|
113
|
+
flipped: flip,
|
|
114
|
+
resolvent: result.resolvent,
|
|
115
|
+
substitution: result.substitution,
|
|
116
|
+
});
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
function factor(c) {
|
|
123
|
+
const seen = new Set();
|
|
124
|
+
const out = [];
|
|
125
|
+
for (const lit of c) {
|
|
126
|
+
const k = (0, term_utils_1.literalKey)(lit);
|
|
127
|
+
if (seen.has(k))
|
|
128
|
+
continue;
|
|
129
|
+
seen.add(k);
|
|
130
|
+
out.push(lit);
|
|
131
|
+
}
|
|
132
|
+
return out;
|
|
133
|
+
}
|
|
134
|
+
/**
|
|
135
|
+
* Reflexivity resolution: drop a literal of the form ¬(t = t) from a clause.
|
|
136
|
+
* Useful both during search and for proving reflexive goals.
|
|
137
|
+
*/
|
|
138
|
+
function reflexivityResolve(c) {
|
|
139
|
+
for (let i = 0; i < c.length; i++) {
|
|
140
|
+
const lit = c[i];
|
|
141
|
+
if (lit === undefined)
|
|
142
|
+
continue;
|
|
143
|
+
if (!(0, term_utils_1.isEqualityLiteral)(lit))
|
|
144
|
+
continue;
|
|
145
|
+
if (!lit.negated)
|
|
146
|
+
continue;
|
|
147
|
+
const a = lit.args[0];
|
|
148
|
+
const b = lit.args[1];
|
|
149
|
+
if (a === undefined || b === undefined)
|
|
150
|
+
continue;
|
|
151
|
+
const sigma = new Map();
|
|
152
|
+
const u = (0, unify_1.unify)(a, b, sigma);
|
|
153
|
+
if (u === null)
|
|
154
|
+
continue;
|
|
155
|
+
return (0, unify_1.applyClause)(c.filter((_, k) => k !== i), sigma);
|
|
156
|
+
}
|
|
157
|
+
return null;
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=paramodulate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paramodulate.js","sourceRoot":"","sources":["../../src/fol-prover-equality/paramodulate.ts"],"names":[],"mappings":";;;AAkCA,oCASC;AAED,sDA6CC;AAkBD,0CAUC;AAsED,gDAkBC;AA7MD,+CAAkF;AAClF,6CAWsB;AAoM2B,4FA7M/C,wBAAW,OA6M+C;AAAnD,kGA1MP,8BAAiB,OA0MO;AAAE,wFAtM1B,oBAAO,OAsM0B;AAAE,2FArMnC,uBAAU,OAqMmC;AA7L/C;;;;;;;;;;;;;GAaG;AACH,SAAgB,YAAY,CAC1B,KAAgB,EAChB,MAAc,EACd,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C,CAAY;IAC7C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;QAClC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;QACjB,IAAI,GAAG,KAAK,SAAS;YAAE,SAAS;QAChC,IAAI,CAAC,IAAA,8BAAiB,EAAC,GAAG,CAAC;YAAE,SAAS;QACtC,IAAI,CAAC,GAAG,CAAC,OAAO;YAAE,SAAS;QAC3B,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,MAAM,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACtB,IAAI,CAAC,KAAK,SAAS,IAAI,CAAC,KAAK,SAAS;YAAE,SAAS;QACjD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAmB,CAAC;QACzC,MAAM,CAAC,GAAG,IAAA,aAAK,EAAC,CAAC,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;QAC7B,IAAI,CAAC,KAAK,IAAI;YAAE,SAAS;QACzB,OAAO,IAAA,mBAAW,EAChB,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,EAC3B,KAAK,CACN,CAAC;IACJ,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Formula } from '../types';
|
|
2
|
+
import type { FOLClause } from '../fol-prover/types';
|
|
3
|
+
import type { EqualityProveOptions, EqualityProveResult } from './types';
|
|
4
|
+
declare function rewriteEqualityClause(c: FOLClause): FOLClause;
|
|
5
|
+
export declare function proveWithEquality(premises: Formula[], goal: Formula, opts?: EqualityProveOptions): EqualityProveResult;
|
|
6
|
+
export { rewriteEqualityClause };
|
|
7
|
+
//# sourceMappingURL=prove.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prove.d.ts","sourceRoot":"","sources":["../../src/fol-prover-equality/prove.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AACxC,OAAO,KAAK,EAAE,SAAS,EAAuB,MAAM,qBAAqB,CAAC;AAO1E,OAAO,KAAK,EAAE,oBAAoB,EAAE,mBAAmB,EAAqB,MAAM,SAAS,CAAC;AAgC5F,iBAAS,qBAAqB,CAAC,CAAC,EAAE,SAAS,GAAG,SAAS,CAEtD;AA4FD,wBAAgB,iBAAiB,CAC/B,QAAQ,EAAE,OAAO,EAAE,EACnB,IAAI,EAAE,OAAO,EACb,IAAI,GAAE,oBAAyB,GAC9B,mBAAmB,CA6KrB;AAGD,OAAO,EAAE,qBAAqB,EAAE,CAAC"}
|
|
@@ -0,0 +1,307 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.proveWithEquality = proveWithEquality;
|
|
4
|
+
exports.rewriteEqualityClause = rewriteEqualityClause;
|
|
5
|
+
const cnf_1 = require("../fol-prover/cnf");
|
|
6
|
+
const resolve_1 = require("../fol-prover/resolve");
|
|
7
|
+
const unify_1 = require("../fol-prover/unify");
|
|
8
|
+
const paramodulate_1 = require("./paramodulate");
|
|
9
|
+
const demodulate_1 = require("./demodulate");
|
|
10
|
+
const term_utils_1 = require("./term-utils");
|
|
11
|
+
const types_1 = require("./types");
|
|
12
|
+
const DEFAULT_TIMEOUT_MS = 3000;
|
|
13
|
+
const DEFAULT_MAX_STEPS = 5000;
|
|
14
|
+
/**
|
|
15
|
+
* Translate the FOL Formula's `equals` kind to our internal equality predicate.
|
|
16
|
+
* Currently the project's CNF pipeline does not natively know about `equals`; it
|
|
17
|
+
* would turn an `equals(t1, t2)` formula into a predicate literal with two
|
|
18
|
+
* parameters by name. To bring it into the equality prover we walk the Formula
|
|
19
|
+
* tree and rewrite any `equals` node into a `predicate` with the special name
|
|
20
|
+
* `__eq__` whose params are the term strings — but since the existing CNF only
|
|
21
|
+
* supports name-based terms, we explicitly construct the FOLClause for the goal
|
|
22
|
+
* and premises that contain equality.
|
|
23
|
+
*
|
|
24
|
+
* Strategy: parse premises and goal via the usual `toCNF`. After CNF, walk every
|
|
25
|
+
* literal and rewrite predicates that look like equalities into the canonical
|
|
26
|
+
* `__eq__(arg0, arg1)` form. The user-facing convention is: any literal of the
|
|
27
|
+
* form `equals(a, b)` (either as a predicate named "equals", "=", or "eq") is
|
|
28
|
+
* treated as an equality.
|
|
29
|
+
*/
|
|
30
|
+
const EQUALITY_ALIASES = new Set(['equals', '=', 'eq', '==']);
|
|
31
|
+
function rewriteEqualityLiteral(lit) {
|
|
32
|
+
if (EQUALITY_ALIASES.has(lit.predicate) && lit.args.length === 2) {
|
|
33
|
+
return { negated: lit.negated, predicate: types_1.EQ_PREDICATE, args: lit.args };
|
|
34
|
+
}
|
|
35
|
+
return lit;
|
|
36
|
+
}
|
|
37
|
+
function rewriteEqualityClause(c) {
|
|
38
|
+
return c.map(rewriteEqualityLiteral);
|
|
39
|
+
}
|
|
40
|
+
function preprocessFormula(f) {
|
|
41
|
+
if (f.kind === 'equals') {
|
|
42
|
+
const params = (f.params ?? f.terms ?? []).slice();
|
|
43
|
+
const newF = { kind: 'predicate', name: '=', params, terms: params };
|
|
44
|
+
if (f.args !== undefined)
|
|
45
|
+
newF.args = f.args.map(preprocessFormula);
|
|
46
|
+
return newF;
|
|
47
|
+
}
|
|
48
|
+
if (f.args === undefined)
|
|
49
|
+
return f;
|
|
50
|
+
return { ...f, args: f.args.map(preprocessFormula) };
|
|
51
|
+
}
|
|
52
|
+
function reflexivityClauses() {
|
|
53
|
+
// The axiom ∀x. x = x → CNF clause __eq__(x, x)
|
|
54
|
+
return [
|
|
55
|
+
[
|
|
56
|
+
{
|
|
57
|
+
negated: false,
|
|
58
|
+
predicate: types_1.EQ_PREDICATE,
|
|
59
|
+
args: [
|
|
60
|
+
{ kind: 'var', name: '__refl_x' },
|
|
61
|
+
{ kind: 'var', name: '__refl_x' },
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
function isTautology(c) {
|
|
68
|
+
// Standard tautology: P and ¬P with identical args.
|
|
69
|
+
for (let i = 0; i < c.length; i++) {
|
|
70
|
+
for (let j = i + 1; j < c.length; j++) {
|
|
71
|
+
const li = c[i];
|
|
72
|
+
const lj = c[j];
|
|
73
|
+
if (li === undefined || lj === undefined)
|
|
74
|
+
continue;
|
|
75
|
+
if (li.negated === lj.negated)
|
|
76
|
+
continue;
|
|
77
|
+
if (li.predicate !== lj.predicate)
|
|
78
|
+
continue;
|
|
79
|
+
if (li.args.length !== lj.args.length)
|
|
80
|
+
continue;
|
|
81
|
+
let same = true;
|
|
82
|
+
for (let k = 0; k < li.args.length; k++) {
|
|
83
|
+
const a = li.args[k];
|
|
84
|
+
const b = lj.args[k];
|
|
85
|
+
if (a === undefined || b === undefined) {
|
|
86
|
+
same = false;
|
|
87
|
+
break;
|
|
88
|
+
}
|
|
89
|
+
if (!(0, term_utils_1.termsEqual)(a, b)) {
|
|
90
|
+
same = false;
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
if (same)
|
|
95
|
+
return true;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
// Reflexive tautology: positive __eq__(t, t).
|
|
99
|
+
for (const lit of c) {
|
|
100
|
+
if (!(0, term_utils_1.isEqualityLiteral)(lit) || lit.negated)
|
|
101
|
+
continue;
|
|
102
|
+
const a = lit.args[0];
|
|
103
|
+
const b = lit.args[1];
|
|
104
|
+
if (a === undefined || b === undefined)
|
|
105
|
+
continue;
|
|
106
|
+
if ((0, term_utils_1.termsEqual)(a, b))
|
|
107
|
+
return true;
|
|
108
|
+
}
|
|
109
|
+
return false;
|
|
110
|
+
}
|
|
111
|
+
function reflexivityResolveStep(c) {
|
|
112
|
+
for (let i = 0; i < c.length; i++) {
|
|
113
|
+
const lit = c[i];
|
|
114
|
+
if (lit === undefined)
|
|
115
|
+
continue;
|
|
116
|
+
if (!(0, term_utils_1.isEqualityLiteral)(lit))
|
|
117
|
+
continue;
|
|
118
|
+
if (!lit.negated)
|
|
119
|
+
continue;
|
|
120
|
+
const a = lit.args[0];
|
|
121
|
+
const b = lit.args[1];
|
|
122
|
+
if (a === undefined || b === undefined)
|
|
123
|
+
continue;
|
|
124
|
+
const sigma = new Map();
|
|
125
|
+
const u = (0, unify_1.unify)(a, b, sigma);
|
|
126
|
+
if (u === null)
|
|
127
|
+
continue;
|
|
128
|
+
const rest = c
|
|
129
|
+
.filter((_, k) => k !== i)
|
|
130
|
+
.map((l) => ({
|
|
131
|
+
negated: l.negated,
|
|
132
|
+
predicate: l.predicate,
|
|
133
|
+
args: l.args.map((t) => (0, unify_1.applyTerm)(t, sigma)),
|
|
134
|
+
}));
|
|
135
|
+
return { clause: rest, sigma };
|
|
136
|
+
}
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
function proveWithEquality(premises, goal, opts = {}) {
|
|
140
|
+
const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
|
|
141
|
+
const maxSteps = opts.maxSteps ?? DEFAULT_MAX_STEPS;
|
|
142
|
+
// Rewrite `equals` nodes so CNF treats them as binary predicates we can recognise.
|
|
143
|
+
const preProcessedPremises = premises.map(preprocessFormula);
|
|
144
|
+
const preGoal = preprocessFormula(goal);
|
|
145
|
+
const rawPremiseClauses = preProcessedPremises.flatMap((p) => (0, cnf_1.toCNF)(p));
|
|
146
|
+
const negatedGoal = { kind: 'not', args: [preGoal] };
|
|
147
|
+
const rawNegGoalClauses = (0, cnf_1.toCNF)(negatedGoal);
|
|
148
|
+
const premiseClauses = rawPremiseClauses.map(rewriteEqualityClause);
|
|
149
|
+
const negGoalClauses = rawNegGoalClauses.map(rewriteEqualityClause);
|
|
150
|
+
if (premiseClauses.some((c) => c.length === 0) || negGoalClauses.some((c) => c.length === 0)) {
|
|
151
|
+
return { proven: true, steps: [] };
|
|
152
|
+
}
|
|
153
|
+
const all = [];
|
|
154
|
+
const seen = new Set();
|
|
155
|
+
const addClause = (c) => {
|
|
156
|
+
if (isTautology(c))
|
|
157
|
+
return { idx: -1, novel: false };
|
|
158
|
+
const key = (0, term_utils_1.clauseKey)(c);
|
|
159
|
+
const existingIdx = all.findIndex((existing) => (0, term_utils_1.clauseKey)(existing) === key);
|
|
160
|
+
if (existingIdx >= 0)
|
|
161
|
+
return { idx: existingIdx, novel: false };
|
|
162
|
+
seen.add(key);
|
|
163
|
+
all.push(c);
|
|
164
|
+
return { idx: all.length - 1, novel: true };
|
|
165
|
+
};
|
|
166
|
+
// Seed: reflexivity axiom (used by paramodulation when a clause demands x = x).
|
|
167
|
+
for (const c of reflexivityClauses())
|
|
168
|
+
addClause(c);
|
|
169
|
+
for (const c of premiseClauses)
|
|
170
|
+
addClause(c);
|
|
171
|
+
for (const c of negGoalClauses)
|
|
172
|
+
addClause(c);
|
|
173
|
+
const steps = [];
|
|
174
|
+
const startedAt = Date.now();
|
|
175
|
+
const finishSuccess = () => ({ proven: true, steps });
|
|
176
|
+
// Saturation loop: classic given-clause-ish. For each new clause, try resolution
|
|
177
|
+
// and paramodulation with every older clause; apply reflexivity resolution and
|
|
178
|
+
// equality factoring inline.
|
|
179
|
+
let cursor = 0;
|
|
180
|
+
while (cursor < all.length) {
|
|
181
|
+
if (Date.now() - startedAt > timeoutMs) {
|
|
182
|
+
return { proven: false, steps, timeoutHit: true };
|
|
183
|
+
}
|
|
184
|
+
if (steps.length >= maxSteps) {
|
|
185
|
+
return { proven: false, steps, reason: 'max-steps' };
|
|
186
|
+
}
|
|
187
|
+
const ci = all[cursor];
|
|
188
|
+
if (ci === undefined) {
|
|
189
|
+
cursor++;
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
// Reflexivity resolution on the current clause itself.
|
|
193
|
+
{
|
|
194
|
+
const r = reflexivityResolveStep(ci);
|
|
195
|
+
if (r !== null) {
|
|
196
|
+
if (r.clause.length === 0) {
|
|
197
|
+
steps.push({
|
|
198
|
+
rule: 'reflex',
|
|
199
|
+
from: [cursor],
|
|
200
|
+
result: r.clause,
|
|
201
|
+
substitution: (0, term_utils_1.substToRecordTerm)(r.sigma),
|
|
202
|
+
});
|
|
203
|
+
return finishSuccess();
|
|
204
|
+
}
|
|
205
|
+
const { idx, novel } = addClause(r.clause);
|
|
206
|
+
if (novel && idx >= 0) {
|
|
207
|
+
steps.push({
|
|
208
|
+
rule: 'reflex',
|
|
209
|
+
from: [cursor],
|
|
210
|
+
result: r.clause,
|
|
211
|
+
substitution: (0, term_utils_1.substToRecordTerm)(r.sigma),
|
|
212
|
+
});
|
|
213
|
+
}
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
// Equality factoring on the current clause.
|
|
217
|
+
for (const factored of (0, demodulate_1.equalityFactor)(ci)) {
|
|
218
|
+
const { idx, novel } = addClause(factored);
|
|
219
|
+
if (novel && idx >= 0) {
|
|
220
|
+
steps.push({
|
|
221
|
+
rule: 'factor',
|
|
222
|
+
from: [cursor],
|
|
223
|
+
result: factored,
|
|
224
|
+
substitution: {},
|
|
225
|
+
});
|
|
226
|
+
if (factored.length === 0)
|
|
227
|
+
return finishSuccess();
|
|
228
|
+
}
|
|
229
|
+
if (steps.length >= maxSteps)
|
|
230
|
+
return { proven: false, steps, reason: 'max-steps' };
|
|
231
|
+
}
|
|
232
|
+
for (let j = 0; j <= cursor; j++) {
|
|
233
|
+
if (Date.now() - startedAt > timeoutMs) {
|
|
234
|
+
return { proven: false, steps, timeoutHit: true };
|
|
235
|
+
}
|
|
236
|
+
const cj = all[j];
|
|
237
|
+
if (cj === undefined)
|
|
238
|
+
continue;
|
|
239
|
+
// --- Binary resolution
|
|
240
|
+
const resolvents = (0, resolve_1.resolveWithRecord)({ c1Idx: cursor, c2Idx: j, c1: ci, c2: cj });
|
|
241
|
+
for (const r of resolvents) {
|
|
242
|
+
if (r.resolvent.length === 0) {
|
|
243
|
+
steps.push({
|
|
244
|
+
rule: 'resolve',
|
|
245
|
+
from: [cursor, j],
|
|
246
|
+
result: r.resolvent,
|
|
247
|
+
substitution: {},
|
|
248
|
+
});
|
|
249
|
+
return finishSuccess();
|
|
250
|
+
}
|
|
251
|
+
const { idx, novel } = addClause(r.resolvent);
|
|
252
|
+
if (novel && idx >= 0) {
|
|
253
|
+
steps.push({
|
|
254
|
+
rule: 'resolve',
|
|
255
|
+
from: [cursor, j],
|
|
256
|
+
result: r.resolvent,
|
|
257
|
+
substitution: {},
|
|
258
|
+
});
|
|
259
|
+
if (steps.length >= maxSteps)
|
|
260
|
+
return { proven: false, steps, reason: 'max-steps' };
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
// --- Paramodulation in both directions
|
|
264
|
+
const paramods = (0, paramodulate_1.paramodulateAll)(cursor, ci, j, cj);
|
|
265
|
+
for (const p of paramods) {
|
|
266
|
+
if (p.resolvent.length === 0) {
|
|
267
|
+
steps.push({
|
|
268
|
+
rule: 'paramod',
|
|
269
|
+
from: [p.fromEqClause, p.fromTargetClause],
|
|
270
|
+
result: p.resolvent,
|
|
271
|
+
substitution: (0, term_utils_1.substToRecordTerm)(p.substitution),
|
|
272
|
+
});
|
|
273
|
+
return finishSuccess();
|
|
274
|
+
}
|
|
275
|
+
// Apply reflexivity resolution to the paramodulant before adding; this
|
|
276
|
+
// catches the common pattern where paramod produces e.g. ¬(a = a) ∨ ...
|
|
277
|
+
let toAdd = p.resolvent;
|
|
278
|
+
const reflexed = reflexivityResolveStep(toAdd);
|
|
279
|
+
if (reflexed !== null)
|
|
280
|
+
toAdd = reflexed.clause;
|
|
281
|
+
if (toAdd.length === 0) {
|
|
282
|
+
steps.push({
|
|
283
|
+
rule: 'paramod',
|
|
284
|
+
from: [p.fromEqClause, p.fromTargetClause],
|
|
285
|
+
result: toAdd,
|
|
286
|
+
substitution: (0, term_utils_1.substToRecordTerm)(p.substitution),
|
|
287
|
+
});
|
|
288
|
+
return finishSuccess();
|
|
289
|
+
}
|
|
290
|
+
const { idx, novel } = addClause(toAdd);
|
|
291
|
+
if (novel && idx >= 0) {
|
|
292
|
+
steps.push({
|
|
293
|
+
rule: 'paramod',
|
|
294
|
+
from: [p.fromEqClause, p.fromTargetClause],
|
|
295
|
+
result: toAdd,
|
|
296
|
+
substitution: (0, term_utils_1.substToRecordTerm)(p.substitution),
|
|
297
|
+
});
|
|
298
|
+
if (steps.length >= maxSteps)
|
|
299
|
+
return { proven: false, steps, reason: 'max-steps' };
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
cursor++;
|
|
304
|
+
}
|
|
305
|
+
return { proven: false, steps, reason: 'saturated' };
|
|
306
|
+
}
|
|
307
|
+
//# sourceMappingURL=prove.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prove.js","sourceRoot":"","sources":["../../src/fol-prover-equality/prove.ts"],"names":[],"mappings":";;AAsIA,8CAiLC;AAGQ,sDAAqB;AAxT9B,2CAA0C;AAC1C,mDAA0D;AAC1D,+CAAuD;AACvD,iDAAiD;AACjD,6CAA8C;AAC9C,6CAA2F;AAE3F,mCAAuC;AAEvC,MAAM,kBAAkB,GAAG,IAAI,CAAC;AAChC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AAE/B;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,gBAAgB,GAAG,IAAI,GAAG,CAAC,CAAC,QAAQ,EAAE,GAAG,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC,CAAC;AAE9D,SAAS,sBAAsB,CAAC,GAAe;IAC7C,IAAI,gBAAgB,CAAC,GAAG,CAAC,GAAG,CAAC,SAAS,CAAC,IAAI,GAAG,CAAC,IAAI,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACjE,OAAO,EAAE,OAAO,EAAE,GAAG,CAAC,OAAO,EAAE,SAAS,EAAE,oBAAY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CAAC,CAAC,CAAC,YAAY,EAAE,CAAC,CAAC,gBAAgB,CAAC;wBAC1C,MAAM,EAAE,KAAK;wBACb,YAAY,EAAE,IAAA,8BAAiB,EAAC,CAAC,CAAC,YAAY,CAAC;qBAChD,CAAC,CAAC;oBACH,IAAI,KAAK,CAAC,MAAM,IAAI,QAAQ;wBAAE,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;gBACrF,CAAC;YACH,CAAC;QACH,CAAC;QACD,MAAM,EAAE,CAAC;IACX,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC;AACvD,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import type { FOLClause, FOLLiteral, FOLTerm } from '../fol-prover/types';
|
|
2
|
+
export declare function isEqualityLiteral(lit: FOLLiteral): boolean;
|
|
3
|
+
export declare function termKey(t: FOLTerm): string;
|
|
4
|
+
export declare function literalKey(lit: FOLLiteral): string;
|
|
5
|
+
export declare function clauseKey(c: FOLClause): string;
|
|
6
|
+
export declare function termsEqual(a: FOLTerm, b: FOLTerm): boolean;
|
|
7
|
+
export declare function cloneTerm(t: FOLTerm): FOLTerm;
|
|
8
|
+
export declare function cloneLiteral(lit: FOLLiteral): FOLLiteral;
|
|
9
|
+
export declare function cloneClause(c: FOLClause): FOLClause;
|
|
10
|
+
export declare function termSize(t: FOLTerm): number;
|
|
11
|
+
export declare function collectVars(t: FOLTerm, out: Set<string>): void;
|
|
12
|
+
export declare function termVars(t: FOLTerm): Set<string>;
|
|
13
|
+
/**
|
|
14
|
+
* Returns the subterm of `t` at the given position. Position [] returns t itself;
|
|
15
|
+
* position [i, j, ...] descends into args[i], then args[j], etc.
|
|
16
|
+
*/
|
|
17
|
+
export declare function termAt(t: FOLTerm, pos: number[]): FOLTerm | null;
|
|
18
|
+
/**
|
|
19
|
+
* Returns a new term equal to `t` but with the subterm at `pos` replaced by `replacement`.
|
|
20
|
+
* If pos is invalid returns `t` unchanged.
|
|
21
|
+
*/
|
|
22
|
+
export declare function replaceAt(t: FOLTerm, pos: number[], replacement: FOLTerm): FOLTerm;
|
|
23
|
+
/**
|
|
24
|
+
* Enumerate every (non-empty) position inside the term tree, including the root.
|
|
25
|
+
* Variables and constants only yield their own position; functions also yield children.
|
|
26
|
+
*/
|
|
27
|
+
export declare function allPositions(t: FOLTerm): number[][];
|
|
28
|
+
/**
|
|
29
|
+
* Enumerate positions for a literal as (argIndex, ...termPath). Useful for paramodulation
|
|
30
|
+
* targets that point inside a literal's args.
|
|
31
|
+
*/
|
|
32
|
+
export declare function allLiteralPositions(lit: FOLLiteral): number[][];
|
|
33
|
+
export declare function getLiteralSubterm(lit: FOLLiteral, pos: number[]): FOLTerm | null;
|
|
34
|
+
export declare function replaceLiteralSubterm(lit: FOLLiteral, pos: number[], replacement: FOLTerm): FOLLiteral;
|
|
35
|
+
/**
|
|
36
|
+
* Lexicographic path ordering–ish comparison used for orienting equations and
|
|
37
|
+
* for selecting which side rewrites the other in demodulation. Strictly compares
|
|
38
|
+
* (size, then key) so that the "bigger" term is rewritten into the "smaller" one.
|
|
39
|
+
*/
|
|
40
|
+
export declare function compareTerms(a: FOLTerm, b: FOLTerm): number;
|
|
41
|
+
export declare function freshenClause(c: FOLClause): FOLClause;
|
|
42
|
+
export declare function substToRecordTerm(s: Map<string, FOLTerm>): Record<string, FOLTerm>;
|
|
43
|
+
//# sourceMappingURL=term-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"term-utils.d.ts","sourceRoot":"","sources":["../../src/fol-prover-equality/term-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAG1E,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,UAAU,GAAG,OAAO,CAE1D;AAED,wBAAgB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