For those looking to gentle introduction to logic programming, Tarski's World was a very good book. https://ggweb.gradegrinder.net/tarskisworld https://web.stanford.edu/group/cslipublications/cslipublicat... Might help, instead of jumping straight into Prolog.
Introduction to logic programming with Prolog
61–70 of 93 posts
Re: Introduction to logic programming with Prolog
#62I agree with what Sylvain Soliman said about this on Reddit: It's a nice tutorial for the 80's parts of the language: https://www.reddit.com/r/programming/comments/7hp2xw/introdu... In modern Prolog systems, you would use more declarative features such as constraints to model combinatorial tasks like map coloring. Make sure to check out modern Prolog features if you are interested in learning the language seriously!
are modern prolog just a layer on top of the old semantics or somehow an incompatible paradigm ?
Re: Introduction to logic programming with Prolog
#63I find the section 5.3 from the paper "Out of the tar pit"[1] describes it very well: > It is for this reason that Prolog falls short of the ideals of logic programming. Specifically it is necessary to be concerned with the operational interpretation of the program whilst writing the axioms. I haven't heard of any approach that generalizes the goals of logic programming in a far better way. Is there any? (on specific…
Re: Introduction to logic programming with Prolog
#64Earlier quoted context omitted.
The point of Prolog as a practical logic programming language really is that it is portable accross Prolog implementations based on ISO Prolog (and maybe prolog-commons API compatibility). If you're using a Prologish tool (a Java framework, say) that is not quite Prolog, then you're loosing the compatibility for very little gain IMHO. Applications domains I've used Prolog for: discrete planning, game logic, limited/r…
> The point of Prolog as a practical logic programming language really is that it is portable accross Prolog implementations based on ISO Prolog (and maybe prolog-commons API compatibility). If you're using a Prologish tool (a Java framework, say) that is not quite Prolog, then you're loosing the compatibility for very little gain IMHO. I feel like I might be missing something obvious, but I'm not getting what the "c…
Re: Introduction to logic programming with Prolog
#65I agree with what Sylvain Soliman said about this on Reddit: It's a nice tutorial for the 80's parts of the language: https://www.reddit.com/r/programming/comments/7hp2xw/introdu... In modern Prolog systems, you would use more declarative features such as constraints to model combinatorial tasks like map coloring. Make sure to check out modern Prolog features if you are interested in learning the language seriously!
are modern prolog just a layer on top of the old semantics or somehow an incompatible paradigm ?
The set of CLP languages is generally implemented as a superset or add-on package(s) to a Prolog implementation. For example, SICStus Prolog and SWI-Prolog have CLP modules, e.g.:
https://sicstus.sics.se/sicstus/docs/3.7.1/html/sicstus_32.h...
http://www.swi-prolog.org/pldoc/man?section=clp
and "Constraint Handling Rules(CHR):
http://www.swi-prolog.org/pldoc/man?section=chr
To the best of my knowledge the modules are written in Prolog. A look at those links will give you an idea of how CLP is used. There are modules available for CLP(X) where X is one of:
B = boolean,
Z = integers,
Q = rational numbers,
R = real(floating point) numbers,
FD = finite domains (see "CLP(FD) Constraint Logic Programming over Finite Domains" http://www.pathwayslms.com/swipltuts/clpfd/clpfd.html )
etc.
One can understand how constraining the domain of interest (reducing the search space) to say, the integers, might make search more efficient.
Re: Introduction to logic programming with Prolog
#66Re: Introduction to logic programming with Prolog
#67Is anyone reading this aware of any work on logic programming in the large as in efforts that are harnessing the fact that answerset programming avoids committed choice and so enables us to write reliable tractable programs, but aims to make that possible in teams or in distributed settings?
I haven't encountered anything across answer set programming in the large as you put it. It is still pretty academic and mainly used for solving puzzle and optimization problems.
Re: Introduction to logic programming with Prolog
#68How does Prolog relate to ML systems? It seems they work in a similar way. Input some learning data and then the system produces output based on these.
As a corollary: Prolog will negate anything that can't be proven true from the rules you give it. A ML algorithm will always give you some answer, though the quality depends on the learning data.
Re: Introduction to logic programming with Prolog
#69I've seen a few contalks about logic programming, read a few articles, and aside from the intellectual curiosity in itself I can see that it is very elegant in certain circumstances (although I lack the hands-on experience to feel what those circumstances are). Since doing a whole program in prolog isn't really practical for me, is there any way to use the logic programming paradigm in mainstream programming language…
Check out https://github.com/rvirding/erlog with Erlang/Elixir
Re: Introduction to logic programming with Prolog
#70How does Prolog relate to ML systems? It seems they work in a similar way. Input some learning data and then the system produces output based on these.
Eh, they are quite different under the hood. To put it real simple (and probably quite sloppy): Prolog determines the output by applying logic. ML uses mathematics to analyze the input and "guesses" the output, based on the training set. As a corollary: Prolog will negate anything that can't be proven true from the rules you give it. A ML algorithm will always give you some answer, though the quality depends on the l…