Prolog Basics Explained with Pokémon
unplannedobsolescence.com
Prolog Basics Explained with Pokémon
1–10 of 64 posts
Re: Prolog Basics Explained with Pokémon
#2Re: Prolog Basics Explained with Pokémon
#3Re: Prolog Basics Explained with Pokémon
#4Re: Prolog Basics Explained with Pokémon
#5Was initially nonplussed, but toward the end I realized the choice of pokemon for an example actually works out well for showing how prologue can solve problems. I’m now a bit curious about trying it out somewhere.
Re: Prolog Basics Explained with Pokémon
#6Re: Prolog Basics Explained with Pokémon
#7Was initially nonplussed, but toward the end I realized the choice of pokemon for an example actually works out well for showing how prologue can solve problems. I’m now a bit curious about trying it out somewhere.
All examples shown in the article can be ran with Datalog too (with stratified negation and arithmetic comparison), which has a clearer execution model and looks almost identical to Prolog. Prolog underneath is doing backtracking, while Datalog is finding a least fixed point of derived relations where iterating on data won't produce more relations, and is akind to SQL (but usually stronger because of recursion).
Re: Prolog Basics Explained with Pokémon
#8Re: Prolog Basics Explained with Pokémon
#9When i was in uni, the course teaching Prolog and Lisp was called "Artificial Intelligence for Engineers".
Man, where was a post like this when I was struggling trying to learn Prolog, modelling something with knights and knaves...
Re: Prolog Basics Explained with Pokémon
#10Earlier quoted context omitted.
All examples shown in the article can be ran with Datalog too (with stratified negation and arithmetic comparison), which has a clearer execution model and looks almost identical to Prolog. Prolog underneath is doing backtracking, while Datalog is finding a least fixed point of derived relations where iterating on data won't produce more relations, and is akind to SQL (but usually stronger because of recursion).
Importantly, Datalog is not Turing-complete though.
And yet Prolog can express all examples in the article. For these kinds of problems, giving up TC is mostly a feature. And if you need more expressiveness, there's a lot of practical Datalog-ish systems that can recover Turing completeness (Flix, Formulog, parts of Souffle), while still being saner than SWI Prolog and co. for this type of work, as you generally don't have to care about atom order or search order in the same way. They act so much more predictably.