There is a very small programming language built from just these three statements.
if <boolean expression> then <statement list> fi
if <boolean expression> then <statement list> else <statement list> fi
checkpoint
Every keyword is written in lowercase. A <statement list> is one or more statements, and the whole program is a single <statement list>.
A <boolean expression> is made of the following.
~ (NOT), binary & (AND), binary | (OR)~ is highest, then &, then |.The grammar of an expression is:
<BE> -> ~<BE> | <BE>&<BE> | <BE>|<BE> | (<BE>) | [A-Z]
Given a syntactically correct program, write a program that determines, for each checkpoint, the value every variable must take in order to reach it.
A single syntactically correct program is given on standard input.
<statement list> contains at least one statement.Print one line for each checkpoint in the order it appears in the program. On each line:
>.unreachable after the >.