<!-- 
RSS generated by JIRA (4.4#649-r158309) at Wed Jun 19 17:52:19 CDT 2013

It is possible to restrict the fields that are returned in this document by specifying the 'field' parameter in your request.
For example, to request only the issue key and summary add field=key&field=summary to the URL of your request.
For example:
http://dev.clojure.org/jira/si/jira.issueviews:issue-xml/LOGIC-100/LOGIC-100.xml?field=key&field=summary
-->
<rss version="0.92" >
<channel>
    <title>Clojure JIRA</title>
    <link>http://dev.clojure.org/jira</link>
    <description>This file is an XML representation of an issue</description>
    <language>en-us</language>    <build-info>
        <version>4.4</version>
        <build-number>649</build-number>
        <build-date>25-07-2011</build-date>
    </build-info>

<item>
            <title>[LOGIC-100] pruning of unsatisfiable non-ground disequalities</title>
                <link>http://dev.clojure.org/jira/browse/LOGIC-100</link>
                <project id="10020" key="LOGIC">core.logic</project>
                        <description>&lt;p&gt;Not sure whether we actually want to do anything about this.&lt;/p&gt;

&lt;p&gt;When running this snippet,&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;(run* [q]
  (fresh [a b]
    (== q [a b])
    (!= a q)))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;we get the result:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;(([_0 _1] :- (!= (_0 [_0 _1]))))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;

&lt;p&gt;The reified != constraint is arguably spurious, because of the occurs-check.&lt;/p&gt;

&lt;p&gt;Even if we instantiate the a:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;(run* [q]
  (fresh [a b]
    (== q [a b])
    (!= a q)
    (== a 1)))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;we get the result:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;(([1 _0] :- (!= (1 [1 _0]))))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;while there is no way the != constraint can be satisfied.&lt;/p&gt;

&lt;p&gt;Thoughts?&lt;/p&gt;</description>
                <environment></environment>
            <key id="15949">LOGIC-100</key>
            <summary>pruning of unsatisfiable non-ground disequalities</summary>
                <type id="1" iconUrl="http://dev.clojure.org/jira/images/icons/bug.gif">Defect</type>
                                <priority id="4" iconUrl="http://dev.clojure.org/jira/images/icons/priority_minor.gif">Minor</priority>
                    <status id="5" iconUrl="http://dev.clojure.org/jira/images/icons/status_resolved.gif">Resolved</status>
                    <resolution id="1">Completed</resolution>
                                <assignee username="dnolen">David Nolen</assignee>
                                <reporter username="namin">Nada Amin</reporter>
                        <labels>
                    </labels>
                <created>Mon, 7 Jan 2013 06:50:16 -0600</created>
                <updated>Mon, 7 Jan 2013 11:00:06 -0600</updated>
                    <resolved>Mon, 7 Jan 2013 11:00:06 -0600</resolved>
                                                                    <due></due>
                    <votes>0</votes>
                        <watches>0</watches>
                        <comments>
                    <comment id="30384" author="namin" created="Mon, 7 Jan 2013 07:25:17 -0600"  >&lt;p&gt;logic-100.diff contains a hackish fix: use unify instead of not= to deal with non-ground terms. Also, don&apos;t add the constraint if you know that some pairs cannot be unified upfront (this is needed b/c disunify and unify are not consistent wrt occurs-check).&lt;/p&gt;</comment>
                    <comment id="30387" author="dnolen" created="Mon, 7 Jan 2013 08:37:14 -0600"  >&lt;p&gt;Well it is possible to disable occurs-check. Why can&apos;t we just use the existing occurs-check fn to do this work?&lt;/p&gt;</comment>
                    <comment id="30388" author="namin" created="Mon, 7 Jan 2013 09:35:22 -0600"  >&lt;p&gt;There are two issues. The first one is that it&apos;s too conservative to just prune != constraints by checking that ground term pairs are not=, because &lt;span class=&quot;error&quot;&gt;&amp;#91;1 w&amp;#93;&lt;/span&gt; and &lt;span class=&quot;error&quot;&gt;&amp;#91;2 z&amp;#93;&lt;/span&gt; should also be pruned. Here is an extra test case illustrating this:&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;(deftest test-logic-100-disequality-3
  (is (= (run* [q]
           (fresh [x y w z]
             (== x [1 w])
             (== y [2 z])
             (!= x y)))
        &apos;(_0)))
  (is (= (run* [q]
           (fresh [x y w z]
             (!= x y)
             (== x [1 w])
             (== y [2 z])))
        &apos;(_0))))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;On master, the second one fails b/c it has the extra constraint&lt;/p&gt;
&lt;div class=&quot;code panel&quot; style=&quot;border-width: 1px;&quot;&gt;&lt;div class=&quot;codeContent panelContent&quot;&gt;
&lt;pre class=&quot;code-java&quot;&gt;(!= ([1 _1] [2 _2]))&lt;/pre&gt;
&lt;/div&gt;&lt;/div&gt;
&lt;p&gt;which we ought to prune.&lt;/p&gt;

&lt;p&gt;The second issue is that disunify does not take the occurs-check into account, so it can create a !=c that is not considered runnable, but if run, would be rightly pruned by the new unify clause (if the occurs-check is enabled).&lt;/p&gt;</comment>
                    <comment id="30389" author="dnolen" created="Mon, 7 Jan 2013 10:39:23 -0600"  >&lt;p&gt;Ok, makes sense. Can we get a new patch using master. This one doesn&apos;t apply anymore. Thanks!&lt;/p&gt;</comment>
                    <comment id="30390" author="namin" created="Mon, 7 Jan 2013 10:50:27 -0600"  >&lt;p&gt;logic-100-rebase.diff is a new patch against master. I also added the extra tests discussed above.&lt;/p&gt;</comment>
                    <comment id="30394" author="dnolen" created="Mon, 7 Jan 2013 11:00:06 -0600"  >&lt;p&gt;fixed, &lt;a href=&quot;http://github.com/clojure/core.logic/commit/770e027858bde711121abb9267854966a4dd92ed&quot;&gt;http://github.com/clojure/core.logic/commit/770e027858bde711121abb9267854966a4dd92ed&lt;/a&gt;&lt;/p&gt;</comment>
                </comments>
                    <attachments>
                    <attachment id="11794" name="logic-100.diff" size="2390" author="namin" created="Mon, 7 Jan 2013 07:25:17 -0600" />
                    <attachment id="11796" name="logic-100-rebase.diff" size="2723" author="namin" created="Mon, 7 Jan 2013 10:50:27 -0600" />
                </attachments>
            <subtasks>
        </subtasks>
                <customfields>
                                                                                            <customfield id="customfield_10010" key="com.pyxis.greenhopper.jira:gh-global-rank">
                <customfieldname>Global Rank</customfieldname>
                <customfieldvalues>
                    
                </customfieldvalues>
            </customfield>
                                                                                                            </customfields>
    </item>
</channel>
</rss>