<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def expr2truthtable(expr):
 """Convert an expression into a truth table."""

    inputs = [ttvar(v.names, v.indices) for v in expr.inputs]
    return truthtable(inputs, expr.iter_image())