Welcome! Please see the About page for a little more info on how this works.

0 votes
in core.logic by

clojure 1.7 changes the interning of strings when creating symbols, as is described here

Therefore, two non-unique lvars with the same name don't have to be equal anymore with the current
Lvar equality method which checks (identical? name (:name o)).

This is causing expresso, which relies on non-unique lvars for the rule engine to fail with clojure 1.7

changing the identical? to a = fixes the issue.

4 Answers

0 votes

Comment made by: dnolen

When I apply this patch two tests fail. Can we fix these tests? Thanks!

0 votes

Comment made by: mschuene

sorry for not responding quicker.
Which two tests are failing? It seems that they aren't always failing. I get zero failures with mvn test.
Also when I check out a fresh copy of core.logic master, apply the patch and run the tests all succeed.

~/programming $ git clone https://github.com/clojure/core.logic
Cloning into 'core.logic'...
remote: Counting objects: 14868, done.
remote: Total 14868 (delta 0), reused 0 (delta 0), pack-reused 14868
Receiving objects: 100% (14868/14868), 3.02 MiB | 1.86 MiB/s, done.
Resolving deltas: 100% (3955/3955), done.
Checking connectivity... done.
~/programming $ cd core.logic/
~/programming/core.logic $ git apply 0001-alter-equality-of-non-unique-lvars-for-clojure-1.7.patch
~/programming/core.logic $ mvn test
(link: INFO) Scanning for projects...
(link: WARNING)
(link: WARNING) Some problems were encountered while building the effective model for org.clojure:core.logic:jar:0.8.11-SNAPSHOT
(link: WARNING) The expression ${artifactId} is deprecated. Please use ${project.artifactId} instead.
(link: WARNING)
(link: WARNING) It is highly recommended to fix these problems because they threaten the stability of your build.
(link: WARNING)
(link: WARNING) For this reason, future Maven versions might no longer support building such malformed projects.
(link: WARNING)
(link: INFO)
(link: INFO) ------------------------------------------------------------------------
(link: INFO) Building core.logic 0.8.11-SNAPSHOT
(link: INFO) ------------------------------------------------------------------------
(link: INFO)
(link: INFO) --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ core.logic ---
(link: INFO)
(link: INFO) --- build-helper-maven-plugin:1.5:add-source (add-clojure-source-dirs) @ core.logic ---
(link: INFO) Source directory: /home/kima/programming/core.logic/src/main/clojure added.
(link: INFO)
(link: INFO) --- build-helper-maven-plugin:1.5:add-resource (add-clojure-source-dirs) @ core.logic ---
(link: INFO)
(link: INFO) --- build-helper-maven-plugin:1.5:add-test-source (add-clojure-test-source-dirs) @ core.logic ---
(link: INFO) Test Source directory: /home/kima/programming/core.logic/src/test/clojure added.
(link: INFO)
(link: INFO) --- build-helper-maven-plugin:1.5:add-test-resource (add-clojure-test-source-dirs) @ core.logic ---
(link: INFO)
(link: INFO) --- maven-resources-plugin:2.3:resources (default-resources) @ core.logic ---
(link: INFO) Using 'UTF-8' encoding to copy filtered resources.
(link: INFO) skip non existing resourceDirectory /home/kima/programming/core.logic/src/main/resources
(link: INFO) Copying 14 resources
(link: INFO)
(link: INFO) --- maven-compiler-plugin:3.1:compile (default-compile) @ core.logic ---
(link: INFO) Nothing to compile - all classes are up to date
(link: INFO)
(link: INFO) --- clojure-maven-plugin:1.3.13:compile (clojure-compile) @ core.logic ---
Compiling clojure.core.logic.unifier to /tmp/classes7718945366616667003.dir
Compiling clojure.core.logic to /tmp/classes7718945366616667003.dir
Compiling clojure.core.logic.nominal to /tmp/classes7718945366616667003.dir
Compiling clojure.core.logic.datomic to /tmp/classes7718945366616667003.dir
Compiling clojure.core.logic.dcg to /tmp/classes7718945366616667003.dir
Compiling clojure.core.logic.fd to /tmp/classes7718945366616667003.dir
Compiling clojure.core.logic.pldb to /tmp/classes7718945366616667003.dir
Compiling cljs.core.logic to /tmp/classes7718945366616667003.dir
Compiling clojure.core.logic.arithmetic to /tmp/classes7718945366616667003.dir
Compiling clojure.core.logic.protocols to /tmp/classes7718945366616667003.dir
Compiling cljs.core.logic.pldb to /tmp/classes7718945366616667003.dir
Compiling clojure.core.logic.bench to /tmp/classes7718945366616667003.dir
(link: INFO)
(link: INFO) --- maven-resources-plugin:2.3:testResources (default-testResources) @ core.logic ---
(link: INFO) Using 'UTF-8' encoding to copy filtered resources.
(link: INFO) skip non existing resourceDirectory /home/kima/programming/core.logic/src/test/resources
(link: INFO) Copying 3 resources
(link: INFO)
(link: INFO) --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ core.logic ---
(link: INFO) Nothing to compile - all classes are up to date
(link: INFO)
(link: INFO) --- maven-surefire-plugin:2.10:test (default-test) @ core.logic ---
(link: INFO) Surefire report directory: /home/kima/programming/core.logic/target/surefire-reports


Results :

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0

(link: INFO)
(link: INFO) --- clojure-maven-plugin:1.3.13:test (clojure-test) @ core.logic ---

Testing clojure.core.logic.pldb.tests

Testing clojure.core.logic.nominal.tests

Testing clojure.core.logic.tests

Ran 425 tests containing 661 assertions.
0 failures, 0 errors.
(link: INFO) ------------------------------------------------------------------------
(link: INFO) ------------------------------------------------------------------------
(link: INFO) Total time: 33.466s
(link: INFO) Finished at: Sun Jul 26 14:03:54 CEST 2015
(link: INFO) Final Memory: 12M/300M
(link: INFO) ------------------------------------------------------------------------

~/programming/core.logic $ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git checkout -- ..." to discard changes in working directory)

modified:   src/main/clojure/clojure/core/logic.clj
modified:   src/test/clojure/clojure/core/logic/tests.clj

no changes added to commit (use "git add" and/or "git commit -a")

0 votes

Comment made by: ticking

I didn't see failing tests after applying this patch either.

0 votes
Reference: https://clojure.atlassian.net/browse/LOGIC-169 (reported by alex+import)