5 ms·
Prolog is good for discrete search like this, mostly because it's just hiding the underlying search algorithm that other languages would be to be explicit about
by ggggtez 7y ago
Prolog is good for discrete search like this, mostly because it's just hiding the underlying search algorithm that other languages would be to be explicit about (but as a result, other languages can search more efficiently).
- segmondy 7y agoAll computer science problems can be reduced to sorting & searching. ;-D
- randomsearch 7y agoIs this really true? I was wondering about complexity analysis, for example.
- jodrellblank 7y agoOther languages can search more efficiently if you write a more efficient search in them, but Prolog can search more efficiently if you write a more efficient search in it, too. "That's it. On backtracking, this generates increasingly longer lists Ls, and invokes p/1 only on lists of bounded length. Bamm! Iterative deepening. [..] asymptotically optimal under very general assumptions, and you can make it easily available in Prolog yourself. I guess mostly for this reason, the default execution strategy is kept extremely simple. When needed, you can easily implement other search strategies on top of it." - https://www.reddit.com/r/prolog/comments/47fchf/why_depthfirst_for_resolution/ https://www.reddit.com/r/prolog/comments/47fchf/why_depthfir...