Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Compute the given substitutions. Just substitute the expression for the value; you don't need to simplify anything further. Recall that you may need to

Compute the given substitutions. Just substitute the expression for the value; you don't need to simplify 

Compute the given substitutions. Just substitute the expression for the value; you don't need to simplify anything further. Recall that you may need to perform a-conversions to avoid variable capture. Show the intermediate steps of substitution when quantifiers are involved, as we did in class. a) [y+2/y3z.V.(x+yz+y) b) [y+2/x].Va.(x + y z+y) c) [x+2/y]3z.V.(z+y z+y) d) [z/x] (x2z (3z.Vx.x+y2z+y) ^ y > z) e) [2/2] (12z (3x+y2z+y) Ay> z) 3 Proofs and Proof Outlines Task 3.1 (Written, 20 points). a) Write a program in IMP that given an array a of size two, returns its maximum element in variable m. b) Write a partial correctness triple to state that your program does what is described in part (a). c) Prove your partial correctness triple in Hoare logic using either proof trees or Hilbert-stlye proofs. d) Write a proof outline for your partial correctness triple. You can use either rule for if that we discussed in class. Task 3.2 (Written, 7 points). Convert the following proof outline to a Hilbert-style proof. The remainder operator z%y returns the remainder when z is divided by y.. {z 0) if(z%3=0) then 8:=3 (x20x%3=0} (820A8%3=0} = {s%3=0} {z 20^x%3#0} else if (2%3= 1) then {z 20^z%3/0A2%3=1}{r-120Ar-1%3=0} 8:12-1 8:=x-2 fi else fi {s20s%3=0} = {s%3=0} {a 20A z%3#0A2%31) (x-2 0^x-2%3=0} {$20 As%3=0} = {s%3=0} {8%3=0} {s%3=0}

Step by Step Solution

3.50 Rating (163 Votes )

There are 3 Steps involved in it

Step: 1

Lets solve each of the given substitutions step by step a y2yexists ... blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Contemporary Engineering Economics

Authors: Chan S. Park

5th edition

136118488, 978-8120342095, 8120342097, 978-0136118480

More Books

Students also viewed these Programming questions

Question

Tools that can be used for collecting primary data include:

Answered: 1 week ago