SolPrologV2
SolPrologV2 copied to clipboard
A Prolog engine written in Solidity.
The current engine assumes that `Substitution.Info` is in storage but this means that we need to clear the substitutions after every call to `Prolog.query()`. I think it would be better...
Extensions from the original implementation plan for the hackathon (https://hackmd.io/JoWGnhj8RHyDtimrCC6jjQ): - [ ] Better parser - Support infix operators - [ ] Arithmetic - [ ] Cut - [ ]...
We really need an equality operator. In the (tic tac toe demo](https://github.com/leonardoalt/SolPrologV2/tree/master/src/demo) I had to work around it with clauses like these: ```prolog same(., .). same(x, x). same(o, o). same([],...
Currently `Prolog.rewriteVariable()` works with the assumption that hashing a variable name together with an integer won't ever produce a collision with an existing variable: https://github.com/leonardoalt/SolPrologV2/blob/47bb8ec9253022ae91992eda144c0b4ca19914df/src/Prolog.sol#L77-L82 A collision unlikely but not...
Currently `Prolog.query()` stops after it finds a single matching substitution. A real Prolog engine needs a way to continue and produce all matches.
Here's a case that won't work properly without the unification module being able to create fresh variables: ```prolog ?- [family(_), family(_)] = [X, Y]. X = family(_19418), Y = family(_19428)....