Question: Give a CFG that will work for the procedures below and any other procedures that has the same kind of instructions. PROCEDURE multiply a, b;
Give a CFG that will work for the procedures below and any other procedures that has the same kind of instructions.
PROCEDURE multiply a, b; VAR a, b, z; BEGIN 0; WHILE b> 0 DO BEGIN -a+z; b= b - 1; END RETURN z; END; PROCEDURE odd x; VAR x; BEGIN WHILE x > 1 D0 x:= x/2; IF x = 1 THEN RETURN 1; ELSE RETURN 0; END;
Step by Step Solution
★★★★★
3.49 Rating (166 Votes )
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
