SlideShare a Scribd company logo
First Order Logic
Lecture 2: Sep 9
This Lecture
Last time we talked about propositional logic, a logic on simple statements.
This time we will talk about first order logic, a logic on quantified statements.
First order logic is much more expressive than propositional logic.
The topics on first order logic are:
 Quantifiers
 Negation
 Multiple quantifiers
 Arguments of quantified statements
Propositional logic – logic of simple statements
Limitation of Propositional Logic
How to formulate Pythagoreans’ theorem using propositional logic?
cb
a
How to formulate the statement that there are infinitely many primes?
Predicates are propositions (i.e. statements) with variables
x + 2 = yExample: P (x,y) ::=
Predicates
x = 1 and y = 3: P(1,3) is true
x = 1 and y = 4: P(1,4) is false
¬P(1,4) is true
The domain of a variable is the set of all values
that may be substituted in place of the variable.
When there is a variable, we need to specify what to put in the variables.
Set
We have not defined formally what is a set, and will do so later in the course.
For now, it is enough for our discussion to recall some well-known examples.
Z: the set of all integers
Z+
: the set of all positive integers
Z-
: the set of all negative integers
R: the set of all real numbers
Q: the set of all rational numbers
for ALL x∀x
The Universal Quantifier
cb
a
∀ x Z ∀ y Z, x + y = y + x.
The universal quantifier
Pythagorean’s theorem
Example:
Example:
This statement is true if the domain is Z, but not true if the domain is R.
The truth of a predicate depends on the domain.
∀ x Z+
P(x) means P(1)  P(2)  P(3)  …Example:
The Existential Quantifier
∃y There EXISTS some y
.x y x y∀ ∃ <
Domain Truth value
positive integers +
integers 
negative integers -
negative reals R-
T
e.g.
The truth of a predicate depends on the domain.
T
F
T
∃ y Z+
P(y) means P(1)  P(2)  P(3)  …
Translating Mathematical Theorem
Fermat (1637): If an integer n is greater than 2,
then the equation an
+ bn
= cn
has no solutions in non-zero integers a, b, and c.
Andrew Wiles (1994) http://en.wikipedia.org/wiki/Fermat's_last_theorem
Goldbach’s conjecture: Every even number is the sum of two prime numbers.
How to write prime(p)?
Translating Mathematical Theorem
Suppose we have a predicate prime(x) to determine if x is a prime number.
 Quantifiers
 Negation
 Multiple quantifiers
 Arguments of quantified statements
Negations of Quantified Statements
Everyone likes football.
What is the negation of this statement?
(generalized) DeMorgan’s Law
Not everyone likes football = There exists someone who doesn’t like football.
Say the domain has only three values.
The same idea can be used to prove it for any number of variables.
Negations of Quantified Statements
There is a plant that can fly.
What is the negation of this statement?
Not exists a plant that can fly = every plant cannot fly.
(generalized) DeMorgan’s Law Say the domain has only three values.
The same idea can be used to prove it for any number of variables.
 Quantifiers
 Negation
 Multiple quantifiers
 Arguments of quantified statements
Order of Quantifiers
There is an anti-virus program killing every computer virus.
How to interpret this sentence?
For every computer virus, there is an anti-virus program that kills it.
• For every attack, I have a defense:
• against MYDOOM, use Defender
• against ILOVEYOU, use Norton
• against BABLAS, use Zonealarm …
 is expensive!
Order of Quantifiers
There is an anti-virus program killing every computer virus.
There is one single anti-virus program that kills all computer viruses.
How to interpret this sentence?
I have one defense good against every attack.
Example: P is CSE-antivirus,
protects against ALL viruses
That’s much better!
Order of quantifiers is very important!
Order of Quantifiers
Let’s say we have an array A of size 6x6.
1
1 1 1
1
1 1
1
1
Then this table satisfies the statement.
Order of Quantifiers
Let’s say we have an array A of size 6x6.
1
1 1 1
1
1 1
1
1
But if the order of the quantifiers are changes,
then this table no longer satisfies the new statement.
Order of Quantifiers
Let’s say we have an array A of size 6x6.
1 1 1 1 1 1
To satisfy the new statement, there must be a row with all ones.
Questions
Are these statements equivalent?
Are these statements equivalent?
Yes, in general, you can change the order of two “foralls”,
and you can change the order of two “exists”.
More Negations
There is an anti-virus program killing every computer virus.
What is the negation of the above sentence?
For every program, there is some virus that it can not kill.
Exercises
1. There is a smallest positive integer.
2. There is no smallest positive real number.
In words, there is always a larger positive real number.
Exercises
3. There are infinitely many prime numbers.
In words, there exists a prime (first part)
and there is no largest prime (second part, similar to the previous question).
Formulating sentences using first order logic is useful in logic programming
and database queries.
 Quantifiers
 Negation
 Multiple quantifiers
 Arguments of quantified statements
