Exercise 2: Boolean Programs
A boolean program is a program in which all variables have type Boolean and may use the following constructions: Boolean expressions may be formed from boolean variables using the operators ^, V, and constants 0, 1.
If x is a variable and e is a Boolean expression, then the statement x = e is a program that runs by calculating the value of e and updating x to have this value.
If P and Q are programs, then P; Q is a program that runs by first executing P and then executing Q.
If P and Q are programs and e is a boolean expression, then {P} else {Q} is a program that runs by first calculating the value of e and executing P if e is true, and executing Q otherwise.
If P is a program and e is a boolean expression, then while e do {P} is a program that runs by repeatedly testing if e is true and executing P if so. The loop exits as soon as e evaluates to false.
Boolean programs run starting from some given initial assignment T to their boolean variables and update this assignment during their execution. They may terminate or not, possibly depending on the initial assignment. For example, while x do {if y then {y := 0} else {y := 1}} when run from initial assignment T halts immediately if T(y) = 0 and is non-terminating if T(y) = 1.
Show that the computational complexity of the following problem is in PSPACE: given boolean program P, does there exist an assignment T such that P terminates when run from initial assignment T?
Exercise 3: PSPACE-hardness of the Problem from Exercise 2