A Grammar without Class Notation

Applied by Dennis J. Darland

June 15, 2007

See

http://smlweb.cpsc.ucalgary.ca/start.html

I’ve made my grammar acceptable to it.

But you will have to copy & paste it.

This is a context free grammar that I think would  be of Principia Mathematica.

There are no abbreviations (class notation) used.

 S -> A .

S -> A eq A.

S -> A equ A.

S -> A and A.

S -> not A.

A -> F ( V ).

A -> P excl x.

A -> F ( P excl z ).

S -> ( ex V ) F V.

S -> ( ex F ) F V.

S -> ( ex P ) P excl V.

A ->  ( all F ) F V.

A ->  ( all V ) P excl V.

A -> ( all V ) F V.

F ->  f.

F ->  g.

P ->  p.

P ->  q.

V ->  x.

V ->  y.

 

 

Back to Top http://dennisdarland.com/philosophy/index.html

 

Grammar

S →

F FF FA

|

P excl x FA

|

( F(3

|

not A .

F(3

F(1 FA

|

F( .

FA →

|

eq A

|

equ A

|

and A .

F( →

ex Fex .

Fex →

V ) F V

|

F ) F V

|

P ) P excl V .

A →

F FF

|

P excl x

|

( F(1 .

FF →

( F(2 .

F(2

V )

|

P excl z ) .

F(1

all Fall .

Fall →

F ) F V

|

V FV .

FV →

) F) .

F) →

P excl V

|

F V .

F →

f

|

g .

P →

p

|

q .

V →

x

|

y .

Some sentences generated by this grammar: {q excl x, p excl x, not f ( x ), not f ( y ), not q excl x, not p excl x, not f ( p excl z ), not f ( q excl z ), q excl x eq p excl x, p excl x eq q excl x, q excl x eq q excl x, p excl x eq p excl x, p excl x and q excl x, q excl x equ p excl x, p excl x and p excl x, q excl x equ q excl x, p excl x equ q excl x, q excl x and p excl x, p excl x equ p excl x, q excl x and q excl x}

nonterminal

first set

follow set

nullable

endable

S

( not f g p q

no

yes

F(3

all ex

no

yes

FA

eq equ and

yes

yes

F(

ex

no

yes

Fex

x y f g p q

no

yes

A

( f g p q

no

yes

FF

(

eq equ and

no

yes

F(2

x y p q

eq equ and

no

yes

F(1

all

eq equ and

no

yes

Fall

f g x y

eq equ and

no

yes

FV

)

eq equ and

no

yes

F)

p q f g

eq equ and

no

yes

F

f g

( ) x y

no

no

P

p q

) excl

no

no

V

x y

) eq equ and

no

yes

The grammar is LL(1).