Tools for logic programming in OCaml



I have no experience with logic programming (LP) and I have no time and reason to learn Prolog or other language that are canonical in the area of LP. By the way I’m very interested in the topic of LP and related paradigms. Could you please mention some OCaml libraries for logic programming and related things?


Check out It’s based on the LogicT library/paper (worth a read), which is closely related to miniKanren. The ideas are similar in that you construct nondeterministic programs by manipulating streams of solutions.


For a minimal typed μKanren implementation you can have a look at rel a more powerful implementation is provided by ocanren (but wanders a bit too much on the Obj side for my taste).


Also, a Datalog implementation


+1 for OCanren. As a committer to this project I’m curious about opinion of third-party users.