True no matter what
• the Domain is,
• or the predicates are.
∀z [Q(z)  P(z)] → [∀x.Q(x)  ∀y.P(y)]
Predicate Calculus Validity
True no matter what the truth values of A and B are
( ) ( )A B B A→ ∨ →
Propositional validity
Predicate calculus validity
That is, logically correct, independent of the specific content.
Arguments with Quantified Statements
Universal instantiation:
Universal modus ponens:
Universal modus tollens:
Universal Generalization
( )
. ( )
A R c
A x R x
→
→ ∀
valid rule
providing c is independent of A
e.g. given any number c, 2c is an even number
=> for all x, 2x is an even number.
Informally, if we could prove that R(c) is true for an arbitrary c
(in a sense, c is a “variable”), then we could prove the for all statement.
Remark: Universal generalization is often difficult to prove, we will
introduce mathematical induction to prove the validity of for all statements.
Proof: Give countermodel, where
∀z [Q(z)  P(z)] is true,
but ∀x.Q(x)  ∀y.P(y) is false.
In this example, let domain be integers,
Q(z) be true if z is an even number, i.e. Q(z)=even(z)
P(z) be true if z is an odd number, i.e. P(z)=odd(z)
∀z [Q(z)  P(z)] → [∀x.Q(x)  ∀y.P(y)]
Valid Rule?
Find a domain,
and a predicate.
Then ∀z [Q(z)  P(z)] is true, because every number is either even or odd.
But ∀x.Q(x) is not true, since not every number is an even number.
Similarly ∀y.P(y) is not true, and so ∀x.Q(x)  ∀y.P(y) is not true.
Proof: Assume ∀z [Q(z)P(z)].
So Q(z)P(z) holds for all z in the domain D.
Now let c be some element in the domain D.
So Q(c)P(c) holds (by instantiation), and therefore Q(c) by itself holds.
But c could have been any element of the domain D.
So we conclude ∀x.Q(x). (by generalization)
We conclude ∀y.P(y) similarly (by generalization). Therefore,
∀x.Q(x)  ∀y.P(y) QED.
∀z D [Q(z)  P(z)] → [∀x D Q(x)  ∀y D P(y)]
Valid Rule?
• Express (quantified) statements using logic formula
• Use simple logic rules (e.g. DeMorgan, contrapositive, etc)
• Fluent with arguments and logical equivalence
Summary
This finishes the introduction to logic, half of the first part.
In the other half we will use logic to do mathematical proofs.
At this point, you should be able to:
(Optional) More About Logic
Ideally, we can come up with a “perfect” logical system, which is consistent
(not having contradictions) and is powerful (can derive everything that is true).
But Gödel proved that there is no perfect logical system.
This is called the Gödel’s incompleteness theorem.
It is an important and surprising result in mathematics.
The ideas in his proof are also influential in computer
science,
to prove that certain problem is not computable,
e.g. it is impossible to write a program to check whether
another program will loop forever on a particular input
(i.e. a perfect debugger doesn’t exist).
Applications of Logic (Optional)
Logic programming
Database
Digital circuit
solve problems by logic
making queries, data mining

More Related Content

What's hot

Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceasimnawaz54
 
AI_ 3 & 4 Knowledge Representation issues
AI_ 3 & 4 Knowledge Representation issuesAI_ 3 & 4 Knowledge Representation issues
AI_ 3 & 4 Knowledge Representation issues
Khushali Kathiriya
 
Chapter1p1
Chapter1p1Chapter1p1
Chapter1p1
Angel Martinez
 
