
Adventure in Prolog Tutorial (2016) - AlexeyBrin
http://www.amzi.com/AdventureInProlog/advtop.php
======
xvilka
Two more very good Prolog books: The Power of Prolog[1] and Simply Logical:
Intelligent Reasoning by Example[2]. I also recommend visiting the Awesome
Prolog list[3]. There is also a very interesting extension of the Prolog -
Probabilistic Prolog, aka ProbLog[4]. And modern ISO-compatible implementation
in Rust language - Scryer Prolog[5].

[1] [https://github.com/triska/the-power-of-
prolog/](https://github.com/triska/the-power-of-prolog/)

[2] [https://book.simply-logical.space/](https://book.simply-logical.space/)

[3] [https://github.com/klaussinani/awesome-
prolog](https://github.com/klaussinani/awesome-prolog)

[4] [https://github.com/ML-KULeuven/problog](https://github.com/ML-
KULeuven/problog)

[5] [https://github.com/mthom/scryer-prolog](https://github.com/mthom/scryer-
prolog)

~~~
rscho
Scryer unfortunately seems to not be progressing very much. I really hope it
takes off, though!

~~~
mthom
I took a break from working on it over the summer, and am about to start
again. If anyone would like to pay me to work on it full time, do let me know.

~~~
rscho
Do you have a donation page somewhere?

~~~
mthom
No, and I have no idea what sort of legal can of worms that might open.

------
carapace
You know how when someone quits smoking and then, sometimes, they start to go
around telling everyone else how great it is and how OMG! they should quit
smoking too, and generally being a kind of smug and annoying about it?

I had a kind of Prolog "conversion" experience last summer...

You guys! Prolog is _so great!_ OMG! You should really try it! I'm seriously
you guys.

In all seriousness, Prolog is a simple, powerful, elegant language, with a
rich history replete with amazing research and tools. "An elegant weapon...
for a more civilized age."

~~~
tunesmith
I love the idea of prolog, but I'm stumped when I try to imagine integrating
it into other web-based projects. Is there a way? Like for instance having a
regular javascript frontend, and a JVM based backend like with spring or play,
integrating logic programming and prolog somehow?

Or more generally, now that you know prolog, what kind of real-life things do
you find it useful for? I mean I've seen all the tutorials of it solving
sudoku and logic puzzles, but...

~~~
rscho
[http://www.pathwayslms.com/swipltuts/html/index.html](http://www.pathwayslms.com/swipltuts/html/index.html)

[https://www.swi-
prolog.org/pldoc/doc_for?object=section(%27p...](https://www.swi-
prolog.org/pldoc/doc_for?object=section\(%27packages/jpl.html%27\))

[https://pengines.swi-prolog.org/docs/index.html](https://pengines.swi-
prolog.org/docs/index.html)

SWI prolog has all you need, and more!

Shameless plug for smalltalkers (hobbyist work in progress):
[https://github.com/Rscho314/pengines_smalltalk](https://github.com/Rscho314/pengines_smalltalk)

------
segmondy
This is a very good book for a first timer. This is one of the first books I
read when learning Prolog. It's fun since you're building a game. Just work
through it from front to cover and you will begin to get a good grasp on the
language.

------
6thaccount2
This is an awesome book. I had no idea it was free when I bought it lol. It is
also the only book that made Prolog seem pretty simple and not super
confusing.

I just wish I had the kinds of problems where Prolog would be performant
enough.

------
pacaro
I love this book.

I also think that everyone should build a theorem prover at some point, it's
definitely an exercise in humilty

------
aargh_aargh
What are some real-world, non-trivial programs written in Prolog? (with a
short description, please)

~~~
LukeEF
We are about to launch an prolog based DBMS. Incredibly powerful engine. Some
prolog background here:
[https://medium.com/terminusdb](https://medium.com/terminusdb)

Watch this space!

~~~
carapace
I just read your "TerminusDB — what’s in a name?" blog post, love it! The tie-
in to Asimov's Foundation, you folks seem pretty serious about that, yes?

\- - - -

You're releasing TerminusDB under the GPL! Bless your hearts! I can't wait to
see it!

\- - - -

Did you know that the Applied Category Theory folks
([https://www.appliedcategorytheory.org/](https://www.appliedcategorytheory.org/))
have something they call CQL, Categorical Query Language,
[https://www.categoricaldata.net/](https://www.categoricaldata.net/) ? They
have a book out that talks about it, "Seven Sketches in Compositionality:An
Invitation to Applied Category Theory", specifically Chapter 3 "Databases:
Categories, functors, and universal constructions"
[https://math.mit.edu/~dspivak/teaching/sp18/7Sketches.pdf](https://math.mit.edu/~dspivak/teaching/sp18/7Sketches.pdf)

~~~
LukeEF
Thanks! We're very serious about the link to Asimov's foundation. We're huge
fans and our work on the global history databank was, in part, inspired by
psychohistory
([https://en.wikipedia.org/wiki/Cliodynamics](https://en.wikipedia.org/wiki/Cliodynamics)).

\-------

Haven't seen CQL - must take a look and share with Terminus team member
('terminator' naturally!) who wrote our query language, WOQL (web object query
language). Prolog as the basis for a query language is v powerful. We get:
queries returning graphs, recursion as a core feature, composable sub-queries
and irregular expressions & cycles.

There is a standardization push in graph query at the moment so I have all
this stuff in the front of my mind! Trying to write a 'graph query manifesto'
at the moment.

\----------

On earlier comment - we are absolutely hiring, especially folks interested in
prolog!

~~~
carapace
> We're very serious about the link to Asimov's foundation.

Excellent! I've heard that Behavioral Economics is also inspired by
psychohistory.

If you're also looking to the future you might want to get in touch with the
Long Now Foundation.

In re: CQL the underlying CT treatment of DBs is the "secret sauce". I haven't
investigated WOQL in depth yet (I looked at the source in
[https://github.com/terminusdb/terminusdb](https://github.com/terminusdb/terminusdb))
but I agree with you that Prolog is superlative for a query language.

I was joking about hiring, but if you put some issues in github it's not
inconceivable you might get a PR someday. I don't want to make any promises.

As I mentioned above, I'm working on Joy-in-Prolog, and I'm right at the point
where I'm thinking about how to represent data (as in DBs) using Category
Theory along with the standard meta-data in "Data Model Patterns: A Metadata
Map" by David C. Hay.

------
norswap
For a complete different approach: [https://github.com/norswap/prolog-
dry](https://github.com/norswap/prolog-dry)

~~~
segmondy
Not even comparable. The OP posted a book, but you posted is a guide of no
more than 30 pages.

Novice: Adventure in Prolog Learn Prolog Now Logic Programming with Prolog

Med - Advanced: Clause and Effect The Art of Prolog The Craft of Prolog Wam
Book The Practice of Prolog Prolog Programming for AI - Brakto

Deep Dive: Expert Systems in Prolog Natural Language Processing for Prolog
Programmers Intelligent Image Processing in Prolog Representing Knowledge In
Prolog

There are hundreds of books! The real gems are to be found in papers, look
into published papers, you will find amazing topics on Meta Programming,
Machine Learning, Compiler Construction, DCG, etc. Don't discount books by
age, even if they were published in the 80s! The best books are from the
80's-90's.

A few sites [https://www.metalevel.at/](https://www.metalevel.at/)
[https://www.cpp.edu/~jrfisher/www/prolog_tutorial/contents.h...](https://www.cpp.edu/~jrfisher/www/prolog_tutorial/contents.html)

Use SWI-Prolog - [https://www.swi-prolog.org/](https://www.swi-prolog.org/)

~~~
jlarocco
A PDF version of "The Art of Prolog" is available from MIT:
[https://mitpress.mit.edu/books/art-prolog-second-
edition](https://mitpress.mit.edu/books/art-prolog-second-edition)

