3 ms·
Can you give one or two examples of where prolog would be more effective than other tools? I was exposed to it in college but never used it beyond that.
by marcell 8y ago
Can you give one or two examples of where prolog would be more effective than other tools? I was exposed to it in college but never used it beyond that.
- carapace 8y agoSure! DCG (Definite Clause Grammar)[1] are similar to the OMeta PEG parsers[2] but more powerful and flexible. Constraint logic programming, e.g. CLP(FD)[3] makes many kinds of problem easy to solve. I wrote what I call the "Boring Sudoku Solver"[4] It's so simple it's dull. It'll solve, validate, and generate Sudoku puzzles. Interestingly, both of these are considered somewhat newfangled in the Prolog community (despite being ancient by, say, JS standards.) [1] https://en.wikipedia.org/wiki/Definite_clause_grammar https://en.wikipedia.org/wiki/Definite_clause_grammar http://www.amzi.com/manuals/amzi/pro/ref_dcg.htm http://www.amzi.com/manuals/amzi/pro/ref_dcg.htm https://www.metalevel.at/prolog/dcg https://www.metalevel.at/prolog/dcg http://www.pathwayslms.com/swipltuts/dcg/ http://www.pathwayslms.com/swipltuts/dcg/ [2] http://www.vpri.org/pdf/tr2007003_ometa.pdf http://www.vpri.org/pdf/tr2007003_ometa.pdf [3] https://en.wikipedia.org/wiki/Constraint_logic_programming https://en.wikipedia.org/wiki/Constraint_logic_programming http://pathwayslms.com/swipltuts/clpfd/clpfd.html http://pathwayslms.com/swipltuts/clpfd/clpfd.html https://www.metalevel.at/prolog/clpfd https://www.metalevel.at/prolog/clpfd http://www.swi-prolog.org/man/clpfd.html http://www.swi-prolog.org/man/clpfd.html [4] https://swish.swi-prolog.org/p/Boring%20Sudoku.swinb https://swish.swi-prolog.org/p/Boring%20Sudoku.swinb