Question: Solve d please in Z3 (sat/smt) Problem (6 points) The number N is defined as follows. (a) If your student number ends in 0 or

Solve d please in Z3 (sat/smt)Solve d please in Z3 (sat/smt) Problem (6 points) The number N

Problem (6 points) The number N is defined as follows. (a) If your student number ends in 0 or 1 then N = 490. (b) If your student number ends in 2 or 3 then N = 520. (c) If your student number ends in 4 or 5 then N = 450. (d) If your student number ends in 6 or 7 then N = 460. (e) If your student number ends in 8 or 9 then N = 470. Consider the following program: a := 1; b:= 1; for i:=1 to 10 do if f(i) then (a := a + 2b; b :=b+i) else (b:= a +b; a := a +i); if b = N +n then crash Here f is an unknown function mapping any number from 1 to 10 to false or true. Note that the statement if b = N +n then crash' is outside the for loop. Establish by Z3 for which values of n = 1, 2, 3, 4, 5 it is safe, that is, for no function f it will reach 'crash'. Show for one of the non-safe values of n how b = N +n can be reached. Separately, also submit a text file inp.txt containing the input for Z3 giving this result, and a text file outp.txt containing the corresponding Z3 output. The input should be given in SMT-LIB 2 format, just like the examples on the slides. In this format a line starting by ?;' is comment: please put comments in this way in your input file to explain the requirements. Problem (6 points) The number N is defined as follows. (a) If your student number ends in 0 or 1 then N = 490. (b) If your student number ends in 2 or 3 then N = 520. (c) If your student number ends in 4 or 5 then N = 450. (d) If your student number ends in 6 or 7 then N = 460. (e) If your student number ends in 8 or 9 then N = 470. Consider the following program: a := 1; b:= 1; for i:=1 to 10 do if f(i) then (a := a + 2b; b :=b+i) else (b:= a +b; a := a +i); if b = N +n then crash Here f is an unknown function mapping any number from 1 to 10 to false or true. Note that the statement if b = N +n then crash' is outside the for loop. Establish by Z3 for which values of n = 1, 2, 3, 4, 5 it is safe, that is, for no function f it will reach 'crash'. Show for one of the non-safe values of n how b = N +n can be reached. Separately, also submit a text file inp.txt containing the input for Z3 giving this result, and a text file outp.txt containing the corresponding Z3 output. The input should be given in SMT-LIB 2 format, just like the examples on the slides. In this format a line starting by ?;' is comment: please put comments in this way in your input file to explain the requirements

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Accounting Questions!