I have a few boolean expression in RPN-Format like this:
{0} {1} {2} AND OR // equals: {0} or {1} and {2}
Computing the boolean variables {x}
is very expensive. And obviously there is no need to compute {1}
and {2}
if {0}
is already true, since the expression will alway evaluation to true in this case.
How can I detect beforehand which boolean variables I have to evaluate first to abort the evaluation of the expression with as few variables evaluated as possible?
I want to know which variables with a definite value will evaluate the whole expression to be true or false.