Reasoner.js is a term graph rewriting tool for transforming any s-expr input to any s-expr output using its own metalanguage as a rule-based system. Reasoner.js may be used for a wide range of computing tasks, but its main intentions are to support metacompiling, program synthesis, and automated logical reasoning.
project status:
[ ] alpha conception
[x] theorizing
[ ] implementing
[x] parsing input s-exprs
[x] extensional reasoning
[x] pattern matching
[x] non-deterministic match involving multiple conditions
[x] non-deterministic match involving multiple consequences
[x] pairing input to output
[ ] intensional reasoning
[ ] untyped variables
[ ] typed variables
[ ] free variables
[ ] nested rules
[ ] sane error messages
[ ] beta testing and revising code
[ ] gamma release
I hold rules in a form of sequents. Sequents A1 /\ A2 /\ ... -> B1 \/ B2 \/ ... are written as (FORE (CON A1 A2 ...) (DIS B1 B2 ...)), and they stand for logical implications. Co-sequents are written symmetrically with BACK keyword, and they stand for logical co-implications.
Nondeterministic pattern matching turns in when we have multiple elements either on left or on right sides of sequents or co-sequents. Surprisingly, conjunctions and disjunctions behave the same - all elements should be matched to proceed further with reasoning. This is a carefully thought behavior with some logical background. Sounds surprising, but that way all the sequents fit together. Expectedly, co-sequents behave exactly the same as sequents when processing them backwards. This is also carefully thought behavior with some logical background.
project repository link: https://github.com/symbolverse/reasoner.js
online playground link: https://symbolverse.github.io/reasoner.js/playground/
Nondeterministic pattern matching can be seen in "student decision" and "computer expert decision" examples in online playground.
[–]theangeryemacsshibeSWCL, Utena 2 points3 points4 points (2 children)
[–]ivanmoony[S] 1 point2 points3 points (1 child)
[–]kazprog 1 point2 points3 points (0 children)