Skip to content

Commit 2348991

Browse files
Use cons package
1 parent 5a7ec36 commit 2348991

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ pymc4 @ git+https://github.com/pymc-devs/pymc4.git@master#egg=pymc4-0.0.1
99
multipledispatch>=0.6.0
1010
unification>=0.2.2
1111
kanren @ git+https://github.com/pymc-devs/kanren.git@symbolic-pymc#egg=kanren-0.2.3
12+
cons>=0.1.3
1213
toolz>=0.9.0
1314
sympy>=1.3
1415
cachetools

symbolic_pymc/relations/graph.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from kanren.core import goaleval
66

77
from kanren import eq
8-
from kanren.cons import is_cons, is_null
8+
from cons.core import ConsPair, ConsNull
99
from kanren.core import conde, lall
1010
from kanren.goals import conso, fail
1111

@@ -75,11 +75,11 @@ def goal(s):
7575
l_out_, l_in_ = reify((l_out, l_in), s)
7676

7777
out_null_type = False
78-
if is_cons(l_out_) or is_null(l_out_):
78+
if isinstance(l_out_, (ConsPair, ConsNull)):
7979
out_null_type = type(l_out_)()
8080

8181
in_null_type = False
82-
if is_cons(l_in_) or is_null(l_in_):
82+
if isinstance(l_in_, (ConsPair, ConsNull)):
8383
in_null_type = type(l_in_)()
8484

8585
if out_null_type is not False and not type(in_null_type) == type(out_null_type):

symbolic_pymc/unify.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import numpy as np
44

5+
from cons import cdr
56
from kanren.term import term, operator, arguments
67

78
from unification.more import unify

0 commit comments

Comments
 (0)