Question: 4. Conditional assignments (10 points). When rummaging through the syntax manual of other imperative programming language and comparing them to the while language considered in

4. Conditional assignments (10 points). When rummaging through the syntax manual of other imperative programming language and comparing them to the while language considered in class, a clever student found that we totally neglected their favorite feature of conditional assignments. Indeed, the conditional assignment x :=Q?el : e2 that assigns term el to variable x if formula Q is true and otherwise assigns term e2 to x is missing. Your job is to define a semantics [0 := Q?el : e2] for the conditional assignment 2 :=Q?el : e2 as the set of all pairs of initial and final states of running x := Q?el : e2. After having done so, your next task is to design a sound axiom for it: ([:=?:]) [x :=Q?el : e2]p(x) + 5. Now prove it! (10 points). Use the semantics from part 4 to prove that your axiom is sound, i.e., that it is a valid formula of dynamic logic
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
