You are on page 1of 3

Assignment 5

ABHANG SONAWANE

Q1
Solution: The rule will be consistent and complete in the model.
*[b1--> s1|b2-->s2]
if b1 and b2 both are evaluated to true:
Per standard model, S1 or S2 will be chosen non-deterministically. Say, S1 is chosen and executed, the
result of this execution will be valid.
Per new model, S1 will be chosen in this case. So, the result will be valid in new model as well.
Hence the rule will be consistent.
The rule will also be complete because it lets us derive all the results that are valid in new model.
Q2
Solution:


The above rule can be explained as, since, the pre-condition is P, the statement S is executed not
dependent on the value of Q, in the post condition we check for Q and B and again S is executed
depending on the value of B. The checking of (Q and ~B) implies that the loop will be terminate. The
axiom system containing this rule will be consistent and complete.

Q3.

Solution:
<C, s> s , <be, s> true
-----------------------------------------------
<Repeat C until be, s> s

<C, s> s , <be, s> false, <Repeat C until be, s> s
----------------------------------------------------------------------------
<Repeat C until be, s> s





{P} S {Q} , (Q and ~B) ==> P
-------------------------------------
{P} repeat S until B {Q and B}

You might also like