pyeda icon indicating copy to clipboard operation
pyeda copied to clipboard

Is there a way to access terms of an expression?

Open Cerebus opened this issue 7 years ago • 2 comments

I don't see anything in the docs, but I could be missing something.

Cerebus avatar Aug 22 '18 20:08 Cerebus

I'm interested too; if there's an AND or an OR or an XOR, I'd like to be able to access its operands.

jason-s avatar Feb 20 '19 23:02 jason-s

oh wait -- it's .xs:

>>> import pyeda.inter
>>> a,b = map(pyeda.inter.exprvar,'ab')
>>> c = a&~b | b&~a
>>> c
Or(And(a, ~b), And(b, ~a))
>>> c.xs
(And(a, ~b), And(b, ~a))

jason-s avatar Feb 20 '19 23:02 jason-s