






Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!







Your goal for this lecture is to learn how to do the following things:
The conversion from strings to trees is accomplished in two steps.
When we specify a sentence, we talk about two things that could be in them.
Examples: (identify the terminals and the non-terminals)
S → N verb P N→ det noun P→ prep N
“The dog runs under a chair.”
S → NP verb PP NP→ det noun PP→ prep NP S
the dog
runs (^) PP
under NP
a (^) chair
→ v → E > E → if E then E else E
if x > y then a + b else y
Example: A→ Bx B→ Ay
Example “3 + 4 * 5” ... is it “(3 + 4) * 5” or “3 + (4 * 5)”?
T→ integer
The Algorithm:
S → x
S → x S → y S →
S → x y S → z
S → E y S → z E → q E → r
S → z E → E → r F → s F →
S → A x S → B y S → z A → 1 C B A → 2 B B → 3 B B → C C → 4 C →