3 ms·
I would be very interested in seeing a tutorial detailing how to implement Prolog in Haskell!
by X6MW3aQrZU5VKkz 14y ago
I would be very interested in seeing a tutorial detailing how to implement Prolog in Haskell!
- exDM69 14y agoNot really a tutorial and not really Prolog, but here's an interpreter for a logic programming language written in Haskell: https://github.com/rikusalminen/slolog https://github.com/rikusalminen/slolog I wrote it as a project work in an Artificial Intelligence class. It very closely resembles the logic programming language implemented in "Structure and Interpretation of Computer Programs". I'm sorry there isn't any documentation for it. Here's a little example of what it looks like, from examples/royalfamily.slo: (siblings ?x ?y) <- (parent ?x ?parent) & (parent ?y ?parent) (grandparent ?x ?y) <- (parent ?x ?z) & (parent ?z ?y) (cousins ?x ?y) <- (grandparent ?x ?gp) & (grandparent ?y ?gp) & !(siblings ?x ?y)