upvote
Prolog is actually a perfect fit for all kinds of adventure, role playing, strategy, and classic board/card games, with clauses representing game rules and facts representing the game state and universe in the most natural way.

Simple general-purpose opponents can be coded using just recursive backtracking search, while more advanced ones (supporting moves that need to destructively change state) can still be conveniently modelled by reifying facts and thereby enable backtracking over assert/retract-like Prolog DB modifications, as used in discrete combinatorial planners [1].

[1]: https://quantumprolog.sgml.net/container-planning-demo/part1...

reply
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).
reply
Importantly, Datalog is not Turing-complete though.
reply
You can get Turing completeness by wrapping your datalog query in a while loop, so that's not particularly restrictive.
reply
You can get Turing completeness by wrapping basically any math or logic system in a while loop, even arithmetic. So that doesn't tell us much about the restrictiveness of the overall system since I'd call "you can only use arithmetic" pretty damn restrictive.
reply
In the case of Datalog, it not being Turing-complete is usually seen as a feature rather than restrictive.
reply
Exactly :) It is terminating due to the LFP semantics I was pointing out, it's more akin to SQL than to Prolog. The article doesn't even show the usage of the Prolog cut (`!`).

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.

reply
Nonplussed like initially surprised? It does not mean bored or nonchalant which many people seem to think, probably due to the non- prefix.
reply
Interesting, it seems I learned/am using a modern American mutated version of the word.

https://www.broadlearners.com/t/understanding-the-meaning-of...

https://www.merriam-webster.com/grammar/whole-nother

https://old.reddit.com/r/etymology/comments/13s19j0/wtf_happ...

In my case, I was using it as almost a blend of the two meanings, something mostly meaning “unimpressed”, with a touch of “and a bit perplexed why such effort is going into this”. Basically a shoulder shrug and “okay…?”

I now find myself nonplussed, wondering if I should be using the word at all given it seems to have two opposite meanings.

reply