@stevenvo780/st-lang 4.0.1 → 4.2.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 (393) 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 +4 -0
  66. package/dist/index.d.ts.map +1 -1
  67. package/dist/index.js +18 -1
  68. package/dist/index.js.map +1 -1
  69. package/dist/profiles/ctl/check.d.ts +13 -0
  70. package/dist/profiles/ctl/check.d.ts.map +1 -0
  71. package/dist/profiles/ctl/check.js +359 -0
  72. package/dist/profiles/ctl/check.js.map +1 -0
  73. package/dist/profiles/ctl/index.d.ts +5 -0
  74. package/dist/profiles/ctl/index.d.ts.map +1 -0
  75. package/dist/profiles/ctl/index.js +23 -0
  76. package/dist/profiles/ctl/index.js.map +1 -0
  77. package/dist/profiles/ctl/types.d.ts +74 -0
  78. package/dist/profiles/ctl/types.d.ts.map +1 -0
  79. package/dist/profiles/ctl/types.js +53 -0
  80. package/dist/profiles/ctl/types.js.map +1 -0
  81. package/dist/profiles/ctl/witness.d.ts +20 -0
  82. package/dist/profiles/ctl/witness.d.ts.map +1 -0
  83. package/dist/profiles/ctl/witness.js +149 -0
  84. package/dist/profiles/ctl/witness.js.map +1 -0
  85. package/dist/profiles/default-logic/entailment.d.ts +14 -0
  86. package/dist/profiles/default-logic/entailment.d.ts.map +1 -0
  87. package/dist/profiles/default-logic/entailment.js +36 -0
  88. package/dist/profiles/default-logic/entailment.js.map +1 -0
  89. package/dist/profiles/default-logic/extensions.d.ts +35 -0
  90. package/dist/profiles/default-logic/extensions.d.ts.map +1 -0
  91. package/dist/profiles/default-logic/extensions.js +276 -0
  92. package/dist/profiles/default-logic/extensions.js.map +1 -0
  93. package/dist/profiles/default-logic/index.d.ts +5 -0
  94. package/dist/profiles/default-logic/index.d.ts.map +1 -0
  95. package/dist/profiles/default-logic/index.js +33 -0
  96. package/dist/profiles/default-logic/index.js.map +1 -0
  97. package/dist/profiles/default-logic/types.d.ts +29 -0
  98. package/dist/profiles/default-logic/types.d.ts.map +1 -0
  99. package/dist/profiles/default-logic/types.js +25 -0
  100. package/dist/profiles/default-logic/types.js.map +1 -0
  101. package/dist/profiles/description-logic/index.d.ts +5 -0
  102. package/dist/profiles/description-logic/index.d.ts.map +1 -0
  103. package/dist/profiles/description-logic/index.js +39 -0
  104. package/dist/profiles/description-logic/index.js.map +1 -0
  105. package/dist/profiles/description-logic/nnf.d.ts +13 -0
  106. package/dist/profiles/description-logic/nnf.d.ts.map +1 -0
  107. package/dist/profiles/description-logic/nnf.js +123 -0
  108. package/dist/profiles/description-logic/nnf.js.map +1 -0
  109. package/dist/profiles/description-logic/tableau.d.ts +27 -0
  110. package/dist/profiles/description-logic/tableau.d.ts.map +1 -0
  111. package/dist/profiles/description-logic/tableau.js +491 -0
  112. package/dist/profiles/description-logic/tableau.js.map +1 -0
  113. package/dist/profiles/description-logic/types.d.ts +45 -0
  114. package/dist/profiles/description-logic/types.d.ts.map +1 -0
  115. package/dist/profiles/description-logic/types.js +71 -0
  116. package/dist/profiles/description-logic/types.js.map +1 -0
  117. package/dist/profiles/hybrid-logic/index.d.ts +5 -0
  118. package/dist/profiles/hybrid-logic/index.d.ts.map +1 -0
  119. package/dist/profiles/hybrid-logic/index.js +34 -0
  120. package/dist/profiles/hybrid-logic/index.js.map +1 -0
  121. package/dist/profiles/hybrid-logic/sat.d.ts +15 -0
  122. package/dist/profiles/hybrid-logic/sat.d.ts.map +1 -0
  123. package/dist/profiles/hybrid-logic/sat.js +142 -0
  124. package/dist/profiles/hybrid-logic/sat.js.map +1 -0
  125. package/dist/profiles/hybrid-logic/semantics.d.ts +20 -0
  126. package/dist/profiles/hybrid-logic/semantics.d.ts.map +1 -0
  127. package/dist/profiles/hybrid-logic/semantics.js +107 -0
  128. package/dist/profiles/hybrid-logic/semantics.js.map +1 -0
  129. package/dist/profiles/hybrid-logic/types.d.ts +78 -0
  130. package/dist/profiles/hybrid-logic/types.d.ts.map +1 -0
  131. package/dist/profiles/hybrid-logic/types.js +107 -0
  132. package/dist/profiles/hybrid-logic/types.js.map +1 -0
  133. package/dist/profiles/ltl-sat/index.d.ts +4 -0
  134. package/dist/profiles/ltl-sat/index.d.ts.map +1 -0
  135. package/dist/profiles/ltl-sat/index.js +40 -0
  136. package/dist/profiles/ltl-sat/index.js.map +1 -0
  137. package/dist/profiles/ltl-sat/sat.d.ts +8 -0
  138. package/dist/profiles/ltl-sat/sat.d.ts.map +1 -0
  139. package/dist/profiles/ltl-sat/sat.js +140 -0
  140. package/dist/profiles/ltl-sat/sat.js.map +1 -0
  141. package/dist/profiles/ltl-sat/tableau.d.ts +19 -0
  142. package/dist/profiles/ltl-sat/tableau.d.ts.map +1 -0
  143. package/dist/profiles/ltl-sat/tableau.js +358 -0
  144. package/dist/profiles/ltl-sat/tableau.js.map +1 -0
  145. package/dist/profiles/ltl-sat/types.d.ts +52 -0
  146. package/dist/profiles/ltl-sat/types.d.ts.map +1 -0
  147. package/dist/profiles/ltl-sat/types.js +101 -0
  148. package/dist/profiles/ltl-sat/types.js.map +1 -0
  149. package/dist/profiles/sequent-g3/index.d.ts +5 -0
  150. package/dist/profiles/sequent-g3/index.d.ts.map +1 -0
  151. package/dist/profiles/sequent-g3/index.js +23 -0
  152. package/dist/profiles/sequent-g3/index.js.map +1 -0
  153. package/dist/profiles/sequent-g3/latex.d.ts +7 -0
  154. package/dist/profiles/sequent-g3/latex.d.ts.map +1 -0
  155. package/dist/profiles/sequent-g3/latex.js +107 -0
  156. package/dist/profiles/sequent-g3/latex.js.map +1 -0
  157. package/dist/profiles/sequent-g3/normalize.d.ts +15 -0
  158. package/dist/profiles/sequent-g3/normalize.d.ts.map +1 -0
  159. package/dist/profiles/sequent-g3/normalize.js +121 -0
  160. package/dist/profiles/sequent-g3/normalize.js.map +1 -0
  161. package/dist/profiles/sequent-g3/prover.d.ts +16 -0
  162. package/dist/profiles/sequent-g3/prover.d.ts.map +1 -0
  163. package/dist/profiles/sequent-g3/prover.js +348 -0
  164. package/dist/profiles/sequent-g3/prover.js.map +1 -0
  165. package/dist/profiles/sequent-g3/types.d.ts +30 -0
  166. package/dist/profiles/sequent-g3/types.d.ts.map +1 -0
  167. package/dist/profiles/sequent-g3/types.js +16 -0
  168. package/dist/profiles/sequent-g3/types.js.map +1 -0
  169. package/dist/runtime/countermodel-min/index.d.ts +3 -0
  170. package/dist/runtime/countermodel-min/index.d.ts.map +1 -0
  171. package/dist/runtime/countermodel-min/index.js +9 -0
  172. package/dist/runtime/countermodel-min/index.js.map +1 -0
  173. package/dist/runtime/countermodel-min/minimize.d.ts +17 -0
  174. package/dist/runtime/countermodel-min/minimize.d.ts.map +1 -0
  175. package/dist/runtime/countermodel-min/minimize.js +0 -0
  176. package/dist/runtime/countermodel-min/minimize.js.map +1 -0
  177. package/dist/runtime/countermodel-min/types.d.ts +40 -0
  178. package/dist/runtime/countermodel-min/types.d.ts.map +1 -0
  179. package/dist/runtime/countermodel-min/types.js +6 -0
  180. package/dist/runtime/countermodel-min/types.js.map +1 -0
  181. package/dist/runtime/mus/extract.d.ts +34 -0
  182. package/dist/runtime/mus/extract.d.ts.map +1 -0
  183. package/dist/runtime/mus/extract.js +243 -0
  184. package/dist/runtime/mus/extract.js.map +1 -0
  185. package/dist/runtime/mus/index.d.ts +4 -0
  186. package/dist/runtime/mus/index.d.ts.map +1 -0
  187. package/dist/runtime/mus/index.js +12 -0
  188. package/dist/runtime/mus/index.js.map +1 -0
  189. package/dist/runtime/mus/quickxplain.d.ts +10 -0
  190. package/dist/runtime/mus/quickxplain.d.ts.map +1 -0
  191. package/dist/runtime/mus/quickxplain.js +100 -0
  192. package/dist/runtime/mus/quickxplain.js.map +1 -0
  193. package/dist/runtime/mus/types.d.ts +59 -0
  194. package/dist/runtime/mus/types.d.ts.map +1 -0
  195. package/dist/runtime/mus/types.js +20 -0
  196. package/dist/runtime/mus/types.js.map +1 -0
  197. package/dist/solver/cdcl-v2-incremental/index.d.ts +3 -0
  198. package/dist/solver/cdcl-v2-incremental/index.d.ts.map +1 -0
  199. package/dist/solver/cdcl-v2-incremental/index.js +16 -0
  200. package/dist/solver/cdcl-v2-incremental/index.js.map +1 -0
  201. package/dist/solver/cdcl-v2-incremental/solver.d.ts +83 -0
  202. package/dist/solver/cdcl-v2-incremental/solver.d.ts.map +1 -0
  203. package/dist/solver/cdcl-v2-incremental/solver.js +727 -0
  204. package/dist/solver/cdcl-v2-incremental/solver.js.map +1 -0
  205. package/dist/solver/cdcl-v2-incremental/types.d.ts +47 -0
  206. package/dist/solver/cdcl-v2-incremental/types.d.ts.map +1 -0
  207. package/dist/solver/cdcl-v2-incremental/types.js +13 -0
  208. package/dist/solver/cdcl-v2-incremental/types.js.map +1 -0
  209. package/dist/tests/belief-revision/agm.test.d.ts +2 -0
  210. package/dist/tests/belief-revision/agm.test.d.ts.map +1 -0
  211. package/dist/tests/belief-revision/agm.test.js +173 -0
  212. package/dist/tests/belief-revision/agm.test.js.map +1 -0
  213. package/dist/tests/countermodel-min/minimize.test.d.ts +2 -0
  214. package/dist/tests/countermodel-min/minimize.test.d.ts.map +1 -0
  215. package/dist/tests/countermodel-min/minimize.test.js +241 -0
  216. package/dist/tests/countermodel-min/minimize.test.js.map +1 -0
  217. package/dist/tests/coverage-95/api-and-interpreter-e2e.test.d.ts +2 -0
  218. package/dist/tests/coverage-95/api-and-interpreter-e2e.test.d.ts.map +1 -0
  219. package/dist/tests/coverage-95/api-and-interpreter-e2e.test.js +255 -0
  220. package/dist/tests/coverage-95/api-and-interpreter-e2e.test.js.map +1 -0
  221. package/dist/tests/coverage-95/argumentation.test.d.ts +2 -0
  222. package/dist/tests/coverage-95/argumentation.test.d.ts.map +1 -0
  223. package/dist/tests/coverage-95/argumentation.test.js +105 -0
  224. package/dist/tests/coverage-95/argumentation.test.js.map +1 -0
  225. package/dist/tests/coverage-95/arithmetic.test.d.ts +2 -0
  226. package/dist/tests/coverage-95/arithmetic.test.d.ts.map +1 -0
  227. package/dist/tests/coverage-95/arithmetic.test.js +139 -0
  228. package/dist/tests/coverage-95/arithmetic.test.js.map +1 -0
  229. package/dist/tests/coverage-95/belnap.test.d.ts +2 -0
  230. package/dist/tests/coverage-95/belnap.test.d.ts.map +1 -0
  231. package/dist/tests/coverage-95/belnap.test.js +145 -0
  232. package/dist/tests/coverage-95/belnap.test.js.map +1 -0
  233. package/dist/tests/coverage-95/cdcl-v2-solver.test.d.ts +2 -0
  234. package/dist/tests/coverage-95/cdcl-v2-solver.test.d.ts.map +1 -0
  235. package/dist/tests/coverage-95/cdcl-v2-solver.test.js +61 -0
  236. package/dist/tests/coverage-95/cdcl-v2-solver.test.js.map +1 -0
  237. package/dist/tests/coverage-95/classical-propositional-direct.test.d.ts +2 -0
  238. package/dist/tests/coverage-95/classical-propositional-direct.test.d.ts.map +1 -0
  239. package/dist/tests/coverage-95/classical-propositional-direct.test.js +175 -0
  240. package/dist/tests/coverage-95/classical-propositional-direct.test.js.map +1 -0
  241. package/dist/tests/coverage-95/compat.test.d.ts +2 -0
  242. package/dist/tests/coverage-95/compat.test.d.ts.map +1 -0
  243. package/dist/tests/coverage-95/compat.test.js +82 -0
  244. package/dist/tests/coverage-95/compat.test.js.map +1 -0
  245. package/dist/tests/coverage-95/examples-runner.test.d.ts +2 -0
  246. package/dist/tests/coverage-95/examples-runner.test.d.ts.map +1 -0
  247. package/dist/tests/coverage-95/examples-runner.test.js +34 -0
  248. package/dist/tests/coverage-95/examples-runner.test.js.map +1 -0
  249. package/dist/tests/coverage-95/first-order.test.d.ts +2 -0
  250. package/dist/tests/coverage-95/first-order.test.d.ts.map +1 -0
  251. package/dist/tests/coverage-95/first-order.test.js +138 -0
  252. package/dist/tests/coverage-95/first-order.test.js.map +1 -0
  253. package/dist/tests/coverage-95/fol-prover.test.d.ts +2 -0
  254. package/dist/tests/coverage-95/fol-prover.test.d.ts.map +1 -0
  255. package/dist/tests/coverage-95/fol-prover.test.js +228 -0
  256. package/dist/tests/coverage-95/fol-prover.test.js.map +1 -0
  257. package/dist/tests/coverage-95/interpreter-commands.test.d.ts +2 -0
  258. package/dist/tests/coverage-95/interpreter-commands.test.d.ts.map +1 -0
  259. package/dist/tests/coverage-95/interpreter-commands.test.js +332 -0
  260. package/dist/tests/coverage-95/interpreter-commands.test.js.map +1 -0
  261. package/dist/tests/coverage-95/lsp-server.test.d.ts +2 -0
  262. package/dist/tests/coverage-95/lsp-server.test.d.ts.map +1 -0
  263. package/dist/tests/coverage-95/lsp-server.test.js +181 -0
  264. package/dist/tests/coverage-95/lsp-server.test.js.map +1 -0
  265. package/dist/tests/coverage-95/modal-tableau-profiles.test.d.ts +2 -0
  266. package/dist/tests/coverage-95/modal-tableau-profiles.test.d.ts.map +1 -0
  267. package/dist/tests/coverage-95/modal-tableau-profiles.test.js +157 -0
  268. package/dist/tests/coverage-95/modal-tableau-profiles.test.js.map +1 -0
  269. package/dist/tests/coverage-95/parallel-sat.test.d.ts +2 -0
  270. package/dist/tests/coverage-95/parallel-sat.test.d.ts.map +1 -0
  271. package/dist/tests/coverage-95/parallel-sat.test.js +42 -0
  272. package/dist/tests/coverage-95/parallel-sat.test.js.map +1 -0
  273. package/dist/tests/coverage-95/parser-extra.test.d.ts +2 -0
  274. package/dist/tests/coverage-95/parser-extra.test.d.ts.map +1 -0
  275. package/dist/tests/coverage-95/parser-extra.test.js +210 -0
  276. package/dist/tests/coverage-95/parser-extra.test.js.map +1 -0
  277. package/dist/tests/coverage-95/propositional-utilities.test.d.ts +2 -0
  278. package/dist/tests/coverage-95/propositional-utilities.test.d.ts.map +1 -0
  279. package/dist/tests/coverage-95/propositional-utilities.test.js +281 -0
  280. package/dist/tests/coverage-95/propositional-utilities.test.js.map +1 -0
  281. package/dist/tests/coverage-95/protocol-handler.test.d.ts +2 -0
  282. package/dist/tests/coverage-95/protocol-handler.test.d.ts.map +1 -0
  283. package/dist/tests/coverage-95/protocol-handler.test.js +275 -0
  284. package/dist/tests/coverage-95/protocol-handler.test.js.map +1 -0
  285. package/dist/tests/coverage-95/smt-mock-backend.test.d.ts +2 -0
  286. package/dist/tests/coverage-95/smt-mock-backend.test.d.ts.map +1 -0
  287. package/dist/tests/coverage-95/smt-mock-backend.test.js +201 -0
  288. package/dist/tests/coverage-95/smt-mock-backend.test.js.map +1 -0
  289. package/dist/tests/coverage-95/smt-serializer.test.d.ts +2 -0
  290. package/dist/tests/coverage-95/smt-serializer.test.d.ts.map +1 -0
  291. package/dist/tests/coverage-95/smt-serializer.test.js +143 -0
  292. package/dist/tests/coverage-95/smt-serializer.test.js.map +1 -0
  293. package/dist/tests/coverage-95/smt-subprocess.test.d.ts +2 -0
  294. package/dist/tests/coverage-95/smt-subprocess.test.d.ts.map +1 -0
  295. package/dist/tests/coverage-95/smt-subprocess.test.js +96 -0
  296. package/dist/tests/coverage-95/smt-subprocess.test.js.map +1 -0
  297. package/dist/tests/coverage-95/tableau-engine.test.d.ts +2 -0
  298. package/dist/tests/coverage-95/tableau-engine.test.d.ts.map +1 -0
  299. package/dist/tests/coverage-95/tableau-engine.test.js +125 -0
  300. package/dist/tests/coverage-95/tableau-engine.test.js.map +1 -0
  301. package/dist/tests/coverage-95/temporal-ltl.test.d.ts +2 -0
  302. package/dist/tests/coverage-95/temporal-ltl.test.d.ts.map +1 -0
  303. package/dist/tests/coverage-95/temporal-ltl.test.js +94 -0
  304. package/dist/tests/coverage-95/temporal-ltl.test.js.map +1 -0
  305. package/dist/tests/coverage-95/typecheck-checker.test.d.ts +2 -0
  306. package/dist/tests/coverage-95/typecheck-checker.test.d.ts.map +1 -0
  307. package/dist/tests/coverage-95/typecheck-checker.test.js +191 -0
  308. package/dist/tests/coverage-95/typecheck-checker.test.js.map +1 -0
  309. package/dist/tests/coverage-95/undecidability-detector.test.d.ts +2 -0
  310. package/dist/tests/coverage-95/undecidability-detector.test.d.ts.map +1 -0
  311. package/dist/tests/coverage-95/undecidability-detector.test.js +149 -0
  312. package/dist/tests/coverage-95/undecidability-detector.test.js.map +1 -0
  313. package/dist/tests/coverage-95/visitor.test.d.ts +2 -0
  314. package/dist/tests/coverage-95/visitor.test.d.ts.map +1 -0
  315. package/dist/tests/coverage-95/visitor.test.js +140 -0
  316. package/dist/tests/coverage-95/visitor.test.js.map +1 -0
  317. package/dist/tests/ctl/check.test.d.ts +2 -0
  318. package/dist/tests/ctl/check.test.d.ts.map +1 -0
  319. package/dist/tests/ctl/check.test.js +337 -0
  320. package/dist/tests/ctl/check.test.js.map +1 -0
  321. package/dist/tests/curry-howard/infer.test.d.ts +2 -0
  322. package/dist/tests/curry-howard/infer.test.d.ts.map +1 -0
  323. package/dist/tests/curry-howard/infer.test.js +93 -0
  324. package/dist/tests/curry-howard/infer.test.js.map +1 -0
  325. package/dist/tests/curry-howard/proof.test.d.ts +2 -0
  326. package/dist/tests/curry-howard/proof.test.d.ts.map +1 -0
  327. package/dist/tests/curry-howard/proof.test.js +105 -0
  328. package/dist/tests/curry-howard/proof.test.js.map +1 -0
  329. package/dist/tests/curry-howard/reduce.test.d.ts +2 -0
  330. package/dist/tests/curry-howard/reduce.test.d.ts.map +1 -0
  331. package/dist/tests/curry-howard/reduce.test.js +109 -0
  332. package/dist/tests/curry-howard/reduce.test.js.map +1 -0
  333. package/dist/tests/default-logic/extensions.test.d.ts +2 -0
  334. package/dist/tests/default-logic/extensions.test.d.ts.map +1 -0
  335. package/dist/tests/default-logic/extensions.test.js +323 -0
  336. package/dist/tests/default-logic/extensions.test.js.map +1 -0
  337. package/dist/tests/description-logic/alc.test.d.ts +2 -0
  338. package/dist/tests/description-logic/alc.test.d.ts.map +1 -0
  339. package/dist/tests/description-logic/alc.test.js +253 -0
  340. package/dist/tests/description-logic/alc.test.js.map +1 -0
  341. package/dist/tests/fol-prover-equality/prove.test.d.ts +2 -0
  342. package/dist/tests/fol-prover-equality/prove.test.d.ts.map +1 -0
  343. package/dist/tests/fol-prover-equality/prove.test.js +179 -0
  344. package/dist/tests/fol-prover-equality/prove.test.js.map +1 -0
  345. package/dist/tests/hybrid-logic/semantics.test.d.ts +2 -0
  346. package/dist/tests/hybrid-logic/semantics.test.d.ts.map +1 -0
  347. package/dist/tests/hybrid-logic/semantics.test.js +169 -0
  348. package/dist/tests/hybrid-logic/semantics.test.js.map +1 -0
  349. package/dist/tests/ltl-sat/sat.test.d.ts +2 -0
  350. package/dist/tests/ltl-sat/sat.test.d.ts.map +1 -0
  351. package/dist/tests/ltl-sat/sat.test.js +160 -0
  352. package/dist/tests/ltl-sat/sat.test.js.map +1 -0
  353. package/dist/tests/mus/extract.test.d.ts +2 -0
  354. package/dist/tests/mus/extract.test.d.ts.map +1 -0
  355. package/dist/tests/mus/extract.test.js +352 -0
  356. package/dist/tests/mus/extract.test.js.map +1 -0
  357. package/dist/tests/sat-v2-incremental/basic.test.d.ts +2 -0
  358. package/dist/tests/sat-v2-incremental/basic.test.d.ts.map +1 -0
  359. package/dist/tests/sat-v2-incremental/basic.test.js +352 -0
  360. package/dist/tests/sat-v2-incremental/basic.test.js.map +1 -0
  361. package/dist/tests/sequent-g3/prover.test.d.ts +2 -0
  362. package/dist/tests/sequent-g3/prover.test.d.ts.map +1 -0
  363. package/dist/tests/sequent-g3/prover.test.js +205 -0
  364. package/dist/tests/sequent-g3/prover.test.js.map +1 -0
  365. package/dist/tests/text-layer-v2/mdx-bridge/mdx-bridge.test.d.ts +2 -0
  366. package/dist/tests/text-layer-v2/mdx-bridge/mdx-bridge.test.d.ts.map +1 -0
  367. package/dist/tests/text-layer-v2/mdx-bridge/mdx-bridge.test.js +200 -0
  368. package/dist/tests/text-layer-v2/mdx-bridge/mdx-bridge.test.js.map +1 -0
  369. package/dist/text-layer/v2/index.d.ts +2 -0
  370. package/dist/text-layer/v2/index.d.ts.map +1 -1
  371. package/dist/text-layer/v2/index.js +7 -1
  372. package/dist/text-layer/v2/index.js.map +1 -1
  373. package/dist/text-layer/v2/mdx-bridge/diff.d.ts +13 -0
  374. package/dist/text-layer/v2/mdx-bridge/diff.d.ts.map +1 -0
  375. package/dist/text-layer/v2/mdx-bridge/diff.js +69 -0
  376. package/dist/text-layer/v2/mdx-bridge/diff.js.map +1 -0
  377. package/dist/text-layer/v2/mdx-bridge/index.d.ts +14 -0
  378. package/dist/text-layer/v2/mdx-bridge/index.d.ts.map +1 -0
  379. package/dist/text-layer/v2/mdx-bridge/index.js +21 -0
  380. package/dist/text-layer/v2/mdx-bridge/index.js.map +1 -0
  381. package/dist/text-layer/v2/mdx-bridge/parser.d.ts +33 -0
  382. package/dist/text-layer/v2/mdx-bridge/parser.d.ts.map +1 -0
  383. package/dist/text-layer/v2/mdx-bridge/parser.js +192 -0
  384. package/dist/text-layer/v2/mdx-bridge/parser.js.map +1 -0
  385. package/dist/text-layer/v2/mdx-bridge/serializer.d.ts +17 -0
  386. package/dist/text-layer/v2/mdx-bridge/serializer.d.ts.map +1 -0
  387. package/dist/text-layer/v2/mdx-bridge/serializer.js +69 -0
  388. package/dist/text-layer/v2/mdx-bridge/serializer.js.map +1 -0
  389. package/dist/text-layer/v2/mdx-bridge/types.d.ts +53 -0
  390. package/dist/text-layer/v2/mdx-bridge/types.d.ts.map +1 -0
  391. package/dist/text-layer/v2/mdx-bridge/types.js +19 -0
  392. package/dist/text-layer/v2/mdx-bridge/types.js.map +1 -0
  393. package/package.json +1 -1
