<< Back to previous view

[LOGIC-169] equality of non-unique lvars broken for clojure 1.7 Created: 25/Jun/15  Updated: 05/Aug/15

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

Type: Defect Priority: Trivial
Reporter: Maik Sch√ľnemann Assignee: David Nolen
Resolution: Unresolved Votes: 0
Labels: clojure-1.7

Attachments: Text File 0001-alter-equality-of-non-unique-lvars-for-clojure-1.7.patch    
Patch: Code and Test

 Description   

clojure 1.7 changes the interning of strings when creating symbols, as is described here
https://github.com/clojure/clojure/blob/master/changes.md#23-keyword-and-symbol-construction

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.



 Comments   
Comment by David Nolen [ 02/Jul/15 6:14 PM ]

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

Comment by Maik Sch√ľnemann [ 26/Jul/15 8:14 AM ]

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
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for org.clojure:core.logic:jar:0.8.11-SNAPSHOT
[WARNING] The expression ${artifactId} is deprecated. Please use ${project.artifactId} instead.
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building core.logic 0.8.11-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] — maven-enforcer-plugin:1.0:enforce (enforce-maven) @ core.logic —
[INFO]
[INFO] — build-helper-maven-plugin:1.5:add-source (add-clojure-source-dirs) @ core.logic —
[INFO] Source directory: /home/kima/programming/core.logic/src/main/clojure added.
[INFO]
[INFO] — build-helper-maven-plugin:1.5:add-resource (add-clojure-source-dirs) @ core.logic —
[INFO]
[INFO] — build-helper-maven-plugin:1.5:add-test-source (add-clojure-test-source-dirs) @ core.logic —
[INFO] Test Source directory: /home/kima/programming/core.logic/src/test/clojure added.
[INFO]
[INFO] — build-helper-maven-plugin:1.5:add-test-resource (add-clojure-test-source-dirs) @ core.logic —
[INFO]
[INFO] — maven-resources-plugin:2.3:resources (default-resources) @ core.logic —
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/kima/programming/core.logic/src/main/resources
[INFO] Copying 14 resources
[INFO]
[INFO] — maven-compiler-plugin:3.1:compile (default-compile) @ core.logic —
[INFO] Nothing to compile - all classes are up to date
[INFO]
[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
[INFO]
[INFO] — maven-resources-plugin:2.3:testResources (default-testResources) @ core.logic —
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory /home/kima/programming/core.logic/src/test/resources
[INFO] Copying 3 resources
[INFO]
[INFO] — maven-compiler-plugin:3.1:testCompile (default-testCompile) @ core.logic —
[INFO] Nothing to compile - all classes are up to date
[INFO]
[INFO] — maven-surefire-plugin:2.10:test (default-test) @ core.logic —
[INFO] Surefire report directory: /home/kima/programming/core.logic/target/surefire-reports

-------------------------------------------------------
T E S T S
-------------------------------------------------------

Results :

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

[INFO]
[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.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 33.466s
[INFO] Finished at: Sun Jul 26 14:03:54 CEST 2015
[INFO] Final Memory: 12M/300M
[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 <file>..." to update what will be committed)
(use "git checkout – <file>..." 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")

Comment by Jan-Paul Bultmann [ 05/Aug/15 9:27 AM ]

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





[LOGIC-164] Guard against arity missmatches between rels, facts and retractions Created: 10/Dec/14  Updated: 27/Dec/14

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

Type: Enhancement Priority: Trivial
Reporter: Reid McKenzie Assignee: David Nolen
Resolution: Unresolved Votes: 0
Labels: None

Attachments: Text File 0001-Catch-arity-missmatches-between-rels-facts.patch    

 Description   

This patch adds arity checking to relations, facts and retractions so that if a user specifies that a rel "foo" shall be 3-tuple in the def-rel form it will be illegal to add a 4-tuple as a fact to the db. This protects the state of the DB against a class of user errors which would otherwise silently fail through.

This is more a work proposal than anything, as it may well be legitimate to have a variable arity relation. I would just consider such a construct suspect, and this patch supports the way I've approached pldb.



 Comments   
Comment by David Nolen [ 21/Dec/14 2:12 PM ]

Interesting, thanks for the patch. Will think about it.

Comment by Norman Richards [ 27/Dec/14 3:13 PM ]

Many of our pldb relations have a large number of arguments. Being able to detect incorrect declarations early would not be bad.





[LOGIC-157] A warning is thrown regarding the redefinition of record? in clojure 1.6.0 Created: 27/Mar/14  Updated: 15/May/14

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

Type: Task Priority: Trivial
Reporter: Justin Overfelt Assignee: David Nolen
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Linux x64



 Description   

Clojure 1.6.0 adds a record? function that has the same implementation as the one in clojure.core.logic. As a result, a warning is shown when the code in the core.logic namespace is evaluated under clojure 1.6.0. Since the two functions have the same implementation, this is purely a cosmetic issue.



 Comments   
Comment by Justin Overfelt [ 15/May/14 7:17 PM ]

I saw that this is now fixed in master - thanks! This also breaks AOT compilation if used with clojure 1.6.0 as referenced in CLJ-1241. Is there a timeline for a 0.8.8 release?

Comment by David Nolen [ 15/May/14 7:22 PM ]

I will try to cut a release next week.

Comment by Justin Overfelt [ 15/May/14 7:25 PM ]

Awesome - thank you!





[LOGIC-96] relevant-var? logic incorrectly discards a vars constraint set Created: 04/Jan/13  Updated: 17/Mar/13

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

Type: Defect Priority: Trivial
Reporter: David Nolen Assignee: David Nolen
Resolution: Unresolved Votes: 0
Labels: None


 Description   

Need a patch and a test showing that the vars constraint set is preserved.



 Comments   
Comment by David Nolen [ 07/Jan/13 7:04 PM ]

Currently dead code so this is not a blocker.





Generated at Fri Sep 04 16:09:04 CDT 2015 using JIRA 4.4#649-r158309.