I wish there was a way to search for my comments, it sucks that I would have to paginate. I left a lot of comments.
I wish there was a way to search for my comments, it sucks that I would have to paginate. I left a lot of comments.
In practice you would have to write documentation that basically turns into a course on constraint solving in Prolog. There are footguns and somewhat advanced techniques involving control over the execution strategy that are going to trip up newcomers. You'll also have to figure out how to interface with a Prolog implementation.
A compromise might be to use bindings for Z3 or something like the Timefold solver, https://timefold.ai/open-source-solver. Either way it's a good idea to spend some time playing around with Scryer, https://www.scryer.pl/, and Markus Triska's crash course, https://www.metalevel.at/prolog. SWI-Prolog has more conveniences that might make it more suitable for practical applications, but being used to them might make it harder to adapt to e.g. Scryer, Tau or some other implementation.
There's also the Mercury language, it's weirder but also very interesting, https://mercurylang.org/.
Edit: Some people swear by Picat but I have very little experience with it, http://picat-lang.org/.
% Each shift needs a nurse).
1 { shift_nurse(Shift, Nurse): nurse(Nurse) } 1 :- shift(shift).
% It cannot be that a nurse does two shifts in a row.
:- nurse(Nurse), shift_nurse(Shift1,Nurse),shift_nurse(Shift2,Nurse), Shift1 + 1 = Shift2.
[0] https://potassco.org/doc/start/Found the original comment: https://news.ycombinator.com/item?id=41756679
Would this still work with ASP?
[1]: https://www.metalevel.at/prolog/timetabling/
[2]: https://github.com/mthom/scryer-prolog/discussions/2519