Predicate Logic
Predicate LogicPredicate Logic
Predicate Logic
giki67
 
Number theory
Number theoryNumber theory
Number theory
manikanta361
 
Mathematical induction
Mathematical inductionMathematical induction
Mathematical induction
rey castro
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logic
Amey Kerkar
 
A study on number theory and its applications
A study on number theory and its applicationsA study on number theory and its applications
A study on number theory and its applications
Itishree Dash
 
Fuzzy Logic
Fuzzy LogicFuzzy Logic
Fuzzy Logic
Rishikese MR
 
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1taimoor iftikhar
 
Poset in Relations(Discrete Mathematics)
Poset in Relations(Discrete Mathematics)Poset in Relations(Discrete Mathematics)
Poset in Relations(Discrete Mathematics)
Rachana Pathak
 
Ch 2 lattice & boolean algebra
Ch 2 lattice & boolean algebraCh 2 lattice & boolean algebra
Ch 2 lattice & boolean algebra
Rupali Rana
 
Predicates and quantifiers presentation topics
Predicates  and quantifiers  presentation topicsPredicates  and quantifiers  presentation topics
Predicates and quantifiers presentation topics
R.h. Himel
 
mathematical functions
mathematical functions mathematical functions
mathematical functions
Anshul gour
 
Mathematical induction by Animesh Sarkar
Mathematical induction by Animesh SarkarMathematical induction by Animesh Sarkar
Mathematical induction by Animesh Sarkar
Animesh Sarkar
 
Principle of mathematical induction
Principle of mathematical inductionPrinciple of mathematical induction
Principle of mathematical induction
Kriti Varshney
 
Context free grammars
Context free grammarsContext free grammars
Context free grammarsRonak Thakkar
 
Error Finding in Numerical method
Error Finding in Numerical methodError Finding in Numerical method
Error Finding in Numerical method
Fazle Rabbi Ador
 
18 Basic Graph Algorithms
18 Basic Graph Algorithms18 Basic Graph Algorithms
18 Basic Graph Algorithms
Andres Mendez-Vazquez
 
Introduction to prolog
Introduction to prologIntroduction to prolog
Introduction to prolog
Harry Potter
 

What's hot (20)

Lecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inferenceLecture 2 predicates quantifiers and rules of inference
Lecture 2 predicates quantifiers and rules of inference
 
AI_ 3 & 4 Knowledge Representation issues
AI_ 3 & 4 Knowledge Representation issuesAI_ 3 & 4 Knowledge Representation issues
AI_ 3 & 4 Knowledge Representation issues
 
Chapter1p1
Chapter1p1Chapter1p1
Chapter1p1
 
Predicate Logic
Predicate LogicPredicate Logic
Predicate Logic
 
Number theory
Number theoryNumber theory
Number theory
 
Mathematical induction
Mathematical inductionMathematical induction
Mathematical induction
 
Knowledge representation and Predicate logic
Knowledge representation and Predicate logicKnowledge representation and Predicate logic
Knowledge representation and Predicate logic
 
A study on number theory and its applications
A study on number theory and its applicationsA study on number theory and its applications
A study on number theory and its applications
 
Fuzzy Logic
Fuzzy LogicFuzzy Logic
Fuzzy Logic
 
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
Disrete mathematics and_its application_by_rosen _7th edition_lecture_1
 
Poset in Relations(Discrete Mathematics)
Poset in Relations(Discrete Mathematics)Poset in Relations(Discrete Mathematics)
Poset in Relations(Discrete Mathematics)
 
Ch 2 lattice & boolean algebra
Ch 2 lattice & boolean algebraCh 2 lattice & boolean algebra
Ch 2 lattice & boolean algebra
 
Predicates and quantifiers presentation topics
Predicates  and quantifiers  presentation topicsPredicates  and quantifiers  presentation topics
Predicates and quantifiers presentation topics
 
mathematical functions
mathematical functions mathematical functions
mathematical functions
 
Mathematical induction by Animesh Sarkar
Mathematical induction by Animesh SarkarMathematical induction by Animesh Sarkar
Mathematical induction by Animesh Sarkar
 
Principle of mathematical induction
Principle of mathematical inductionPrinciple of mathematical induction
Principle of mathematical induction
 
