Non-Prolog logic programming
-
30-04-2021 - |
Вопрос
Are there any good non-Prolog or Prolog-based logic programming languages ?
Who has or any good experience with it?
Решение
I highly recommend The Reasoned Schemer, by Dan Friedman, Oleg Kiselyov, and Will Byrd. It introduces miniKanren, a small (three core operators) logic programming language built atop Scheme. It's a joy to use, particularly with the matche
macro that allows unifying pattern matches.
Другие советы
Answer Set Programming is an extremely powerful logic programming paradigm. I've had a lot of success with the clasp/clingo answer set solver.
I was introduced to DLV and models through answer set programming, which is basically logic programming.
You might check out CLIPS. It's structured like Lisp (lots of parens) but it's designed for building expert systems; I haven't seen a problem that Prolog solves that CLIPS couldn't. Like Prolog, its based on building facts and then running queries against them.
There's also pretty fast miniKanren implementation written in Clojure, called core.logic.
There are also a few tutorials on using it:
https://github.com/clojure/core.logic/wiki/A-Core.logic-Primer
https://github.com/frenchy64/Logic-Starter/wiki
http://objectcommando.com/blog/2011/11/04/the-magical-island-of-kanren-core-logic-intro-part-1/
Mercury and Oz spring to mind. There's also Datalog which is a restricted (non-Turing complete) version of Prolog.