In [1]:
%load_ext gvmagic
In [2]:
from boolexpr import *
In [3]:
ctx = Context()
In [4]:
a, b, c, d, p, q, s, d1, d0 = map(ctx.get_var, "a b c d p q s d1 d0".split())
In [5]:
%dotobjs ~a | b, or_(0, b, ~c, 'X')
In [6]:
%dotobjs ~a & b, and_(1, b, ~c, '?')
In [7]:
%dotobjs ~a ^ b, xor(0, ~c, d, 'X')
In [8]:
%dotobjs eq(~a, b), eq(1, b, ~c, '?')
In [9]:
%dotobjs impl(p, q), impl(0, 1)
In [10]:
%dotobjs ite(s, d1, d0), ite(s, 0, 1)
In [11]:
%dotobj ~or_(a, and_(b, ~eq(c, impl(p, q))), xor(d, ~ite(s, d1, d0)))
In [ ]: