3 ms·
Prolog is a declarative logic system. As a result, implementing something like a list equality operator means that you can also run the code in "reverse" -- ge
by michael1999 4y ago
Prolog is a declarative logic system. As a result, implementing something like a list equality operator means that you can also run the code in "reverse" -- generate a list that is equal to this list. But as soon as the problem becomes complicated, the order you traverse the search space, and which branches of the search space you exclude early are critical to practical solutions. Prolog solves with cuts and other hints.
A quick google produces this example - https://en.m.wikibooks.org/wiki/Prolog/Cuts_and_Negation https://en.m.wikibooks.org/wiki/Prolog/Cuts_and_Negation
https://www.cs.uleth.ca/~gaur/post/prolog-cut-negation/ https://www.cs.uleth.ca/~gaur/post/prolog-cut-negation/