Derivations Trees Assignment Help

Assignment Help: >> Context-free grammars and languages >> Derivations Trees

Derivations Trees:

Definition: Given a context-free grammar G  = (V, Σ, P, S), for any A  N , an A-derivation tree for G is a (V ∪ { })-tree t (a tree with set of labels (V ∪ { })) such that:

(1) t( )= A;

(2) For each nonleaf node u dom(t), if u1,..., uk  are successors of u, then either there is a production B  X1 ··· Xk in P  such that t(u) = B  and t(ui) = Xi for all i, 1 i k, or B P , t(u)= B  and t(u1) = .A complete derivation is an S-tree whose yield belongs to Σ*.

A derivation tree for grammar

G3  = ({E, T , F, +, , (, ), a}, {+, , (, ), a}, P, E),

here P is the set of rules

E  E T, 

E  T, 

T T F,

T F,

F (E),

F a,

is shown in Figure drawn below The yield of the derivation tree is a + a a.

1497_Derivations Trees.png

Figure : A complete derivation  tree

 

Derivations trees are related to derivations inductively as follows.

Definition: Given a context-free grammar G = (V, Σ, P, S), for A N , if π 57_Derivations Trees2.pngα is a derivation in G, we construct an A-derivation tree tπ with yield α as stated below.

(1) If n = 0, then tπ is 1-node tree such that dom(tπ)= { } and tπ (∈)= A.


(2) If 653_Derivations Trees3.png λBρ  λγρ = α, then if t1 is A-derivation tree with yieldA 653_Derivations Trees3.png λBρ  associated A with the derivation A  =n-λBρ, and if t2 is tree associated with production B γ (that is, if γ = X1 ··· Xk 

1840_Derivations Trees4.png

where u is the address of leaf labeled B  in t1 .

The tree tn is A-derivation tree associated with derivation  57_Derivations Trees2.pngα.

Given the grammar

G2 = ({E, +, , (, ), a}, {+, , (,), a}, P, E),

here P is set of rules

E E + E,

E E E,

E -(E),

E a,

the parse trees associated with 2 derivations of string a + a a are shown in Figure given below:

2268_Derivations Trees1.png

Figure :Two derivation trees for a + a a

The following lemma is shown easily.

Lemma: Let = (V, Σ, P, S) be a context-free grammar. For any derivation 57_Derivations Trees2.png α, there is a unique A-derivation tree associated with the derivation,  with yield α.  On the other hand, for any A-derivation  tree t with yield α, there is a unique leftmost derivation57_Derivations Trees2.pngα in G having t as its associated derivation tree.

 

Email based Automata assignment help – homework help

The study of automata is an important area of theory of computation. Students feel trouble in solving automata questions. We at www.expertsmind.com offers Automata assignment help – Automata homework help and online tutoring with best qualified and experienced computer science tutor’s help. We cover all topics including Derivations Trees in assignment help – homework help service. Get solved problems in automata theory with step by step answers anytime from expert tutors at expertsmind.

 

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd