Question: 4. Consider the program if x3 then y:- ((z * 2) else z in the example language of the book (Sec. 2.5) (a) What is

 4. Consider the program if x3 then y:- ((z * 2)else z in the example language of the book (Sec. 2.5) (a)

4. Consider the program if x3 then y:- ((z * 2) else z in the example language of the book (Sec. 2.5) (a) What is the first step of this program from the initial state -(0,3), (z,4)) according to the structural operational semantics given in the book. Write down the proof tree that formally justifies this step. b) Write down the computation (maximal sequence of steps) of this program from the initial state . (You don't have to formally justify all these steps) Example 2.5 Let us consider the following program, c: Let us fix a state which includes all the variables mentioned in the program, for example, [(X, 6)1, we can calculate the computation of c n as follows. To abbreviate the notation, we write c, to denote the iterative command while 0) do X:-(X - 1). It is not difficult to see that the computation generated by c is the following: (c,a) (skip, o[X0]) The computation in the example just discussed is a terminated computation, in the sense that, after a certain number of transitions, a situation is reached in which no other transition is possible. It can be seen that, moreover, the defion of com putation that we have given above does not require that a computation be finite but only that it cannot be extended. There is, therefore, the possibility that there are infinite computations, as the following example demonstrates: 4. Consider the program if x3 then y:- ((z * 2) else z in the example language of the book (Sec. 2.5) (a) What is the first step of this program from the initial state -(0,3), (z,4)) according to the structural operational semantics given in the book. Write down the proof tree that formally justifies this step. b) Write down the computation (maximal sequence of steps) of this program from the initial state . (You don't have to formally justify all these steps) Example 2.5 Let us consider the following program, c: Let us fix a state which includes all the variables mentioned in the program, for example, [(X, 6)1, we can calculate the computation of c n as follows. To abbreviate the notation, we write c, to denote the iterative command while 0) do X:-(X - 1). It is not difficult to see that the computation generated by c is the following: (c,a) (skip, o[X0]) The computation in the example just discussed is a terminated computation, in the sense that, after a certain number of transitions, a situation is reached in which no other transition is possible. It can be seen that, moreover, the defion of com putation that we have given above does not require that a computation be finite but only that it cannot be extended. There is, therefore, the possibility that there are infinite computations, as the following example demonstrates

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 Databases Questions!