<< Back to previous view

[LOGIC-132] "PMap is non-storable" exception when using featurec with nested feature map. Created: 26/Apr/13  Updated: 28/Jul/13  Resolved: 05/May/13

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

Type: Defect Priority: Major
Reporter: Martin Forsgren Assignee: David Nolen
Resolution: Completed Votes: 0
Labels: None

core.locic 0.8.3


This works as expected:

(run* [x y]
  (featurec x {:a {:b 1}})
  (== y {:b 1})
  (== x {:a y}))

;; => ([{:a {:b 1}} {:b 1}])

But with the last two goals swapped an exception is thrown:

(run* [x y]
  (featurec x {:a {:b 1}})
  (== x {:a y})
  (== y {:b 1}))

;; =>
Exception clojure.core.logic.PMap@3c6f0bed is non-storable
    clojure.core.logic.LVar (logic.clj:647)
    clojure.core.logic/unify (logic.clj:231)
    clojure.core.logic/unify-with-pmap* (logic.clj:2601)
    clojure.core.logic.PMap (logic.clj:2614)
    clojure.core.logic/unify (logic.clj:232)
    clojure.core.logic/==/fn--2819 (logic.clj:1135)
    clojure.core.logic/composeg/fn--2745 (logic.clj:1029)
    clojure.core.logic/-featurec/reify--3655 (logic.clj:2646)
    clojure.core.logic/composeg/fn--2745 (logic.clj:1029)
    clojure.core.logic/composeg/fn--2745 (logic.clj:1030)
    clojure.core.logic/run-constraint/fn--3431 (logic.clj:2184)
    clojure.core.logic/fix-constraints (logic.clj:2211)

The same exception is thrown when (== y {:b 1}) is left out:

(run* [x y]
  (featurec x {:a {:b 1}})
  (== x {:a y}))

Comment by David Nolen [ 05/May/13 7:34 PM ]

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

Generated at Mon Jan 22 16:28:19 CST 2018 using JIRA 4.4#649-r158309.