Context free grammars
Context free grammarsContext free grammars
Context free grammars
 
Error Finding in Numerical method
Error Finding in Numerical methodError Finding in Numerical method
Error Finding in Numerical method
 
18 Basic Graph Algorithms
18 Basic Graph Algorithms18 Basic Graph Algorithms
18 Basic Graph Algorithms
 
Introduction to prolog
Introduction to prologIntroduction to prolog
Introduction to prolog
 

Viewers also liked

Jarrar: First Order Logic
Jarrar: First Order LogicJarrar: First Order Logic
Jarrar: First Order Logic
Mustafa Jarrar
 
Discrete Math Lecture 01: Propositional Logic
Discrete Math Lecture 01: Propositional LogicDiscrete Math Lecture 01: Propositional Logic
Discrete Math Lecture 01: Propositional Logic
IT Engineering Department
 
First order logic in knowledge representation
First order logic in knowledge representationFirst order logic in knowledge representation
First order logic in knowledge representation
Sabaragamuwa University
 
Class first order logic
Class first order logicClass first order logic
Class first order logicchandsek666
 
Discrete math ppt
Discrete math pptDiscrete math ppt
Discrete math pptmsumerton
 
Propositional And First-Order Logic
Propositional And First-Order LogicPropositional And First-Order Logic
Propositional And First-Order Logicankush_kumar
 
16 1 predicate resolution
16 1 predicate resolution16 1 predicate resolution
16 1 predicate resolution
Tianlu Wang
 
Jarrar.lecture notes.aai.2011s.ch9.fol.inference
Jarrar.lecture notes.aai.2011s.ch9.fol.inferenceJarrar.lecture notes.aai.2011s.ch9.fol.inference
Jarrar.lecture notes.aai.2011s.ch9.fol.inferencePalGov
 
Inference in first order logic12
Inference in first order logic12Inference in first order logic12
Inference in first order logic12yosser atassi
 
Jarrar: First Order Logic- Inference Methods
Jarrar: First Order Logic- Inference MethodsJarrar: First Order Logic- Inference Methods
Jarrar: First Order Logic- Inference Methods
Mustafa Jarrar
 
Jarrar: Propositional Logic Inference Methods
Jarrar: Propositional Logic Inference MethodsJarrar: Propositional Logic Inference Methods
Jarrar: Propositional Logic Inference Methods
Mustafa Jarrar
 
Logic Notes
Logic NotesLogic Notes
Logic Notesacavis
 
Attacks in MANET
Attacks in MANETAttacks in MANET
Attacks in MANET
Sunita Sahu
 
Syntax and semantics of propositional logic
Syntax and semantics of propositional logicSyntax and semantics of propositional logic
Syntax and semantics of propositional logic
Janet Stemwedel
 
Dm1
Dm1Dm1
Discrete Structures lecture 2
 Discrete Structures lecture 2 Discrete Structures lecture 2
Discrete Structures lecture 2Ali Usman
 

Viewers also liked (18)

Jarrar: First Order Logic
Jarrar: First Order LogicJarrar: First Order Logic
Jarrar: First Order Logic
 
Discrete Math Lecture 01: Propositional Logic
Discrete Math Lecture 01: Propositional LogicDiscrete Math Lecture 01: Propositional Logic
Discrete Math Lecture 01: Propositional Logic
 
First order logic in knowledge representation
First order logic in knowledge representationFirst order logic in knowledge representation
First order logic in knowledge representation
 
Class first order logic
Class first order logicClass first order logic
Class first order logic
 
Discrete math ppt
Discrete math pptDiscrete math ppt
Discrete math ppt
 
Propositional And First-Order Logic
Propositional And First-Order LogicPropositional And First-Order Logic
Propositional And First-Order Logic
 
16 1 predicate resolution
16 1 predicate resolution16 1 predicate resolution
16 1 predicate resolution
 
Jarrar.lecture notes.aai.2011s.ch9.fol.inference
Jarrar.lecture notes.aai.2011s.ch9.fol.inferenceJarrar.lecture notes.aai.2011s.ch9.fol.inference
Jarrar.lecture notes.aai.2011s.ch9.fol.inference
 
