43 ms·
Does Prolog naturally support optimizing for an objective function?
by rhn_mk1 4y ago
Does Prolog naturally support optimizing for an objective function?
- rad_gruchalski 4y agoIn Prolog, the predicate order matters. So, if I understand your question correctly, no. It's up to the dev to order predicates in such a way that the amount of backtracking is kept to minimal.
- hakank 4y agoWell, most Prolog support clp(fd) (Constraint Logic Programming, Finite Domain) which mostly include support for minimizing/maximizing objectives.
- rad_gruchalski 4y agoBy unification, which will only match the arity, not the rules inside of a predicate. I could be wrong, though. Still learning all ins and outs.