<< Back to previous view

[LOGIC-85] another issue with predc constraint is not enforced when it could be Created: 24/Dec/12  Updated: 28/Jul/13  Resolved: 24/Dec/12

Status: Closed
Project: core.logic
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Nada Amin Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None


 Description   

This returns ([1 1]) instead of ().

(run* [q]
  (fresh [x y]
    (predc y even? `even?)
    (predc x odd? `odd)
    (== x y)
    (== x 1)
    (== q [x y]))))


 Comments   
Comment by David Nolen [ 24/Dec/12 1:31 PM ]

This is actually related to the deeper problem also demonstrated by LOGIC-77. The problem is that cKanren checks constraints via "update-prefix" which calls "update" which calls "run-constraints*". "update" is called on the Substitution prior to unification. This creates all kinds of issues as it's during unification that we "migrate" constraints from one logic var to another.

I'm pondering eliminating "update" and moving "run-constraints*" lower into the system - perhaps at the level of "ext-no-check". A related change would be putting SubstValue smarts into "ext-no-check". For example a "ext-no-check" on a unbound constrained logic var would simply update its SubstValue. This is critical as SubstValue might contain constraint information that must be preserved.

Comment by David Nolen [ 24/Dec/12 6:14 PM ]

fixed, http://github.com/clojure/core.logic/commit/d4d4cd53edfd76c2f416bd699f4b4d914f880985

Generated at Sat Oct 25 06:30:25 CDT 2014 using JIRA 4.4#649-r158309.