Given the following grammar, which variables are “nullable”? Explain you answer.
S --> abC
S --> bbDE
S --> GEAA
A --> DCaaGb
A --> bba
A --> FFS
B --> bGHS
B --> C
B --> KAESE
C --> GG
C --> abbDKaa
C --> aabF
D --> SGaFFbbb
D --> GGCFF
D --> HAKFH
E --> bbSAAKG
E --> KCG
E --> H
F --> bbbbab
F --> SbbFE
F --> AKKB
G --> CDA
G --> (lambda)
G --> HBE
H --> abbaa
H --> SKCD
H --> D
K --> GC
K --> AFB


Given the following grammar, which variables are “nullable”? Explain you answer. S --> abC S -->...
these questions are about LISP please explain the reason In the following Fun language example, which expressions can we get by some series of reductions? Assume that we can reduce the built-in function + in the usual way that addition works. Definitions: f(x, y) = x+y g(x) = x+1 h(x) = 7 Example: f(g(h(4)), h(g(5))) 1.Select all that apply: a. g(h(4)) + h(g(5)) b. f(g(7), h(g(5))) c. f(8, 7) d. 15 e. f(g(h(4)) + h(g(5))) f. f(5, h(g(5))) g. f(h(g(4)),...
Q1: Given the below language and context free gramma:, a. Show that the grammar is ambiguous using the string ( abc) by using substitutions. b. Then design a push down automata that recognizes the language. C. Then show the tracing of (abc, abbccc) using the push down automata. d. Then Show which two simple languages create the greaterlanguage. Give set builder notation for each language. e. Then produce Chomsky normal form for the grammar. The following context-free language is inherently...
Solve the following questions. All questions are mandatory. Q1: What’s wrong in the following grammar? S → ABC A → aA|aa B → bB|B C → cC|cccc Q2: Describe the strings generated by the following grammar S → aSa S → bSb S → aa S → bb Q3: Consider the following grammar: S → ABC A → aA|a B → bB|b C → cC|c Change the above grammar such that it generates L1={anbmck; n>=3,m>=3,k>=4} Q4: Use the following grammar...
P2) Given grammar in BNF, answer the following questions (30 points) <stmt-list>→<stmt> | <stmt»; <stmt-list> (a) Rewrite the given grammar into a EBNF (b) Is the given grammar ambiguous? Support your answer to receive the full credit. (c) Given string A-B C-D: B-C-A-D, draw a parsing tree
P2) Given grammar in BNF, answer the following questions (30 points) → |
Given the following ambiguous context free grammar (3x20) 1. (a) Explain why the grammar is ambiguous (b) Find an equivalent unambiguous context-free grammar. (c) Give the unique leftmost derivation and derivation tree for the string s generated from the unambiguous grammar above. 2. Construct non-deterministic pushdown automata to accept the following language (20) 3. Convert the following CFG into an cquivalent CFG in Chomsky Normal Form (CNF) (20)-
explain please
In which of the following pairs of acids is the first compound the stronger acid? a. HBr HC1 d. HBrO2 HC102 e. H Se HBE b. H,502 HNO3 Cl C- E-O- - c. H- H-C- OH "o=o - OH
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...
Consider the following grammar (S, A, B, and C are nonterminal symbols; S is the start symbol; 0 and 1 are terminal symbols): S → AA A → BCB B → B0 | B1 | 0 | 1 C → 00 | 11 Which of the following sentences are in the language generated by the grammar? Show derivations for the sentences that can be generated. If a sentence cannot be generated by the grammar, explain why. a) 10010001 b) 01101101...
Consider the following grammar G, whose productions rules are the following (an upper case letters represents a nonterminal symbol, a lower case letter represents a terminal symbol). Untitled Note Eile Edit Format View Help S -asCB A b A -aA C B d A Which of the following sentences are in the language generated by the grammar G? |Untitled - Notepad X Eile Edit Format View Help А. асcbd B. abcd c. acccbcc D. acd Е. ассс F. CCC G....