1
Define a set of functions by specifying a starter
set and then ways of adding new functions.
Functions can be on vectors. Stick to integers.
Starter set
 identify function and projection
I(x) = x and Pi(x1,x2,…xn) = xi
 Add 1: A(x) = x+1
 Constant: Ck(x) = k
2
 If there exists a TM for a function F, then F is
recursive.
 If a function F is recursive (that is, in this set),
then [you can define] a TM that performs F.
3
 A grammar G is a
◦ set of symbols, divided in final symbols and
auxiliary symbols
◦ (finite) set of production rules of the form
string of symbols => string of symbols
 final symbols have no production rules of the form
f => …
 In this exposition, we view certain strings of letters as
single symbols.
◦ one auxiliary is called the started symbol s
◦ The language generated (defined by) G is all the
strings of final symbols generated by a sequence
starting with s
4
 Think of auxiliaries as parts of speech and
final symbols as (whole) words
 Let
s be sentence
vp be verb phrase
np be noun phrase
n be noun
v be verb
do be direct object
adj be adjective
adv be adverb
5
 Think of parts of speech
s => np vp
np => adj n | n
vp => v | v adv | v do | v do adv
do => n
n => boy | girl | dog | cheese
v => walks | runs | jumps | eats
adj => short | tall | spotted
adv => fast | slowly
6
 To construct the parse tree for
tall girl walks
short boy eats cheese slowly
7
 Production rules are of the form
auxiliary symbol => string of symbols
8
 There also can be rules of the form
aPb => ….
 where P is an auxiliary symbol. Think of it as:
P in the context of a and b produces
something. So this is NOT context-free.
9
 S => T
T => a
T => a + T
T => (T)
 What language does this produce (list the
terms)?
10

Reguler grammar cfg

  • 1.
  • 2.
    Define a setof functions by specifying a starter set and then ways of adding new functions. Functions can be on vectors. Stick to integers. Starter set  identify function and projection I(x) = x and Pi(x1,x2,…xn) = xi  Add 1: A(x) = x+1  Constant: Ck(x) = k 2
  • 3.
     If thereexists a TM for a function F, then F is recursive.  If a function F is recursive (that is, in this set), then [you can define] a TM that performs F. 3
  • 4.
     A grammarG is a ◦ set of symbols, divided in final symbols and auxiliary symbols ◦ (finite) set of production rules of the form string of symbols => string of symbols  final symbols have no production rules of the form f => …  In this exposition, we view certain strings of letters as single symbols. ◦ one auxiliary is called the started symbol s ◦ The language generated (defined by) G is all the strings of final symbols generated by a sequence starting with s 4
  • 5.
     Think ofauxiliaries as parts of speech and final symbols as (whole) words  Let s be sentence vp be verb phrase np be noun phrase n be noun v be verb do be direct object adj be adjective adv be adverb 5
  • 6.
     Think ofparts of speech s => np vp np => adj n | n vp => v | v adv | v do | v do adv do => n n => boy | girl | dog | cheese v => walks | runs | jumps | eats adj => short | tall | spotted adv => fast | slowly 6
  • 7.
     To constructthe parse tree for tall girl walks short boy eats cheese slowly 7
  • 8.
     Production rulesare of the form auxiliary symbol => string of symbols 8
  • 9.
     There alsocan be rules of the form aPb => ….  where P is an auxiliary symbol. Think of it as: P in the context of a and b produces something. So this is NOT context-free. 9
  • 10.
     S =>T T => a T => a + T T => (T)  What language does this produce (list the terms)? 10