11. (10pts) Recall the attributed grammar from question 8. Consider the following ax- iomatic semantics: {Q1D-0,8 = 0} {Q10 +0,8 = 0} {Q ID ---} ID -> {Q} {P1}S,{P2}, {P2}S,{Q} {PI}S, ENDLINE S,{Q} {Pl}S:{P2},{P2}S:{Q} {P1}S, ENDLINE S,{Q} {Qs+8+1}&{Q} {Q8-28+}%{Q} {Q&-++ ID ) ID {Q} {Qs482) {Q} {P1}S{P2},{P2}S,{Q} {PI}S, S,{Q} NOTE: The semantics in this questions is different from the one presented in other questions. For the following progams, assuming the precondition is {}, what is the vlaue of main in the postcondition? Show the proof. You may also use the Rule of Consequence. (6) main -> step, show step -> , show -> %.&, (6) main -> one, two, three, four one -> two,k, two-> R,& three -> four, .. four-> 6. (10pts) Consider the following grammar:
+ | ENDLINE " | "" ID "&" | "%" | *** Assume is the start symbol. Assume that all caps represents a token, quoted sequence of symbols lexemes, and angle brackets nonterminals. Also assume that the ENDLINE token is the groups of lexemes representing an end of line. The ID token represents ids in the "C" sense (start with letter or underscore, a seqence of alphanumeric and underscore characters). (a) Give a sentence in this language that is generated from at least 3 (6) Show the left-most derivation for your sentence. (c) Show the right-most derivation for your sentence, (a) Show the panse tree for your sentence. 8. (10pts) Recall the following grammar from question 6: + | ID ">" | ids (2) ids = { id) (3) [0].id = { d) U (prod.list> [1].id (1) (prod>id - ID.id .id = .id (6) [0].id (1).id [0].id (7) Predicate: {Q10 +0,8 = 0} {Q ID ---} ID -> {Q} {P1}S,{P2}, {P2}S,{Q} {PI}S, ENDLINE S,{Q} {Pl}S:{P2},{P2}S:{Q} {P1}S, ENDLINE S,{Q} {Qs+8+1}&{Q} {Q8-28+}%{Q} {Q&-++ ID ) ID {Q} {Qs482) {Q} {P1}S{P2},{P2}S,{Q} {PI}S, S,{Q} NOTE: The semantics in this questions is different from the one presented in other questions. For the following progams, assuming the precondition is {}, what is the vlaue of main in the postcondition? Show the proof. You may also use the Rule of Consequence. (6) main -> step, show step -> , show -> %.&, (6) main -> one, two, three, four one -> two,k, two-> R,& three -> four, .. four-> 6. (10pts) Consider the following grammar: + | ENDLINE " | "" ID "&" | "%" | *** Assume is the start symbol. Assume that all caps represents a token, quoted sequence of symbols lexemes, and angle brackets nonterminals. Also assume that the ENDLINE token is the groups of lexemes representing an end of line. The ID token represents ids in the "C" sense (start with letter or underscore, a seqence of alphanumeric and underscore characters). (a) Give a sentence in this language that is generated from at least 3 (6) Show the left-most derivation for your sentence. (c) Show the right-most derivation for your sentence, (a) Show the panse tree for your sentence. 8. (10pts) Recall the following grammar from question 6: + | ID ">" | ids (2) ids = { id) (3) [0].id = { d) U (prod.list> [1].id (1) (prod>id - ID.id .id = .id (6) [0].id (1).id [0].id (7) Predicate: