Is there any application or tool that will take a truth table and turn it into a compacted if block?
For instance, lets say I have this truth table where A and B are conditions and x, y and z are possible actions:
A B | x y z
-------------
0 0 | 0 0 1
0 1 | 0 0 1
1 0 | 0 1 0
1 1 | 1 0 0
This application could produce this if block:
if(A)
{
if(B)
{
do(x)
}
else
{
do(y)
}
}
else
{
do(z)
}
This is an easy sample, but I frequently have several conditions that combined in different ways should produce different outputs and it gets hard to figure out the most compacted and elegant way to represent their logic in an if block.