3 fol examples v2
3 fol examples v23 fol examples v2
3 fol examples v2
 
Inference in first order logic12
Inference in first order logic12Inference in first order logic12
Inference in first order logic12
 
Jarrar: First Order Logic- Inference Methods
Jarrar: First Order Logic- Inference MethodsJarrar: First Order Logic- Inference Methods
Jarrar: First Order Logic- Inference Methods
 
Jarrar: Propositional Logic Inference Methods
Jarrar: Propositional Logic Inference MethodsJarrar: Propositional Logic Inference Methods
Jarrar: Propositional Logic Inference Methods
 
Logic Notes
Logic NotesLogic Notes
Logic Notes
 
Attacks in MANET
Attacks in MANETAttacks in MANET
Attacks in MANET
 
Syntax and semantics of propositional logic
Syntax and semantics of propositional logicSyntax and semantics of propositional logic
Syntax and semantics of propositional logic
 
Dm1
Dm1Dm1
Dm1
 
Discrete Structures lecture 2
 Discrete Structures lecture 2 Discrete Structures lecture 2
Discrete Structures lecture 2
 
Math task 3
Math task 3Math task 3
Math task 3
 

Similar to Discrete Math Lecture 02: First Order Logic

1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.ppt1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.ppt
TejasAditya2
 
Discreate structure presentation introduction
Discreate structure presentation introductionDiscreate structure presentation introduction
Discreate structure presentation introduction
yashirraza123
 
Discrete Structure Lecture #5 & 6.pdf
Discrete Structure Lecture #5 & 6.pdfDiscrete Structure Lecture #5 & 6.pdf
Discrete Structure Lecture #5 & 6.pdf
MuhammadUmerIhtisham
 
dma_ppt.pdf
dma_ppt.pdfdma_ppt.pdf
dma_ppt.pdf
BatoolKhan15
 
P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2
S.Shayan Daneshvar
 
Stochastic Processes Homework Help
Stochastic Processes Homework HelpStochastic Processes Homework Help
Stochastic Processes Homework Help
Excel Homework Help
 
Lecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inferenceLecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inferenceasimnawaz54
 
Math Assignment Help
Math Assignment HelpMath Assignment Help
Math Assignment Help
Math Homework Solver
 
Stochastic Processes Homework Help
Stochastic Processes Homework Help Stochastic Processes Homework Help
Stochastic Processes Homework Help
Statistics Homework Helper
 
CMSC 56 | Lecture 3: Predicates & Quantifiers
CMSC 56 | Lecture 3: Predicates & QuantifiersCMSC 56 | Lecture 3: Predicates & Quantifiers
CMSC 56 | Lecture 3: Predicates & Quantifiers
allyn joy calcaben
 
Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Omnia A. Abdullah
 
DM(1).pptx
DM(1).pptxDM(1).pptx
DM(1).pptx
PradeeshSAI
 
Logic
LogicLogic
Formal Logic - Lesson 8 - Predicates and Quantifiers
Formal Logic - Lesson 8 - Predicates and QuantifiersFormal Logic - Lesson 8 - Predicates and Quantifiers
Formal Logic - Lesson 8 - Predicates and Quantifiers
Laguna State Polytechnic University
 
CSci102_Module 4.ppt
CSci102_Module 4.pptCSci102_Module 4.ppt
CSci102_Module 4.ppt
HarleyGotardo
 
DISCRTE STRUCTURES CSY1-QUANTIFIERS.pptx
DISCRTE STRUCTURES CSY1-QUANTIFIERS.pptxDISCRTE STRUCTURES CSY1-QUANTIFIERS.pptx
DISCRTE STRUCTURES CSY1-QUANTIFIERS.pptx
AzurineBlues
 
C2.0 propositional logic
C2.0 propositional logicC2.0 propositional logic
C2.0 propositional logic
Melaku Bayih Demessie
 
Boolean Programs and Quantified Propositional Proof System -
Boolean Programs and Quantified Propositional Proof System - Boolean Programs and Quantified Propositional Proof System -
Boolean Programs and Quantified Propositional Proof System - Michael Soltys
 
Poggi analytics - star - 1a
Poggi   analytics - star - 1aPoggi   analytics - star - 1a
Poggi analytics - star - 1a
Gaston Liberman
 

