Logic (from the Greek λογική, logikē) refers to both the study of modes of reasoning (which are valid and which are fallacious) and the use of valid reasoning. In the latter sense, logic is used in most intellectual activities, including philosophy and science, but in the first sense, is primarily studied in the disciplines of philosophy, mathematics, semantics, and computer science. It examines general forms that arguments may take. In mathematics, it is the study of valid inferences within some formal language. Logic is also studied in argumentation theory.
Logic was studied in several ancient civilizations, including India, China, and Greece. In the west, logic was established as a formal discipline by Aristotle, who gave it a fundamental place in philosophy. The study of logic was part of the classical trivium, which also included grammar and rhetoric.
Logic is often divided into three parts, inductive reasoning, abductive reasoning, and deductive reasoning.