A grammar is a 4-tuple G, G = (Ν, Σ, Π, Σ, S) where, Ν is a finite set of nonterminal symbols, Σ is a finite set of terminal symbols, Π is a finite set of rules,S is the starting symbol.
Let, Ν = {S, T}
Σ = {a, b, c}
Π = {
S -> aTb
S -> ab
aT -> aaTb
aT -> ac
} S is the starting symbol.
A) Prove that the given grammar G is a context sensitive grammar.
B) What is the language L = L(G) generated by the given grammar G?
C) For the string aaacbbb design the appropriate syntax tree based on the context sensitive grammar G.
D) The language L = L(G) generated by the given grammar G is also context free language. Write the context free grammar G1 that generates the language L.
E) For the string aaacbbb design the appropriate syntax tree based on the context free grammar G1.
Automata: solve a - e
2. (10+10+10+10+10-50 points) Agrammar is a 4-tuple G, G-ON,E,11,L$) where N is a finite set of nonterminal symbols Σ is a finite set of terminal symbols is a finite set of rules S is the starting symbol Let N- (S, T s-{a, b, c} s-> ab aT >aaTb aT-ac S is the starting symbol. (a 10 points) Prove that the given grammar G is a context sensitive grammar. (b-10 points) What is the language L-...
AUTOMATA Given the regular grammar G, G = (Ν, Σ, Π, S), where Ν = {S, A, B} Σ = {a, b} Π = {S → aA, S → aB, A → a, B->a} Starting symbol S is S. Prove that the regular grammar G is ambiguous.
Theory of Computation
7. Write down the Chomsky Normal Form for the context-free language de- fined by the productions: S bAļaB. A bAA laSla, and B aBB bS b, where S, A, B are nonterminal symbols and a, b are terminal symbol 8. For the context-free grammar Ģ -(X, T, R, S) with X (A, B. C, a, b), T a, b and productions R: SAB |BC, ABAa, BCClb,C AB la, check by applying the CYK Theorem whether the string...
1. Consider the following grammar A - aB B-Sb (a) Show a derivation tree for the string aabbbb using the grammar. (b) Give an English description of the language generated by the grammar 2. Let G be the grammar below: S-ASB ab | SS (a) Show that G is ambiguous. (b) Construct an unambiguous grammar equivalent to G. 3. Find a context free grammar for the language L3- fa"b"c+m :n,m21) 4. Find a context free grammar for the language L4...
What is the language L(G) generated by the context-free grammar G given below? S -> A | aB | bA | ε A -> aS | bAA B ->bS | aBB
4. Consider the following context-free grammar S SSSS a (a) Show how the string aa+a* can be generated by this grammar (b) What language does this grammar generate? Explain
Consider the following context-free grammar with terminals {a, b, c, d} and start symbol S. S → W | X | Y | Z W → AW D | X | Y | Z X → BXD | Z Y → AY C | Z Z → BZC | ε A → a B → b C → c D → d (a) Give a derivation tree with input string: aaaabccddd (b) What language does this CFG recognize? Give a...
Automata and Computability Problems
Please check my work. Make necessary edits/corrections to my
work. Please add more detail to number 2 for better understanding
:)
1. Give a context-free grammar (CFG) for each of the following languages over the alphabet = (a, b): (a) All nonempty strings that start and end with the same symbol. 2. Answer each part for the following context-free grammar. I. II. III. IV. V. R> XRXS S -ать | bТа T → XTX | X...
formal language automata
1. (15p) Consider the Context-free grammar G defined by: S → 0A1A1A1A A0A1A a) Describe L(G). (5p) b) Convert G into a Pushdown Automaton (PDA). (10p)
3 points) Question Three Consider the context-free grammar S >SS+1 SS 1a and the string aa Give a leftmost derivation for the string. 3 points) (4 poiots) (5 points) (3 points) sECTION IWOLAttcmpt.any 3.(or 2) questions from this.scction Suppose we have two tokens: (1) the keyword if, and (2) id-entifiers, which are strings of letters other than if. Show the DFA for these tokens. Give a nightmost derivation for the string. Give a parse tree for the string i) Is...