Text this: Ternary and quaternary decision diagrams