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:
Similarly, a simple temporal logic might be cast as:
A simple spatial logic might be cast as:
A fuzzy logic might be cast as: