[LOGIC-91] nom/tie and spurious reification of predc constraint Created: 02/Jan/13 Updated: 28/Jul/13 Resolved: 02/Jan/13
|Reporter:||Nada Amin||Assignee:||David Nolen|
|Comment by Nada Amin [ 02/Jan/13 5:07 AM ]|
Implementing -force-ans in Tie
resolves the test above, but not this one:
|Comment by David Nolen [ 02/Jan/13 8:15 AM ]|
This issue actually impacts any "single shot" constraint that implements `-relevant?` as simply returning `true`. The problem is that the `cgoal` constraint wrapper checks `runnable?`, runs the constraint, and then checks `relevant?` and if that's true adds the constraint even though it may very well may be entailed!
There are 6 constraints (1 of them the `defc` macro) which implement `-relevant?` as returning `true`. I think we should have more support (a protocol) for constraints which are essentially "single shot" and don't need to bother with implementing the `IRelevant` protocol.
For some background - the CLP(FD) constraints benefit most from the `IRelevant` protocol, where the constraints involve up to 3 terms and a considerable amount of propagation work may be avoided by doing some checking up front.
|Comment by Nada Amin [ 02/Jan/13 8:19 AM ]|
I have a fix proposed in pull request https://github.com/clojure/core.logic/pull/15
The idea there is that to honor single-shot constraints, we only need to honor the (remcg this) that they contain. This is only possible if they have proper ids. That's what I fix.
Let me know what you think.
|Comment by David Nolen [ 02/Jan/13 8:46 AM ]|