@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 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/profiles/sequent-g3/index.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,mDAAmD;AACnD,+DAA+D;AAC/D,EAAE;AACF,qEAAqE;AACrE,oEAAoE;AACpE,wEAAwE;AACxE,aAAa;AACb,EAAE;AACF,wDAAwD;AACxD,sCAAsC;;;AAGtC,mCAAsD;AAA7C,sGAAA,YAAY,OAAA;AAAE,sGAAA,YAAY,OAAA;AACnC,iCAAuC;AAA9B,qGAAA,YAAY,OAAA;AACrB,yCAAyD;AAAhD,2GAAA,cAAc,OAAA;AAAE,uGAAA,UAAU,OAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { ProofTree } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Convierte un `ProofTree` G3 en codigo LaTeX bussproofs listo para
|
|
4
|
+
* embeberse dentro de un documento. Asume `\usepackage{bussproofs}`.
|
|
5
|
+
*/
|
|
6
|
+
export declare function proofToLatex(proof: ProofTree): string;
|
|
7
|
+
//# sourceMappingURL=latex.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"latex.d.ts","sourceRoot":"","sources":["../../../src/profiles/sequent-g3/latex.ts"],"names":[],"mappings":"AAUA,OAAO,EAAE,SAAS,EAAwB,MAAM,SAAS,CAAC;AA8F1D;;;GAGG;AACH,wBAAgB,YAAY,CAAC,KAAK,EAAE,SAAS,GAAG,MAAM,CAIrD"}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// G3 — Export de arboles de prueba a LaTeX (bussproofs)
|
|
4
|
+
// ============================================================
|
|
5
|
+
//
|
|
6
|
+
// Genera codigo bussproofs valido para LaTeX. Cada nodo del arbol
|
|
7
|
+
// produce un bloque \AxiomC / \UnaryInfC / \BinaryInfC con la
|
|
8
|
+
// regla anotada en \RightLabel. La raiz queda envuelta en un
|
|
9
|
+
// $\DisplayProof$ para ser inmediatamente renderizable.
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.proofToLatex = proofToLatex;
|
|
12
|
+
const RULE_LABEL = {
|
|
13
|
+
axiom: '\\textsc{Ax}',
|
|
14
|
+
falseL: '$\\bot_L$',
|
|
15
|
+
trueR: '$\\top_R$',
|
|
16
|
+
andL: '$\\wedge_L$',
|
|
17
|
+
andR: '$\\wedge_R$',
|
|
18
|
+
orL: '$\\vee_L$',
|
|
19
|
+
orR: '$\\vee_R$',
|
|
20
|
+
impL: '$\\to_L$',
|
|
21
|
+
impR: '$\\to_R$',
|
|
22
|
+
notL: '$\\neg_L$',
|
|
23
|
+
notR: '$\\neg_R$',
|
|
24
|
+
};
|
|
25
|
+
function formulaToLatex(f) {
|
|
26
|
+
switch (f.kind) {
|
|
27
|
+
case 'atom':
|
|
28
|
+
return escapeAtom(f.name ?? '?');
|
|
29
|
+
case 'true':
|
|
30
|
+
return '\\top';
|
|
31
|
+
case 'false':
|
|
32
|
+
return '\\bot';
|
|
33
|
+
case 'not': {
|
|
34
|
+
const inner = f.args && f.args[0] ? f.args[0] : undefined;
|
|
35
|
+
if (!inner)
|
|
36
|
+
return '\\neg ?';
|
|
37
|
+
return inner.kind === 'atom' || inner.kind === 'true' || inner.kind === 'false'
|
|
38
|
+
? `\\neg ${formulaToLatex(inner)}`
|
|
39
|
+
: `\\neg (${formulaToLatex(inner)})`;
|
|
40
|
+
}
|
|
41
|
+
case 'and':
|
|
42
|
+
return binop(f, '\\wedge');
|
|
43
|
+
case 'or':
|
|
44
|
+
return binop(f, '\\vee');
|
|
45
|
+
case 'implies':
|
|
46
|
+
return binop(f, '\\to');
|
|
47
|
+
case 'biconditional':
|
|
48
|
+
return binop(f, '\\leftrightarrow');
|
|
49
|
+
default:
|
|
50
|
+
// Fallback: usar `kind` como etiqueta opaca
|
|
51
|
+
return `\\mathit{${escapeAtom(f.kind)}}`;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
function binop(f, op) {
|
|
55
|
+
const a = f.args && f.args[0] ? formulaToLatex(f.args[0]) : '?';
|
|
56
|
+
const b = f.args && f.args[1] ? formulaToLatex(f.args[1]) : '?';
|
|
57
|
+
return `(${a} ${op} ${b})`;
|
|
58
|
+
}
|
|
59
|
+
function escapeAtom(name) {
|
|
60
|
+
// bussproofs corre dentro de math mode: hay que escapar caracteres
|
|
61
|
+
// problematicos como `_` y `#` para evitar romper el render.
|
|
62
|
+
return name.replace(/([\\#$%&_{}])/g, '\\$1');
|
|
63
|
+
}
|
|
64
|
+
function sequentToLatex(seq) {
|
|
65
|
+
const left = seq.left.map(formulaToLatex).join(', ');
|
|
66
|
+
const right = seq.right.map(formulaToLatex).join(', ');
|
|
67
|
+
return `$${left} \\vdash ${right}$`;
|
|
68
|
+
}
|
|
69
|
+
function emit(tree, lines) {
|
|
70
|
+
// Recorrido post-orden: emitimos premisas primero porque bussproofs
|
|
71
|
+
// consume el stack de \AxiomC en orden top-down.
|
|
72
|
+
if (!tree.rule || tree.premises.length === 0) {
|
|
73
|
+
// Hoja: axiom, falseL, trueR, o rama abierta.
|
|
74
|
+
if (tree.rule === 'axiom' || tree.rule === 'falseL' || tree.rule === 'trueR') {
|
|
75
|
+
lines.push(`\\AxiomC{${sequentToLatex(tree.goal)}}`);
|
|
76
|
+
lines.push(`\\RightLabel{${RULE_LABEL[tree.rule]}}`);
|
|
77
|
+
lines.push(`\\UnaryInfC{${sequentToLatex(tree.goal)}}`);
|
|
78
|
+
}
|
|
79
|
+
else {
|
|
80
|
+
// Rama abierta (no cerrable): emitimos como axioma marcado.
|
|
81
|
+
lines.push(`\\AxiomC{${sequentToLatex(tree.goal)}}`);
|
|
82
|
+
lines.push(`\\RightLabel{\\textsc{open}}`);
|
|
83
|
+
lines.push(`\\UnaryInfC{${sequentToLatex(tree.goal)}}`);
|
|
84
|
+
}
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
for (const premise of tree.premises) {
|
|
88
|
+
emit(premise, lines);
|
|
89
|
+
}
|
|
90
|
+
lines.push(`\\RightLabel{${RULE_LABEL[tree.rule]}}`);
|
|
91
|
+
const infCmd = tree.premises.length === 1
|
|
92
|
+
? 'UnaryInfC'
|
|
93
|
+
: tree.premises.length === 2
|
|
94
|
+
? 'BinaryInfC'
|
|
95
|
+
: 'TrinaryInfC';
|
|
96
|
+
lines.push(`\\${infCmd}{${sequentToLatex(tree.goal)}}`);
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Convierte un `ProofTree` G3 en codigo LaTeX bussproofs listo para
|
|
100
|
+
* embeberse dentro de un documento. Asume `\usepackage{bussproofs}`.
|
|
101
|
+
*/
|
|
102
|
+
function proofToLatex(proof) {
|
|
103
|
+
const lines = [];
|
|
104
|
+
emit(proof, lines);
|
|
105
|
+
return `\\begin{prooftree}\n${lines.join('\n')}\n\\end{prooftree}`;
|
|
106
|
+
}
|
|
107
|
+
//# sourceMappingURL=latex.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"latex.js","sourceRoot":"","sources":["../../../src/profiles/sequent-g3/latex.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,wDAAwD;AACxD,+DAA+D;AAC/D,EAAE;AACF,kEAAkE;AAClE,8DAA8D;AAC9D,6DAA6D;AAC7D,wDAAwD;;AAqGxD,oCAIC;AApGD,MAAM,UAAU,GAAgC;IAC9C,KAAK,EAAE,cAAc;IACrB,MAAM,EAAE,WAAW;IACnB,KAAK,EAAE,WAAW;IAClB,IAAI,EAAE,aAAa;IACnB,IAAI,EAAE,aAAa;IACnB,GAAG,EAAE,WAAW;IAChB,GAAG,EAAE,WAAW;IAChB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,WAAW;IACjB,IAAI,EAAE,WAAW;CAClB,CAAC;AAEF,SAAS,cAAc,CAAC,CAAU;IAChC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;QACf,KAAK,MAAM;YACT,OAAO,UAAU,CAAC,CAAC,CAAC,IAAI,IAAI,GAAG,CAAC,CAAC;QACnC,KAAK,MAAM;YACT,OAAO,OAAO,CAAC;QACjB,KAAK,OAAO;YACV,OAAO,OAAO,CAAC;QACjB,KAAK,KAAK,CAAC,CAAC,CAAC;YACX,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;YAC1D,IAAI,CAAC,KAAK;gBAAE,OAAO,SAAS,CAAC;YAC7B,OA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;IAED,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QACpC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC;IACvB,CAAC;IACD,KAAK,CAAC,IAAI,CAAC,gBAAgB,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrD,MAAM,MAAM,GACV,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;QACxB,CAAC,CAAC,WAAW;QACb,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,MAAM,KAAK,CAAC;YAC1B,CAAC,CAAC,YAAY;YACd,CAAC,CAAC,aAAa,CAAC;IACtB,KAAK,CAAC,IAAI,CAAC,KAAK,MAAM,IAAI,cAAc,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC1D,CAAC;AAED;;;GAGG;AACH,SAAgB,YAAY,CAAC,KAAgB;IAC3C,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,CAAC,KAAK,EAAE,KAAK,CAAC,CAAC;IACnB,OAAO,uBAAuB,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC;AACrE,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Formula } from '../../types';
|
|
2
|
+
/**
|
|
3
|
+
* Reescribe la formula al nucleo {atom, true, false, not, and, or, implies}
|
|
4
|
+
* preservando las locaciones. Las formulas no proposicionales se dejan tal
|
|
5
|
+
* cual: el prover las tratara como atomicas y normalmente no podra cerrar
|
|
6
|
+
* la prueba salvo coincidencia sintactica exacta.
|
|
7
|
+
*/
|
|
8
|
+
export declare function normalizeForG3(f: Formula): Formula;
|
|
9
|
+
/**
|
|
10
|
+
* Canoniza una formula a una representacion textual estable que ignora
|
|
11
|
+
* `source` y normaliza orden interno donde aplica. Sirve como clave para
|
|
12
|
+
* comparar formulas en multisets.
|
|
13
|
+
*/
|
|
14
|
+
export declare function formulaKey(f: Formula): string;
|
|
15
|
+
//# sourceMappingURL=normalize.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.d.ts","sourceRoot":"","sources":["../../../src/profiles/sequent-g3/normalize.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,CAAC,EAAE,OAAO,GAAG,OAAO,CAgElD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CA2B7C"}
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// G3 — Normalizacion de formulas a {atom, not, and, or, implies}
|
|
4
|
+
// ============================================================
|
|
5
|
+
//
|
|
6
|
+
// El nucleo G3 razona sobre 5 conectivos. Las formulas con
|
|
7
|
+
// biconditional, xor, nand, nor se reescriben a esa base; tambien
|
|
8
|
+
// se expanden cuantificadores y operadores aritmeticos no
|
|
9
|
+
// soportados (devolviendo error semantico via NaN-formula).
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.normalizeForG3 = normalizeForG3;
|
|
12
|
+
exports.formulaKey = formulaKey;
|
|
13
|
+
/**
|
|
14
|
+
* Reescribe la formula al nucleo {atom, true, false, not, and, or, implies}
|
|
15
|
+
* preservando las locaciones. Las formulas no proposicionales se dejan tal
|
|
16
|
+
* cual: el prover las tratara como atomicas y normalmente no podra cerrar
|
|
17
|
+
* la prueba salvo coincidencia sintactica exacta.
|
|
18
|
+
*/
|
|
19
|
+
function normalizeForG3(f) {
|
|
20
|
+
switch (f.kind) {
|
|
21
|
+
case 'atom':
|
|
22
|
+
case 'true':
|
|
23
|
+
case 'false':
|
|
24
|
+
return f;
|
|
25
|
+
case 'not': {
|
|
26
|
+
const inner = f.args && f.args[0] ? normalizeForG3(f.args[0]) : f;
|
|
27
|
+
return { kind: 'not', args: [inner], source: f.source };
|
|
28
|
+
}
|
|
29
|
+
case 'and':
|
|
30
|
+
case 'or':
|
|
31
|
+
case 'implies': {
|
|
32
|
+
const a = f.args && f.args[0] ? normalizeForG3(f.args[0]) : f;
|
|
33
|
+
const b = f.args && f.args[1] ? normalizeForG3(f.args[1]) : f;
|
|
34
|
+
return { kind: f.kind, args: [a, b], source: f.source };
|
|
35
|
+
}
|
|
36
|
+
case 'biconditional': {
|
|
37
|
+
// A ↔ B ≡ (A → B) ∧ (B → A)
|
|
38
|
+
if (!f.args || !f.args[0] || !f.args[1])
|
|
39
|
+
return f;
|
|
40
|
+
const a = normalizeForG3(f.args[0]);
|
|
41
|
+
const b = normalizeForG3(f.args[1]);
|
|
42
|
+
return {
|
|
43
|
+
kind: 'and',
|
|
44
|
+
args: [
|
|
45
|
+
{ kind: 'implies', args: [a, b] },
|
|
46
|
+
{ kind: 'implies', args: [b, a] },
|
|
47
|
+
],
|
|
48
|
+
source: f.source,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
case 'xor': {
|
|
52
|
+
// A ⊕ B ≡ (A ∧ ¬B) ∨ (¬A ∧ B)
|
|
53
|
+
if (!f.args || !f.args[0] || !f.args[1])
|
|
54
|
+
return f;
|
|
55
|
+
const a = normalizeForG3(f.args[0]);
|
|
56
|
+
const b = normalizeForG3(f.args[1]);
|
|
57
|
+
return {
|
|
58
|
+
kind: 'or',
|
|
59
|
+
args: [
|
|
60
|
+
{ kind: 'and', args: [a, { kind: 'not', args: [b] }] },
|
|
61
|
+
{ kind: 'and', args: [{ kind: 'not', args: [a] }, b] },
|
|
62
|
+
],
|
|
63
|
+
source: f.source,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
case 'nand': {
|
|
67
|
+
// A ↑ B ≡ ¬(A ∧ B)
|
|
68
|
+
if (!f.args || !f.args[0] || !f.args[1])
|
|
69
|
+
return f;
|
|
70
|
+
const a = normalizeForG3(f.args[0]);
|
|
71
|
+
const b = normalizeForG3(f.args[1]);
|
|
72
|
+
return { kind: 'not', args: [{ kind: 'and', args: [a, b] }], source: f.source };
|
|
73
|
+
}
|
|
74
|
+
case 'nor': {
|
|
75
|
+
// A ↓ B ≡ ¬(A ∨ B)
|
|
76
|
+
if (!f.args || !f.args[0] || !f.args[1])
|
|
77
|
+
return f;
|
|
78
|
+
const a = normalizeForG3(f.args[0]);
|
|
79
|
+
const b = normalizeForG3(f.args[1]);
|
|
80
|
+
return { kind: 'not', args: [{ kind: 'or', args: [a, b] }], source: f.source };
|
|
81
|
+
}
|
|
82
|
+
default:
|
|
83
|
+
// Cuantificadores, predicados, modales, aritmetica: el prover
|
|
84
|
+
// proposicional los trata como atomos opacos.
|
|
85
|
+
return f;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Canoniza una formula a una representacion textual estable que ignora
|
|
90
|
+
* `source` y normaliza orden interno donde aplica. Sirve como clave para
|
|
91
|
+
* comparar formulas en multisets.
|
|
92
|
+
*/
|
|
93
|
+
function formulaKey(f) {
|
|
94
|
+
switch (f.kind) {
|
|
95
|
+
case 'atom':
|
|
96
|
+
return `a:${f.name ?? '?'}`;
|
|
97
|
+
case 'true':
|
|
98
|
+
return 'T';
|
|
99
|
+
case 'false':
|
|
100
|
+
return 'F';
|
|
101
|
+
case 'not':
|
|
102
|
+
return `n(${f.args && f.args[0] ? formulaKey(f.args[0]) : '?'})`;
|
|
103
|
+
case 'and':
|
|
104
|
+
case 'or':
|
|
105
|
+
case 'implies':
|
|
106
|
+
case 'biconditional': {
|
|
107
|
+
const a = f.args && f.args[0] ? formulaKey(f.args[0]) : '?';
|
|
108
|
+
const b = f.args && f.args[1] ? formulaKey(f.args[1]) : '?';
|
|
109
|
+
return `${f.kind}(${a},${b})`;
|
|
110
|
+
}
|
|
111
|
+
case 'predicate':
|
|
112
|
+
return `p:${f.name ?? '?'}(${(f.params ?? f.terms ?? []).join(',')})`;
|
|
113
|
+
case 'forall':
|
|
114
|
+
case 'exists':
|
|
115
|
+
return `${f.kind}:${f.variable ?? '?'}(${f.args && f.args[0] ? formulaKey(f.args[0]) : '?'})`;
|
|
116
|
+
default:
|
|
117
|
+
// Fallback: usar kind + estructura recursiva
|
|
118
|
+
return `${f.kind}(${(f.args ?? []).map(formulaKey).join(',')})`;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
//# sourceMappingURL=normalize.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"normalize.js","sourceRoot":"","sources":["../../../src/profiles/sequent-g3/normalize.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,iEAAiE;AACjE,+DAA+D;AAC/D,EAAE;AACF,2DAA2D;AAC3D,kEAAkE;AAClE,0DAA0D;AAC1D,4DAA4D;;AAU5D,wCAgEC;AAOD,gCA2BC;AAxGD;;;;;GAKG;AACH,SAAgB,cAAc,CAAC,CAAU;IACvC,QAAQ,CAAC,CAAC,IAAI,EAAE,CAAC;QACf,KAAK,MAAM,CAAC;QACZ,KAAK,MAAM,CAAC;QACZ,KAAK,OAAO;YACV,OAAO,CAAC,CAAC;QACX,KAAK,KAAK,CAAC,CAAC,CAAC;YACX,MAAM,KAAK,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;YAClE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;QAC1D,CAAC;QACD,KAAK,KAAK,CAAC;QACX,KAAK,IAAI,CAAC;QACV,KAAK,SAAS,CAAC,CAAC,CAAC;YACf,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAA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demuestra `seq` (Γ ⊢ Δ) por backward search en G3.
|
|
5
|
+
* Normaliza las formulas antes de comenzar.
|
|
6
|
+
*/
|
|
7
|
+
export declare function proveSequent(seq: Sequent, options?: {
|
|
8
|
+
budget?: number;
|
|
9
|
+
}): ProveResult;
|
|
10
|
+
/**
|
|
11
|
+
* Atajo: demuestra que `⊢ φ` (formula sin hipotesis) es valida en G3.
|
|
12
|
+
*/
|
|
13
|
+
export declare function proveFormula(formula: Formula, options?: {
|
|
14
|
+
budget?: number;
|
|
15
|
+
}): ProveResult;
|
|
16
|
+
//# sourceMappingURL=prover.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prover.d.ts","sourceRoot":"","sources":["../../../src/profiles/sequent-g3/prover.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAa,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAyV1D;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,WAAW,CAOzF;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,GAAE;IAAE,MAAM,CAAC,EAAE,MAAM,CAAA;CAAO,GAAG,WAAW,CAE7F"}
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// G3 — Backward proof search
|
|
4
|
+
// ============================================================
|
|
5
|
+
//
|
|
6
|
+
// Busqueda hacia atras (root-first). Las reglas de G3 son
|
|
7
|
+
// invertibles, por lo que NO hay que retroceder al elegir la
|
|
8
|
+
// proxima regla: cualquier formula compleja que aplique cierra
|
|
9
|
+
// el subgoal sii la version sin descomponer era cerrable.
|
|
10
|
+
//
|
|
11
|
+
// Terminacion: cada paso reemplaza una formula compleja por
|
|
12
|
+
// sub-formulas estrictamente menores. Para evitar contracciones
|
|
13
|
+
// redundantes en multisets, se dedupica por clave sintactica
|
|
14
|
+
// antes de aplicar la siguiente regla.
|
|
15
|
+
//
|
|
16
|
+
// Branching:
|
|
17
|
+
// - andR, orL, impL ramifican en 2 premisas (cada una debe cerrar).
|
|
18
|
+
// - andL, orR, impR, notL, notR son lineales (1 premisa).
|
|
19
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
+
exports.proveSequent = proveSequent;
|
|
21
|
+
exports.proveFormula = proveFormula;
|
|
22
|
+
const normalize_1 = require("./normalize");
|
|
23
|
+
function slotsOf(list) {
|
|
24
|
+
return list.map((f) => ({ formula: f, key: (0, normalize_1.formulaKey)(f) }));
|
|
25
|
+
}
|
|
26
|
+
function dedupSlots(slots) {
|
|
27
|
+
const seen = new Set();
|
|
28
|
+
const out = [];
|
|
29
|
+
for (const slot of slots) {
|
|
30
|
+
if (!seen.has(slot.key)) {
|
|
31
|
+
seen.add(slot.key);
|
|
32
|
+
out.push(slot);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
function isAtomic(f) {
|
|
38
|
+
// En G3, los atomos del calculo proposicional son atom/true/false.
|
|
39
|
+
// Tambien tratamos como opacas las formulas no-proposicionales
|
|
40
|
+
// (predicados, modales, ...) para que el prover no las descomponga.
|
|
41
|
+
switch (f.kind) {
|
|
42
|
+
case 'atom':
|
|
43
|
+
case 'true':
|
|
44
|
+
case 'false':
|
|
45
|
+
return true;
|
|
46
|
+
case 'not':
|
|
47
|
+
case 'and':
|
|
48
|
+
case 'or':
|
|
49
|
+
case 'implies':
|
|
50
|
+
return false;
|
|
51
|
+
default:
|
|
52
|
+
// Predicados/cuantificadores/etc: opacos.
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
function findAxiomMatch(left, right) {
|
|
57
|
+
const rightKeys = new Set(right.map((s) => s.key));
|
|
58
|
+
for (const slot of left) {
|
|
59
|
+
if (rightKeys.has(slot.key))
|
|
60
|
+
return slot.formula;
|
|
61
|
+
}
|
|
62
|
+
return undefined;
|
|
63
|
+
}
|
|
64
|
+
function findFalseLeft(left) {
|
|
65
|
+
return left.find((s) => s.formula.kind === 'false')?.formula;
|
|
66
|
+
}
|
|
67
|
+
function findTrueRight(right) {
|
|
68
|
+
return right.find((s) => s.formula.kind === 'true')?.formula;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Busca la primera formula no-atomica en `slots` y devuelve su indice y
|
|
72
|
+
* el slot. Si no hay ninguna, devuelve undefined.
|
|
73
|
+
*/
|
|
74
|
+
function findFirstComplex(slots) {
|
|
75
|
+
for (let i = 0; i < slots.length; i++) {
|
|
76
|
+
const slot = slots[i];
|
|
77
|
+
if (slot && !isAtomic(slot.formula))
|
|
78
|
+
return { index: i, slot };
|
|
79
|
+
}
|
|
80
|
+
return undefined;
|
|
81
|
+
}
|
|
82
|
+
function removeAt(arr, idx) {
|
|
83
|
+
const copy = arr.slice();
|
|
84
|
+
copy.splice(idx, 1);
|
|
85
|
+
return copy;
|
|
86
|
+
}
|
|
87
|
+
function toSequent(left, right) {
|
|
88
|
+
return {
|
|
89
|
+
left: left.map((s) => s.formula),
|
|
90
|
+
right: right.map((s) => s.formula),
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
function exhausted(ctx) {
|
|
94
|
+
return ctx.used >= ctx.budget;
|
|
95
|
+
}
|
|
96
|
+
function prove(left, right, ctx) {
|
|
97
|
+
ctx.used++;
|
|
98
|
+
if (exhausted(ctx))
|
|
99
|
+
return undefined;
|
|
100
|
+
const dedupL = dedupSlots(left);
|
|
101
|
+
const dedupR = dedupSlots(right);
|
|
102
|
+
const goal = toSequent(dedupL, dedupR);
|
|
103
|
+
// 1. Axioma: misma formula a izquierda y derecha.
|
|
104
|
+
const axiomFormula = findAxiomMatch(dedupL, dedupR);
|
|
105
|
+
if (axiomFormula) {
|
|
106
|
+
return { goal, rule: 'axiom', principalFormula: axiomFormula, premises: [], closed: true };
|
|
107
|
+
}
|
|
108
|
+
// 2. ⊥ en la izquierda cierra inmediatamente.
|
|
109
|
+
const bottomLeft = findFalseLeft(dedupL);
|
|
110
|
+
if (bottomLeft) {
|
|
111
|
+
return { goal, rule: 'falseL', principalFormula: bottomLeft, premises: [], closed: true };
|
|
112
|
+
}
|
|
113
|
+
// 3. ⊤ en la derecha cierra inmediatamente.
|
|
114
|
+
const topRight = findTrueRight(dedupR);
|
|
115
|
+
if (topRight) {
|
|
116
|
+
return { goal, rule: 'trueR', principalFormula: topRight, premises: [], closed: true };
|
|
117
|
+
}
|
|
118
|
+
// 4. Reglas no-ramificantes primero (siempre que existan).
|
|
119
|
+
// Esto reduce el espacio antes de ramificar y produce arboles mas
|
|
120
|
+
// pequenos sin sacrificar completitud (las reglas son invertibles).
|
|
121
|
+
// notL: Γ, ¬A ⊢ Δ ↦ Γ ⊢ A, Δ
|
|
122
|
+
for (let i = 0; i < dedupL.length; i++) {
|
|
123
|
+
const slot = dedupL[i];
|
|
124
|
+
if (slot && slot.formula.kind === 'not' && slot.formula.args && slot.formula.args[0]) {
|
|
125
|
+
const inner = slot.formula.args[0];
|
|
126
|
+
const newL = removeAt(dedupL, i);
|
|
127
|
+
const newR = [{ formula: inner, key: (0, normalize_1.formulaKey)(inner) }, ...dedupR];
|
|
128
|
+
const sub = prove(newL, newR, ctx);
|
|
129
|
+
if (!sub)
|
|
130
|
+
return undefined;
|
|
131
|
+
return {
|
|
132
|
+
goal,
|
|
133
|
+
rule: 'notL',
|
|
134
|
+
principalFormula: slot.formula,
|
|
135
|
+
premises: [sub],
|
|
136
|
+
closed: sub.closed,
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
// notR: Γ ⊢ ¬A, Δ ↦ Γ, A ⊢ Δ
|
|
141
|
+
for (let i = 0; i < dedupR.length; i++) {
|
|
142
|
+
const slot = dedupR[i];
|
|
143
|
+
if (slot && slot.formula.kind === 'not' && slot.formula.args && slot.formula.args[0]) {
|
|
144
|
+
const inner = slot.formula.args[0];
|
|
145
|
+
const newR = removeAt(dedupR, i);
|
|
146
|
+
const newL = [{ formula: inner, key: (0, normalize_1.formulaKey)(inner) }, ...dedupL];
|
|
147
|
+
const sub = prove(newL, newR, ctx);
|
|
148
|
+
if (!sub)
|
|
149
|
+
return undefined;
|
|
150
|
+
return {
|
|
151
|
+
goal,
|
|
152
|
+
rule: 'notR',
|
|
153
|
+
principalFormula: slot.formula,
|
|
154
|
+
premises: [sub],
|
|
155
|
+
closed: sub.closed,
|
|
156
|
+
};
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
// andL: Γ, A∧B ⊢ Δ ↦ Γ, A, B ⊢ Δ
|
|
160
|
+
for (let i = 0; i < dedupL.length; i++) {
|
|
161
|
+
const slot = dedupL[i];
|
|
162
|
+
if (slot &&
|
|
163
|
+
slot.formula.kind === 'and' &&
|
|
164
|
+
slot.formula.args &&
|
|
165
|
+
slot.formula.args[0] &&
|
|
166
|
+
slot.formula.args[1]) {
|
|
167
|
+
const a = slot.formula.args[0];
|
|
168
|
+
const b = slot.formula.args[1];
|
|
169
|
+
const newL = [
|
|
170
|
+
{ formula: a, key: (0, normalize_1.formulaKey)(a) },
|
|
171
|
+
{ formula: b, key: (0, normalize_1.formulaKey)(b) },
|
|
172
|
+
...removeAt(dedupL, i),
|
|
173
|
+
];
|
|
174
|
+
const sub = prove(newL, dedupR, ctx);
|
|
175
|
+
if (!sub)
|
|
176
|
+
return undefined;
|
|
177
|
+
return {
|
|
178
|
+
goal,
|
|
179
|
+
rule: 'andL',
|
|
180
|
+
principalFormula: slot.formula,
|
|
181
|
+
premises: [sub],
|
|
182
|
+
closed: sub.closed,
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
// orR: Γ ⊢ A∨B, Δ ↦ Γ ⊢ A, B, Δ
|
|
187
|
+
for (let i = 0; i < dedupR.length; i++) {
|
|
188
|
+
const slot = dedupR[i];
|
|
189
|
+
if (slot &&
|
|
190
|
+
slot.formula.kind === 'or' &&
|
|
191
|
+
slot.formula.args &&
|
|
192
|
+
slot.formula.args[0] &&
|
|
193
|
+
slot.formula.args[1]) {
|
|
194
|
+
const a = slot.formula.args[0];
|
|
195
|
+
const b = slot.formula.args[1];
|
|
196
|
+
const newR = [
|
|
197
|
+
{ formula: a, key: (0, normalize_1.formulaKey)(a) },
|
|
198
|
+
{ formula: b, key: (0, normalize_1.formulaKey)(b) },
|
|
199
|
+
...removeAt(dedupR, i),
|
|
200
|
+
];
|
|
201
|
+
const sub = prove(dedupL, newR, ctx);
|
|
202
|
+
if (!sub)
|
|
203
|
+
return undefined;
|
|
204
|
+
return {
|
|
205
|
+
goal,
|
|
206
|
+
rule: 'orR',
|
|
207
|
+
principalFormula: slot.formula,
|
|
208
|
+
premises: [sub],
|
|
209
|
+
closed: sub.closed,
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
// impR: Γ ⊢ A→B, Δ ↦ Γ, A ⊢ B, Δ
|
|
214
|
+
for (let i = 0; i < dedupR.length; i++) {
|
|
215
|
+
const slot = dedupR[i];
|
|
216
|
+
if (slot &&
|
|
217
|
+
slot.formula.kind === 'implies' &&
|
|
218
|
+
slot.formula.args &&
|
|
219
|
+
slot.formula.args[0] &&
|
|
220
|
+
slot.formula.args[1]) {
|
|
221
|
+
const a = slot.formula.args[0];
|
|
222
|
+
const b = slot.formula.args[1];
|
|
223
|
+
const newL = [{ formula: a, key: (0, normalize_1.formulaKey)(a) }, ...dedupL];
|
|
224
|
+
const newR = [{ formula: b, key: (0, normalize_1.formulaKey)(b) }, ...removeAt(dedupR, i)];
|
|
225
|
+
const sub = prove(newL, newR, ctx);
|
|
226
|
+
if (!sub)
|
|
227
|
+
return undefined;
|
|
228
|
+
return {
|
|
229
|
+
goal,
|
|
230
|
+
rule: 'impR',
|
|
231
|
+
principalFormula: slot.formula,
|
|
232
|
+
premises: [sub],
|
|
233
|
+
closed: sub.closed,
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
// 5. Reglas ramificantes (despues de las lineales).
|
|
238
|
+
// andR: Γ ⊢ A∧B, Δ ↦ Γ ⊢ A, Δ ∧ Γ ⊢ B, Δ
|
|
239
|
+
for (let i = 0; i < dedupR.length; i++) {
|
|
240
|
+
const slot = dedupR[i];
|
|
241
|
+
if (slot &&
|
|
242
|
+
slot.formula.kind === 'and' &&
|
|
243
|
+
slot.formula.args &&
|
|
244
|
+
slot.formula.args[0] &&
|
|
245
|
+
slot.formula.args[1]) {
|
|
246
|
+
const a = slot.formula.args[0];
|
|
247
|
+
const b = slot.formula.args[1];
|
|
248
|
+
const restR = removeAt(dedupR, i);
|
|
249
|
+
const subA = prove(dedupL, [{ formula: a, key: (0, normalize_1.formulaKey)(a) }, ...restR], ctx);
|
|
250
|
+
if (!subA)
|
|
251
|
+
return undefined;
|
|
252
|
+
const subB = prove(dedupL, [{ formula: b, key: (0, normalize_1.formulaKey)(b) }, ...restR], ctx);
|
|
253
|
+
if (!subB)
|
|
254
|
+
return undefined;
|
|
255
|
+
return {
|
|
256
|
+
goal,
|
|
257
|
+
rule: 'andR',
|
|
258
|
+
principalFormula: slot.formula,
|
|
259
|
+
premises: [subA, subB],
|
|
260
|
+
closed: subA.closed && subB.closed,
|
|
261
|
+
};
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
// orL: Γ, A∨B ⊢ Δ ↦ Γ, A ⊢ Δ ∧ Γ, B ⊢ Δ
|
|
265
|
+
for (let i = 0; i < dedupL.length; i++) {
|
|
266
|
+
const slot = dedupL[i];
|
|
267
|
+
if (slot &&
|
|
268
|
+
slot.formula.kind === 'or' &&
|
|
269
|
+
slot.formula.args &&
|
|
270
|
+
slot.formula.args[0] &&
|
|
271
|
+
slot.formula.args[1]) {
|
|
272
|
+
const a = slot.formula.args[0];
|
|
273
|
+
const b = slot.formula.args[1];
|
|
274
|
+
const restL = removeAt(dedupL, i);
|
|
275
|
+
const subA = prove([{ formula: a, key: (0, normalize_1.formulaKey)(a) }, ...restL], dedupR, ctx);
|
|
276
|
+
if (!subA)
|
|
277
|
+
return undefined;
|
|
278
|
+
const subB = prove([{ formula: b, key: (0, normalize_1.formulaKey)(b) }, ...restL], dedupR, ctx);
|
|
279
|
+
if (!subB)
|
|
280
|
+
return undefined;
|
|
281
|
+
return {
|
|
282
|
+
goal,
|
|
283
|
+
rule: 'orL',
|
|
284
|
+
principalFormula: slot.formula,
|
|
285
|
+
premises: [subA, subB],
|
|
286
|
+
closed: subA.closed && subB.closed,
|
|
287
|
+
};
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
// impL: Γ, A→B ⊢ Δ ↦ Γ ⊢ A, Δ ∧ Γ, B ⊢ Δ
|
|
291
|
+
for (let i = 0; i < dedupL.length; i++) {
|
|
292
|
+
const slot = dedupL[i];
|
|
293
|
+
if (slot &&
|
|
294
|
+
slot.formula.kind === 'implies' &&
|
|
295
|
+
slot.formula.args &&
|
|
296
|
+
slot.formula.args[0] &&
|
|
297
|
+
slot.formula.args[1]) {
|
|
298
|
+
const a = slot.formula.args[0];
|
|
299
|
+
const b = slot.formula.args[1];
|
|
300
|
+
const restL = removeAt(dedupL, i);
|
|
301
|
+
const subA = prove(restL, [{ formula: a, key: (0, normalize_1.formulaKey)(a) }, ...dedupR], ctx);
|
|
302
|
+
if (!subA)
|
|
303
|
+
return undefined;
|
|
304
|
+
const subB = prove([{ formula: b, key: (0, normalize_1.formulaKey)(b) }, ...restL], dedupR, ctx);
|
|
305
|
+
if (!subB)
|
|
306
|
+
return undefined;
|
|
307
|
+
return {
|
|
308
|
+
goal,
|
|
309
|
+
rule: 'impL',
|
|
310
|
+
principalFormula: slot.formula,
|
|
311
|
+
premises: [subA, subB],
|
|
312
|
+
closed: subA.closed && subB.closed,
|
|
313
|
+
};
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
// 6. Si llegamos aca, no quedan formulas complejas que descomponer y
|
|
317
|
+
// no se encontro axioma: el secuente no es derivable (es una hoja
|
|
318
|
+
// abierta del arbol de busqueda).
|
|
319
|
+
const complexL = findFirstComplex(dedupL);
|
|
320
|
+
const complexR = findFirstComplex(dedupR);
|
|
321
|
+
if (!complexL && !complexR) {
|
|
322
|
+
return { goal, premises: [], closed: false };
|
|
323
|
+
}
|
|
324
|
+
// Si todavia queda complejidad pero nuestras ramas fueron consumidas,
|
|
325
|
+
// significa que el algoritmo no encontro forma de avanzar. No deberia
|
|
326
|
+
// ocurrir con la base normalizada; devolvemos undefined como senal.
|
|
327
|
+
return undefined;
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Demuestra `seq` (Γ ⊢ Δ) por backward search en G3.
|
|
331
|
+
* Normaliza las formulas antes de comenzar.
|
|
332
|
+
*/
|
|
333
|
+
function proveSequent(seq, options = {}) {
|
|
334
|
+
const normLeft = seq.left.map(normalize_1.normalizeForG3);
|
|
335
|
+
const normRight = seq.right.map(normalize_1.normalizeForG3);
|
|
336
|
+
const ctx = { budget: options.budget ?? 5_000, used: 0 };
|
|
337
|
+
const tree = prove(slotsOf(normLeft), slotsOf(normRight), ctx);
|
|
338
|
+
if (!tree)
|
|
339
|
+
return { provable: false };
|
|
340
|
+
return { provable: tree.closed, proof: tree };
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Atajo: demuestra que `⊢ φ` (formula sin hipotesis) es valida en G3.
|
|
344
|
+
*/
|
|
345
|
+
function proveFormula(formula, options = {}) {
|
|
346
|
+
return proveSequent({ left: [], right: [formula] }, options);
|
|
347
|
+
}
|
|
348
|
+
//# sourceMappingURL=prover.js.map
|