Hacker News new | past | comments | ask | show | jobs | submit login

Depending on which types of constraints you need to express your problem space, you could use plain Prolog or (more likely) make use of excellent constraint libraries like CLP(FD) for SWI-Prolog [1]. It's important to note that these are built into and tightly integrated with most Prolog. So people who point out that Prolog's backtracking search is too limited and/or slow are not taking the full picture into account.

I also recommend checking out Picat, a Prolog-derived language with excellent support for constraints programming and many built-in global constraints (a very important tool for larger-scale constraint programming) [2]. As of the recently released version 3 (featured on HN [3]), Picat also supports traditional Prolog syntax. IMO Picat is still rough around the edges when it comes to error messages, modularization etc, but if nothing else it's excellent for learning and for prototyping constraint models.

[1] https://www.swi-prolog.org/man/clpfd.html [2] http://picat-lang.org/ [3] https://news.ycombinator.com/item?id=24608997




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: