Logic (from Classical Greek λόγος logos; meaning word, thought, idea, argument, account, reason or principle) is the study of the principles and criteria of valid inference and demonstration.
As a formal science, logic investigates and classifies the structure of statements and arguments, both through the study of formal systems of inference and through the study of arguments in natural language. The field of logic ranges from core topics such as the study of fallacies and paradoxes, to specialized analysis of reasoning using probability and to arguments involving causality. Logic is also commonly used today in argumentation theory.
Traditionally, logic is studied as a branch of philosophy, one part of the classical trivium, which consisted of grammar, logic, and rhetoric. Since the mid-nineteenth century formal logic has been studied in the context of foundations of mathematics. In 1903 Bertrand Russell and Alfred North Whitehead attempted to establish logic formally as the cornerstone of mathematics with the publication of Principia Mathematica. However, the system of Principia is no longer much used, having been largely supplanted by set theory. The development of formal logic and its implementation in computing machinery is the foundation of computer science.