4 ms·
Yes, I should've mentioned I found plus/3 for prolog. Not sure if it's available as something that can be coaxed into running in the browser, though. https://w
by e12e 7y ago
Yes, I should've mentioned I found plus/3 for prolog. Not sure if it's available as something that can be coaxed into running in the browser, though.
https://www.swi-prolog.org/pldoc/man?predicate=plus%2f3 https://www.swi-prolog.org/pldoc/man?predicate=plus%2f3
I've not been able to find something similar for datalog - but to be honest, I don't think I've managed to find solid documentation for datalog. Not that I've been able to really grok the language from enough to build an intuition for what's an idiomatic approach, at least.
- simplify 7y agoTau Prolog[0] runs in the browser, but it's still a bit heavy for forms. What someone needs to do is take an implementation of Hitchhiker Prolog[1] like this one[2] – because it's so lightweight – and make it JavaScript developer friendly so one can use it on a web page without a second thought. [0] http://tau-prolog.org http://tau-prolog.org [1] http://www.cse.unt.edu/~tarau/research/2017/eng.pdf http://www.cse.unt.edu/~tarau/research/2017/eng.pdf [2] https://github.com/CapelliC/hitchhicker-prolog https://github.com/CapelliC/hitchhicker-prolog
- kccqzy 7y agoNo, plus/3 is just a simple addition predicate. You should take a look at the CLP(FD) functionality: https://www.swi-prolog.org/man/clpfd.html https://www.swi-prolog.org/man/clpfd.html You also mentioned CLP(Z) in the parent comment. Not sure if familiar you are with these tools, but here's a nice intro: https://www.metalevel.at/prolog/clpz https://www.metalevel.at/prolog/clpz Avoid GNU Prolog. It sucks.
- e12e 7y agoThanks for the tip. Ed: the introduction looks like exactly what I need from the prolog side, last I looked at this stuff in prolog, I only found some proof of concept/instructive texts using Peano numbers - which works after a fashion, but is slow and painful. There's nothing analogous for datalog or some other minimal, embeddable logic/predicate system?
- e12e 7y agoHm, maybe this could be combined with reasonml/ocaml js target... https://github.com/Emmanuel-PLF/facile https://github.com/Emmanuel-PLF/facile