@@ -0,0 +1,91 @@
1
+ export type PropType = {
2
+ kind: 'atom';
3
+ name: string;
4
+ } | {
5
+ kind: 'arrow';
6
+ from: PropType;
7
+ to: PropType;
8
+ } | {
9
+ kind: 'product';
10
+ left: PropType;
11
+ right: PropType;
12
+ } | {
13
+ kind: 'sum';
14
+ left: PropType;
15
+ right: PropType;
16
+ } | {
17
+ kind: 'bottom';
18
+ };
19
+ export type LambdaTerm = {
20
+ kind: 'var';
21
+ name: string;
22
+ } | {
23
+ kind: 'app';
24
+ fn: LambdaTerm;
25
+ arg: LambdaTerm;
26
+ } | {
27
+ kind: 'abs';
28
+ param: string;
29
+ paramType: PropType;
30
+ body: LambdaTerm;
31
+ } | {
32
+ kind: 'pair';
33
+ fst: LambdaTerm;
34
+ snd: LambdaTerm;
35
+ } | {
36
+ kind: 'fst';
37
+ pair: LambdaTerm;
38
+ } | {
39
+ kind: 'snd';
40
+ pair: LambdaTerm;
41
+ } | {
42
+ kind: 'inl';
43
+ left: LambdaTerm;
44
+ rightType: PropType;
45
+ } | {
46
+ kind: 'inr';
47
+ right: LambdaTerm;
48
+ leftType: PropType;
49
+ } | {
50
+ kind: 'case';
51
+ scrutinee: LambdaTerm;
52
+ leftBind: string;
53
+ leftBody: LambdaTerm;
54
+ rightBind: string;
55
+ rightBody: LambdaTerm;
56
+ } | {
57
+ kind: 'absurd';
58
+ proofOfFalse: LambdaTerm;
59
+ resultType: PropType;
60
+ };
61
+ export type ProofRule = 'axiom' | '→I' | '→E' | '∧I' | '∧E-L' | '∧E-R' | '∨I-L' | '∨I-R' | '∨E' | '⊥E';
62
+ export interface ProofTree {
63
+ rule: ProofRule;
64
+ conclusion: PropType;
65
+ premises: ProofTree[];
66
+ discharged?: {
67
+ name: string;
68
+ type: PropType;
69
+ }[];
70
+ assumption?: string;
71
+ }
72
+ export type Context = Record<string, PropType>;
73
+ export declare const atom: (name: string) => PropType;
74
+ export declare const arrow: (from: PropType, to: PropType) => PropType;
75
+ export declare const product: (left: PropType, right: PropType) => PropType;
76
+ export declare const sum: (left: PropType, right: PropType) => PropType;
77
+ export declare const bottom: () => PropType;
78
+ export declare const vr: (name: string) => LambdaTerm;
79
+ export declare const app: (fn: LambdaTerm, arg: LambdaTerm) => LambdaTerm;
80
+ export declare const abs: (param: string, paramType: PropType, body: LambdaTerm) => LambdaTerm;
81
+ export declare const pair: (f: LambdaTerm, s: LambdaTerm) => LambdaTerm;
82
+ export declare const fst: (p: LambdaTerm) => LambdaTerm;
83
+ export declare const snd: (p: LambdaTerm) => LambdaTerm;
84
+ export declare const inl: (left: LambdaTerm, rightType: PropType) => LambdaTerm;
85
+ export declare const inr: (right: LambdaTerm, leftType: PropType) => LambdaTerm;
86
+ export declare const cse: (scrutinee: LambdaTerm, leftBind: string, leftBody: LambdaTerm, rightBind: string, rightBody: LambdaTerm) => LambdaTerm;
87
+ export declare const absurd: (proofOfFalse: LambdaTerm, resultType: PropType) => LambdaTerm;
88
+ export declare function eqType(a: PropType, b: PropType): boolean;
89
+ export declare function typeToString(t: PropType): string;
90
+ export declare function termToString(t: LambdaTerm): string;
91
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/curry-howard/types.ts"],"names":[],"mappings":"AAgBA,MAAM,MAAM,QAAQ,GACh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AAU,EAAE,KAAK,UAAU,KAAG,UAAwC,CAAC;AAC/F,eAAO,MAAM,GAAG,GAAI,OAAO,MAAM,EAAE,WAAW,QAAQ,EAAE,MAAM,UAAU,KAAG,UAKzE,CAAC;AACH,eAAO,MAAM,IAAI,GAAI,GAAG,UAAU,EAAE,GAAG,UAAU,KAAG,UAIlD,CAAC;AACH,eAAO,MAAM,GAAG,GAAI,GAAG,UAAU,KAAG,UAAwC,CAAC;AAC7E,eAAO,MAAM,GAAG,GAAI,GAAG,UAAU,KAAG,UAAwC,CAAC;AAC7E,eAAO,MAAM,GAAG,GAAI,MAAM,UAAU,EAAE,WAAW,QAAQ,KAAG,UAI1D,CAAC;AACH,eAAO,MAAM,GAAG,GAAI,OAAO,UAAU,EAAE,UAAU,QAAQ,KAAG,UAI1D,CAAC;AACH,eAAO,MAAM,GAAG,GACd,WAAW,UAAU,EACrB,UAAU,MAAM,EAChB,UAAU,UAAU,EACpB,WAAW,MAAM,EACjB,WAAW,UAAU,KACpB,UAOD,CAAC;AACH,eAAO,MAAM,MAAM,GAAI,cAAc,UAAU,EAAE,YAAY,QAAQ,KAAG,UAItE,CAAC;AAGH,wBAAgB,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC,EAAE,QAAQ,GAAG,OAAO,CAoBxD;AAGD,wBAAgB,YAAY,CAAC,CAAC,EAAE,QAAQ,GAAG,MAAM,CAehD;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,UAAU,GAAG,MAAM,CAyBlD"}
@@ -0,0 +1,149 @@
1
+ "use strict";
2
+ // ============================================================
3
+ // Curry-Howard — Tipos y términos
4
+ // ============================================================
5
+ //
6
+ // Correspondencia Curry-Howard:
7
+ // tipo ↔ proposición
8
+ // programa ↔ prueba
9
+ // β-reducción ↔ normalización de pruebas
10
+ //
11
+ // Constructores soportados:
12
+ // → (arrow) → implicación
13
+ // ∧ (product) → conjunción
14
+ // ∨ (sum) → disyunción
15
+ // ⊥ (bottom) → falso
16
+ // atom → variable proposicional
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ exports.absurd = exports.cse = exports.inr = exports.inl = exports.snd = exports.fst = exports.pair = exports.abs = exports.app = exports.vr = exports.bottom = exports.sum = exports.product = exports.arrow = exports.atom = void 0;
19
+ exports.eqType = eqType;
20
+ exports.typeToString = typeToString;
21
+ exports.termToString = termToString;
22
+ // ---------- Constructores convenientes ----------
23
+ const atom = (name) => ({ kind: 'atom', name });
24
+ exports.atom = atom;
25
+ const arrow = (from, to) => ({ kind: 'arrow', from, to });
26
+ exports.arrow = arrow;
27
+ const product = (left, right) => ({
28
+ kind: 'product',
29
+ left,
30
+ right,
31
+ });
32
+ exports.product = product;
33
+ const sum = (left, right) => ({ kind: 'sum', left, right });
34
+ exports.sum = sum;
35
+ const bottom = () => ({ kind: 'bottom' });
36
+ exports.bottom = bottom;
37
+ const vr = (name) => ({ kind: 'var', name });
38
+ exports.vr = vr;
39
+ const app = (fn, arg) => ({ kind: 'app', fn, arg });
40
+ exports.app = app;
41
+ const abs = (param, paramType, body) => ({
42
+ kind: 'abs',
43
+ param,
44
+ paramType,
45
+ body,
46
+ });
47
+ exports.abs = abs;
48
+ const pair = (f, s) => ({
49
+ kind: 'pair',
50
+ fst: f,
51
+ snd: s,
52
+ });
53
+ exports.pair = pair;
54
+ const fst = (p) => ({ kind: 'fst', pair: p });
55
+ exports.fst = fst;
56
+ const snd = (p) => ({ kind: 'snd', pair: p });
57
+ exports.snd = snd;
58
+ const inl = (left, rightType) => ({
59
+ kind: 'inl',
60
+ left,
61
+ rightType,
62
+ });
63
+ exports.inl = inl;
64
+ const inr = (right, leftType) => ({
65
+ kind: 'inr',
66
+ right,
67
+ leftType,
68
+ });
69
+ exports.inr = inr;
70
+ const cse = (scrutinee, leftBind, leftBody, rightBind, rightBody) => ({
71
+ kind: 'case',
72
+ scrutinee,
73
+ leftBind,
74
+ leftBody,
75
+ rightBind,
76
+ rightBody,
77
+ });
78
+ exports.cse = cse;
79
+ const absurd = (proofOfFalse, resultType) => ({
80
+ kind: 'absurd',
81
+ proofOfFalse,
82
+ resultType,
83
+ });
84
+ exports.absurd = absurd;
85
+ // ---------- Igualdad estructural de tipos ----------
86
+ function eqType(a, b) {
87
+ if (a.kind !== b.kind)
88
+ return false;
89
+ switch (a.kind) {
90
+ case 'atom':
91
+ return a.name === b.name;
92
+ case 'arrow': {
93
+ const bb = b;
94
+ return eqType(a.from, bb.from) && eqType(a.to, bb.to);
95
+ }
96
+ case 'product': {
97
+ const bb = b;
98
+ return eqType(a.left, bb.left) && eqType(a.right, bb.right);
99
+ }
100
+ case 'sum': {
101
+ const bb = b;
102
+ return eqType(a.left, bb.left) && eqType(a.right, bb.right);
103
+ }
104
+ case 'bottom':
105
+ return true;
106
+ }
107
+ }
108
+ // ---------- Serialización legible ----------
109
+ function typeToString(t) {
110
+ switch (t.kind) {
111
+ case 'atom':
112
+ return t.name;
113
+ case 'bottom':
114
+ return '⊥';
115
+ case 'arrow': {
116
+ const lhs = t.from.kind === 'arrow' ? `(${typeToString(t.from)})` : typeToString(t.from);
117
+ return `${lhs} → ${typeToString(t.to)}`;
118
+ }
119
+ case 'product':
120
+ return `(${typeToString(t.left)} ∧ ${typeToString(t.right)})`;
121
+ case 'sum':
122
+ return `(${typeToString(t.left)} ∨ ${typeToString(t.right)})`;
123
+ }
124
+ }
125
+ function termToString(t) {
126
+ switch (t.kind) {
127
+ case 'var':
128
+ return t.name;
129
+ case 'app':
130
+ return `(${termToString(t.fn)} ${termToString(t.arg)})`;
131
+ case 'abs':
132
+ return `(λ${t.param}:${typeToString(t.paramType)}. ${termToString(t.body)})`;
133
+ case 'pair':
134
+ return `⟨${termToString(t.fst)}, ${termToString(t.snd)}⟩`;
135
+ case 'fst':
136
+ return `fst(${termToString(t.pair)})`;
137
+ case 'snd':
138
+ return `snd(${termToString(t.pair)})`;
139
+ case 'inl':
140
+ return `inl(${termToString(t.left)})`;
141
+ case 'inr':
142
+ return `inr(${termToString(t.right)})`;
143
+ case 'case':
144
+ return `case ${termToString(t.scrutinee)} of inl(${t.leftBind})→${termToString(t.leftBody)} | inr(${t.rightBind})→${termToString(t.rightBody)}`;
145
+ case 'absurd':
146
+ return `absurd(${termToString(t.proofOfFalse)} : ${typeToString(t.resultType)})`;
147
+ }
148
+ }
149
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/curry-howard/types.ts"],"names":[],"mappings":";AAAA,+DAA+D;AAC/D,kCAAkC;AAClC,+DAA+D;AAC/D,EAAE;AACF,gCAAgC;AAChC,mCAAmC;AACnC,8BAA8B;AAC9B,gDAAgD;AAChD,EAAE;AACF,4BAA4B;AAC5B,kCAAkC;AAClC,iCAAiC;AACjC,iCAAiC;AACjC,4BAA4B;AAC5B,6CAA6C;;;AAkH7C,wBAoBC;AAGD,oCAeC;AAED,oCAyBC;AA1HD,mDAAmD;AAC5C,MAAM,IAAI,GAAG,CAAC,IAAY,EAAY,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;AAA5D,QAAA,IAAI,QAAwD;AAClE,MAAM,KAAK,GAAG,CAAC,IAAc,EAAE,EAAY,EAAY,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;AAAlF,QAAA,KAAK,SAA6E;AACxF,MAAM,OAAO,GAAG,CAAC,IAAc,EAAE,KAAe,EAAY,EAAE,CAAC,CAAC;IACrE,IAAI,EAAE,SAAS;IACf,IAAI;IACJ,KAAK;CACN,CAAC,CAAC;AAJU,QAAA,OAAO,WAIjB;AACI,MAAM,GAAG,GAAG,CAAC,IAAc,EAAE,KAAe,EAAY,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,CAAC;AAApF,QAAA,GAAG,OAAiF;AAC1F,MAAM,MAAM,GAAG,GAAa,EA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AAK;YACR,OAAO,IAAI,YAAY,CAAC,CAAC,CAAC,EAAE,CAAC,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;QAC1D,KAAK,KAAK;YACR,OAAO,KAAK,CAAC,CAAC,KAAK,IAAI,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QAC/E,KAAK,MAAM;YACT,OAAO,IAAI,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,YAAY,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC;QAC5D,KAAK,KAAK;YACR,OAAO,OAAO,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QACxC,KAAK,KAAK;YACR,OAAO,OAAO,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QACxC,KAAK,KAAK;YACR,OAAO,OAAO,YAAY,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC;QACxC,KAAK,KAAK;YACR,OAAO,OAAO,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC;QACzC,KAAK,MAAM;YACT,OAAO,QAAQ,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC,QAAQ,KAAK,YAAY,CAC5E,CAAC,CAAC,QAAQ,CACX,UAAU,CAAC,CAAC,SAAS,KAAK,YAAY,CAAC,CAAC,CAAC,SAAS,CAAC,EAAE,CAAC;QACzD,KAAK,QAAQ;YACX,OAAO,UAAU,YAAY,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,YAAY,CAAC,CAAC,CAAC,UAAU,CAAC,GAAG,CAAC;IACrF,CAAC;AACH,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { FOLClause, FOLTerm } from '../fol-prover/types';
2
+ import { cloneLiteral } from './term-utils';
3
+ export interface DemodulationRule {
4
+ from: FOLTerm;
5
+ to: FOLTerm;
6
+ }
7
+ /**
8
+ * Apply a list of oriented rewrite rules `from → to` to every position of every literal
9
+ * in `clause`, repeatedly, until no more rewrites apply (fixed point) or we exceed a
10
+ * safety bound. Each rule is treated as "matching by unification of the variables in
11
+ * `from` against the subterm" — i.e. one-way matching, not two-way unification.
12
+ *
13
+ * The orientation guarantees termination because every successful rewrite replaces a
14
+ * larger term (by `compareTerms`) with a smaller one; we additionally cap the total
15
+ * number of rewrites per call.
16
+ */
17
+ export declare function demodulate(clause: FOLClause, rewrites: DemodulationRule[]): FOLClause;
18
+ /**
19
+ * Equality factoring: given a clause containing two positive equality literals
20
+ * x = y and x = z
21
+ * with shared lhs, produce the factor x = y ∨ y ≠ z (which is logically valid
22
+ * given the original and helps the saturation process). Returns every distinct factor.
23
+ *
24
+ * More generally, for two positive equalities (a=b) and (c=d) where a unifies with c
25
+ * via σ, emits (a=b ∨ b≠d)·σ.
26
+ */
27
+ export declare function equalityFactor(clause: FOLClause): FOLClause[];
28
+ export { cloneLiteral };
29
+ //# sourceMappingURL=demodulate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"demodulate.d.ts","sourceRoot":"","sources":["../../src/fol-prover-equality/demodulate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAc,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE1E,OAAO,EAGL,YAAY,EAQb,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,gBAAgB;IAC/B,IAAI,EAAE,OAAO,CAAC;IACd,EAAE,EAAE,OAAO,CAAC;CACb;AAED;;;;;;;;;GASG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,gBAAgB,EAAE,GAAG,SAAS,CAkCrF;AA0DD;;;;;;;;GAQG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,SAAS,GAAG,SAAS,EAAE,CA0C7D;AAsBD,OAAO,EAAE,YAAY,EAAE,CAAC"}
@@ -0,0 +1,197 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cloneLiteral = void 0;
4
+ exports.demodulate = demodulate;
5
+ exports.equalityFactor = equalityFactor;
6
+ const unify_1 = require("../fol-prover/unify");
7
+ const term_utils_1 = require("./term-utils");
8
+ Object.defineProperty(exports, "cloneLiteral", { enumerable: true, get: function () { return term_utils_1.cloneLiteral; } });
9
+ /**
10
+ * Apply a list of oriented rewrite rules `from → to` to every position of every literal
11
+ * in `clause`, repeatedly, until no more rewrites apply (fixed point) or we exceed a
12
+ * safety bound. Each rule is treated as "matching by unification of the variables in
13
+ * `from` against the subterm" — i.e. one-way matching, not two-way unification.
14
+ *
15
+ * The orientation guarantees termination because every successful rewrite replaces a
16
+ * larger term (by `compareTerms`) with a smaller one; we additionally cap the total
17
+ * number of rewrites per call.
18
+ */
19
+ function demodulate(clause, rewrites) {
20
+ if (rewrites.length === 0)
21
+ return (0, term_utils_1.cloneClause)(clause);
22
+ // Always orient each rule larger → smaller.
23
+ const oriented = rewrites
24
+ .map(({ from, to }) => {
25
+ if ((0, term_utils_1.compareTerms)(from, to) >= 0)
26
+ return { from: (0, term_utils_1.cloneTerm)(from), to: (0, term_utils_1.cloneTerm)(to) };
27
+ return { from: (0, term_utils_1.cloneTerm)(to), to: (0, term_utils_1.cloneTerm)(from) };
28
+ })
29
+ .filter(({ from, to }) => !(0, term_utils_1.termsEqual)(from, to));
30
+ if (oriented.length === 0)
31
+ return (0, term_utils_1.cloneClause)(clause);
32
+ const MAX_REWRITES = 256;
33
+ const cur = (0, term_utils_1.cloneClause)(clause);
34
+ let rewrites_done = 0;
35
+ // outer fixed point
36
+ let changed = true;
37
+ while (changed && rewrites_done < MAX_REWRITES) {
38
+ changed = false;
39
+ for (let li = 0; li < cur.length; li++) {
40
+ const lit = cur[li];
41
+ if (lit === undefined)
42
+ continue;
43
+ const rewritten = rewriteLiteralOnce(lit, oriented);
44
+ if (rewritten === null)
45
+ continue;
46
+ cur[li] = rewritten;
47
+ rewrites_done++;
48
+ changed = true;
49
+ if (rewrites_done >= MAX_REWRITES)
50
+ break;
51
+ }
52
+ }
53
+ return cur;
54
+ }
55
+ function rewriteLiteralOnce(lit, rules) {
56
+ // Try every position; first match wins.
57
+ for (const pos of (0, term_utils_1.allLiteralPositions)(lit)) {
58
+ const sub = (0, term_utils_1.getLiteralSubterm)(lit, pos);
59
+ if (sub === null)
60
+ continue;
61
+ for (const rule of rules) {
62
+ const sigma = matchSubterm(rule.from, sub);
63
+ if (sigma === null)
64
+ continue;
65
+ const replacement = (0, unify_1.applyTerm)(rule.to, sigma);
66
+ // Must strictly reduce (orientation guarantees this for closed substitutions but
67
+ // matching may leave variables; double-check).
68
+ const subSigma = (0, unify_1.applyTerm)(rule.from, sigma);
69
+ if ((0, term_utils_1.compareTerms)(replacement, subSigma) >= 0)
70
+ continue;
71
+ return (0, term_utils_1.replaceLiteralSubterm)(lit, pos, replacement);
72
+ }
73
+ }
74
+ return null;
75
+ }
76
+ /**
77
+ * One-way matching: try to find σ such that `pattern·σ = subject`. Variables in `subject`
78
+ * are treated as constants (cannot be bound). Returns the substitution or null.
79
+ */
80
+ function matchSubterm(pattern, subject) {
81
+ // We reuse `unify` but enforce one-way matching by walking manually: bind variables
82
+ // from pattern only.
83
+ const sigma = new Map();
84
+ if (!matchInto(pattern, subject, sigma))
85
+ return null;
86
+ return sigma;
87
+ }
88
+ function matchInto(p, s, sigma) {
89
+ if (p.kind === 'var') {
90
+ const existing = sigma.get(p.name);
91
+ if (existing !== undefined)
92
+ return (0, term_utils_1.termsEqual)(existing, s);
93
+ sigma.set(p.name, (0, term_utils_1.cloneTerm)(s));
94
+ return true;
95
+ }
96
+ if (p.kind === 'const') {
97
+ return s.kind === 'const' && p.name === s.name;
98
+ }
99
+ // p is func
100
+ if (s.kind !== 'func')
101
+ return false;
102
+ if (p.name !== s.name)
103
+ return false;
104
+ const pa = p.args ?? [];
105
+ const sa = s.args ?? [];
106
+ if (pa.length !== sa.length)
107
+ return false;
108
+ for (let i = 0; i < pa.length; i++) {
109
+ const pi = pa[i];
110
+ const si = sa[i];
111
+ if (pi === undefined || si === undefined)
112
+ return false;
113
+ if (!matchInto(pi, si, sigma))
114
+ return false;
115
+ }
116
+ return true;
117
+ }
118
+ /**
119
+ * Equality factoring: given a clause containing two positive equality literals
120
+ * x = y and x = z
121
+ * with shared lhs, produce the factor x = y ∨ y ≠ z (which is logically valid
122
+ * given the original and helps the saturation process). Returns every distinct factor.
123
+ *
124
+ * More generally, for two positive equalities (a=b) and (c=d) where a unifies with c
125
+ * via σ, emits (a=b ∨ b≠d)·σ.
126
+ */
127
+ function equalityFactor(clause) {
128
+ const out = [];
129
+ for (let i = 0; i < clause.length; i++) {
130
+ const li = clause[i];
131
+ if (li === undefined || li.negated || !(0, term_utils_1.isEqualityLiteral)(li))
132
+ continue;
133
+ const a = li.args[0];
134
+ const b = li.args[1];
135
+ if (a === undefined || b === undefined)
136
+ continue;
137
+ for (let j = i + 1; j < clause.length; j++) {
138
+ const lj = clause[j];
139
+ if (lj === undefined || lj.negated || !(0, term_utils_1.isEqualityLiteral)(lj))
140
+ continue;
141
+ const c = lj.args[0];
142
+ const d = lj.args[1];
143
+ if (c === undefined || d === undefined)
144
+ continue;
145
+ // Try both alignments (a~c) and (a~d) to cover the "shared lhs" case symmetrically.
146
+ for (const [u, v] of [
147
+ [c, d],
148
+ [d, c],
149
+ ]) {
150
+ const sigma = new Map();
151
+ const r = (0, unify_1.unify)(a, u, sigma);
152
+ if (r === null)
153
+ continue;
154
+ // Produce (a = b ∨ b ≠ v)·σ along with the rest of the clause.
155
+ const aSigma = (0, unify_1.applyTerm)(a, sigma);
156
+ const bSigma = (0, unify_1.applyTerm)(b, sigma);
157
+ const vSigma = (0, unify_1.applyTerm)(v, sigma);
158
+ // Skip degenerate factors where b ≡ v under σ (would yield a tautology after refl).
159
+ if ((0, term_utils_1.termsEqual)(bSigma, vSigma))
160
+ continue;
161
+ const newClause = [];
162
+ newClause.push({ negated: false, predicate: li.predicate, args: [aSigma, bSigma] });
163
+ newClause.push({ negated: true, predicate: li.predicate, args: [bSigma, vSigma] });
164
+ for (let k = 0; k < clause.length; k++) {
165
+ if (k === i || k === j)
166
+ continue;
167
+ const lk = clause[k];
168
+ if (lk === undefined)
169
+ continue;
170
+ newClause.push(applyLitLocal(lk, sigma));
171
+ }
172
+ out.push(dedup(newClause));
173
+ }
174
+ }
175
+ }
176
+ return out;
177
+ }
178
+ function applyLitLocal(lit, sigma) {
179
+ return {
180
+ negated: lit.negated,
181
+ predicate: lit.predicate,
182
+ args: lit.args.map((a) => (0, unify_1.applyTerm)(a, sigma)),
183
+ };
184
+ }
185
+ function dedup(c) {
186
+ const seen = new Set();
187
+ const out = [];
188
+ for (const lit of c) {
189
+ const k = `${lit.negated ? '!' : ''}${lit.predicate}(${lit.args.map(term_utils_1.termKey).join(',')})`;
190
+ if (seen.has(k))
191
+ continue;
192
+ seen.add(k);
193
+ out.push(lit);
194
+ }
195
+ return out;
196
+ }
197
+ //# sourceMappingURL=demodulate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"demodulate.js","sourceRoot":"","sources":["../../src/fol-prover-equality/demodulate.ts"],"names":[],"mappings":";;;AA8BA,gCAkCC;AAmED,wCA0CC;AA5KD,+CAAuD;AACvD,6CAWsB;AAsLb,6FA9LP,yBAAY,OA8LO;AA/KrB;;;;;;;;;GASG;AACH,SAAgB,UAAU,CAAC,MAAiB,EAAE,QAA4B;IACxE,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAA,wBAAW,EAAC,MAAM,CAAC,CAAC;IAEtD,4CAA4C;IAC5C,MAAM,QAAQ,GAAG,QAAQ;SACtB,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,EAAE,EAAE;QACpB,IAAI,IAAA,yBAAY,EAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC;YAAE,OAAO,EAAE,IAAI,EAAE,IAAA,sBAAS,EAAC,IA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C,CAAC,CAAC;YAC7B,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,aAAa,CAAC,GAAe,EAAE,KAA2B;IACjE,OAAO;QACL,OAAO,EAAE,GAAG,CAAC,OAAO;QACpB,SAAS,EAAE,GAAG,CAAC,SAAS;QACxB,IAAI,EAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,iBAAS,EAAC,CAAC,EAAE,KAAK,CAAC,CAAC;KAC/C,CAAC;AACJ,CAAC;AAED,SAAS,KAAK,CAAC,CAAY;IACzB,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,GAAG,GAAc,EAAE,CAAC;IAC1B,KAAK,MAAM,GAAG,IAAI,CAAC,EAAE,CAAC;QACpB,MAAM,CAAC,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,CAAC,SAAS,IAAI,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,oBAAO,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;QAC1F,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;YAAE,SAAS;QAC1B,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC;QACZ,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IAChB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
@@ -0,0 +1,8 @@
1
+ export type { EqualityProveResult, EqualityProveStep, EqualityProveOptions, EqualityRule, } from './types';
2
+ export { EQ_PREDICATE } from './types';
3
+ export { paramodulate, paramodulateAll, paramodulateWithSubst, reflexivityResolve, } from './paramodulate';
4
+ export { demodulate, equalityFactor } from './demodulate';
5
+ export type { DemodulationRule } from './demodulate';
6
+ export { proveWithEquality } from './prove';
7
+ export { allLiteralPositions, allPositions, compareTerms, isEqualityLiteral, replaceAt, replaceLiteralSubterm, termAt, } from './term-utils';
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/fol-prover-equality/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAEvC,OAAO,EACL,YAAY,EACZ,eAAe,EACf,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAC1D,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,EACL,mBAAmB,EACnB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,SAAS,EACT,qBAAqB,EACrB,MAAM,GACP,MAAM,cAAc,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.termAt = exports.replaceLiteralSubterm = exports.replaceAt = exports.isEqualityLiteral = exports.compareTerms = exports.allPositions = exports.allLiteralPositions = exports.proveWithEquality = exports.equalityFactor = exports.demodulate = exports.reflexivityResolve = exports.paramodulateWithSubst = exports.paramodulateAll = exports.paramodulate = exports.EQ_PREDICATE = void 0;
4
+ var types_1 = require("./types");
5
+ Object.defineProperty(exports, "EQ_PREDICATE", { enumerable: true, get: function () { return types_1.EQ_PREDICATE; } });
6
+ var paramodulate_1 = require("./paramodulate");
7
+ Object.defineProperty(exports, "paramodulate", { enumerable: true, get: function () { return paramodulate_1.paramodulate; } });
8
+ Object.defineProperty(exports, "paramodulateAll", { enumerable: true, get: function () { return paramodulate_1.paramodulateAll; } });
9
+ Object.defineProperty(exports, "paramodulateWithSubst", { enumerable: true, get: function () { return paramodulate_1.paramodulateWithSubst; } });
10
+ Object.defineProperty(exports, "reflexivityResolve", { enumerable: true, get: function () { return paramodulate_1.reflexivityResolve; } });
11
+ var demodulate_1 = require("./demodulate");
12
+ Object.defineProperty(exports, "demodulate", { enumerable: true, get: function () { return demodulate_1.demodulate; } });
13
+ Object.defineProperty(exports, "equalityFactor", { enumerable: true, get: function () { return demodulate_1.equalityFactor; } });
14
+ var prove_1 = require("./prove");
15
+ Object.defineProperty(exports, "proveWithEquality", { enumerable: true, get: function () { return prove_1.proveWithEquality; } });
16
+ var term_utils_1 = require("./term-utils");
17
+ Object.defineProperty(exports, "allLiteralPositions", { enumerable: true, get: function () { return term_utils_1.allLiteralPositions; } });
18
+ Object.defineProperty(exports, "allPositions", { enumerable: true, get: function () { return term_utils_1.allPositions; } });
19
+ Object.defineProperty(exports, "compareTerms", { enumerable: true, get: function () { return term_utils_1.compareTerms; } });
20
+ Object.defineProperty(exports, "isEqualityLiteral", { enumerable: true, get: function () { return term_utils_1.isEqualityLiteral; } });
21
+ Object.defineProperty(exports, "replaceAt", { enumerable: true, get: function () { return term_utils_1.replaceAt; } });
22
+ Object.defineProperty(exports, "replaceLiteralSubterm", { enumerable: true, get: function () { return term_utils_1.replaceLiteralSubterm; } });
23
+ Object.defineProperty(exports, "termAt", { enumerable: true, get: function () { return term_utils_1.termAt; } });
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/fol-prover-equality/index.ts"],"names":[],"mappings":";;;AAMA,iCAAuC;AAA9B,qGAAA,YAAY,OAAA;AAErB,+CAKwB;AAJtB,4GAAA,YAAY,OAAA;AACZ,+GAAA,eAAe,OAAA;AACf,qHAAA,qBAAqB,OAAA;AACrB,kHAAA,kBAAkB,OAAA;AAEpB,2CAA0D;AAAjD,wGAAA,UAAU,OAAA;AAAE,4GAAA,cAAc,OAAA;AAEnC,iCAA4C;AAAnC,0GAAA,iBAAiB,OAAA;AAC1B,2CAQsB;AAPpB,iHAAA,mBAAmB,OAAA;AACnB,0GAAA,YAAY,OAAA;AACZ,0GAAA,YAAY,OAAA;AACZ,+GAAA,iBAAiB,OAAA;AACjB,uGAAA,SAAS,OAAA;AACT,mHAAA,qBAAqB,OAAA;AACrB,oGAAA,MAAM,OAAA"}
@@ -0,0 +1,46 @@
1
+ import type { FOLClause, FOLTerm } from '../fol-prover/types';
2
+ import { cloneClause, isEqualityLiteral, termKey, termsEqual } from './term-utils';
3
+ export interface ParamodResult {
4
+ resolvent: FOLClause;
5
+ substitution: Map<string, FOLTerm>;
6
+ }
7
+ /**
8
+ * Paramodulation:
9
+ *
10
+ * from C ∨ (s = t) (eqClause, eq_idx points to the s=t literal)
11
+ * and D[u] (target clause, target_idx points to literal containing u,
12
+ * target_pos points inside that literal's args)
13
+ * if unify(s, u) = σ then (C ∨ D[u → t])·σ
14
+ *
15
+ * The direction is fixed: args[0] = s (lhs), args[1] = t (rhs). To paramodulate
16
+ * "in the other direction" callers should retry with the equation flipped (see
17
+ * `paramodulateAll` for the symmetric enumeration).
18
+ *
19
+ * Returns null when the literals can't paramodulate (wrong kind, unification fails, etc.).
20
+ */
21
+ export declare function paramodulate(c1Raw: FOLClause, eq_idx: number, c2Raw: FOLClause, target_idx: number, target_pos: number[]): FOLClause | null;
22
+ export declare function paramodulateWithSubst(c1Raw: FOLClause, eq_idx: number, c2Raw: FOLClause, target_idx: number, target_pos: number[]): ParamodResult | null;
23
+ /**
24
+ * Generate all paramodulation children between two clauses considering both directions
25
+ * of every equality literal in either clause and every interior position of every
26
+ * non-equality target literal in the other.
27
+ */
28
+ export interface ParamodAllStep {
29
+ fromEqClause: number;
30
+ fromTargetClause: number;
31
+ eqIdx: number;
32
+ targetIdx: number;
33
+ targetPos: number[];
34
+ flipped: boolean;
35
+ resolvent: FOLClause;
36
+ substitution: Map<string, FOLTerm>;
37
+ }
38
+ export declare function paramodulateAll(idxA: number, cA: FOLClause, idxB: number, cB: FOLClause): ParamodAllStep[];
39
+ /**
40
+ * Reflexivity resolution: drop a literal of the form ¬(t = t) from a clause.
41
+ * Useful both during search and for proving reflexive goals.
42
+ */
43
+ export declare function reflexivityResolve(c: FOLClause): FOLClause | null;
44
+ /** Re-export utilities used by tests. */
45
+ export { isEqualityLiteral, termKey, termsEqual, cloneClause };
46
+ //# sourceMappingURL=paramodulate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paramodulate.d.ts","sourceRoot":"","sources":["../../src/fol-prover-equality/paramodulate.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE9D,OAAO,EAEL,WAAW,EAGX,iBAAiB,EAIjB,OAAO,EACP,UAAU,EACX,MAAM,cAAc,CAAC;AAEtB,MAAM,WAAW,aAAa;IAC5B,SAAS,EAAE,SAAS,CAAC;IACrB,YAAY,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACpC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,YAAY,CAC1B,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAAE,GACnB,SAAS,GAAG,IAAI,CAGlB;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,SAAS,EAChB,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,SAAS,EAChB,UAAU,EAAE,MAAM,EAClB,UAAU,EAAE,MAAM,EAAE,GACnB,aAAa,GAAG,IAAI,CAuCtB;AAED;;;;GAIG;AACH,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,SAAS,EAAE,MAAM,EAAE,CAAC;IACp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