1role of Logic in Cs

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

1

CHAPTER 1
INTRODUCTION TO LOGIC

When you see the word “logic”, what would you think of it? In the Merriam-
Webster dictionary, the word logic is defined as follows:
1. (a) a science that deals with the principles and criteria of validity of inference
and demonstration: the science of the formal principles of reasoning
e.g., a professor of logic
(b) a branch or variety of logic
e.g., Boolean logic
(c) a branch of semiotics, especially: syntactics
(d) the formal principles of a branch of knowledge
e.g., the logic of grammar.

2. (a) a particular mode of reasoning viewed as valid or faulty.


e.g., She spent a long time explaining the situation, but he failed to see
her logic.
(b) Relevance, Propriety
e.g., Could not understand the logic of such an action.
(c) interrelation or sequence of facts or events when seen as inevitable or
predictable
e.g., By the logic of events, anarchy leads to dictatorship.
(d) the arrangement of circuit elements (as in a computer) needed for com-
putation

In this book, we will take “logic” in the sense of 1.(a): Logic is the science of
the formal principles of reasoning. When these principles are introduced, we will
use “logic” in the sense of 1.(b) and introduce several branches of logic, such as
propositional logic, equational logic, first-order logic, etc. These logics belong to the
domain of mathematical logic (formerly known as symbolic logic).
2

1.1 Logic is Everywhere

Logic has been called the calculus of computer science, because logic plays a
fundamental role in computer science, starting from the construction of computers,
to the computing devices beyond our ability of construction, such as computer ar-
chitecture (digital gates, hardware verification), software engineering (specification,
verification), programming languages (semantics, type theory, abstract data types,
object-oriented programming), databases (relational algebra), artificial intelligence
(automated theorem proving, knowledge representation), algorithms and theory of
computation (complexity, computability), etc.
Logic also plays important roles in other fields, such as mathematics and
philosophy. In mathematics, logic includes both the mathematical study of logic
and the applications of formal logic to other areas of mathematics. The unifying
themes in mathematical logic include the study of the expressive power of formal
systems and the deductive power of formal proof systems. Mathematical logic is
often divided into the fields of (a) set theory, (b) model theory, (c) proof theory,
and (d) computability theory. These areas share basic results on logic.
Symbolic logic in the late nineteenth century and mathematical logic in the
twentieth are also called formal logic. Topics traditionally treated by logic not
being part of formal logic have tended to be termed either philosophy of logic or
philosophical logic . Philosophical logic dealt with arguments in the natural language
used by humans.

Example. Given the premises that (a) “all men are mortal” and (b)
“Socrates is a man”, we may draw the conclusion that (c) “Socrates is
mortal”, by the inference rule of Modus Ponens.

Philosophical logic is the investigation, critical analysis and intellectual reflection


on issues arising in logic and is the branch of studying questions about reference,
predication, identity, truth, quantification, existence, entailment, modality, and ne-
cessity.

1.1.1 Statement or Proposition


Logic comes from natural languages as most sentences in natural languages are
statements or propositions. A proposition is a statement or assertion that expresses
a judgment or opinion. Here statement, assertion, and proposition are synonyms.
Here are some examples:

• That apple is delicious.


3

• Today is either Monday or Tuesday.

• He has good memory and runs fast.

Every statement can be either true or false. True or false are called the truth
values of a statement. Some sentences in natural languages are not statements, such
as commands or exclamatory sentences. For example, “Run fast!” Coach shouts.
The first part of the sentence, “Run fast!”, is not a statement; the second part,
¯
“Coach shouts”, is a statement. In fact, a sentence is a statement if and only if it
has a truth value.
In natural languages, we can combine, or relate statements with words such as
“not” (negation), “and” (conjunction), “or” (disjunction), “implies” (implication),
“if-then”, etc. That is, a statement can be obtained from other statements by these
words. In logic, these words are called logical operators, or equivalently, logical
connectives. A statement is composed if it can be expressed as a composition of
several simpler statements; otherwise it is simple. In the above three examples of
statements, the first statement is simple, but the other two are composed. That is,
“today is either Monday or Tuesday” is the composition of “today is Monday” and
“today is Tuesday”, using the logical operator “or”. We often regard “that apple is
not delicious” as a composed statement: It is the negation of a simple statement.
Logical connectives are indispensable for expressing the relationship between
statements. For example, the following statement is a composition of several simple
statements.

(∗) Since I don’t have a good memory, I don’t know that today is either
Monday or Tuesday.

To see this clearly, we need to introduce symbols, such as p, q, r, s, and t, to denote


them:

1. p: I have a good memory.

2. q: Today is Monday.

3. r: Today is Tuesday.

4. s: q or r.

5. t: I know s.
4

To express that the statement (∗) is composed, let us use these symbols for
logical operators: ¬ for negation, ∨ for “OR”, ∧ for “AND”, and → for implication.
Then (∗) becomes the following formula:

(¬p) → (¬t)
Here each of the symbols p, q, r, s, and t is called a propositional variable, which
denotes a statement, either simple or composed. Naturally, these propositional
variables, like statements, can take on only the truth values, i.e., true and false.
Propositional variables are also called Boolean variables after their inventor,
the nineteenth century mathematician George Boole. Boolean logic includes any
logic in which the considered truth values are true and false. The study of proposi-
tional variables with logic operators is called Propositional logic, which is the most
simple one in the family of Boolean logics. On the other hand, probability logic is
not a Boolean logic because probability values are used to represent various degrees
of the truth values. Questions regarding degrees of truth or the sense-content of
sentences are ignored in Boolean logic. Despite this simplification, or indeed be-
cause of it, such a method is scientifically successful. One does not even have to
know exactly what the truth values true and false actually are.

1.1.2 A Brief History of Logic


Sophisticated theories of logic were developed in many cultures, including
China, India, Greece and the Islamic world. Greek methods, particularly Aris-
totelian logic (or term logic) as found in the Organon, found wide application and
acceptance in Western science and mathematics for millennia.
Aristotle (384 – 322 BC) was the first logician to attempt a systematic analysis
of logical syntax, of noun (or term), and of verb. He demonstrated the principles
of reasoning by employing variables to show the underlying logical form of an ar-
gument. He sought relations of dependence which characterize necessary inference,
and distinguished the validity of these relations, from the truth of the premises.
He was the first to deal with the principles of contradiction and excluded middle
in a systematic way. Aristotle has had an enormous influence in Western thought.
and he developed the theory of the syllogism, where three important principles are
applied for the first time in history: the use of symbols, a purely formal treatment,
and the use of an axiomatic system. Aristotle also developed the theory of fallacies,
as a theory of non-formal logic.
Christian and Islamic philosophers such as Boethius (died 524), Ibn Sina (Avi-
cenna, died 1037) and William of Ockham (died 1347) further developed Aristotle’s

You might also like