Solving the knapsack problem (NP-complete!) in Prolog: https://newtocode.wordpress.com/2013/11/23/knapsack-problem-in-prolog/
miniblog.
Related Posts
Prolog has a really unusual comparison syntax: it uses =< for less than or equal, unlike most languages which use <=.
TIL that Prolog has a notion of a functor! https://www.cse.unsw.edu.au/~billw/dictionaries/prolog/functor.html
In true PL style it has a different meaning from the Haskell, OCaml and C++ terminology.
Awesome, there's a whole miniKanren implementation in emacs lisp! https://github.com/nickdrozd/reazon
This gives you logic programming somewhat like Prolog or Clojure's core.logic.