3 ms·
> However, in terms of sophistication and convenience, Prolog is hard to beat, since it is a full-fledged programming language that can also be used to fetch, p
by jhgb 5y ago
> However, in terms of sophistication and convenience, Prolog is hard to beat, since it is a full-fledged programming language that can also be used to fetch, process and transform any available input in any way necessary to make it amenable to all built-in constraint solvers.
Surely the same thing could be accomplished in Lisp as well?
- dreamcompiler 5y agoYes but it would take more work. Prolog is tailor-made for solving logic and constraint problems like Sudoku out of the box; Lisp is not. That said, it's relatively easy to write a version of Prolog in Lisp and then just use that to solve the problem. Both pg and Peter Norvig show that in their Lisp books.
- simplify 5y agoIt can indeed! Both lisp and prolog are homoiconic :)
- Tomte 5y agoYes, and commercial Lisp implementations often include a reasonably performant Prolog. If you'd like to see how to do that yourself: https://github.com/norvig/paip-lisp https://github.com/norvig/paip-lisp