clojure-numerics / expresso

Clojure library for symbolic computation
312 stars 20 forks source link

Problem solving a single equation #24

Closed johngarg closed 7 years ago

johngarg commented 7 years ago

The function solve returns an error when only one equation to be solved is supplied. Thus (solve 'x '(= 13 (+ (* 4 x) 5))) gives me:

Unhandled java.lang.IllegalArgumentException 

Don't know how to create ISeq from: clojure.core.logic.LVar

while (solve 'x '(= 13 (+ (* 4 x) 5)) '(= a b)) evaluates to #{{x 2}}, as expected.

mschuene commented 7 years ago

What version are you using? Locally this works fine for me:

numeric.expresso.core> (solve 'x '(= 13 (+ (* 4 x) 5)) '(= a b))
#{{x 2}}
numeric.expresso.core> (solve 'x '(= 13 (+ (* 4 x) 5)))
#{2}
johngarg commented 7 years ago

My dependencies are

  :dependencies [[org.clojure/clojure "1.8.0"]
                 [expresso "0.2.2-SNAPSHOT"]
                 [instaparse "1.4.3"]]

I should note that [org.clojure/clojure "1.6.0"] seems to work fine—something I checked after reading a comment in a different issue's thread.