@stevenvo780/st-lang 4.2.0 → 4.4.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/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +70 -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/mltt/equality.d.ts +9 -0
- package/dist/mltt/equality.d.ts.map +1 -0
- package/dist/mltt/equality.js +79 -0
- package/dist/mltt/equality.js.map +1 -0
- package/dist/mltt/index.d.ts +8 -0
- package/dist/mltt/index.d.ts.map +1 -0
- package/dist/mltt/index.js +49 -0
- package/dist/mltt/index.js.map +1 -0
- package/dist/mltt/infer.d.ts +17 -0
- package/dist/mltt/infer.d.ts.map +1 -0
- package/dist/mltt/infer.js +269 -0
- package/dist/mltt/infer.js.map +1 -0
- package/dist/mltt/normalize.d.ts +7 -0
- package/dist/mltt/normalize.d.ts.map +1 -0
- package/dist/mltt/normalize.js +131 -0
- package/dist/mltt/normalize.js.map +1 -0
- package/dist/mltt/substitute.d.ts +4 -0
- package/dist/mltt/substitute.d.ts.map +1 -0
- package/dist/mltt/substitute.js +94 -0
- package/dist/mltt/substitute.js.map +1 -0
- package/dist/mltt/types.d.ts +72 -0
- package/dist/mltt/types.d.ts.map +1 -0
- package/dist/mltt/types.js +211 -0
- package/dist/mltt/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/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/mu-calculus/check.d.ts +15 -0
- package/dist/profiles/mu-calculus/check.d.ts.map +1 -0
- package/dist/profiles/mu-calculus/check.js +172 -0
- package/dist/profiles/mu-calculus/check.js.map +1 -0
- package/dist/profiles/mu-calculus/ctl-translate.d.ts +61 -0
- package/dist/profiles/mu-calculus/ctl-translate.d.ts.map +1 -0
- package/dist/profiles/mu-calculus/ctl-translate.js +181 -0
- package/dist/profiles/mu-calculus/ctl-translate.js.map +1 -0
- package/dist/profiles/mu-calculus/index.d.ts +7 -0
- package/dist/profiles/mu-calculus/index.d.ts.map +1 -0
- package/dist/profiles/mu-calculus/index.js +33 -0
- package/dist/profiles/mu-calculus/index.js.map +1 -0
- package/dist/profiles/mu-calculus/types.d.ts +51 -0
- package/dist/profiles/mu-calculus/types.d.ts.map +1 -0
- package/dist/profiles/mu-calculus/types.js +42 -0
- package/dist/profiles/mu-calculus/types.js.map +1 -0
- package/dist/profiles/mu-calculus/wellformed.d.ts +40 -0
- package/dist/profiles/mu-calculus/wellformed.d.ts.map +1 -0
- package/dist/profiles/mu-calculus/wellformed.js +160 -0
- package/dist/profiles/mu-calculus/wellformed.js.map +1 -0
- package/dist/profiles/sequent-lk/cut-elimination.d.ts +11 -0
- package/dist/profiles/sequent-lk/cut-elimination.d.ts.map +1 -0
- package/dist/profiles/sequent-lk/cut-elimination.js +216 -0
- package/dist/profiles/sequent-lk/cut-elimination.js.map +1 -0
- package/dist/profiles/sequent-lk/index.d.ts +5 -0
- package/dist/profiles/sequent-lk/index.d.ts.map +1 -0
- package/dist/profiles/sequent-lk/index.js +24 -0
- package/dist/profiles/sequent-lk/index.js.map +1 -0
- package/dist/profiles/sequent-lk/prover.d.ts +25 -0
- package/dist/profiles/sequent-lk/prover.d.ts.map +1 -0
- package/dist/profiles/sequent-lk/prover.js +532 -0
- package/dist/profiles/sequent-lk/prover.js.map +1 -0
- package/dist/profiles/sequent-lk/types.d.ts +55 -0
- package/dist/profiles/sequent-lk/types.d.ts.map +1 -0
- package/dist/profiles/sequent-lk/types.js +18 -0
- package/dist/profiles/sequent-lk/types.js.map +1 -0
- package/dist/profiles/sequent-lk/util.d.ts +18 -0
- package/dist/profiles/sequent-lk/util.d.ts.map +1 -0
- package/dist/profiles/sequent-lk/util.js +71 -0
- package/dist/profiles/sequent-lk/util.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/refinement-types/checker.d.ts +19 -0
- package/dist/refinement-types/checker.d.ts.map +1 -0
- package/dist/refinement-types/checker.js +248 -0
- package/dist/refinement-types/checker.js.map +1 -0
- package/dist/refinement-types/index.d.ts +11 -0
- package/dist/refinement-types/index.d.ts.map +1 -0
- package/dist/refinement-types/index.js +51 -0
- package/dist/refinement-types/index.js.map +1 -0
- package/dist/refinement-types/predicate.d.ts +31 -0
- package/dist/refinement-types/predicate.d.ts.map +1 -0
- package/dist/refinement-types/predicate.js +369 -0
- package/dist/refinement-types/predicate.js.map +1 -0
- package/dist/refinement-types/solver.d.ts +24 -0
- package/dist/refinement-types/solver.d.ts.map +1 -0
- package/dist/refinement-types/solver.js +207 -0
- package/dist/refinement-types/solver.js.map +1 -0
- package/dist/refinement-types/subtype.d.ts +14 -0
- package/dist/refinement-types/subtype.d.ts.map +1 -0
- package/dist/refinement-types/subtype.js +39 -0
- package/dist/refinement-types/subtype.js.map +1 -0
- package/dist/refinement-types/types.d.ts +64 -0
- package/dist/refinement-types/types.d.ts.map +1 -0
- package/dist/refinement-types/types.js +130 -0
- package/dist/refinement-types/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/anti-unification/anti-unify.d.ts +22 -0
- package/dist/runtime/anti-unification/anti-unify.d.ts.map +1 -0
- package/dist/runtime/anti-unification/anti-unify.js +154 -0
- package/dist/runtime/anti-unification/anti-unify.js.map +1 -0
- package/dist/runtime/anti-unification/index.d.ts +6 -0
- package/dist/runtime/anti-unification/index.d.ts.map +1 -0
- package/dist/runtime/anti-unification/index.js +23 -0
- package/dist/runtime/anti-unification/index.js.map +1 -0
- package/dist/runtime/anti-unification/many.d.ts +49 -0
- package/dist/runtime/anti-unification/many.d.ts.map +1 -0
- package/dist/runtime/anti-unification/many.js +185 -0
- package/dist/runtime/anti-unification/many.js.map +1 -0
- package/dist/runtime/anti-unification/term-utils.d.ts +40 -0
- package/dist/runtime/anti-unification/term-utils.d.ts.map +1 -0
- package/dist/runtime/anti-unification/term-utils.js +173 -0
- package/dist/runtime/anti-unification/term-utils.js.map +1 -0
- package/dist/runtime/anti-unification/types.d.ts +41 -0
- package/dist/runtime/anti-unification/types.d.ts.map +1 -0
- package/dist/runtime/anti-unification/types.js +26 -0
- package/dist/runtime/anti-unification/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/csp/ac3.d.ts +20 -0
- package/dist/runtime/csp/ac3.d.ts.map +1 -0
- package/dist/runtime/csp/ac3.js +165 -0
- package/dist/runtime/csp/ac3.js.map +1 -0
- package/dist/runtime/csp/backtrack.d.ts +15 -0
- package/dist/runtime/csp/backtrack.d.ts.map +1 -0
- package/dist/runtime/csp/backtrack.js +233 -0
- package/dist/runtime/csp/backtrack.js.map +1 -0
- package/dist/runtime/csp/builtins.d.ts +27 -0
- package/dist/runtime/csp/builtins.d.ts.map +1 -0
- package/dist/runtime/csp/builtins.js +109 -0
- package/dist/runtime/csp/builtins.js.map +1 -0
- package/dist/runtime/csp/index.d.ts +5 -0
- package/dist/runtime/csp/index.d.ts.map +1 -0
- package/dist/runtime/csp/index.js +23 -0
- package/dist/runtime/csp/index.js.map +1 -0
- package/dist/runtime/csp/types.d.ts +54 -0
- package/dist/runtime/csp/types.d.ts.map +1 -0
- package/dist/runtime/csp/types.js +14 -0
- package/dist/runtime/csp/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/markov-logic/grounding.d.ts +19 -0
- package/dist/runtime/markov-logic/grounding.d.ts.map +1 -0
- package/dist/runtime/markov-logic/grounding.js +252 -0
- package/dist/runtime/markov-logic/grounding.js.map +1 -0
- package/dist/runtime/markov-logic/index.d.ts +6 -0
- package/dist/runtime/markov-logic/index.d.ts.map +1 -0
- package/dist/runtime/markov-logic/index.js +47 -0
- package/dist/runtime/markov-logic/index.js.map +1 -0
- package/dist/runtime/markov-logic/inference.d.ts +77 -0
- package/dist/runtime/markov-logic/inference.d.ts.map +1 -0
- package/dist/runtime/markov-logic/inference.js +382 -0
- package/dist/runtime/markov-logic/inference.js.map +1 -0
- package/dist/runtime/markov-logic/parser.d.ts +25 -0
- package/dist/runtime/markov-logic/parser.d.ts.map +1 -0
- package/dist/runtime/markov-logic/parser.js +264 -0
- package/dist/runtime/markov-logic/parser.js.map +1 -0
- package/dist/runtime/markov-logic/types.d.ts +64 -0
- package/dist/runtime/markov-logic/types.d.ts.map +1 -0
- package/dist/runtime/markov-logic/types.js +17 -0
- package/dist/runtime/markov-logic/types.js.map +1 -0
- package/dist/runtime/pi-calculus/congruence.d.ts +15 -0
- package/dist/runtime/pi-calculus/congruence.d.ts.map +1 -0
- package/dist/runtime/pi-calculus/congruence.js +271 -0
- package/dist/runtime/pi-calculus/congruence.js.map +1 -0
- package/dist/runtime/pi-calculus/index.d.ts +6 -0
- package/dist/runtime/pi-calculus/index.d.ts.map +1 -0
- package/dist/runtime/pi-calculus/index.js +30 -0
- package/dist/runtime/pi-calculus/index.js.map +1 -0
- package/dist/runtime/pi-calculus/names.d.ts +28 -0
- package/dist/runtime/pi-calculus/names.d.ts.map +1 -0
- package/dist/runtime/pi-calculus/names.js +182 -0
- package/dist/runtime/pi-calculus/names.js.map +1 -0
- package/dist/runtime/pi-calculus/reduction.d.ts +25 -0
- package/dist/runtime/pi-calculus/reduction.d.ts.map +1 -0
- package/dist/runtime/pi-calculus/reduction.js +338 -0
- package/dist/runtime/pi-calculus/reduction.js.map +1 -0
- package/dist/runtime/pi-calculus/substitution.d.ts +11 -0
- package/dist/runtime/pi-calculus/substitution.d.ts.map +1 -0
- package/dist/runtime/pi-calculus/substitution.js +109 -0
- package/dist/runtime/pi-calculus/substitution.js.map +1 -0
- package/dist/runtime/pi-calculus/types.d.ts +38 -0
- package/dist/runtime/pi-calculus/types.d.ts.map +1 -0
- package/dist/runtime/pi-calculus/types.js +22 -0
- package/dist/runtime/pi-calculus/types.js.map +1 -0
- package/dist/runtime/planning/astar.d.ts +10 -0
- package/dist/runtime/planning/astar.d.ts.map +1 -0
- package/dist/runtime/planning/astar.js +155 -0
- package/dist/runtime/planning/astar.js.map +1 -0
- package/dist/runtime/planning/bfs.d.ts +17 -0
- package/dist/runtime/planning/bfs.d.ts.map +1 -0
- package/dist/runtime/planning/bfs.js +87 -0
- package/dist/runtime/planning/bfs.js.map +1 -0
- package/dist/runtime/planning/ground.d.ts +55 -0
- package/dist/runtime/planning/ground.d.ts.map +1 -0
- package/dist/runtime/planning/ground.js +154 -0
- package/dist/runtime/planning/ground.js.map +1 -0
- package/dist/runtime/planning/heuristic.d.ts +29 -0
- package/dist/runtime/planning/heuristic.d.ts.map +1 -0
- package/dist/runtime/planning/heuristic.js +172 -0
- package/dist/runtime/planning/heuristic.js.map +1 -0
- package/dist/runtime/planning/index.d.ts +6 -0
- package/dist/runtime/planning/index.d.ts.map +1 -0
- package/dist/runtime/planning/index.js +38 -0
- package/dist/runtime/planning/index.js.map +1 -0
- package/dist/runtime/planning/types.d.ts +100 -0
- package/dist/runtime/planning/types.d.ts.map +1 -0
- package/dist/runtime/planning/types.js +22 -0
- package/dist/runtime/planning/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 +212 -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/runtime/theorem-cache/cache.d.ts +100 -0
- package/dist/runtime/theorem-cache/cache.d.ts.map +1 -0
- package/dist/runtime/theorem-cache/cache.js +213 -0
- package/dist/runtime/theorem-cache/cache.js.map +1 -0
- package/dist/runtime/theorem-cache/canonical.d.ts +59 -0
- package/dist/runtime/theorem-cache/canonical.d.ts.map +1 -0
- package/dist/runtime/theorem-cache/canonical.js +105 -0
- package/dist/runtime/theorem-cache/canonical.js.map +1 -0
- package/dist/runtime/theorem-cache/index.d.ts +6 -0
- package/dist/runtime/theorem-cache/index.d.ts.map +1 -0
- package/dist/runtime/theorem-cache/index.js +16 -0
- package/dist/runtime/theorem-cache/index.js.map +1 -0
- package/dist/runtime/theorem-cache/pattern.d.ts +24 -0
- package/dist/runtime/theorem-cache/pattern.d.ts.map +1 -0
- package/dist/runtime/theorem-cache/pattern.js +80 -0
- package/dist/runtime/theorem-cache/pattern.js.map +1 -0
- package/dist/system-f/index.d.ts +7 -0
- package/dist/system-f/index.d.ts.map +1 -0
- package/dist/system-f/index.js +48 -0
- package/dist/system-f/index.js.map +1 -0
- package/dist/system-f/infer.d.ts +9 -0
- package/dist/system-f/infer.d.ts.map +1 -0
- package/dist/system-f/infer.js +94 -0
- package/dist/system-f/infer.js.map +1 -0
- package/dist/system-f/reduce.d.ts +15 -0
- package/dist/system-f/reduce.d.ts.map +1 -0
- package/dist/system-f/reduce.js +259 -0
- package/dist/system-f/reduce.js.map +1 -0
- package/dist/system-f/types.d.ts +53 -0
- package/dist/system-f/types.d.ts.map +1 -0
- package/dist/system-f/types.js +157 -0
- package/dist/system-f/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/anti-unification/anti-unify.test.d.ts +2 -0
- package/dist/tests/anti-unification/anti-unify.test.d.ts.map +1 -0
- package/dist/tests/anti-unification/anti-unify.test.js +219 -0
- package/dist/tests/anti-unification/anti-unify.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/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/coverage-fill-aristotelian.test.js +1 -1
- package/dist/tests/coverage-fill-aristotelian.test.js.map +1 -1
- package/dist/tests/coverage-fill-fallacies.test.js +1 -1
- package/dist/tests/coverage-fill-fallacies.test.js.map +1 -1
- package/dist/tests/coverage-fill-format.test.js +1 -1
- package/dist/tests/coverage-fill-format.test.js.map +1 -1
- package/dist/tests/coverage-fill-intuitionistic.test.js +1 -1
- package/dist/tests/coverage-fill-intuitionistic.test.js.map +1 -1
- package/dist/tests/coverage-fill-probabilistic.test.js +1 -1
- package/dist/tests/coverage-fill-probabilistic.test.js.map +1 -1
- package/dist/tests/csp/csp.test.d.ts +2 -0
- package/dist/tests/csp/csp.test.d.ts.map +1 -0
- package/dist/tests/csp/csp.test.js +292 -0
- package/dist/tests/csp/csp.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/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/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/markov-logic/markov-logic.test.d.ts +2 -0
- package/dist/tests/markov-logic/markov-logic.test.d.ts.map +1 -0
- package/dist/tests/markov-logic/markov-logic.test.js +349 -0
- package/dist/tests/markov-logic/markov-logic.test.js.map +1 -0
- package/dist/tests/mltt/mltt.test.d.ts +2 -0
- package/dist/tests/mltt/mltt.test.d.ts.map +1 -0
- package/dist/tests/mltt/mltt.test.js +181 -0
- package/dist/tests/mltt/mltt.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/mu-calculus/check.test.d.ts +2 -0
- package/dist/tests/mu-calculus/check.test.d.ts.map +1 -0
- package/dist/tests/mu-calculus/check.test.js +234 -0
- package/dist/tests/mu-calculus/check.test.js.map +1 -0
- package/dist/tests/pi-calculus/pi-calculus.test.d.ts +2 -0
- package/dist/tests/pi-calculus/pi-calculus.test.d.ts.map +1 -0
- package/dist/tests/pi-calculus/pi-calculus.test.js +273 -0
- package/dist/tests/pi-calculus/pi-calculus.test.js.map +1 -0
- package/dist/tests/planning/planning.test.d.ts +2 -0
- package/dist/tests/planning/planning.test.d.ts.map +1 -0
- package/dist/tests/planning/planning.test.js +397 -0
- package/dist/tests/planning/planning.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/refinement-types/refinement-types.test.d.ts +2 -0
- package/dist/tests/refinement-types/refinement-types.test.d.ts.map +1 -0
- package/dist/tests/refinement-types/refinement-types.test.js +174 -0
- package/dist/tests/refinement-types/refinement-types.test.js.map +1 -0
- package/dist/tests/sequent-lk/prover.test.d.ts +2 -0
- package/dist/tests/sequent-lk/prover.test.d.ts.map +1 -0
- package/dist/tests/sequent-lk/prover.test.js +317 -0
- package/dist/tests/sequent-lk/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/system-f/system-f.test.d.ts +2 -0
- package/dist/tests/system-f/system-f.test.d.ts.map +1 -0
- package/dist/tests/system-f/system-f.test.js +217 -0
- package/dist/tests/system-f/system-f.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/dist/tests/theorem-cache/cache.test.d.ts +2 -0
- package/dist/tests/theorem-cache/cache.test.d.ts.map +1 -0
- package/dist/tests/theorem-cache/cache.test.js +510 -0
- package/dist/tests/theorem-cache/cache.test.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// ST Bisimulation — barrel público.
|
|
4
|
+
// ============================================================
|
|
5
|
+
// API:
|
|
6
|
+
// paigeTarjan(lts) → BisimulationResult
|
|
7
|
+
// areBisimilar(lts, s, t) → boolean
|
|
8
|
+
// quotientLTS(lts) → LTS mínimo módulo ~
|
|
9
|
+
// strongBisimulation(L1, L2) → boolean
|
|
10
|
+
// weakBisimulation(lts, tau) → BisimulationResult (oculta τ)
|
|
11
|
+
// ============================================================
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.weakBisimulation = exports.strongBisimulation = exports.quotientLTS = exports.areBisimilar = exports.paigeTarjan = void 0;
|
|
14
|
+
var paige_tarjan_1 = require("./paige-tarjan");
|
|
15
|
+
Object.defineProperty(exports, "paigeTarjan", { enumerable: true, get: function () { return paige_tarjan_1.paigeTarjan; } });
|
|
16
|
+
var operations_1 = require("./operations");
|
|
17
|
+
Object.defineProperty(exports, "areBisimilar", { enumerable: true, get: function () { return operations_1.areBisimilar; } });
|
|
18
|
+
Object.defineProperty(exports, "quotientLTS", { enumerable: true, get: function () { return operations_1.quotientLTS; } });
|
|
19
|
+
Object.defineProperty(exports, "strongBisimulation", { enumerable: true, get: function () { return operations_1.strongBisimulation; } });
|
|
20
|
+
Object.defineProperty(exports, "weakBisimulation", { enumerable: true, get: function () { return operations_1.weakBisimulation; } });
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/runtime/bisimulation/index.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,oCAAoC;AACpC,+DAA+D;AAC/D,OAAO;AACP,uDAAuD;AACvD,4CAA4C;AAC5C,wDAAwD;AACxD,4CAA4C;AAC5C,kEAAkE;AAClE,+DAA+D;;;AAG/D,+CAA6C;AAApC,2GAAA,WAAW,OAAA;AACpB,2CAA+F;AAAtF,0GAAA,YAAY,OAAA;AAAE,yGAAA,WAAW,OAAA;AAAE,gHAAA,kBAAkB,OAAA;AAAE,8GAAA,gBAAgB,OAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { LTS, BisimulationResult } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Devuelve `true` si los estados `s` y `t` caen en el mismo bloque de la
|
|
4
|
+
* partición de bisimulación fuerte. Lanza si alguno no existe en M.
|
|
5
|
+
*/
|
|
6
|
+
export declare function areBisimilar(lts: LTS, s: string, t: string): boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Construye el LTS cociente M/~ donde cada bloque de la partición de
|
|
9
|
+
* bisimulación se convierte en un único estado. Las transiciones se
|
|
10
|
+
* deduplican: si s -a-> t, entonces [s] -a-> [t] aparece una sola vez.
|
|
11
|
+
*
|
|
12
|
+
* El labelling del bloque es el labelling común de sus miembros
|
|
13
|
+
* (todos los miembros tienen el mismo labelling por construcción).
|
|
14
|
+
*/
|
|
15
|
+
export declare function quotientLTS(lts: LTS): LTS;
|
|
16
|
+
/**
|
|
17
|
+
* Verifica si dos LTS son fuertemente bisimilares.
|
|
18
|
+
* Los espacios de estados deben ser disjuntos; si no lo son, los renombramos
|
|
19
|
+
* internamente con prefijos "L:" y "R:".
|
|
20
|
+
*
|
|
21
|
+
* El criterio: en el LTS combinado, los conjuntos iniciales (o, en ausencia
|
|
22
|
+
* de iniciales explícitos, todos los estados) deben quedar particionados de
|
|
23
|
+
* forma que cada estado de L tenga al menos un estado equivalente en R y
|
|
24
|
+
* viceversa. Como API simple, se compara la firma de la partición sobre
|
|
25
|
+
* el LTS combinado: dos LTS son bisimilares como sistemas sii existe una
|
|
26
|
+
* biyección entre sus bloques tal que cada bloque contiene estados de ambos
|
|
27
|
+
* lados (interpretación de "los autómatas son indistinguibles").
|
|
28
|
+
*/
|
|
29
|
+
export declare function strongBisimulation(lts1: LTS, lts2: LTS): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* Bisimulación débil: oculta transiciones τ y satura ⇒ = τ* antes de aplicar
|
|
32
|
+
* Paige-Tarjan. Útil para CCS / process algebras donde τ representa una
|
|
33
|
+
* acción interna no observable.
|
|
34
|
+
*
|
|
35
|
+
* Cuesta O(n³) por la saturación (transitivos τ); para LTS grandes con muchas
|
|
36
|
+
* acciones reales esto es aceptable. La partición resultante es la mayor
|
|
37
|
+
* relación de bisimulación débil.
|
|
38
|
+
*/
|
|
39
|
+
export declare function weakBisimulation(lts: LTS, tau: string): BisimulationResult;
|
|
40
|
+
//# sourceMappingURL=operations.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.d.ts","sourceRoot":"","sources":["../../../src/runtime/bisimulation/operations.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,GAAG,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAEvD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,OAAO,CAMpE;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,GAAG,CAsCzC;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CA8ChE;AAED;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,GAAG,kBAAkB,CA6D1E"}
|
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// Operaciones derivadas sobre bisimulación.
|
|
4
|
+
// ============================================================
|
|
5
|
+
// - areBisimilar(M, s, t) : ¿s y t están en el mismo bloque?
|
|
6
|
+
// - quotientLTS(M) : LTS mínimo módulo bisimulación.
|
|
7
|
+
// - strongBisimulation(M1, M2) : ¿dos LTS son fuertemente bisimilares?
|
|
8
|
+
// - weakBisimulation(M, τ) : partición que oculta transiciones τ.
|
|
9
|
+
//
|
|
10
|
+
// Para weakBisimulation usamos la construcción estándar:
|
|
11
|
+
// 1. saturar: ⇒ = τ* (con loops auto-incluidos)
|
|
12
|
+
// 2. para cada arista s -a-> t con a ≠ τ, agregar todas las composiciones
|
|
13
|
+
// τ* ; a ; τ*
|
|
14
|
+
// 3. para a = τ, agregar todos los pares (s, t) tales que s ⇒ t (incluido
|
|
15
|
+
// el reflexivo) bajo la acción τ.
|
|
16
|
+
// 4. Aplicar Paige-Tarjan sobre el LTS saturado.
|
|
17
|
+
//
|
|
18
|
+
// El resultado es la partición de bisimulación débil (~_w o "observational
|
|
19
|
+
// equivalence" de Milner).
|
|
20
|
+
// ============================================================
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.areBisimilar = areBisimilar;
|
|
23
|
+
exports.quotientLTS = quotientLTS;
|
|
24
|
+
exports.strongBisimulation = strongBisimulation;
|
|
25
|
+
exports.weakBisimulation = weakBisimulation;
|
|
26
|
+
const paige_tarjan_1 = require("./paige-tarjan");
|
|
27
|
+
/**
|
|
28
|
+
* Devuelve `true` si los estados `s` y `t` caen en el mismo bloque de la
|
|
29
|
+
* partición de bisimulación fuerte. Lanza si alguno no existe en M.
|
|
30
|
+
*/
|
|
31
|
+
function areBisimilar(lts, s, t) {
|
|
32
|
+
const known = new Set(lts.states);
|
|
33
|
+
if (!known.has(s))
|
|
34
|
+
throw new Error(`areBisimilar: estado desconocido "${s}"`);
|
|
35
|
+
if (!known.has(t))
|
|
36
|
+
throw new Error(`areBisimilar: estado desconocido "${t}"`);
|
|
37
|
+
const result = (0, paige_tarjan_1.paigeTarjan)(lts);
|
|
38
|
+
return result.partition.get(s) === result.partition.get(t);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Construye el LTS cociente M/~ donde cada bloque de la partición de
|
|
42
|
+
* bisimulación se convierte en un único estado. Las transiciones se
|
|
43
|
+
* deduplican: si s -a-> t, entonces [s] -a-> [t] aparece una sola vez.
|
|
44
|
+
*
|
|
45
|
+
* El labelling del bloque es el labelling común de sus miembros
|
|
46
|
+
* (todos los miembros tienen el mismo labelling por construcción).
|
|
47
|
+
*/
|
|
48
|
+
function quotientLTS(lts) {
|
|
49
|
+
const result = (0, paige_tarjan_1.paigeTarjan)(lts);
|
|
50
|
+
const blockName = (idx) => `q${idx}`;
|
|
51
|
+
const newStates = result.blocks.map((_, i) => blockName(i));
|
|
52
|
+
const seen = new Set();
|
|
53
|
+
const newTransitions = [];
|
|
54
|
+
for (const [from, action, to] of lts.transitions) {
|
|
55
|
+
const bf = result.partition.get(from);
|
|
56
|
+
const bt = result.partition.get(to);
|
|
57
|
+
if (bf === undefined || bt === undefined)
|
|
58
|
+
continue;
|
|
59
|
+
const key = `${bf}|${action}|${bt}`;
|
|
60
|
+
if (seen.has(key))
|
|
61
|
+
continue;
|
|
62
|
+
seen.add(key);
|
|
63
|
+
newTransitions.push([blockName(bf), action, blockName(bt)]);
|
|
64
|
+
}
|
|
65
|
+
// Labelling: cada bloque hereda el labelling de cualquiera de sus miembros
|
|
66
|
+
// (los miembros de un mismo bloque coinciden en labelling por bisimulación).
|
|
67
|
+
const labelling = {};
|
|
68
|
+
if (lts.labelling) {
|
|
69
|
+
for (let i = 0; i < result.blocks.length; i++) {
|
|
70
|
+
const cell = result.blocks[i];
|
|
71
|
+
const rep = cell && cell.length > 0 ? cell[0] : undefined;
|
|
72
|
+
if (rep === undefined)
|
|
73
|
+
continue;
|
|
74
|
+
const labs = lts.labelling[rep];
|
|
75
|
+
if (labs && labs.size > 0) {
|
|
76
|
+
labelling[blockName(i)] = new Set(labs);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
const out = {
|
|
81
|
+
states: newStates,
|
|
82
|
+
transitions: newTransitions,
|
|
83
|
+
};
|
|
84
|
+
if (Object.keys(labelling).length > 0)
|
|
85
|
+
out.labelling = labelling;
|
|
86
|
+
return out;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Verifica si dos LTS son fuertemente bisimilares.
|
|
90
|
+
* Los espacios de estados deben ser disjuntos; si no lo son, los renombramos
|
|
91
|
+
* internamente con prefijos "L:" y "R:".
|
|
92
|
+
*
|
|
93
|
+
* El criterio: en el LTS combinado, los conjuntos iniciales (o, en ausencia
|
|
94
|
+
* de iniciales explícitos, todos los estados) deben quedar particionados de
|
|
95
|
+
* forma que cada estado de L tenga al menos un estado equivalente en R y
|
|
96
|
+
* viceversa. Como API simple, se compara la firma de la partición sobre
|
|
97
|
+
* el LTS combinado: dos LTS son bisimilares como sistemas sii existe una
|
|
98
|
+
* biyección entre sus bloques tal que cada bloque contiene estados de ambos
|
|
99
|
+
* lados (interpretación de "los autómatas son indistinguibles").
|
|
100
|
+
*/
|
|
101
|
+
function strongBisimulation(lts1, lts2) {
|
|
102
|
+
const prefix = (side, s) => `${side}:${s}`;
|
|
103
|
+
const states = [
|
|
104
|
+
...lts1.states.map((s) => prefix('L', s)),
|
|
105
|
+
...lts2.states.map((s) => prefix('R', s)),
|
|
106
|
+
];
|
|
107
|
+
const transitions = [
|
|
108
|
+
...lts1.transitions.map(([f, a, t]) => [prefix('L', f), a, prefix('L', t)]),
|
|
109
|
+
...lts2.transitions.map(([f, a, t]) => [prefix('R', f), a, prefix('R', t)]),
|
|
110
|
+
];
|
|
111
|
+
const labelling = {};
|
|
112
|
+
if (lts1.labelling) {
|
|
113
|
+
for (const [k, v] of Object.entries(lts1.labelling)) {
|
|
114
|
+
labelling[prefix('L', k)] = new Set(v);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
if (lts2.labelling) {
|
|
118
|
+
for (const [k, v] of Object.entries(lts2.labelling)) {
|
|
119
|
+
labelling[prefix('R', k)] = new Set(v);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
const combined = { states, transitions };
|
|
123
|
+
if (Object.keys(labelling).length > 0)
|
|
124
|
+
combined.labelling = labelling;
|
|
125
|
+
const result = (0, paige_tarjan_1.paigeTarjan)(combined);
|
|
126
|
+
// Para que dos LTS sean "globalmente" bisimilares, cada estado de un lado
|
|
127
|
+
// debe quedar emparejado con al menos un estado del otro: los bloques deben
|
|
128
|
+
// contener miembros de ambos lados (o bloques que toquen sólo un lado son
|
|
129
|
+
// testigos de no-bisimilaridad).
|
|
130
|
+
for (const cell of result.blocks) {
|
|
131
|
+
let hasL = false;
|
|
132
|
+
let hasR = false;
|
|
133
|
+
for (const s of cell) {
|
|
134
|
+
if (s.startsWith('L:'))
|
|
135
|
+
hasL = true;
|
|
136
|
+
else if (s.startsWith('R:'))
|
|
137
|
+
hasR = true;
|
|
138
|
+
if (hasL && hasR)
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
if (!hasL || !hasR)
|
|
142
|
+
return false;
|
|
143
|
+
}
|
|
144
|
+
return true;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Bisimulación débil: oculta transiciones τ y satura ⇒ = τ* antes de aplicar
|
|
148
|
+
* Paige-Tarjan. Útil para CCS / process algebras donde τ representa una
|
|
149
|
+
* acción interna no observable.
|
|
150
|
+
*
|
|
151
|
+
* Cuesta O(n³) por la saturación (transitivos τ); para LTS grandes con muchas
|
|
152
|
+
* acciones reales esto es aceptable. La partición resultante es la mayor
|
|
153
|
+
* relación de bisimulación débil.
|
|
154
|
+
*/
|
|
155
|
+
function weakBisimulation(lts, tau) {
|
|
156
|
+
const states = new Set(lts.states);
|
|
157
|
+
// Construir τ-reachability (incluyendo cero pasos: cada s alcanza a sí mismo).
|
|
158
|
+
const tauNext = new Map();
|
|
159
|
+
for (const s of states)
|
|
160
|
+
tauNext.set(s, new Set([s]));
|
|
161
|
+
for (const [f, a, t] of lts.transitions) {
|
|
162
|
+
if (a === tau)
|
|
163
|
+
tauNext.get(f)?.add(t);
|
|
164
|
+
}
|
|
165
|
+
// Cierre transitivo de τ (Floyd-Warshall ingenuo).
|
|
166
|
+
const tauStar = new Map();
|
|
167
|
+
for (const s of states) {
|
|
168
|
+
const reach = new Set([s]);
|
|
169
|
+
const queue = [s];
|
|
170
|
+
while (queue.length > 0) {
|
|
171
|
+
const cur = queue.shift();
|
|
172
|
+
if (cur === undefined)
|
|
173
|
+
continue;
|
|
174
|
+
for (const n of tauNext.get(cur) ?? []) {
|
|
175
|
+
if (!reach.has(n)) {
|
|
176
|
+
reach.add(n);
|
|
177
|
+
queue.push(n);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
tauStar.set(s, reach);
|
|
182
|
+
}
|
|
183
|
+
// Saturación: s ⇒ -a-> ⇐ t ≡ existen u, v con s ⇒ u -a-> v y v ⇒ t.
|
|
184
|
+
// Para τ: s ⇒ t (sólo cuando el LTS original tiene al menos un τ desde s o
|
|
185
|
+
// s ≠ t por algún camino) se traduce a aristas τ explícitas en el saturado.
|
|
186
|
+
const saturated = [];
|
|
187
|
+
const seen = new Set();
|
|
188
|
+
const addEdge = (f, a, t) => {
|
|
189
|
+
const k = `${f}|${a}|${t}`;
|
|
190
|
+
if (seen.has(k))
|
|
191
|
+
return;
|
|
192
|
+
seen.add(k);
|
|
193
|
+
saturated.push([f, a, t]);
|
|
194
|
+
};
|
|
195
|
+
// Saturación de transiciones observables (a ≠ τ):
|
|
196
|
+
// en el LTS saturado, s -a-> u sii existen f, t con s ⇒ f -a-> t ⇒ u.
|
|
197
|
+
// Los τ originales NO se emiten como aristas observables: se "absorben" en
|
|
198
|
+
// ⇒ y desaparecen de la firma local, que es la definición canónica de
|
|
199
|
+
// bisimulación débil de Milner.
|
|
200
|
+
for (const [f, a, t] of lts.transitions) {
|
|
201
|
+
if (a === tau)
|
|
202
|
+
continue;
|
|
203
|
+
for (const s of tauStar.keys()) {
|
|
204
|
+
if (!tauStar.get(s)?.has(f))
|
|
205
|
+
continue;
|
|
206
|
+
for (const u of tauStar.get(t) ?? []) {
|
|
207
|
+
addEdge(s, a, u);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
const satLts = {
|
|
212
|
+
states: [...states],
|
|
213
|
+
transitions: saturated,
|
|
214
|
+
};
|
|
215
|
+
if (lts.labelling)
|
|
216
|
+
satLts.labelling = lts.labelling;
|
|
217
|
+
return (0, paige_tarjan_1.paigeTarjan)(satLts);
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=operations.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operations.js","sourceRoot":"","sources":["../../../src/runtime/bisimulation/operations.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,4CAA4C;AAC5C,+DAA+D;AAC/D,qEAAqE;AACrE,oEAAoE;AACpE,0EAA0E;AAC1E,yEAAyE;AACzE,EAAE;AACF,yDAAyD;AACzD,kDAAkD;AAClD,4EAA4E;AAC5E,mBAAmB;AACnB,6EAA6E;AAC7E,uCAAuC;AACvC,mDAAmD;AACnD,EAAE;AACF,2EAA2E;AAC3E,2BAA2B;AAC3B,+DAA+D;;AAS/D,oCAMC;AAUD,kCAsCC;AAeD,gDA8CC;AAWD,4CA6DC;AAlMD,iDAA6C;AAG7C;;;GAGG;AACH,SAAgB,YAAY,CAAC,GAAQ,EAAE,CAAS,EAAE,CAAS;IACzD,MAAM,KAAK,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;IAClC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,GAAG,CAAC,CAAC;IAC9E,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;QAAE,MAAM,IAAI,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AC,EAAE,CAAC;QAC3B,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,OAAO;QACxB,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACZ,SAAS,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;IAC5B,CAAC,CAAC;IAEF,kDAAkD;IAClD,yEAAyE;IACzE,2EAA2E;IAC3E,sEAAsE;IACtE,gCAAgC;IAChC,KAAK,MAAM,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC;QACxC,IAAI,CAAC,KAAK,GAAG;YAAE,SAAS;QACxB,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC;YAC/B,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC,CAAC;gBAAE,SAAS;YACtC,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC;gBACrC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;YACnB,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,MAAM,GAAQ;QAClB,MAAM,EAAE,CAAC,GAAG,MAAM,CAAC;QACnB,WAAW,EAAE,SAAS;KACvB,CAAC;IACF,IAAI,GAAG,CAAC,SAAS;QAAE,MAAM,CAAC,SAAS,GAAG,GAAG,CAAC,SAAS,CAAC;IACpD,OAAO,IAAA,0BAAW,EAAC,MAAM,CAAC,CAAC;AAC7B,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LTS, BisimulationResult } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Particiona el LTS según bisimulación fuerte usando Paige-Tarjan.
|
|
4
|
+
* Devuelve la partición canónica donde dos estados están en el mismo bloque
|
|
5
|
+
* sii son fuertemente bisimilares.
|
|
6
|
+
*/
|
|
7
|
+
export declare function paigeTarjan(lts: LTS): BisimulationResult;
|
|
8
|
+
//# sourceMappingURL=paige-tarjan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paige-tarjan.d.ts","sourceRoot":"","sources":["../../../src/runtime/bisimulation/paige-tarjan.ts"],"names":[],"mappings":"AAoBA,OAAO,KAAK,EAAE,GAAG,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAyEvD;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,kBAAkB,CA+GxD"}
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// Paige-Tarjan — partition refinement para bisimulación fuerte.
|
|
4
|
+
// ============================================================
|
|
5
|
+
// Complejidad O(m log n) sobre LTS finitos, donde m = |→| y n = |S|.
|
|
6
|
+
//
|
|
7
|
+
// Idea:
|
|
8
|
+
// - Comienza con la partición coarsest compatible con el labelling.
|
|
9
|
+
// - Mantiene una cola de "splitters" (B, a): bloque B y acción a.
|
|
10
|
+
// - Para cada splitter, particiona cada bloque X en
|
|
11
|
+
// X₁ = { s ∈ X | ∃ s -a-> t, t ∈ B }
|
|
12
|
+
// X₂ = X \ X₁
|
|
13
|
+
// y si ambos son no vacíos, reemplaza X y agrega el bloque más pequeño
|
|
14
|
+
// como nuevo splitter (heurística que da el factor log n).
|
|
15
|
+
// - Termina cuando no quedan splitters útiles.
|
|
16
|
+
//
|
|
17
|
+
// La implementación usa un Map de aristas inversas por acción
|
|
18
|
+
// inversa[a][to] = { from : ∃ from -a-> to }
|
|
19
|
+
// para que el split sea proporcional a |a-predecessors|.
|
|
20
|
+
// ============================================================
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
exports.paigeTarjan = paigeTarjan;
|
|
23
|
+
function canonicalLabel(labels) {
|
|
24
|
+
if (!labels || labels.size === 0)
|
|
25
|
+
return '∅';
|
|
26
|
+
return [...labels].sort().join('|');
|
|
27
|
+
}
|
|
28
|
+
function compile(lts) {
|
|
29
|
+
const stateSet = new Set(lts.states);
|
|
30
|
+
const actionSet = new Set();
|
|
31
|
+
const inverse = new Map();
|
|
32
|
+
for (const [from, action, to] of lts.transitions) {
|
|
33
|
+
if (!stateSet.has(from)) {
|
|
34
|
+
throw new Error(`Bisimulation: transición desde estado desconocido "${from}"`);
|
|
35
|
+
}
|
|
36
|
+
if (!stateSet.has(to)) {
|
|
37
|
+
throw new Error(`Bisimulation: transición hacia estado desconocido "${to}"`);
|
|
38
|
+
}
|
|
39
|
+
actionSet.add(action);
|
|
40
|
+
let invA = inverse.get(action);
|
|
41
|
+
if (!invA) {
|
|
42
|
+
invA = new Map();
|
|
43
|
+
inverse.set(action, invA);
|
|
44
|
+
}
|
|
45
|
+
let bucket = invA.get(to);
|
|
46
|
+
if (!bucket) {
|
|
47
|
+
bucket = new Set();
|
|
48
|
+
invA.set(to, bucket);
|
|
49
|
+
}
|
|
50
|
+
bucket.add(from);
|
|
51
|
+
}
|
|
52
|
+
const labelKey = new Map();
|
|
53
|
+
for (const s of lts.states) {
|
|
54
|
+
labelKey.set(s, canonicalLabel(lts.labelling?.[s]));
|
|
55
|
+
}
|
|
56
|
+
return {
|
|
57
|
+
states: [...lts.states],
|
|
58
|
+
actions: [...actionSet],
|
|
59
|
+
inverse,
|
|
60
|
+
labelKey,
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Calcula los `a-predecessors` de un conjunto target:
|
|
65
|
+
* pre_a(B) = { s | ∃ s -a-> t, t ∈ B }
|
|
66
|
+
*/
|
|
67
|
+
function preimage(compiled, action, target) {
|
|
68
|
+
const out = new Set();
|
|
69
|
+
const invA = compiled.inverse.get(action);
|
|
70
|
+
if (!invA)
|
|
71
|
+
return out;
|
|
72
|
+
for (const to of target) {
|
|
73
|
+
const froms = invA.get(to);
|
|
74
|
+
if (!froms)
|
|
75
|
+
continue;
|
|
76
|
+
for (const f of froms)
|
|
77
|
+
out.add(f);
|
|
78
|
+
}
|
|
79
|
+
return out;
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Particiona el LTS según bisimulación fuerte usando Paige-Tarjan.
|
|
83
|
+
* Devuelve la partición canónica donde dos estados están en el mismo bloque
|
|
84
|
+
* sii son fuertemente bisimilares.
|
|
85
|
+
*/
|
|
86
|
+
function paigeTarjan(lts) {
|
|
87
|
+
const compiled = compile(lts);
|
|
88
|
+
// Partición inicial por labelling (refinement compatible con la condición 1).
|
|
89
|
+
const byLabel = new Map();
|
|
90
|
+
for (const s of compiled.states) {
|
|
91
|
+
const k = compiled.labelKey.get(s) ?? '∅';
|
|
92
|
+
let g = byLabel.get(k);
|
|
93
|
+
if (!g) {
|
|
94
|
+
g = new Set();
|
|
95
|
+
byLabel.set(k, g);
|
|
96
|
+
}
|
|
97
|
+
g.add(s);
|
|
98
|
+
}
|
|
99
|
+
const blocks = [];
|
|
100
|
+
const blockOf = new Map();
|
|
101
|
+
for (const members of byLabel.values()) {
|
|
102
|
+
const id = blocks.length;
|
|
103
|
+
blocks.push({ id, members });
|
|
104
|
+
for (const s of members)
|
|
105
|
+
blockOf.set(s, id);
|
|
106
|
+
}
|
|
107
|
+
// Cola de splitters: pares (blockId, action). Usamos una clave canónica para
|
|
108
|
+
// evitar inserciones duplicadas en la cola.
|
|
109
|
+
const pending = [];
|
|
110
|
+
const pendingKey = new Set();
|
|
111
|
+
const enqueue = (bid, a) => {
|
|
112
|
+
const k = `${bid}|${a}`;
|
|
113
|
+
if (pendingKey.has(k))
|
|
114
|
+
return;
|
|
115
|
+
pendingKey.add(k);
|
|
116
|
+
pending.push([bid, a]);
|
|
117
|
+
};
|
|
118
|
+
// Sembrar la cola con todos los pares (bloque inicial, acción).
|
|
119
|
+
for (const b of blocks) {
|
|
120
|
+
for (const a of compiled.actions)
|
|
121
|
+
enqueue(b.id, a);
|
|
122
|
+
}
|
|
123
|
+
let iterations = 0;
|
|
124
|
+
const maxIter = compiled.states.length * compiled.actions.length * 4 + 16;
|
|
125
|
+
while (pending.length > 0) {
|
|
126
|
+
if (iterations++ > maxIter) {
|
|
127
|
+
// Cinturón de seguridad; Paige-Tarjan termina en O(m log n).
|
|
128
|
+
break;
|
|
129
|
+
}
|
|
130
|
+
const head = pending.shift();
|
|
131
|
+
if (!head)
|
|
132
|
+
break;
|
|
133
|
+
const [splitterId, action] = head;
|
|
134
|
+
pendingKey.delete(`${splitterId}|${action}`);
|
|
135
|
+
const splitter = blocks[splitterId];
|
|
136
|
+
if (!splitter)
|
|
137
|
+
continue;
|
|
138
|
+
// pre_action(splitter.members) — estados que pueden alcanzar el splitter
|
|
139
|
+
// vía la acción dada.
|
|
140
|
+
const pre = preimage(compiled, action, splitter.members);
|
|
141
|
+
if (pre.size === 0)
|
|
142
|
+
continue;
|
|
143
|
+
// Agrupar los preimage por bloque actual (para saber qué bloques tocan).
|
|
144
|
+
const touched = new Map();
|
|
145
|
+
for (const s of pre) {
|
|
146
|
+
const bid = blockOf.get(s);
|
|
147
|
+
if (bid === undefined)
|
|
148
|
+
continue;
|
|
149
|
+
let bucket = touched.get(bid);
|
|
150
|
+
if (!bucket) {
|
|
151
|
+
bucket = new Set();
|
|
152
|
+
touched.set(bid, bucket);
|
|
153
|
+
}
|
|
154
|
+
bucket.add(s);
|
|
155
|
+
}
|
|
156
|
+
for (const [bid, inPre] of touched) {
|
|
157
|
+
const block = blocks[bid];
|
|
158
|
+
if (!block)
|
|
159
|
+
continue;
|
|
160
|
+
if (inPre.size === block.members.size)
|
|
161
|
+
continue; // splitter no separa este bloque.
|
|
162
|
+
// Particionar block en (block ∩ pre, block \ pre).
|
|
163
|
+
const outside = new Set();
|
|
164
|
+
for (const s of block.members) {
|
|
165
|
+
if (!inPre.has(s))
|
|
166
|
+
outside.add(s);
|
|
167
|
+
}
|
|
168
|
+
// Nuevo bloque para `outside`; `block` se queda con `inPre`.
|
|
169
|
+
const newId = blocks.length;
|
|
170
|
+
blocks.push({ id: newId, members: outside });
|
|
171
|
+
block.members = inPre;
|
|
172
|
+
for (const s of outside)
|
|
173
|
+
blockOf.set(s, newId);
|
|
174
|
+
// Heurística Paige-Tarjan: encolar el bloque más pequeño como splitter.
|
|
175
|
+
// El más grande "hereda" su antiguo rol en cola sin necesidad de reencolar.
|
|
176
|
+
const smaller = block.members.size <= outside.size ? block.id : newId;
|
|
177
|
+
for (const a of compiled.actions)
|
|
178
|
+
enqueue(smaller, a);
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
// Compactar: filtrar bloques no vacíos y renumerar.
|
|
182
|
+
const finalBlocks = [];
|
|
183
|
+
const partition = new Map();
|
|
184
|
+
for (const b of blocks) {
|
|
185
|
+
if (b.members.size === 0)
|
|
186
|
+
continue;
|
|
187
|
+
const idx = finalBlocks.length;
|
|
188
|
+
finalBlocks.push([...b.members]);
|
|
189
|
+
for (const s of b.members)
|
|
190
|
+
partition.set(s, idx);
|
|
191
|
+
}
|
|
192
|
+
return {
|
|
193
|
+
partition,
|
|
194
|
+
blocks: finalBlocks,
|
|
195
|
+
numBlocks: finalBlocks.length,
|
|
196
|
+
iterations,
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
//# sourceMappingURL=paige-tarjan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"paige-tarjan.js","sourceRoot":"","sources":["../../../src/runtime/bisimulation/paige-tarjan.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,gEAAgE;AAChE,+DAA+D;AAC/D,qEAAqE;AACrE,EAAE;AACF,QAAQ;AACR,sEAAsE;AACtE,oEAAoE;AACpE,sDAAsD;AACtD,4CAA4C;AAC5C,qBAAqB;AACrB,2EAA2E;AAC3E,+DAA+D;AAC/D,iDAAiD;AACjD,EAAE;AACF,8DAA8D;AAC9D,+CAA+C;AAC/C,yDAAyD;AACzD,+DAA+D;;AAgF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YACtE,KAAK,MAAM,CAAC,IAAI,QAAQ,CAAC,OAAO;gBAAE,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,oDAAoD;IACpD,MAAM,WAAW,GAAe,EAAE,CAAC;IACnC,MAAM,SAAS,GAAG,IAAI,GAAG,EAAkB,CAAC;IAC5C,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE,CAAC;QACvB,IAAI,CAAC,CAAC,OAAO,CAAC,IAAI,KAAK,CAAC;YAAE,SAAS;QACnC,MAAM,GAAG,GAAG,WAAW,CAAC,MAAM,CAAC;QAC/B,WAAW,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QACjC,KAAK,MAAM,CAAC,IAAI,CAAC,CAAC,OAAO;YAAE,SAAS,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;IACnD,CAAC;IAED,OAAO;QACL,SAAS;QACT,MAAM,EAAE,WAAW;QACnB,SAAS,EAAE,WAAW,CAAC,MAAM;QAC7B,UAAU;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sistema de transiciones etiquetadas.
|
|
3
|
+
* - `states` lista finita de identificadores de estado.
|
|
4
|
+
* - `transitions` triplas [from, action, to] que codifican →.
|
|
5
|
+
* - `labelling` opcional: estado → conjunto de proposiciones atómicas que
|
|
6
|
+
* se cumplen en él. Estados ausentes se tratan como ∅.
|
|
7
|
+
*/
|
|
8
|
+
export interface LTS {
|
|
9
|
+
states: string[];
|
|
10
|
+
transitions: Array<[string, string, string]>;
|
|
11
|
+
labelling?: Record<string, Set<string>>;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Resultado de un algoritmo de partition refinement.
|
|
15
|
+
* - `partition` estado → índice de bloque.
|
|
16
|
+
* - `blocks` bloques como listas de estados (índice consistente con partition).
|
|
17
|
+
* - `numBlocks` cardinalidad de la partición final.
|
|
18
|
+
* - `iterations` número de iteraciones de refinamiento ejecutadas.
|
|
19
|
+
*/
|
|
20
|
+
export interface BisimulationResult {
|
|
21
|
+
partition: Map<string, number>;
|
|
22
|
+
blocks: string[][];
|
|
23
|
+
numBlocks: number;
|
|
24
|
+
iterations: number;
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/runtime/bisimulation/types.ts"],"names":[],"mappings":"AAoBA;;;;;;GAMG;AACH,MAAM,WAAW,GAAG;IAClB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,WAAW,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IAC7C,SAAS,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC,CAAC;CACzC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC/B,MAAM,EAAE,MAAM,EAAE,EAAE,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,CAAC;CACpB"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// ============================================================
|
|
3
|
+
// Bisimulation — tipos públicos
|
|
4
|
+
// ============================================================
|
|
5
|
+
// Sistema de Transiciones Etiquetadas (LTS, Labelled Transition System):
|
|
6
|
+
// M = (S, Act, →, L)
|
|
7
|
+
// S conjunto finito de estados
|
|
8
|
+
// Act alfabeto de acciones
|
|
9
|
+
// → relación de transición ⊆ S × Act × S
|
|
10
|
+
// L función de etiquetado opcional S → 2^AP (proposiciones atómicas)
|
|
11
|
+
//
|
|
12
|
+
// La bisimulación fuerte ~ es la mayor relación R ⊆ S × S tal que (s, t) ∈ R
|
|
13
|
+
// implica:
|
|
14
|
+
// 1. L(s) = L(t) (mismas etiquetas)
|
|
15
|
+
// 2. ∀ s -a-> s'. ∃ t'. t -a-> t' ∧ (s', t') ∈ R (forward simulation)
|
|
16
|
+
// 3. ∀ t -a-> t'. ∃ s'. s -a-> s' ∧ (s', t') ∈ R (backward simulation)
|
|
17
|
+
//
|
|
18
|
+
// La bisimulación débil ignora τ-transiciones internas y compara cadenas
|
|
19
|
+
// s ⇒ s' ≡ s -τ*-> ·-a-> ·-τ*-> s'
|
|
20
|
+
// ============================================================
|
|
21
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
22
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/runtime/bisimulation/types.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,gCAAgC;AAChC,+DAA+D;AAC/D,yEAAyE;AACzE,uBAAuB;AACvB,yCAAyC;AACzC,mCAAmC;AACnC,mDAAmD;AACnD,+EAA+E;AAC/E,EAAE;AACF,6EAA6E;AAC7E,WAAW;AACX,iFAAiF;AACjF,mFAAmF;AACnF,oFAAoF;AACpF,EAAE;AACF,yEAAyE;AACzE,qCAAqC;AACrC,+DAA+D"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { CSP } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Aplica AC-3 sobre una copia de los dominios del CSP.
|
|
4
|
+
* Devuelve { consistent, reducedDomains }: si `consistent` es false,
|
|
5
|
+
* el CSP es UNSAT por consistencia de arco (algún dominio quedó vacío).
|
|
6
|
+
*
|
|
7
|
+
* La firma deja los dominios originales intactos: el caller decide si
|
|
8
|
+
* adoptar `reducedDomains` o conservar los originales.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ac3<V, D>(csp: CSP<V, D>): {
|
|
11
|
+
consistent: boolean;
|
|
12
|
+
reducedDomains: Map<V, D[]>;
|
|
13
|
+
};
|
|
14
|
+
/**
|
|
15
|
+
* Helper público para uso en backtracking incremental: aplica AC-3
|
|
16
|
+
* sobre un set de dominios ya provisto (mutación in-place permitida)
|
|
17
|
+
* y devuelve `true` si los dominios siguen consistentes.
|
|
18
|
+
*/
|
|
19
|
+
export declare function ac3InPlace<V, D>(csp: CSP<V, D>, domains: Map<V, D[]>): boolean;
|
|
20
|
+
//# sourceMappingURL=ac3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ac3.d.ts","sourceRoot":"","sources":["../../../src/runtime/csp/ac3.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,GAAG,EAAc,MAAM,SAAS,CAAC;AA8D/C;;;;;;;GAOG;AACH,wBAAgB,GAAG,CAAC,CAAC,EAAE,CAAC,EACtB,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,GACb;IACD,UAAU,EAAE,OAAO,CAAC;IACpB,cAAc,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;CAC7B,CAqCA;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,GAAG,OAAO,CA2B9E"}
|