Logic is the art of thinking; grammar, the art of inventing symbols and combining them to express thought; and rhetoric, the art of communicating thought from one mind to another, the adaptation of language to circumstance.Sister Miriam Joseph
Painting by Cesare Maccari (1840-1919), Cicero Denounces Catiline.
In medieval universities, the trivium comprised the three subjects taught first: grammar, logic, and rhetoric. The word is a Latin term meaning “the three ways” or “the three roads” forming the foundation of a medieval liberal arts education. This study was preparatory for the quadrivium. The trivium is implicit in the De nuptiis of Martianus Capella, although the term was not used until the Carolingian era when it was coined in imitation of the earlier quadrivium. It was later systematized in part by Petrus Ramus as an essential part of Ramism.
A formal grammar (sometimes simply called a grammar) is a set of rules of a specific kind, for forming strings in a formal language. The rules describe how to form strings from the language's alphabet that are valid according to the language's syntax. A grammar does not describe the meaning of the strings or what can be done with them in whatever context —only their form.
Formal language theory, the discipline which studies formal grammars and languages, is a branch of applied mathematics. Its applications are found in theoretical computer science, theoretical linguistics, formal semantics, mathematical logic, and other areas.
A formal grammar is a set of rules for rewriting strings, along with a "start symbol" from which rewriting must start. Therefore, a grammar is usually thought of as a language generator. However, it can also sometimes be used as the basis for a "recognizer"—a function in computing that determines whether a given string belongs to the language or is grammatically incorrect. To describe such recognizers, formal language theory uses separate formalisms, known as automata theory. One of the interesting results of automata theory is that it is not possible to design a recognizer for certain formal languages.
Parsing is the process of recognizing an utterance (a string in natural languages) by breaking it down to a set of symbols and analyzing each one against the grammar of the language. Most languages have the meanings of their utterances structured according to their syntax—a practice known as compositional semantics. As a result, the first step to describing the meaning of an utterance in language is to break it down part by part and look at its analyzed form (known as its parse tree in computer science, and as its deep structure in generative grammar).
As a discipline, logic dates back to Aristotle, who established its fundamental place in philosophy. The study of logic is part of the classical trivium.
Averroes defined logic as "the tool for distinguishing between the true and the false"; Richard Whately, '"the Science, as well as the Art, of reasoning"; and Frege, "the science of the most general laws of truth". The article Definitions of logic provides citations for these and other definitions.
Logic is often divided into two parts, inductive reasoning and deductive reasoning. The first is drawing general conclusions from specific examples, the second drawing logical conclusions from definitions and axioms. A similar dichotomy, used by Aristotle, is analysis and synthesis. Here the first takes an object of study and examines its component parts, the second considers how parts can be combined to form a whole.
Logic is also studied in argumentation theory.