solve boolean expression