Similar to Discrete Math Lecture 02: First Order Logic (20)

1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.ppt1606751772-ds-lecture-6.ppt
1606751772-ds-lecture-6.ppt
 
Discreate structure presentation introduction
Discreate structure presentation introductionDiscreate structure presentation introduction
Discreate structure presentation introduction
 
Discrete Structure Lecture #5 & 6.pdf
Discrete Structure Lecture #5 & 6.pdfDiscrete Structure Lecture #5 & 6.pdf
Discrete Structure Lecture #5 & 6.pdf
 
dma_ppt.pdf
dma_ppt.pdfdma_ppt.pdf
dma_ppt.pdf
 
P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2P, NP and NP-Complete, Theory of NP-Completeness V2
P, NP and NP-Complete, Theory of NP-Completeness V2
 
Stochastic Processes Homework Help
Stochastic Processes Homework HelpStochastic Processes Homework Help
Stochastic Processes Homework Help
 
Lecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inferenceLecture 3 qualtifed rules of inference
Lecture 3 qualtifed rules of inference
 
Math Assignment Help
Math Assignment HelpMath Assignment Help
Math Assignment Help
 
DISMATH_Part1
DISMATH_Part1DISMATH_Part1
DISMATH_Part1
 
Stochastic Processes Homework Help
Stochastic Processes Homework Help Stochastic Processes Homework Help
Stochastic Processes Homework Help
 
CMSC 56 | Lecture 3: Predicates & Quantifiers
CMSC 56 | Lecture 3: Predicates & QuantifiersCMSC 56 | Lecture 3: Predicates & Quantifiers
CMSC 56 | Lecture 3: Predicates & Quantifiers
 
Discrete Mathematics - All chapters
Discrete Mathematics - All chapters Discrete Mathematics - All chapters
Discrete Mathematics - All chapters
 
DM(1).pptx
DM(1).pptxDM(1).pptx
DM(1).pptx
 
Logic
LogicLogic
Logic
 
Formal Logic - Lesson 8 - Predicates and Quantifiers
Formal Logic - Lesson 8 - Predicates and QuantifiersFormal Logic - Lesson 8 - Predicates and Quantifiers
Formal Logic - Lesson 8 - Predicates and Quantifiers
 
CSci102_Module 4.ppt
CSci102_Module 4.pptCSci102_Module 4.ppt
CSci102_Module 4.ppt
 
DISCRTE STRUCTURES CSY1-QUANTIFIERS.pptx
DISCRTE STRUCTURES CSY1-QUANTIFIERS.pptxDISCRTE STRUCTURES CSY1-QUANTIFIERS.pptx
DISCRTE STRUCTURES CSY1-QUANTIFIERS.pptx
 
C2.0 propositional logic
C2.0 propositional logicC2.0 propositional logic
C2.0 propositional logic
 
Boolean Programs and Quantified Propositional Proof System -
Boolean Programs and Quantified Propositional Proof System - Boolean Programs and Quantified Propositional Proof System -
Boolean Programs and Quantified Propositional Proof System -
 
Poggi analytics - star - 1a
Poggi   analytics - star - 1aPoggi   analytics - star - 1a
Poggi analytics - star - 1a
 

Recently uploaded

BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Akanksha trivedi rama nursing college kanpur.
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
Kartik Tiwari
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
gb193092
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
Krisztián Száraz
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
DhatriParmar
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Dr. Vinod Kumar Kanvaria
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
goswamiyash170123
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
Celine George
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
Scholarhat
 

Recently uploaded (20)

BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama UniversityNatural birth techniques - Mrs.Akanksha Trivedi Rama University
Natural birth techniques - Mrs.Akanksha Trivedi Rama University
 
Chapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdfChapter -12, Antibiotics (One Page Notes).pdf
Chapter -12, Antibiotics (One Page Notes).pdf
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
Marketing internship report file for MBA
Marketing internship report file for MBAMarketing internship report file for MBA
Marketing internship report file for MBA
 
Advantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO PerspectiveAdvantages and Disadvantages of CMS from an SEO Perspective
Advantages and Disadvantages of CMS from an SEO Perspective
 
The Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptxThe Diamond Necklace by Guy De Maupassant.pptx
The Diamond Necklace by Guy De Maupassant.pptx
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdfMASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
MASS MEDIA STUDIES-835-CLASS XI Resource Material.pdf
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
Model Attribute Check Company Auto Property
Model Attribute  Check Company Auto PropertyModel Attribute  Check Company Auto Property
Model Attribute Check Company Auto Property
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
Azure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHatAzure Interview Questions and Answers PDF By ScholarHat
Azure Interview Questions and Answers PDF By ScholarHat
 

Discrete Math Lecture 02: First Order Logic

  • 2. This Lecture Last time we talked about propositional logic, a logic on simple statements. This time we will talk about first order logic, a logic on quantified statements. First order logic is much more expressive than propositional logic. The topics on first order logic are:  Quantifiers  Negation  Multiple quantifiers  Arguments of quantified statements
  • 3. Propositional logic – logic of simple statements Limitation of Propositional Logic How to formulate Pythagoreans’ theorem using propositional logic? cb a How to formulate the statement that there are infinitely many primes?
  • 4. Predicates are propositions (i.e. statements) with variables x + 2 = yExample: P (x,y) ::= Predicates x = 1 and y = 3: P(1,3) is true x = 1 and y = 4: P(1,4) is false ¬P(1,4) is true The domain of a variable is the set of all values that may be substituted in place of the variable. When there is a variable, we need to specify what to put in the variables.
  • 5. Set We have not defined formally what is a set, and will do so later in the course. For now, it is enough for our discussion to recall some well-known examples. Z: the set of all integers Z+ : the set of all positive integers Z- : the set of all negative integers R: the set of all real numbers Q: the set of all rational numbers
  • 6. for ALL x∀x The Universal Quantifier cb a ∀ x Z ∀ y Z, x + y = y + x. The universal quantifier Pythagorean’s theorem Example: Example: This statement is true if the domain is Z, but not true if the domain is R. The truth of a predicate depends on the domain. ∀ x Z+ P(x) means P(1)  P(2)  P(3)  …Example:
  • 7. The Existential Quantifier ∃y There EXISTS some y .x y x y∀ ∃ < Domain Truth value positive integers + integers  negative integers - negative reals R- T e.g. The truth of a predicate depends on the domain. T F T ∃ y Z+ P(y) means P(1)  P(2)  P(3)  …
  • 8. Translating Mathematical Theorem Fermat (1637): If an integer n is greater than 2, then the equation an + bn = cn has no solutions in non-zero integers a, b, and c. Andrew Wiles (1994) http://en.wikipedia.org/wiki/Fermat's_last_theorem
  • 9. Goldbach’s conjecture: Every even number is the sum of two prime numbers. How to write prime(p)? Translating Mathematical Theorem Suppose we have a predicate prime(x) to determine if x is a prime number.
  • 10.  Quantifiers  Negation  Multiple quantifiers  Arguments of quantified statements
  • 11. Negations of Quantified Statements Everyone likes football. What is the negation of this statement? (generalized) DeMorgan’s Law Not everyone likes football = There exists someone who doesn’t like football. Say the domain has only three values. The same idea can be used to prove it for any number of variables.
  • 12. Negations of Quantified Statements There is a plant that can fly. What is the negation of this statement? Not exists a plant that can fly = every plant cannot fly. (generalized) DeMorgan’s Law Say the domain has only three values. The same idea can be used to prove it for any number of variables.
  • 13.  Quantifiers  Negation  Multiple quantifiers  Arguments of quantified statements
  • 14. Order of Quantifiers There is an anti-virus program killing every computer virus. How to interpret this sentence? For every computer virus, there is an anti-virus program that kills it. • For every attack, I have a defense: • against MYDOOM, use Defender • against ILOVEYOU, use Norton • against BABLAS, use Zonealarm …  is expensive!
  • 15. Order of Quantifiers There is an anti-virus program killing every computer virus. There is one single anti-virus program that kills all computer viruses. How to interpret this sentence? I have one defense good against every attack. Example: P is CSE-antivirus, protects against ALL viruses That’s much better! Order of quantifiers is very important!
  • 16. Order of Quantifiers Let’s say we have an array A of size 6x6. 1 1 1 1 1 1 1 1 1 Then this table satisfies the statement.
  • 17. Order of Quantifiers Let’s say we have an array A of size 6x6. 1 1 1 1 1 1 1 1 1 But if the order of the quantifiers are changes, then this table no longer satisfies the new statement.
  • 18. Order of Quantifiers Let’s say we have an array A of size 6x6. 1 1 1 1 1 1 To satisfy the new statement, there must be a row with all ones.
  • 19. Questions Are these statements equivalent? Are these statements equivalent? Yes, in general, you can change the order of two “foralls”, and you can change the order of two “exists”.
  • 20. More Negations There is an anti-virus program killing every computer virus. What is the negation of the above sentence? For every program, there is some virus that it can not kill.
  • 21. Exercises 1. There is a smallest positive integer. 2. There is no smallest positive real number. In words, there is always a larger positive real number.
  • 22. Exercises 3. There are infinitely many prime numbers. In words, there exists a prime (first part) and there is no largest prime (second part, similar to the previous question). Formulating sentences using first order logic is useful in logic programming and database queries.
  • 23.  Quantifiers  Negation  Multiple quantifiers  Arguments of quantified statements
  • 24. True no matter what • the Domain is, • or the predicates are. ∀z [Q(z)  P(z)] → [∀x.Q(x)  ∀y.P(y)] Predicate Calculus Validity True no matter what the truth values of A and B are ( ) ( )A B B A→ ∨ → Propositional validity Predicate calculus validity That is, logically correct, independent of the specific content.
  • 25. Arguments with Quantified Statements Universal instantiation: Universal modus ponens: Universal modus tollens:
  • 26. Universal Generalization ( ) . ( ) A R c A x R x → → ∀ valid rule providing c is independent of A e.g. given any number c, 2c is an even number => for all x, 2x is an even number. Informally, if we could prove that R(c) is true for an arbitrary c (in a sense, c is a “variable”), then we could prove the for all statement. Remark: Universal generalization is often difficult to prove, we will introduce mathematical induction to prove the validity of for all statements.
  • 27. Proof: Give countermodel, where ∀z [Q(z)  P(z)] is true, but ∀x.Q(x)  ∀y.P(y) is false. In this example, let domain be integers, Q(z) be true if z is an even number, i.e. Q(z)=even(z) P(z) be true if z is an odd number, i.e. P(z)=odd(z) ∀z [Q(z)  P(z)] → [∀x.Q(x)  ∀y.P(y)] Valid Rule? Find a domain, and a predicate. Then ∀z [Q(z)  P(z)] is true, because every number is either even or odd. But ∀x.Q(x) is not true, since not every number is an even number. Similarly ∀y.P(y) is not true, and so ∀x.Q(x)  ∀y.P(y) is not true.
  • 28. Proof: Assume ∀z [Q(z)P(z)]. So Q(z)P(z) holds for all z in the domain D. Now let c be some element in the domain D. So Q(c)P(c) holds (by instantiation), and therefore Q(c) by itself holds. But c could have been any element of the domain D. So we conclude ∀x.Q(x). (by generalization) We conclude ∀y.P(y) similarly (by generalization). Therefore, ∀x.Q(x)  ∀y.P(y) QED. ∀z D [Q(z)  P(z)] → [∀x D Q(x)  ∀y D P(y)] Valid Rule?
  • 29. • Express (quantified) statements using logic formula • Use simple logic rules (e.g. DeMorgan, contrapositive, etc) • Fluent with arguments and logical equivalence Summary This finishes the introduction to logic, half of the first part. In the other half we will use logic to do mathematical proofs. At this point, you should be able to:
  • 30. (Optional) More About Logic Ideally, we can come up with a “perfect” logical system, which is consistent (not having contradictions) and is powerful (can derive everything that is true). But Gödel proved that there is no perfect logical system. This is called the Gödel’s incompleteness theorem. It is an important and surprising result in mathematics. The ideas in his proof are also influential in computer science, to prove that certain problem is not computable, e.g. it is impossible to write a program to check whether another program will loop forever on a particular input (i.e. a perfect debugger doesn’t exist).
  • 31. Applications of Logic (Optional) Logic programming Database Digital circuit solve problems by logic making queries, data mining