mentat-collective / emmy

The Emmy Computer Algebra System.
https://emmy.mentat.org
GNU General Public License v3.0
389 stars 21 forks source link

Allow for equation representation (ie symbolic `=`) #82

Open sritchie opened 3 years ago

sritchie commented 3 years ago

@hcarvalhoaves and CTW in Clojurians Slack noted that this would be great.

Some tasks:

We might want inequalities represented with a new record type, rather than an expression with an embedded <=. But they should certainly freeze to that.

sritchie commented 3 years ago

I've started this over in sicmutils/sicmutils#262 - I've got = plugged in. Next I'll generalize to handle the other comparison operators.

sritchie commented 3 years ago

@hcarvalhoalves , I have come around to the idea that we want special constructors for this — maybe sym:= or something, but not =. it would be too easy to write tests like (is (= ...)) and have it succeed, because the thing is falsey.

The other note is that we'll be in GREAT shape if we simply make these return a Literal with a new type. Not ::x/numeric, but ::x/boolean or something. Then (+ (= 'x 'y) 'z) will NOT work (which is good)... but we can add a new set of boolean operations, with symbolic versions of or, and, not.

Thoughts?