Originally Posted By: zmjezhd


I was thinking more along the lines of variable substitution. You can have the following (simple) grammatical rule:

S -> NP VP
NP -> det N (PP)
PP -> prep NP
VP -> V (NP) (PP)
det -> a | an | the
N -> dog | cat | book | bird | pond
prep -> on | at | by
V reads | loves | eats

So, the follow are valid or (*) invalid sentences licensed by this grammar:

The dog ate the book.
A cat reads a book by the pond.
*A car ran over my dog.
etc.

It's way more complicated than that with nodes being headed by certain words or subnodes, etc.


Way Interesting! Does that mean we can get a computer to form sentences through programming grammar?