Wednesday, August 28, 2013

Grammar as (a non-standard) logic

Richard Trench said that "grammar is the logic of speech.." (On the study of words, 1858).  Grammar is sometimes defined as: rules of (correct) sentence composition.  A grade school definition of a sentence is: one complete thought.  Logic is sometimes defined as: rules of (correct) thought (see Boole's book, The Laws of Thought, for instance).

A simple grammar can be cast as an extension of PROLOG using rules like:
s(S,R):- np(S,VP),vp(VP,R).

Similarly, a simple temporal logic might be cast as:
after(X,Z):-after(X,Y),after(Y,Z).

A simple spatial logic might be cast as:
left_of(X,Z):-left_of(X,Y),left_of(Y,Z).

A fuzzy logic might be cast as:
young(X):-X.>=.0,X.<=.35.

etc.

No comments:

Post a Comment