Logic refers to both the study of modes of reasoning 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.