# pyeda.boolalg.minimization — Logic Minimization¶

The pyeda.boolalg.minimization module contains interface functions for two-level logic minimization.

Interface Functions:

## Interface Functions¶

pyeda.boolalg.minimization.espresso_exprs(*exprs)[source]

Return a tuple of expressions optimized using Espresso.

The variadic exprs argument is a sequence of expressions.

For example:

>>> from pyeda.boolalg.expr import exprvar
>>> a, b, c = map(exprvar, 'abc')
>>> f1 = ~a & ~b & ~c | ~a & ~b & c | a & ~b & c | a & b & c | a & b & ~c
>>> f2 = f2 = ~a & ~b & c | a & ~b & c
>>> f1m, f2m = espresso_exprs(f1, f2)
>>> f1m
Or(And(~a, ~b), And(a, b), And(~b, c))
>>> f2m
And(~b, c)

pyeda.boolalg.minimization.espresso_tts(*tts)[source]

Return a tuple of expressions optimized using Espresso.

The variadic tts argument is a sequence of truth tables.

For example:

>>> from pyeda.boolalg.bfarray import ttvars
>>> from pyeda.boolalg.table import truthtable
>>> X = ttvars('x', 4)
>>> f1 = truthtable(X, "0000011111------")
>>> f2 = truthtable(X, "0001111100------")
>>> f1m, f2m = espresso_tts(f1, f2)
>>> f1m
Or(x[3], And(x[0], x[2]), And(x[1], x[2]))
>>> f2m
Or(x[2], And(x[0], x[1]))