Cour 1,2
Cour 1,2
Logic, in the philosophical is the sense of the term, dates back to the Greek period. The first
person to teach logic was the philosopher Aristotle.
Logic can be defined as
‘the science that studies the general rules of correct reasoning’.
founding role : Logic provides a mathematical foundation for properly defining and
dealing with the fundamental concepts of computer science. e.g.: properly defining the
notion of a problem with an algorithmic solution in the Calculability and Complexity
course in L3. It also provides good training in correct and precise reasoning, and the
description of concepts without ambiguity.
internal role: model, specify, verify, reason automatically, provide the basis for certain
programming languages, etc.
The use of mathematical logic is not confined to the purely theoretical, but it contributed
significantly to the birth of the first computers. The binarity of truth values is the basis of all
the electronic circuits that make up a computer.
Subsequently, the foundations of mathematical logic have made a major contribution to the
applications of artificial intelligence.
1- Assertion
An assertion is a mathematical statement to which one of two logical values is assigned: true
(T) or false (F).
Example:
Assertion 1 + 1 = 2 is true.
Assertion 2 + 2 = 5 is false
2- Connectors
There are five (5) logical connectors, the basis of all mathematical reasoning.
Negation of negation
In general, a double negation often reinforces the negation, such as : do you want to go out?
no, no.
Examples
denoted P ∧ Q.
We will call the conjunction of P and Q, the assertion (P and Q) and which will be
Example
P: The earth is round (true) and Q: The sky is blue (true).
So P and Q or P Q is The earth is round AND the sky is blue. P Q is true. We say that
the proposition P Q is false if at least one of the two propositions is false. two
propositions are false. So The earth is round AND the sky is green is a false
proposition.
be noted P ∨ Q
We will call the disjunction of P and Q, the assertion (P or Q) which will
Implication
If P then Q,
Equivalence « ⇔ »
We will say that two assertions are logically equivalent if they have the
same truth value and will be noted P ⇔ Q.
P is equivalent to Q,
For P, Q is necessary and
sufficient,
P is a necessary and
sufficient condition for Q
P if and only if Q.
Example
Propositional logic
The logic of propositions (or propositional logic - is a mathematical
theory which allows part of human reasoning to be formally
modeled.
E xample:
The earth is spherical … True
The sun revolves around the earth … False
We say that the truth value of the first sentence = True
2. -P, 5P, ¬PAa, ¬ (PAa), ¬¬ (PA -Q) are: formulas composed of Lp(¬, ^)
Abbreviation connectors
α∨ ß=def ¬ (¬ α ^¬ß)
“→ “ called “Arrow”
α →ß =def¬ (α ^¬ß)
α ↔ ß=def (α → ß) ^ (ß→ α)
Priority
between
1. Parentheses (from left to right and from the most internal to the
most external)
3. ∧ , ∨ (left to right),
2. ¬ (innermost first), le plus interne d'abord
Examples:
Parentheses with the color red are called “superfluous parentheses”, They
can be eliminated
Note: The external parentheses of a formula are also superfluous
parentheses: (α) will be noted α
Example of formalisation in Lp
Decomposition tree
Representation of deduction
Definition (Deduction): A deduction in the deductive system (¬, ∧) is
a finite tree using the rules called the Natural Gentzen rules , whose
leaves are the initial premises (hypotheses) and whose root is the
Conclusion.
T he Rules of connector ∧
of ∧ ,
noted: (E ∧ )
2- Rule of elimination
“if we have the formula α ∧ β then we can deduce either the formula α (1st
Form) or the formula β (2nd Form), depending on what we wish to
have.”
“if we have the formula ¬¬α then we can deduce the formula α”
Notations
Strategy
Strategy (Generalization)
α1 ,…, αn ├ β
In general, to construct β,
we often assume
in addition to the
initial hypotheses: ¬
β and possibly other
formulas δ1,, ..,
δm with (m≥0).
Example 1:
Example 2:
Show the deduction ├ α∨¬α which can also be translated by showing that
├ α∨¬α is a theorem of Lp
Note: there are no initial hypotheses (this is the case Γ = Ø) Given that
we are in the deductive system of L p(¬, ∧), we must replace the ∨ by its
definition
Example 3:
Show the following deduction:
α→β,α├β
Given that we are in the deductive system of Lp(¬ ,∧), we must replace
the → by its definition.
T heorem (deduction):
Then we have:
Demonstration:
: Γ, α├ β ⇒ Γ ├ α →β
: Γ ├ α →β ⇒ Γ, α├ β
: Γ, α├ β ⇒ Γ ├ α →β
Hypothesis: DI Conclusion: D2
: Γ ├ α →β ⇒ Γ, α├ β
Hypothesis: D2 Conclusion: D1
δ1 ,δ2 ,….., δn , α1 ├ α2
Note: that the deduction obtained is simpler to make than the initial
deduction
α→β, ¬β├ ¬α
Given that we
are in the
deductive
system of
Lp(¬ ,∧) we
must
replace the →
by its definition.
This amounts to showing: ¬(α∧¬β), ¬β ├ ¬α
The rules of the connector ¬ (E¬) and (1¬) It is the same rules seen
previously
The rules of the connector ¬ (E¬) and (1¬) It is the same rules seen
previously