This preview shows pages 1–3. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS-536 Assignment-3 CWID # A201930231A.a.{ab= xy*z} (y,z :=y-1,x*z) { ab= xy*z}{ab= xy*z} => ab= xy*z x*zz y-1y=> ab= xy-1*x*z=> ab= xy*z{ab= xy*z} => ab= xy*zTrue => TrueHence, the statement is correct.b.{ab= xy*z ^even(y) ^y != 0 } (x,y := x*x,y/2) { ab= xy*z}{ab= xy*z ^even(y) ^y != 0 } => ab= xy*z yy/2xx*x=> ab= (x*x)y/2*z => ab= (x2)y/2*z=> ab= xy*z{ab= xy*z ^even(y) ^y != 0 } => ab= xy*zHence, {ab= xy*z ^even(y) ^y != 0 } is a subset of ab= xy*z and it is correct.2A.a. { z* xy= ab^ y ≠ 0 }if odd(y) then (y,z) := (y-1, z*x);else (x,y):= (x*x, y/2); { z* xy= ab}{ z* xy= ab^ y ≠ 0 ^ odd(y)} (y,z) : = (y-1, z*x) { z* xy= ab} and{ z* xy= ab^ y ≠ 0 ^ even(y)} (x,y):= (x*x, y/2) { z* xy= ab}Let us take first { z* xy= ab^ y ≠ 0 ^ odd(y)} (y,z) : = (y-1, z*x) { z* xy= ab}{ z* xy= ab^ y ≠ 0 ^ odd(y)} => z* xy= abzz*xyy-1=> z*x* xy-1= ab=> z* xy= ab{ z* xy= ab^ y ≠ 0 ^ odd(y)} => z* xy= aband{ z* xy= ab^ y ≠ 0 ^ even(y)} (x,y):= (x*x, y/2) { z* xy= ab}{ z* xy= ab^ y ≠ 0 ^ even(y)} => z* xy= ab yy/2xx*x => z* (x*x)y/2= ab=> z* (x2)y/2= ab=> z* xy= ab{ z* xy= ab^ y ≠ 0 ^ even(y)} =>z* xy= abTrue and True is True....
View Full Document