@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.
Files changed (553) hide show
  1. package/dist/belief-revision/agm.d.ts +76 -0
  2. package/dist/belief-revision/agm.d.ts.map +1 -0
  3. package/dist/belief-revision/agm.js +249 -0
  4. package/dist/belief-revision/agm.js.map +1 -0
  5. package/dist/belief-revision/index.d.ts +6 -0
  6. package/dist/belief-revision/index.d.ts.map +1 -0
  7. package/dist/belief-revision/index.js +33 -0
  8. package/dist/belief-revision/index.js.map +1 -0
  9. package/dist/belief-revision/parser.d.ts +16 -0
  10. package/dist/belief-revision/parser.d.ts.map +1 -0
  11. package/dist/belief-revision/parser.js +199 -0
  12. package/dist/belief-revision/parser.js.map +1 -0
  13. package/dist/belief-revision/sat.d.ts +19 -0
  14. package/dist/belief-revision/sat.d.ts.map +1 -0
  15. package/dist/belief-revision/sat.js +90 -0
  16. package/dist/belief-revision/sat.js.map +1 -0
  17. package/dist/belief-revision/types.d.ts +51 -0
  18. package/dist/belief-revision/types.d.ts.map +1 -0
  19. package/dist/belief-revision/types.js +10 -0
  20. package/dist/belief-revision/types.js.map +1 -0
  21. package/dist/curry-howard/index.d.ts +7 -0
  22. package/dist/curry-howard/index.d.ts.map +1 -0
  23. package/dist/curry-howard/index.js +46 -0
  24. package/dist/curry-howard/index.js.map +1 -0
  25. package/dist/curry-howard/infer.d.ts +9 -0
  26. package/dist/curry-howard/infer.d.ts.map +1 -0
  27. package/dist/curry-howard/infer.js +129 -0
  28. package/dist/curry-howard/infer.js.map +1 -0
  29. package/dist/curry-howard/proof.d.ts +7 -0
  30. package/dist/curry-howard/proof.d.ts.map +1 -0
  31. package/dist/curry-howard/proof.js +282 -0
  32. package/dist/curry-howard/proof.js.map +1 -0
  33. package/dist/curry-howard/reduce.d.ts +7 -0
  34. package/dist/curry-howard/reduce.d.ts.map +1 -0
  35. package/dist/curry-howard/reduce.js +266 -0
  36. package/dist/curry-howard/reduce.js.map +1 -0
  37. package/dist/curry-howard/types.d.ts +91 -0
  38. package/dist/curry-howard/types.d.ts.map +1 -0
  39. package/dist/curry-howard/types.js +149 -0
  40. package/dist/curry-howard/types.js.map +1 -0
  41. package/dist/fol-prover-equality/demodulate.d.ts +29 -0
  42. package/dist/fol-prover-equality/demodulate.d.ts.map +1 -0
  43. package/dist/fol-prover-equality/demodulate.js +197 -0
  44. package/dist/fol-prover-equality/demodulate.js.map +1 -0
  45. package/dist/fol-prover-equality/index.d.ts +8 -0
  46. package/dist/fol-prover-equality/index.d.ts.map +1 -0
  47. package/dist/fol-prover-equality/index.js +24 -0
  48. package/dist/fol-prover-equality/index.js.map +1 -0
  49. package/dist/fol-prover-equality/paramodulate.d.ts +46 -0
  50. package/dist/fol-prover-equality/paramodulate.d.ts.map +1 -0
  51. package/dist/fol-prover-equality/paramodulate.js +159 -0
  52. package/dist/fol-prover-equality/paramodulate.js.map +1 -0
  53. package/dist/fol-prover-equality/prove.d.ts +7 -0
  54. package/dist/fol-prover-equality/prove.d.ts.map +1 -0
  55. package/dist/fol-prover-equality/prove.js +307 -0
  56. package/dist/fol-prover-equality/prove.js.map +1 -0
  57. package/dist/fol-prover-equality/term-utils.d.ts +43 -0
  58. package/dist/fol-prover-equality/term-utils.d.ts.map +1 -0
  59. package/dist/fol-prover-equality/term-utils.js +230 -0
  60. package/dist/fol-prover-equality/term-utils.js.map +1 -0
  61. package/dist/fol-prover-equality/types.d.ts +20 -0
  62. package/dist/fol-prover-equality/types.d.ts.map +1 -0
  63. package/dist/fol-prover-equality/types.js +5 -0
  64. package/dist/fol-prover-equality/types.js.map +1 -0
  65. package/dist/index.d.ts +8 -0
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +53 -1
  68. package/dist/index.js.map +1 -1
  69. package/dist/lambda-calc/church.d.ts +8 -0
  70. package/dist/lambda-calc/church.d.ts.map +1 -0
  71. package/dist/lambda-calc/church.js +67 -0
  72. package/dist/lambda-calc/church.js.map +1 -0
  73. package/dist/lambda-calc/combinators.d.ts +8 -0
  74. package/dist/lambda-calc/combinators.d.ts.map +1 -0
  75. package/dist/lambda-calc/combinators.js +24 -0
  76. package/dist/lambda-calc/combinators.js.map +1 -0
  77. package/dist/lambda-calc/index.d.ts +8 -0
  78. package/dist/lambda-calc/index.d.ts.map +1 -0
  79. package/dist/lambda-calc/index.js +48 -0
  80. package/dist/lambda-calc/index.js.map +1 -0
  81. package/dist/lambda-calc/reduce.d.ts +18 -0
  82. package/dist/lambda-calc/reduce.d.ts.map +1 -0
  83. package/dist/lambda-calc/reduce.js +174 -0
  84. package/dist/lambda-calc/reduce.js.map +1 -0
  85. package/dist/lambda-calc/substitution.d.ts +6 -0
  86. package/dist/lambda-calc/substitution.d.ts.map +1 -0
  87. package/dist/lambda-calc/substitution.js +120 -0
  88. package/dist/lambda-calc/substitution.js.map +1 -0
  89. package/dist/lambda-calc/types.d.ts +19 -0
  90. package/dist/lambda-calc/types.d.ts.map +1 -0
  91. package/dist/lambda-calc/types.js +72 -0
  92. package/dist/lambda-calc/types.js.map +1 -0
  93. package/dist/profiles/ctl/check.d.ts +13 -0
  94. package/dist/profiles/ctl/check.d.ts.map +1 -0
  95. package/dist/profiles/ctl/check.js +359 -0
  96. package/dist/profiles/ctl/check.js.map +1 -0
  97. package/dist/profiles/ctl/index.d.ts +5 -0
  98. package/dist/profiles/ctl/index.d.ts.map +1 -0
  99. package/dist/profiles/ctl/index.js +23 -0
  100. package/dist/profiles/ctl/index.js.map +1 -0
  101. package/dist/profiles/ctl/types.d.ts +74 -0
  102. package/dist/profiles/ctl/types.d.ts.map +1 -0
  103. package/dist/profiles/ctl/types.js +53 -0
  104. package/dist/profiles/ctl/types.js.map +1 -0
  105. package/dist/profiles/ctl/witness.d.ts +20 -0
  106. package/dist/profiles/ctl/witness.d.ts.map +1 -0
  107. package/dist/profiles/ctl/witness.js +149 -0
  108. package/dist/profiles/ctl/witness.js.map +1 -0
  109. package/dist/profiles/default-logic/entailment.d.ts +14 -0
  110. package/dist/profiles/default-logic/entailment.d.ts.map +1 -0
  111. package/dist/profiles/default-logic/entailment.js +36 -0
  112. package/dist/profiles/default-logic/entailment.js.map +1 -0
  113. package/dist/profiles/default-logic/extensions.d.ts +35 -0
  114. package/dist/profiles/default-logic/extensions.d.ts.map +1 -0
  115. package/dist/profiles/default-logic/extensions.js +276 -0
  116. package/dist/profiles/default-logic/extensions.js.map +1 -0
  117. package/dist/profiles/default-logic/index.d.ts +5 -0
  118. package/dist/profiles/default-logic/index.d.ts.map +1 -0
  119. package/dist/profiles/default-logic/index.js +33 -0
  120. package/dist/profiles/default-logic/index.js.map +1 -0
  121. package/dist/profiles/default-logic/types.d.ts +29 -0
  122. package/dist/profiles/default-logic/types.d.ts.map +1 -0
  123. package/dist/profiles/default-logic/types.js +25 -0
  124. package/dist/profiles/default-logic/types.js.map +1 -0
  125. package/dist/profiles/description-logic/index.d.ts +5 -0
  126. package/dist/profiles/description-logic/index.d.ts.map +1 -0
  127. package/dist/profiles/description-logic/index.js +39 -0
  128. package/dist/profiles/description-logic/index.js.map +1 -0
  129. package/dist/profiles/description-logic/nnf.d.ts +13 -0
  130. package/dist/profiles/description-logic/nnf.d.ts.map +1 -0
  131. package/dist/profiles/description-logic/nnf.js +123 -0
  132. package/dist/profiles/description-logic/nnf.js.map +1 -0
  133. package/dist/profiles/description-logic/tableau.d.ts +27 -0
  134. package/dist/profiles/description-logic/tableau.d.ts.map +1 -0
  135. package/dist/profiles/description-logic/tableau.js +491 -0
  136. package/dist/profiles/description-logic/tableau.js.map +1 -0
  137. package/dist/profiles/description-logic/types.d.ts +45 -0
  138. package/dist/profiles/description-logic/types.d.ts.map +1 -0
  139. package/dist/profiles/description-logic/types.js +71 -0
  140. package/dist/profiles/description-logic/types.js.map +1 -0
  141. package/dist/profiles/hybrid-logic/index.d.ts +5 -0
  142. package/dist/profiles/hybrid-logic/index.d.ts.map +1 -0
  143. package/dist/profiles/hybrid-logic/index.js +34 -0
  144. package/dist/profiles/hybrid-logic/index.js.map +1 -0
  145. package/dist/profiles/hybrid-logic/sat.d.ts +15 -0
  146. package/dist/profiles/hybrid-logic/sat.d.ts.map +1 -0
  147. package/dist/profiles/hybrid-logic/sat.js +142 -0
  148. package/dist/profiles/hybrid-logic/sat.js.map +1 -0
  149. package/dist/profiles/hybrid-logic/semantics.d.ts +20 -0
  150. package/dist/profiles/hybrid-logic/semantics.d.ts.map +1 -0
  151. package/dist/profiles/hybrid-logic/semantics.js +107 -0
  152. package/dist/profiles/hybrid-logic/semantics.js.map +1 -0
  153. package/dist/profiles/hybrid-logic/types.d.ts +78 -0
  154. package/dist/profiles/hybrid-logic/types.d.ts.map +1 -0
  155. package/dist/profiles/hybrid-logic/types.js +107 -0
  156. package/dist/profiles/hybrid-logic/types.js.map +1 -0
  157. package/dist/profiles/intuitionistic-nj/formula.d.ts +19 -0
  158. package/dist/profiles/intuitionistic-nj/formula.d.ts.map +1 -0
  159. package/dist/profiles/intuitionistic-nj/formula.js +99 -0
  160. package/dist/profiles/intuitionistic-nj/formula.js.map +1 -0
  161. package/dist/profiles/intuitionistic-nj/index.d.ts +5 -0
  162. package/dist/profiles/intuitionistic-nj/index.d.ts.map +1 -0
  163. package/dist/profiles/intuitionistic-nj/index.js +24 -0
  164. package/dist/profiles/intuitionistic-nj/index.js.map +1 -0
  165. package/dist/profiles/intuitionistic-nj/kripke.d.ts +17 -0
  166. package/dist/profiles/intuitionistic-nj/kripke.d.ts.map +1 -0
  167. package/dist/profiles/intuitionistic-nj/kripke.js +206 -0
  168. package/dist/profiles/intuitionistic-nj/kripke.js.map +1 -0
  169. package/dist/profiles/intuitionistic-nj/prover.d.ts +13 -0
  170. package/dist/profiles/intuitionistic-nj/prover.d.ts.map +1 -0
  171. package/dist/profiles/intuitionistic-nj/prover.js +418 -0
  172. package/dist/profiles/intuitionistic-nj/prover.js.map +1 -0
  173. package/dist/profiles/intuitionistic-nj/types.d.ts +55 -0
  174. package/dist/profiles/intuitionistic-nj/types.d.ts.map +1 -0
  175. package/dist/profiles/intuitionistic-nj/types.js +21 -0
  176. package/dist/profiles/intuitionistic-nj/types.js.map +1 -0
  177. package/dist/profiles/ltl-sat/index.d.ts +4 -0
  178. package/dist/profiles/ltl-sat/index.d.ts.map +1 -0
  179. package/dist/profiles/ltl-sat/index.js +40 -0
  180. package/dist/profiles/ltl-sat/index.js.map +1 -0
  181. package/dist/profiles/ltl-sat/sat.d.ts +8 -0
  182. package/dist/profiles/ltl-sat/sat.d.ts.map +1 -0
  183. package/dist/profiles/ltl-sat/sat.js +140 -0
  184. package/dist/profiles/ltl-sat/sat.js.map +1 -0
  185. package/dist/profiles/ltl-sat/tableau.d.ts +19 -0
  186. package/dist/profiles/ltl-sat/tableau.d.ts.map +1 -0
  187. package/dist/profiles/ltl-sat/tableau.js +358 -0
  188. package/dist/profiles/ltl-sat/tableau.js.map +1 -0
  189. package/dist/profiles/ltl-sat/types.d.ts +52 -0
  190. package/dist/profiles/ltl-sat/types.d.ts.map +1 -0
  191. package/dist/profiles/ltl-sat/types.js +101 -0
  192. package/dist/profiles/ltl-sat/types.js.map +1 -0
  193. package/dist/profiles/many-valued/index.d.ts +39 -0
  194. package/dist/profiles/many-valued/index.d.ts.map +1 -0
  195. package/dist/profiles/many-valued/index.js +250 -0
  196. package/dist/profiles/many-valued/index.js.map +1 -0
  197. package/dist/profiles/modal-frame-axioms/formula.d.ts +23 -0
  198. package/dist/profiles/modal-frame-axioms/formula.d.ts.map +1 -0
  199. package/dist/profiles/modal-frame-axioms/formula.js +158 -0
  200. package/dist/profiles/modal-frame-axioms/formula.js.map +1 -0
  201. package/dist/profiles/modal-frame-axioms/index.d.ts +6 -0
  202. package/dist/profiles/modal-frame-axioms/index.d.ts.map +1 -0
  203. package/dist/profiles/modal-frame-axioms/index.js +41 -0
  204. package/dist/profiles/modal-frame-axioms/index.js.map +1 -0
  205. package/dist/profiles/modal-frame-axioms/systems.d.ts +29 -0
  206. package/dist/profiles/modal-frame-axioms/systems.d.ts.map +1 -0
  207. package/dist/profiles/modal-frame-axioms/systems.js +96 -0
  208. package/dist/profiles/modal-frame-axioms/systems.js.map +1 -0
  209. package/dist/profiles/modal-frame-axioms/tableau.d.ts +12 -0
  210. package/dist/profiles/modal-frame-axioms/tableau.d.ts.map +1 -0
  211. package/dist/profiles/modal-frame-axioms/tableau.js +299 -0
  212. package/dist/profiles/modal-frame-axioms/tableau.js.map +1 -0
  213. package/dist/profiles/modal-frame-axioms/types.d.ts +61 -0
  214. package/dist/profiles/modal-frame-axioms/types.d.ts.map +1 -0
  215. package/dist/profiles/modal-frame-axioms/types.js +27 -0
  216. package/dist/profiles/modal-frame-axioms/types.js.map +1 -0
  217. package/dist/profiles/sequent-g3/index.d.ts +5 -0
  218. package/dist/profiles/sequent-g3/index.d.ts.map +1 -0
  219. package/dist/profiles/sequent-g3/index.js +23 -0
  220. package/dist/profiles/sequent-g3/index.js.map +1 -0
  221. package/dist/profiles/sequent-g3/latex.d.ts +7 -0
  222. package/dist/profiles/sequent-g3/latex.d.ts.map +1 -0
  223. package/dist/profiles/sequent-g3/latex.js +107 -0
  224. package/dist/profiles/sequent-g3/latex.js.map +1 -0
  225. package/dist/profiles/sequent-g3/normalize.d.ts +15 -0
  226. package/dist/profiles/sequent-g3/normalize.d.ts.map +1 -0
  227. package/dist/profiles/sequent-g3/normalize.js +121 -0
  228. package/dist/profiles/sequent-g3/normalize.js.map +1 -0
  229. package/dist/profiles/sequent-g3/prover.d.ts +16 -0
  230. package/dist/profiles/sequent-g3/prover.d.ts.map +1 -0
  231. package/dist/profiles/sequent-g3/prover.js +348 -0
  232. package/dist/profiles/sequent-g3/prover.js.map +1 -0
  233. package/dist/profiles/sequent-g3/types.d.ts +30 -0
  234. package/dist/profiles/sequent-g3/types.d.ts.map +1 -0
  235. package/dist/profiles/sequent-g3/types.js +16 -0
  236. package/dist/profiles/sequent-g3/types.js.map +1 -0
  237. package/dist/profiles/substructural/index.d.ts +4 -0
  238. package/dist/profiles/substructural/index.d.ts.map +1 -0
  239. package/dist/profiles/substructural/index.js +22 -0
  240. package/dist/profiles/substructural/index.js.map +1 -0
  241. package/dist/profiles/substructural/prover.d.ts +13 -0
  242. package/dist/profiles/substructural/prover.d.ts.map +1 -0
  243. package/dist/profiles/substructural/prover.js +481 -0
  244. package/dist/profiles/substructural/prover.js.map +1 -0
  245. package/dist/profiles/substructural/types.d.ts +72 -0
  246. package/dist/profiles/substructural/types.d.ts.map +1 -0
  247. package/dist/profiles/substructural/types.js +27 -0
  248. package/dist/profiles/substructural/types.js.map +1 -0
  249. package/dist/runtime/abduction/entails.d.ts +21 -0
  250. package/dist/runtime/abduction/entails.d.ts.map +1 -0
  251. package/dist/runtime/abduction/entails.js +308 -0
  252. package/dist/runtime/abduction/entails.js.map +1 -0
  253. package/dist/runtime/abduction/find.d.ts +18 -0
  254. package/dist/runtime/abduction/find.d.ts.map +1 -0
  255. package/dist/runtime/abduction/find.js +202 -0
  256. package/dist/runtime/abduction/find.js.map +1 -0
  257. package/dist/runtime/abduction/index.d.ts +4 -0
  258. package/dist/runtime/abduction/index.d.ts.map +1 -0
  259. package/dist/runtime/abduction/index.js +26 -0
  260. package/dist/runtime/abduction/index.js.map +1 -0
  261. package/dist/runtime/abduction/types.d.ts +78 -0
  262. package/dist/runtime/abduction/types.d.ts.map +1 -0
  263. package/dist/runtime/abduction/types.js +23 -0
  264. package/dist/runtime/abduction/types.js.map +1 -0
  265. package/dist/runtime/bayesian/factor.d.ts +22 -0
  266. package/dist/runtime/bayesian/factor.d.ts.map +1 -0
  267. package/dist/runtime/bayesian/factor.js +249 -0
  268. package/dist/runtime/bayesian/factor.js.map +1 -0
  269. package/dist/runtime/bayesian/index.d.ts +3 -0
  270. package/dist/runtime/bayesian/index.d.ts.map +1 -0
  271. package/dist/runtime/bayesian/index.js +25 -0
  272. package/dist/runtime/bayesian/index.js.map +1 -0
  273. package/dist/runtime/bayesian/inference.d.ts +6 -0
  274. package/dist/runtime/bayesian/inference.d.ts.map +1 -0
  275. package/dist/runtime/bayesian/inference.js +260 -0
  276. package/dist/runtime/bayesian/inference.js.map +1 -0
  277. package/dist/runtime/bayesian/types.d.ts +19 -0
  278. package/dist/runtime/bayesian/types.d.ts.map +1 -0
  279. package/dist/runtime/bayesian/types.js +9 -0
  280. package/dist/runtime/bayesian/types.js.map +1 -0
  281. package/dist/runtime/bisimulation/index.d.ts +4 -0
  282. package/dist/runtime/bisimulation/index.d.ts.map +1 -0
  283. package/dist/runtime/bisimulation/index.js +21 -0
  284. package/dist/runtime/bisimulation/index.js.map +1 -0
  285. package/dist/runtime/bisimulation/operations.d.ts +40 -0
  286. package/dist/runtime/bisimulation/operations.d.ts.map +1 -0
  287. package/dist/runtime/bisimulation/operations.js +219 -0
  288. package/dist/runtime/bisimulation/operations.js.map +1 -0
  289. package/dist/runtime/bisimulation/paige-tarjan.d.ts +8 -0
  290. package/dist/runtime/bisimulation/paige-tarjan.d.ts.map +1 -0
  291. package/dist/runtime/bisimulation/paige-tarjan.js +199 -0
  292. package/dist/runtime/bisimulation/paige-tarjan.js.map +1 -0
  293. package/dist/runtime/bisimulation/types.d.ts +26 -0
  294. package/dist/runtime/bisimulation/types.d.ts.map +1 -0
  295. package/dist/runtime/bisimulation/types.js +22 -0
  296. package/dist/runtime/bisimulation/types.js.map +1 -0
  297. package/dist/runtime/countermodel-min/index.d.ts +3 -0
  298. package/dist/runtime/countermodel-min/index.d.ts.map +1 -0
  299. package/dist/runtime/countermodel-min/index.js +9 -0
  300. package/dist/runtime/countermodel-min/index.js.map +1 -0
  301. package/dist/runtime/countermodel-min/minimize.d.ts +17 -0
  302. package/dist/runtime/countermodel-min/minimize.d.ts.map +1 -0
  303. package/dist/runtime/countermodel-min/minimize.js +0 -0
  304. package/dist/runtime/countermodel-min/minimize.js.map +1 -0
  305. package/dist/runtime/countermodel-min/types.d.ts +40 -0
  306. package/dist/runtime/countermodel-min/types.d.ts.map +1 -0
  307. package/dist/runtime/countermodel-min/types.js +6 -0
  308. package/dist/runtime/countermodel-min/types.js.map +1 -0
  309. package/dist/runtime/fca/context.d.ts +46 -0
  310. package/dist/runtime/fca/context.d.ts.map +1 -0
  311. package/dist/runtime/fca/context.js +155 -0
  312. package/dist/runtime/fca/context.js.map +1 -0
  313. package/dist/runtime/fca/implications.d.ts +10 -0
  314. package/dist/runtime/fca/implications.d.ts.map +1 -0
  315. package/dist/runtime/fca/implications.js +33 -0
  316. package/dist/runtime/fca/implications.js.map +1 -0
  317. package/dist/runtime/fca/index.d.ts +6 -0
  318. package/dist/runtime/fca/index.d.ts.map +1 -0
  319. package/dist/runtime/fca/index.js +39 -0
  320. package/dist/runtime/fca/index.js.map +1 -0
  321. package/dist/runtime/fca/lattice.d.ts +10 -0
  322. package/dist/runtime/fca/lattice.d.ts.map +1 -0
  323. package/dist/runtime/fca/lattice.js +86 -0
  324. package/dist/runtime/fca/lattice.js.map +1 -0
  325. package/dist/runtime/fca/next-closure.d.ts +12 -0
  326. package/dist/runtime/fca/next-closure.d.ts.map +1 -0
  327. package/dist/runtime/fca/next-closure.js +99 -0
  328. package/dist/runtime/fca/next-closure.js.map +1 -0
  329. package/dist/runtime/fca/types.d.ts +31 -0
  330. package/dist/runtime/fca/types.d.ts.map +1 -0
  331. package/dist/runtime/fca/types.js +30 -0
  332. package/dist/runtime/fca/types.js.map +1 -0
  333. package/dist/runtime/mus/extract.d.ts +34 -0
  334. package/dist/runtime/mus/extract.d.ts.map +1 -0
  335. package/dist/runtime/mus/extract.js +243 -0
  336. package/dist/runtime/mus/extract.js.map +1 -0
  337. package/dist/runtime/mus/index.d.ts +4 -0
  338. package/dist/runtime/mus/index.d.ts.map +1 -0
  339. package/dist/runtime/mus/index.js +12 -0
  340. package/dist/runtime/mus/index.js.map +1 -0
  341. package/dist/runtime/mus/quickxplain.d.ts +10 -0
  342. package/dist/runtime/mus/quickxplain.d.ts.map +1 -0
  343. package/dist/runtime/mus/quickxplain.js +100 -0
  344. package/dist/runtime/mus/quickxplain.js.map +1 -0
  345. package/dist/runtime/mus/types.d.ts +59 -0
  346. package/dist/runtime/mus/types.d.ts.map +1 -0
  347. package/dist/runtime/mus/types.js +20 -0
  348. package/dist/runtime/mus/types.js.map +1 -0
  349. package/dist/runtime/proof-minify/index.d.ts +3 -0
  350. package/dist/runtime/proof-minify/index.d.ts.map +1 -0
  351. package/dist/runtime/proof-minify/index.js +13 -0
  352. package/dist/runtime/proof-minify/index.js.map +1 -0
  353. package/dist/runtime/proof-minify/minify.d.ts +13 -0
  354. package/dist/runtime/proof-minify/minify.d.ts.map +1 -0
  355. package/dist/runtime/proof-minify/minify.js +540 -0
  356. package/dist/runtime/proof-minify/minify.js.map +1 -0
  357. package/dist/runtime/proof-minify/types.d.ts +89 -0
  358. package/dist/runtime/proof-minify/types.d.ts.map +1 -0
  359. package/dist/runtime/proof-minify/types.js +16 -0
  360. package/dist/runtime/proof-minify/types.js.map +1 -0
  361. package/dist/runtime/symbolic-diff/constructors.d.ts +16 -0
  362. package/dist/runtime/symbolic-diff/constructors.d.ts.map +1 -0
  363. package/dist/runtime/symbolic-diff/constructors.js +75 -0
  364. package/dist/runtime/symbolic-diff/constructors.js.map +1 -0
  365. package/dist/runtime/symbolic-diff/differentiate.d.ts +22 -0
  366. package/dist/runtime/symbolic-diff/differentiate.d.ts.map +1 -0
  367. package/dist/runtime/symbolic-diff/differentiate.js +107 -0
  368. package/dist/runtime/symbolic-diff/differentiate.js.map +1 -0
  369. package/dist/runtime/symbolic-diff/evaluate.d.ts +3 -0
  370. package/dist/runtime/symbolic-diff/evaluate.d.ts.map +1 -0
  371. package/dist/runtime/symbolic-diff/evaluate.js +47 -0
  372. package/dist/runtime/symbolic-diff/evaluate.js.map +1 -0
  373. package/dist/runtime/symbolic-diff/index.d.ts +9 -0
  374. package/dist/runtime/symbolic-diff/index.d.ts.map +1 -0
  375. package/dist/runtime/symbolic-diff/index.js +34 -0
  376. package/dist/runtime/symbolic-diff/index.js.map +1 -0
  377. package/dist/runtime/symbolic-diff/parse.d.ts +16 -0
  378. package/dist/runtime/symbolic-diff/parse.d.ts.map +1 -0
  379. package/dist/runtime/symbolic-diff/parse.js +206 -0
  380. package/dist/runtime/symbolic-diff/parse.js.map +1 -0
  381. package/dist/runtime/symbolic-diff/simplify.d.ts +11 -0
  382. package/dist/runtime/symbolic-diff/simplify.d.ts.map +1 -0
  383. package/dist/runtime/symbolic-diff/simplify.js +214 -0
  384. package/dist/runtime/symbolic-diff/simplify.js.map +1 -0
  385. package/dist/runtime/symbolic-diff/stringify.d.ts +3 -0
  386. package/dist/runtime/symbolic-diff/stringify.d.ts.map +1 -0
  387. package/dist/runtime/symbolic-diff/stringify.js +69 -0
  388. package/dist/runtime/symbolic-diff/stringify.js.map +1 -0
  389. package/dist/runtime/symbolic-diff/types.d.ts +35 -0
  390. package/dist/runtime/symbolic-diff/types.d.ts.map +1 -0
  391. package/dist/runtime/symbolic-diff/types.js +9 -0
  392. package/dist/runtime/symbolic-diff/types.js.map +1 -0
  393. package/dist/runtime/term-rewriting/critical-pairs.d.ts +38 -0
  394. package/dist/runtime/term-rewriting/critical-pairs.d.ts.map +1 -0
  395. package/dist/runtime/term-rewriting/critical-pairs.js +109 -0
  396. package/dist/runtime/term-rewriting/critical-pairs.js.map +1 -0
  397. package/dist/runtime/term-rewriting/index.d.ts +9 -0
  398. package/dist/runtime/term-rewriting/index.d.ts.map +1 -0
  399. package/dist/runtime/term-rewriting/index.js +38 -0
  400. package/dist/runtime/term-rewriting/index.js.map +1 -0
  401. package/dist/runtime/term-rewriting/knuth-bendix.d.ts +29 -0
  402. package/dist/runtime/term-rewriting/knuth-bendix.d.ts.map +1 -0
  403. package/dist/runtime/term-rewriting/knuth-bendix.js +196 -0
  404. package/dist/runtime/term-rewriting/knuth-bendix.js.map +1 -0
  405. package/dist/runtime/term-rewriting/lpo.d.ts +17 -0
  406. package/dist/runtime/term-rewriting/lpo.d.ts.map +1 -0
  407. package/dist/runtime/term-rewriting/lpo.js +158 -0
  408. package/dist/runtime/term-rewriting/lpo.js.map +1 -0
  409. package/dist/runtime/term-rewriting/rewrite.d.ts +44 -0
  410. package/dist/runtime/term-rewriting/rewrite.d.ts.map +1 -0
  411. package/dist/runtime/term-rewriting/rewrite.js +189 -0
  412. package/dist/runtime/term-rewriting/rewrite.js.map +1 -0
  413. package/dist/runtime/term-rewriting/term-utils.d.ts +64 -0
  414. package/dist/runtime/term-rewriting/term-utils.d.ts.map +1 -0
  415. package/dist/runtime/term-rewriting/term-utils.js +360 -0
  416. package/dist/runtime/term-rewriting/term-utils.js.map +1 -0
  417. package/dist/runtime/term-rewriting/types.d.ts +66 -0
  418. package/dist/runtime/term-rewriting/types.d.ts.map +1 -0
  419. package/dist/runtime/term-rewriting/types.js +21 -0
  420. package/dist/runtime/term-rewriting/types.js.map +1 -0
  421. package/dist/solver/cdcl-v2-incremental/index.d.ts +3 -0
  422. package/dist/solver/cdcl-v2-incremental/index.d.ts.map +1 -0
  423. package/dist/solver/cdcl-v2-incremental/index.js +16 -0
  424. package/dist/solver/cdcl-v2-incremental/index.js.map +1 -0
  425. package/dist/solver/cdcl-v2-incremental/solver.d.ts +83 -0
  426. package/dist/solver/cdcl-v2-incremental/solver.d.ts.map +1 -0
  427. package/dist/solver/cdcl-v2-incremental/solver.js +727 -0
  428. package/dist/solver/cdcl-v2-incremental/solver.js.map +1 -0
  429. package/dist/solver/cdcl-v2-incremental/types.d.ts +47 -0
  430. package/dist/solver/cdcl-v2-incremental/types.d.ts.map +1 -0
  431. package/dist/solver/cdcl-v2-incremental/types.js +13 -0
  432. package/dist/solver/cdcl-v2-incremental/types.js.map +1 -0
  433. package/dist/tests/abduction/abduction.test.d.ts +2 -0
  434. package/dist/tests/abduction/abduction.test.d.ts.map +1 -0
  435. package/dist/tests/abduction/abduction.test.js +380 -0
  436. package/dist/tests/abduction/abduction.test.js.map +1 -0
  437. package/dist/tests/bayesian/bayesian.test.d.ts +2 -0
  438. package/dist/tests/bayesian/bayesian.test.d.ts.map +1 -0
  439. package/dist/tests/bayesian/bayesian.test.js +328 -0
  440. package/dist/tests/bayesian/bayesian.test.js.map +1 -0
  441. package/dist/tests/belief-revision/agm.test.d.ts +2 -0
  442. package/dist/tests/belief-revision/agm.test.d.ts.map +1 -0
  443. package/dist/tests/belief-revision/agm.test.js +173 -0
  444. package/dist/tests/belief-revision/agm.test.js.map +1 -0
  445. package/dist/tests/bisimulation/paige-tarjan.test.d.ts +2 -0
  446. package/dist/tests/bisimulation/paige-tarjan.test.d.ts.map +1 -0
  447. package/dist/tests/bisimulation/paige-tarjan.test.js +254 -0
  448. package/dist/tests/bisimulation/paige-tarjan.test.js.map +1 -0
  449. package/dist/tests/countermodel-min/minimize.test.d.ts +2 -0
  450. package/dist/tests/countermodel-min/minimize.test.d.ts.map +1 -0
  451. package/dist/tests/countermodel-min/minimize.test.js +241 -0
  452. package/dist/tests/countermodel-min/minimize.test.js.map +1 -0
  453. package/dist/tests/ctl/check.test.d.ts +2 -0
  454. package/dist/tests/ctl/check.test.d.ts.map +1 -0
  455. package/dist/tests/ctl/check.test.js +337 -0
  456. package/dist/tests/ctl/check.test.js.map +1 -0
  457. package/dist/tests/curry-howard/infer.test.d.ts +2 -0
  458. package/dist/tests/curry-howard/infer.test.d.ts.map +1 -0
  459. package/dist/tests/curry-howard/infer.test.js +93 -0
  460. package/dist/tests/curry-howard/infer.test.js.map +1 -0
  461. package/dist/tests/curry-howard/proof.test.d.ts +2 -0
  462. package/dist/tests/curry-howard/proof.test.d.ts.map +1 -0
  463. package/dist/tests/curry-howard/proof.test.js +105 -0
  464. package/dist/tests/curry-howard/proof.test.js.map +1 -0
  465. package/dist/tests/curry-howard/reduce.test.d.ts +2 -0
  466. package/dist/tests/curry-howard/reduce.test.d.ts.map +1 -0
  467. package/dist/tests/curry-howard/reduce.test.js +109 -0
  468. package/dist/tests/curry-howard/reduce.test.js.map +1 -0
  469. package/dist/tests/default-logic/extensions.test.d.ts +2 -0
  470. package/dist/tests/default-logic/extensions.test.d.ts.map +1 -0
  471. package/dist/tests/default-logic/extensions.test.js +323 -0
  472. package/dist/tests/default-logic/extensions.test.js.map +1 -0
  473. package/dist/tests/description-logic/alc.test.d.ts +2 -0
  474. package/dist/tests/description-logic/alc.test.d.ts.map +1 -0
  475. package/dist/tests/description-logic/alc.test.js +253 -0
  476. package/dist/tests/description-logic/alc.test.js.map +1 -0
  477. package/dist/tests/fca/fca.test.d.ts +2 -0
  478. package/dist/tests/fca/fca.test.d.ts.map +1 -0
  479. package/dist/tests/fca/fca.test.js +317 -0
  480. package/dist/tests/fca/fca.test.js.map +1 -0
  481. package/dist/tests/fol-prover-equality/prove.test.d.ts +2 -0
  482. package/dist/tests/fol-prover-equality/prove.test.d.ts.map +1 -0
  483. package/dist/tests/fol-prover-equality/prove.test.js +179 -0
  484. package/dist/tests/fol-prover-equality/prove.test.js.map +1 -0
  485. package/dist/tests/hybrid-logic/semantics.test.d.ts +2 -0
  486. package/dist/tests/hybrid-logic/semantics.test.d.ts.map +1 -0
  487. package/dist/tests/hybrid-logic/semantics.test.js +169 -0
  488. package/dist/tests/hybrid-logic/semantics.test.js.map +1 -0
  489. package/dist/tests/intuitionistic-nj/nj.test.d.ts +2 -0
  490. package/dist/tests/intuitionistic-nj/nj.test.d.ts.map +1 -0
  491. package/dist/tests/intuitionistic-nj/nj.test.js +216 -0
  492. package/dist/tests/intuitionistic-nj/nj.test.js.map +1 -0
  493. package/dist/tests/lambda-calc/lambda-calc.test.d.ts +2 -0
  494. package/dist/tests/lambda-calc/lambda-calc.test.d.ts.map +1 -0
  495. package/dist/tests/lambda-calc/lambda-calc.test.js +164 -0
  496. package/dist/tests/lambda-calc/lambda-calc.test.js.map +1 -0
  497. package/dist/tests/ltl-sat/sat.test.d.ts +2 -0
  498. package/dist/tests/ltl-sat/sat.test.d.ts.map +1 -0
  499. package/dist/tests/ltl-sat/sat.test.js +160 -0
  500. package/dist/tests/ltl-sat/sat.test.js.map +1 -0
  501. package/dist/tests/many-valued/many-valued.test.d.ts +2 -0
  502. package/dist/tests/many-valued/many-valued.test.d.ts.map +1 -0
  503. package/dist/tests/many-valued/many-valued.test.js +150 -0
  504. package/dist/tests/many-valued/many-valued.test.js.map +1 -0
  505. package/dist/tests/modal-frame-axioms/frame-axioms.test.d.ts +2 -0
  506. package/dist/tests/modal-frame-axioms/frame-axioms.test.d.ts.map +1 -0
  507. package/dist/tests/modal-frame-axioms/frame-axioms.test.js +236 -0
  508. package/dist/tests/modal-frame-axioms/frame-axioms.test.js.map +1 -0
  509. package/dist/tests/mus/extract.test.d.ts +2 -0
  510. package/dist/tests/mus/extract.test.d.ts.map +1 -0
  511. package/dist/tests/mus/extract.test.js +352 -0
  512. package/dist/tests/mus/extract.test.js.map +1 -0
  513. package/dist/tests/proof-minify/minify.test.d.ts +2 -0
  514. package/dist/tests/proof-minify/minify.test.d.ts.map +1 -0
  515. package/dist/tests/proof-minify/minify.test.js +281 -0
  516. package/dist/tests/proof-minify/minify.test.js.map +1 -0
  517. package/dist/tests/sat-v2-incremental/basic.test.d.ts +2 -0
  518. package/dist/tests/sat-v2-incremental/basic.test.d.ts.map +1 -0
  519. package/dist/tests/sat-v2-incremental/basic.test.js +352 -0
  520. package/dist/tests/sat-v2-incremental/basic.test.js.map +1 -0
  521. package/dist/tests/sequent-g3/prover.test.d.ts +2 -0
  522. package/dist/tests/sequent-g3/prover.test.d.ts.map +1 -0
  523. package/dist/tests/sequent-g3/prover.test.js +205 -0
  524. package/dist/tests/sequent-g3/prover.test.js.map +1 -0
  525. package/dist/tests/substructural/prover.test.d.ts +2 -0
  526. package/dist/tests/substructural/prover.test.d.ts.map +1 -0
  527. package/dist/tests/substructural/prover.test.js +271 -0
  528. package/dist/tests/substructural/prover.test.js.map +1 -0
  529. package/dist/tests/symbolic-diff/symbolic-diff.test.d.ts +2 -0
  530. package/dist/tests/symbolic-diff/symbolic-diff.test.d.ts.map +1 -0
  531. package/dist/tests/symbolic-diff/symbolic-diff.test.js +278 -0
  532. package/dist/tests/symbolic-diff/symbolic-diff.test.js.map +1 -0
  533. package/dist/tests/term-rewriting/critical-pairs.test.d.ts +2 -0
  534. package/dist/tests/term-rewriting/critical-pairs.test.d.ts.map +1 -0
  535. package/dist/tests/term-rewriting/critical-pairs.test.js +34 -0
  536. package/dist/tests/term-rewriting/critical-pairs.test.js.map +1 -0
  537. package/dist/tests/term-rewriting/knuth-bendix.test.d.ts +2 -0
  538. package/dist/tests/term-rewriting/knuth-bendix.test.d.ts.map +1 -0
  539. package/dist/tests/term-rewriting/knuth-bendix.test.js +94 -0
  540. package/dist/tests/term-rewriting/knuth-bendix.test.js.map +1 -0
  541. package/dist/tests/term-rewriting/lpo.test.d.ts +2 -0
  542. package/dist/tests/term-rewriting/lpo.test.d.ts.map +1 -0
  543. package/dist/tests/term-rewriting/lpo.test.js +57 -0
  544. package/dist/tests/term-rewriting/lpo.test.js.map +1 -0
  545. package/dist/tests/term-rewriting/rewrite.test.d.ts +2 -0
  546. package/dist/tests/term-rewriting/rewrite.test.d.ts.map +1 -0
  547. package/dist/tests/term-rewriting/rewrite.test.js +56 -0
  548. package/dist/tests/term-rewriting/rewrite.test.js.map +1 -0
  549. package/dist/tests/term-rewriting/term-utils.test.d.ts +2 -0
  550. package/dist/tests/term-rewriting/term-utils.test.d.ts.map +1 -0
  551. package/dist/tests/term-rewriting/term-utils.test.js +58 -0
  552. package/dist/tests/term-rewriting/term-utils.test.js.map +1 -0
  553. 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;IACh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@@
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,CAA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I,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;QACxE,KAAK,QAAQ,CAAC;QACd,KAAK,QAAQ;YACX,OAAO,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,QAAQ,IAAI,GAAG,IAAI,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;QAChG;YACE,6CAA6C;YAC7C,OAAO,GAAG,CAAC,CAAC,IAAI,IAAI,CAAC,CAAC,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;IACpE,CAAC;AACH,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { Formula } from '../../types';
2
+ import { Sequent, ProveResult } from './types';
3
+ /**
4
+ * 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