
























Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Some concepts of Computability are Algorithmic Problems, Automata, Closure of Regular Languages, Computability, Free Languages, Machine Transforms, Magic Bullets, Minimization, Models of Computation, Nondeterministic Complexity. Important points in this lecture are: Free Languages, Free Grammars, Derivations, Parse-Trees, Cfgparse, Ambiguity, Motivating Example, Palindrome,, Generate Another, Context Free Grammar
Typology: Slides
1 / 32
This page cannot be seen from the preview
Don't miss anything!

























1
2
Derivations Parse-trees CFGParse Ambiguity
4
5
Each pipe “|” is an or, just ad in UNIX regexp’s.
In fact, all elements of pal can be generated from e by using these rules.
Q: How would you generate 11011011 starting
7
V – a finite set of variables (or symbols , or non- terminals ) S – a finite set set of terminals (or the alphabet ) R – a finite set of rules (or productions ) of the form v w with v V, and w(S V )* (read “ v yields w ” or “ v produces w ” ) S V – the start symbol.
8
10
11
“derives” or “produces” or “yields” is a
Q: Which of LHS’s yield which of RHS’s in pal?
13
14
Grammar is given by:
16
Continuing on in this fashion and summarizing:
17
In a right-most derivation, the variable most to the right is replaced.
There is a lot of ambiguity involved in how a string is derived. However, if decide that derivations are left-most, or right-most, each derivation is not unique.
Another way to describe a derivation in a unique way is using derivation trees.
19
20
CFGParse is a tool that I wrote that helps you play with context free grammars and create derivation trees. Yoav Hirsch (TA) also added some functionality that allows you to convert CFG’s into various forms that we’ll learn about next week.
USAGE: java CFGParse <grammar-file> <input-string> pdflatex <LaTeX-tree-filename>
Second command only works on CUNIX, unless install LaTeX plus some libraries (ecltree).