← Back to context

Comment by cess11

10 days ago

Would depend on the implementation, I think. You could probably write one like that, but as usual there will be trade-offs. I suspect it would also matter if you're targeting booleans or numbers.

The typical, obvious case how these things work in Prolog is in list concatenation. If you only supply variables it'll start outputting lists of increasing length with placeholder variables. It's a somewhat simple engine for traversing a problem space and testing constraints that uses backtracking to step through it. Some implementations allow you to explicitly change the search strategy.