SlideShare a Scribd company logo
03/07/17 1
Module #1 - Logic
North South University
Dept. of Computer Science & Engineering
CSE 173
Discrete Mathematics
Dr. Mohammad R. Rahman
Slides for a Course Based on the TextSlides for a Course Based on the Text
Discrete Mathematics & Its ApplicationsDiscrete Mathematics & Its Applications
(5(5thth
Edition)Edition)
by Kenneth H. Rosenby Kenneth H. Rosen
03/07/17 2
Module #1 - Logic
Module #1:
The Fundamentals of Logic
Rosen 5Rosen 5thth
ed., §§1.1-1.4ed., §§1.1-1.4
~6-8 lectures~6-8 lectures
03/07/17 3
Module #1 - Logic
Module #1: Foundations of Logic
(§§1.1-1.4)
Mathematical Logic is a tool for working with
elaborate compound statements. It includes:
• A formal language for expressing them.
• A concise notation for writing them.
• A methodology for objectively reasoning about
their truth or falsity.
• It is the foundation for expressing formal proofs in
all branches of mathematics.
03/07/17 4
Module #1 - Logic
Foundations of Logic: Overview
• Propositional logic (Propositional logic (§1.1-1.2)§1.1-1.2)::
– Basic definitions. (§1.1)Basic definitions. (§1.1)
– Equivalence rules & derivations. (§1.2)Equivalence rules & derivations. (§1.2)
• Predicate logic (§1.3-1.4)Predicate logic (§1.3-1.4)
– Predicates.Predicates.
– Quantified predicate expressions.Quantified predicate expressions.
– Equivalences & derivations.Equivalences & derivations.
03/07/17 5
Module #1 - Logic
Propositional Logic (§1.1)
Propositional LogicPropositional Logic is the logic of compoundis the logic of compound
statements built from simpler statementsstatements built from simpler statements
using so-calledusing so-called BooleanBoolean connectives.connectives.
Some applications in computer science:Some applications in computer science:
• Design of digital electronic circuits.Design of digital electronic circuits.
• Expressing conditions in programs.Expressing conditions in programs.
• Queries to databases & search engines.Queries to databases & search engines.
Topic #1 – Propositional Logic
George Boole
(1815-1864)
Chrysippus of Soli
(ca. 281 B.C. – 205 B.C.)
03/07/17 6
Module #1 - Logic
Definition of a Proposition
Definition:Definition: AA propositionproposition (denoted(denoted pp,, qq,, rr, …) is simply:, …) is simply:
• aa statementstatement ((i.e.i.e., a declarative sentence), a declarative sentence)
– with some definite meaningwith some definite meaning, (not vague or ambiguous), (not vague or ambiguous)
• having ahaving a truth valuetruth value that’s eitherthat’s either truetrue ((TT) or) or falsefalse ((FF))
– it isit is nevernever both, neither, or somewhere “in between!”both, neither, or somewhere “in between!”
• However, you might notHowever, you might not knowknow the actual truth value,the actual truth value,
• and, the truth value mightand, the truth value might dependdepend on the situation or context.on the situation or context.
• However with probability theory,However with probability theory, we assignwe assign degrees of certaintydegrees of certainty
(“between”(“between” TT andand FF) to propositions.) to propositions.
– But for now: think True/False only!But for now: think True/False only!
Topic #1 – Propositional Logic
03/07/17 7
Module #1 - Logic
Examples of Propositions
• ““It is raining.”It is raining.” (In a given situation.)(In a given situation.)
• ““Beijing is the capital of China.” • “1 + 2 = 3”Beijing is the capital of China.” • “1 + 2 = 3”
But, the following areBut, the following are NOTNOT propositions:propositions:
• ““Who’s there?”Who’s there?” (interrogative, question)(interrogative, question)
• ““La la la la la.”La la la la la.” (meaningless interjection)(meaningless interjection)
• ““Just do it!”Just do it!” (imperative, command)(imperative, command)
• ““Yeah, I sorta dunno, whatever...”Yeah, I sorta dunno, whatever...” (vague)(vague)
• ““1 + 2”1 + 2” (expression with a non-true/false value)(expression with a non-true/false value)
Topic #1 – Propositional Logic
03/07/17 8
Module #1 - Logic
AnAn operatoroperator oror connectiveconnective combines one orcombines one or
moremore operandoperand expressions into a largerexpressions into a larger
expression. (expression. (E.g.E.g., “+” in numeric exprs.), “+” in numeric exprs.)
• UnaryUnary operators take 1 operand (operators take 1 operand (e.g.,e.g., −−3);3);
binarybinary operators take 2 operands (operators take 2 operands (egeg 33 ×× 4).4).
• PropositionalPropositional oror BooleanBoolean operatorsoperators operateoperate
on propositionson propositions (or their truth values)(or their truth values)
instead of on numbers.instead of on numbers.
Operators / Connectives
Topic #1.0 – Propositional Logic: Operators
03/07/17 9
Module #1 - Logic
Some Popular Boolean Operators
Formal NameFormal Name NicknameNickname ArityArity SymbolSymbol
Negation operatorNegation operator NOTNOT UnaryUnary ¬¬
Conjunction operatorConjunction operator ANDAND BinaryBinary ∧∧
Disjunction operatorDisjunction operator OROR BinaryBinary ∨∨
Exclusive-OR operatorExclusive-OR operator XORXOR BinaryBinary ⊕⊕
Implication operatorImplication operator IMPLIESIMPLIES BinaryBinary →→
Biconditional operatorBiconditional operator IFFIFF BinaryBinary ↔↔
Topic #1.0 – Propositional Logic: Operators
03/07/17 10
Module #1 - Logic
The Negation Operator
The unaryThe unary negation operatornegation operator “¬” (“¬” (NOTNOT))
transforms a prop. into its logicaltransforms a prop. into its logical negationnegation..
E.g.E.g. IfIf pp = “I have brown hair.”= “I have brown hair.”
then ¬then ¬pp = “I do= “I do notnot have brown hair.”have brown hair.”
TheThe truth tabletruth table for NOT:for NOT: p ¬p
T F
F T
T :≡ True; F :≡ False
“:≡” means “is defined as”
Operand
column
Result
column
Topic #1.0 – Propositional Logic: Operators
03/07/17 11
Module #1 - Logic
The Conjunction Operator
The binaryThe binary conjunction operatorconjunction operator ““∧∧” (” (ANDAND))
combines two propositions to form theircombines two propositions to form their
logicallogical conjunctionconjunction..
E.g.E.g. IfIf pp=“I will have salad for lunch.” and=“I will have salad for lunch.” and
q=q=“I will have steak for dinner.”, then“I will have steak for dinner.”, then
pp∧∧qq=“I will have salad for lunch=“I will have salad for lunch andand
I will have steak for dinner.”I will have steak for dinner.”
Remember: “∧∧” points up like an “A”, and it means “” points up like an “A”, and it means “∧∧NDND””
∧∧NDND
Topic #1.0 – Propositional Logic: Operators
03/07/17 12
Module #1 - Logic
• Note that aNote that a
conjunctionconjunction
pp11 ∧∧ pp22 ∧∧ …… ∧∧ ppnn
ofof nn propositionspropositions
will have 2will have 2nn
rowsrows
in its truth table.in its truth table.
• Also: ¬ andAlso: ¬ and ∧∧ operations together are suffi-operations together are suffi-
cient to expresscient to express anyany Boolean truth table!Boolean truth table!
Conjunction Truth Table
p q p∧q
F F F
F T F
T F F
T T T
Operand columns
Topic #1.0 – Propositional Logic: Operators
03/07/17 13
Module #1 - Logic
The Disjunction Operator
The binaryThe binary disjunction operatordisjunction operator ““∨∨” (” (OROR))
combines two propositions to form theircombines two propositions to form their
logicallogical disjunctiondisjunction..
pp=“My car has a bad engine.”=“My car has a bad engine.”
q=q=“My car has a bad carburetor.”“My car has a bad carburetor.”
pp∨∨qq=“Either my car has a bad engine,=“Either my car has a bad engine, oror
my car has a bad carburetor.”my car has a bad carburetor.” After the downward-
pointing “axe” of “∨∨””
splits the wood, yousplits the wood, you
can take 1 piece OR thecan take 1 piece OR the
other, or both.other, or both.
∨∨
Topic #1.0 – Propositional Logic: Operators
Meaning is like “and/or” in English.
03/07/17 14
Module #1 - Logic
• Note thatNote that pp∨∨qq meansmeans
thatthat pp is true, oris true, or qq isis
true,true, or bothor both are true!are true!
• So, this operation isSo, this operation is
also calledalso called inclusive or,inclusive or,
because itbecause it includesincludes thethe
possibility that bothpossibility that both pp andand qq are true.are true.
• ““¬” and “¬” and “∨∨” together are also universal.” together are also universal.
Disjunction Truth Table
p q p∨ q
F F F
F T T
T F T
T T T
Note
difference
from AND
Topic #1.0 – Propositional Logic: Operators
03/07/17 15
Module #1 - Logic
Nested Propositional Expressions
• Use parentheses toUse parentheses to group sub-expressionsgroup sub-expressions::
““I just saw my oldI just saw my old ffriendriend, and either, and either he’she’s
ggrownrown oror I’veI’ve sshrunkhrunk.” =.” = ff ∧∧ ((gg ∨∨ ss))
– ((ff ∧∧ gg)) ∨∨ ss would mean something differentwould mean something different
– ff ∧∧ gg ∨∨ ss would be ambiguouswould be ambiguous
• By convention, “¬” takesBy convention, “¬” takes precedenceprecedence overover
both “both “∧∧” and “” and “∨∨”.”.
– ¬¬ss ∧∧ ff means (¬means (¬ss)) ∧∧ ff ,, notnot ¬ (¬ (ss ∧∧ ff))
Topic #1.0 – Propositional Logic: Operators
03/07/17 16
Module #1 - Logic
A Simple Exercise
LetLet pp=“It rained last night”,=“It rained last night”,
qq=“The sprinklers came on last night,”=“The sprinklers came on last night,”
rr=“The lawn was wet this morning.”=“The lawn was wet this morning.”
Translate each of the following into English:Translate each of the following into English:
¬¬pp ==
rr ∧∧ ¬¬pp ==
¬¬ rr ∨∨ pp ∨∨ q =q =
“It didn’t rain last night.”
“The lawn was wet this morning, and
it didn’t rain last night.”
“Either the lawn wasn’t wet this
morning, or it rained last night, or
the sprinklers came on last night.”
Topic #1.0 – Propositional Logic: Operators
03/07/17 17
Module #1 - Logic
The Exclusive Or Operator
The binaryThe binary exclusive-or operatorexclusive-or operator ““⊕⊕” (” (XORXOR))
combines two propositions to form theircombines two propositions to form their
logical “exclusive or” (exjunction?).logical “exclusive or” (exjunction?).
pp = “I will earn an A in this course,”= “I will earn an A in this course,”
qq == “I will drop this course,”“I will drop this course,”
pp ⊕⊕ qq = “I will either earn an A in this course,= “I will either earn an A in this course,
or I will drop it (but not both!)”or I will drop it (but not both!)”
Topic #1.0 – Propositional Logic: Operators
03/07/17 18
Module #1 - Logic
• Note thatNote that pp⊕⊕qq meansmeans
thatthat pp is true, oris true, or qq isis
true, buttrue, but not bothnot both!!
• This operation isThis operation is
calledcalled exclusive or,exclusive or,
because itbecause it excludesexcludes thethe
possibility that bothpossibility that both pp andand qq are true.are true.
• ““¬” and “¬” and “⊕⊕” together are” together are notnot universal.universal.
Exclusive-Or Truth Table
p q p⊕ q
F F F
F T T
T F T
T T F Note
difference
from OR.
Topic #1.0 – Propositional Logic: Operators
03/07/17 19
Module #1 - Logic
Note thatNote that EnglishEnglish “or” can be“or” can be ambiguousambiguous
regarding the “both” case!regarding the “both” case!
““Pat is a singer orPat is a singer or
Pat is a writer.” -Pat is a writer.” -
““Pat is a man orPat is a man or
Pat is a woman.” -Pat is a woman.” -
Need context to disambiguate the meaning!Need context to disambiguate the meaning!
For this class, assume “or” meansFor this class, assume “or” means inclusiveinclusive..
Natural Language is Ambiguous
p q p "or" q
F F F
F T T
T F T
T T ?
∨
⊕
Topic #1.0 – Propositional Logic: Operators
03/07/17 20
Module #1 - Logic
The Implication Operator
TheThe implicationimplication pp →→ qq states thatstates that pp impliesimplies q.q.
I.e.I.e., If, If pp is true, thenis true, then qq is true; but ifis true; but if pp is notis not
true, thentrue, then qq could be either true or false.could be either true or false.
E.g.E.g., let, let pp = “You study hard.”= “You study hard.”
qq = “You will get a good grade.”= “You will get a good grade.”
pp →→ q =q = “If you study hard, then you will get“If you study hard, then you will get
a good grade.”a good grade.” (else, it could go either way)(else, it could go either way)
Topic #1.0 – Propositional Logic: Operators
antecedent consequent
03/07/17 21
Module #1 - Logic
Implication Truth Table
• pp →→ qq isis falsefalse onlyonly whenwhen
pp is true butis true but qq isis notnot true.true.
• pp →→ qq doesdoes notnot saysay
thatthat pp causescauses qq!!
• pp →→ qq doesdoes notnot requirerequire
thatthat pp oror qq are ever trueare ever true!!
• E.g.E.g. “(1=0)“(1=0) →→ pigs can fly” is TRUE!pigs can fly” is TRUE!
p q p→q
F F T
F T T
T F F
T T T
The
only
False
case!
Topic #1.0 – Propositional Logic: Operators
03/07/17 22
Module #1 - Logic
Examples of Implications
• ““If this lecture ever ends, then the sun willIf this lecture ever ends, then the sun will
rise tomorrow.”rise tomorrow.” TrueTrue oror FalseFalse??
• ““If Tuesday is a day of the week, then I amIf Tuesday is a day of the week, then I am
a penguin.”a penguin.” TrueTrue oror FalseFalse??
• ““If 1+1=6, then Bush is president.”If 1+1=6, then Bush is president.”
TrueTrue oror FalseFalse??
• ““If the moon is made of green cheese, then IIf the moon is made of green cheese, then I
am richer than Bill Gates.”am richer than Bill Gates.” TrueTrue oror FalseFalse??
Topic #1.0 – Propositional Logic: Operators
03/07/17 23
Module #1 - Logic
Difference between English
Language and Logic
• The way we have defined implications is more generalThe way we have defined implications is more general
than the meaning attached to English Language.than the meaning attached to English Language.
• Consider a sentence like,Consider a sentence like,
– ““If it is sunny today, then we will go to beach”If it is sunny today, then we will go to beach”
• In normal language there is a relationship betweenIn normal language there is a relationship between
antecedent and consequent.antecedent and consequent.
• Now Let us consider this exampleNow Let us consider this example
– ““If it is Friday, then 2+3=5”If it is Friday, then 2+3=5”
• In logic, we consider the sentenceIn logic, we consider the sentence TrueTrue since thesince the
conclusion is trueconclusion is true
03/07/17 24
Module #1 - Logic
More about Discrepancy
• In English, a sentence “ifIn English, a sentence “if pp thenthen qq” usually really” usually really
implicitlyimplicitly means something like,means something like,
• ““In all possible situationsIn all possible situations, if, if pp thenthen qq.”.”
– That is, “ForThat is, “For pp to be true andto be true and qq false isfalse is impossibleimpossible.”.”
– Or, “IOr, “I guaranteeguarantee that no matter what, ifthat no matter what, if pp, then, then qq.”.”
• In mathematical concept of an implication isIn mathematical concept of an implication is
independent of a cause and effect relationshipindependent of a cause and effect relationship
between hypothesis and conclusionbetween hypothesis and conclusion
• The implication only specifies the truth values; it isThe implication only specifies the truth values; it is
not based on English usage.not based on English usage.
03/07/17 25
Module #1 - Logic
English Phrases Meaning p → q
• ““pp impliesimplies qq””
• ““ifif pp, then, then qq””
• ““ifif pp,, qq””
• ““whenwhen pp,, qq””
• ““wheneverwhenever pp,, qq””
• ““qq ifif pp””
• ““qq whenwhen pp””
• ““qq wheneverwhenever pp””
• ““pp only ifonly if qq””
• ““pp is sufficient foris sufficient for qq””
• ““qq is necessary foris necessary for pp””
• ““qq follows fromfollows from pp””
• ““qq is implied byis implied by pp””
We will see some equivalentWe will see some equivalent
logic expressions later.logic expressions later.
Topic #1.0 – Propositional Logic: Operators
03/07/17 26
Module #1 - Logic
Converse, Inverse, Contrapositive
Some terminology, for an implicationSome terminology, for an implication pp →→ qq::
• ItsIts converseconverse is:is: qq →→ pp..
• ItsIts inverseinverse is:is: ¬¬pp →→ ¬¬qq..
• ItsIts contrapositivecontrapositive:: ¬¬qq →→ ¬¬ p.p.
• One of these three has theOne of these three has the same meaningsame meaning
(same truth table) as(same truth table) as pp →→ qq. Can you figure. Can you figure
out which?out which?
Topic #1.0 – Propositional Logic: Operators
03/07/17 27
Module #1 - Logic
How do we know for sure?
Proving the equivalence ofProving the equivalence of pp →→ qq and itsand its
contrapositive using truth tables:contrapositive using truth tables:
p q ¬q ¬p p→q ¬q →¬p
F F T T T T
F T F T T T
T F T F F F
T T F F T T
Topic #1.0 – Propositional Logic: Operators
03/07/17 28
Module #1 - Logic
The biconditional operator
• TheThe biconditionalbiconditional pp ↔ qq is theis the
proposition that is true when p andproposition that is true when p and
q have the same truth values, and isq have the same truth values, and is
false otherwise.false otherwise.
• pp ↔ qq is true preciously when bothis true preciously when both
the implicationsthe implications
pp →→ qq andand qq →→ pp are trueare true
• The terminology “if and only if q”The terminology “if and only if q”
is used foris used for pp ↔ qq
Topic #1.0 – Propositional Logic: Operators
p q p ↔q
F F T
F T F
T F F
T T T
03/07/17 29
Module #1 - Logic
Biconditional Truth Table
• pp ↔ qq means thatmeans that pp andand qq
have thehave the samesame truth value.truth value.
• Note this truth table is theNote this truth table is the
exactexact oppositeopposite ofof ⊕⊕’s!’s!
Thus,Thus, pp ↔ qq means ¬(means ¬(pp ⊕⊕ qq))
• pp ↔ qq doesdoes notnot implyimply
thatthat pp andand qq are true, or that either of them causesare true, or that either of them causes
the other, or that they have a common cause.the other, or that they have a common cause.
Topic #1.0 – Propositional Logic: Operators
p q p ↔q
F F T
F T F
T F F
T T T
03/07/17 30
Module #1 - Logic
English Equivalent
• ““p is necessary and sufficient for q”p is necessary and sufficient for q”
• ““if p then q, and conversely.”if p then q, and conversely.”
• ““p iff q”p iff q”
• Example: p: You can take the flight and q:Example: p: You can take the flight and q:
You buy a ticketYou buy a ticket
• pp ↔ q: “ You can take the flight if and onlyq: “ You can take the flight if and only
if you buy a ticket”if you buy a ticket”
03/07/17 31
Module #1 - Logic
Translating English Sentences
1.1. You can access the Internet from campusYou can access the Internet from campus
only if you are a computer science majoronly if you are a computer science major
or you are not a freshman.or you are not a freshman.
2.2. You cannot ride the roller coaster if youYou cannot ride the roller coaster if you
are under 4 feet tall unless you are olderare under 4 feet tall unless you are older
than 16 years old.than 16 years old.
3.3. The automated reply cannot be sent whenThe automated reply cannot be sent when
the file system is full.the file system is full.
03/07/17 32
Module #1 - Logic
System Specifications
• System and software engineers take requirements inSystem and software engineers take requirements in
natural language and produce precise and unambiguousnatural language and produce precise and unambiguous
specifications that could be used as the basis of systemspecifications that could be used as the basis of system
development.development.
• System specifications should not contain conflictingSystem specifications should not contain conflicting
requirements.requirements.
• Propositional expressions representing these specificationsPropositional expressions representing these specifications
need to beneed to be consistentconsistent ::
• there must be an assignment of truth values to the variablethere must be an assignment of truth values to the variable
in the expressions that makes all the expressions truein the expressions that makes all the expressions true
03/07/17 33
Module #1 - Logic
Example: System Specifications
Are the system specifications consistent?Are the system specifications consistent?
• The diagnostic message is stored in theThe diagnostic message is stored in the
buffer or it is retransmittedbuffer or it is retransmitted
• The diagnostic message is not stored in theThe diagnostic message is not stored in the
buffer.buffer.
• If the diagnostic message is stored in theIf the diagnostic message is stored in the
buffer, then it is retransmitted.buffer, then it is retransmitted.
03/07/17 34
Module #1 - Logic
Some Alternative Notations
Name: not and or xor implies iff
Propositional logic: ¬∧ ∨ ⊕ → ↔
Boolean algebra: p pq + ⊕
C/C++/Java (wordwise): ! && || != ==
C/C++/Java (bitwise): ~ & | ^
Logic gates:
Topic #1.0 – Propositional Logic: Operators
03/07/17 35
Module #1 - Logic
Bits and Bit Operations
• AA bitbit is ais a bibinary (base 2) dignary (base 2) digitit: 0 or 1.: 0 or 1.
• Bits may be used to represent truth values.Bits may be used to represent truth values.
• By convention:By convention:
0 represents “false”; 1 represents “true”.0 represents “false”; 1 represents “true”.
• Boolean algebraBoolean algebra is like ordinary algebrais like ordinary algebra
except that variables stand for bits, + meansexcept that variables stand for bits, + means
“or”, and multiplication means “and”.“or”, and multiplication means “and”.
Topic #2 – Bits
John Tukey
(1915-2000)
03/07/17 36
Module #1 - Logic
Bitwise Operations
• Boolean operations can be extended toBoolean operations can be extended to
operate on bit strings as well as single bits.operate on bit strings as well as single bits.
• E.g.:E.g.:
01 1011 011001 1011 0110
11 0001 110111 0001 1101
11 1011 1111 Bit-wise ORBit-wise OR
01 0001 0100 Bit-wise ANDBit-wise AND
10 1010 1011 Bit-wise XORBit-wise XOR
Topic #2 – Bits
03/07/17 37
Module #1 - Logic
End of §1.1
You have learned about:You have learned about:
• Propositions: WhatPropositions: What
they are.they are.
• Propositional logicPropositional logic
operators’operators’
– Symbolic notations.Symbolic notations.
– English equivalents.English equivalents.
– Logical meaning.Logical meaning.
– Truth tables.Truth tables.
• Atomic vs. compoundAtomic vs. compound
propositions.propositions.
• Alternative notations.Alternative notations.
• Bits and bit-strings.Bits and bit-strings.
• Next section: §1.2Next section: §1.2
– PropositionalPropositional
equivalences.equivalences.
– How to prove them.How to prove them.
03/07/17 38
Module #1 - Logic
Propositional Equivalence (§1.2)
TwoTwo syntacticallysyntactically ((i.e.,i.e., textually) differenttextually) different
compound propositions may be thecompound propositions may be the
semanticallysemantically identical (identical (i.e.,i.e., have the samehave the same
meaning). We call themmeaning). We call them equivalentequivalent. Learn:. Learn:
• VariousVarious equivalence rulesequivalence rules oror lawslaws..
• How toHow to proveprove equivalences usingequivalences using symbolicsymbolic
derivationsderivations..
Topic #1.1 – Propositional Logic: Equivalences
03/07/17 39
Module #1 - Logic
Tautologies and Contradictions
AA tautologytautology is a compound proposition that isis a compound proposition that is
truetrue no matter whatno matter what the truth values of itsthe truth values of its
atomic propositions are!atomic propositions are!
Ex.Ex. pp ∨∨ ¬¬pp [What is its truth table?][What is its truth table?]
AA contradictioncontradiction is a compound propositionis a compound proposition
that isthat is falsefalse no matter what!no matter what! Ex.Ex. pp ∧∧ ¬¬pp
[Truth table?][Truth table?]
Other compound props. areOther compound props. are contingenciescontingencies..
Topic #1.1 – Propositional Logic: Equivalences
03/07/17 40
Module #1 - Logic
Logical Equivalence
Compound propositionCompound proposition pp isis logicallylogically
equivalentequivalent to compound propositionto compound proposition qq,,
writtenwritten pp⇔⇔qq,, IFFIFF the compoundthe compound
propositionproposition pp↔↔qq is a tautology.is a tautology.
Compound propositionsCompound propositions pp andand qq are logicallyare logically
equivalent to each otherequivalent to each other IFFIFF pp andand qq
contain the same truth values as each othercontain the same truth values as each other
inin allall rows of their truth tables.rows of their truth tables.
Topic #1.1 – Propositional Logic: Equivalences
03/07/17 41
Module #1 - Logic
Ex.Ex. Prove thatProve that pp∨∨qq ⇔⇔ ¬¬((¬¬pp ∧∧ ¬¬qq).).
p q pp∨∨qq ¬¬pp ¬¬qq ¬¬pp ∧∧¬¬qq ¬¬((¬¬pp ∧∧¬¬qq))
F F
F T
T F
T T
Proving Equivalence
via Truth Tables
F
T
T
T
T
T
T
T
T
T
F
F
F
F
F
F
F
F
T
T
Topic #1.1 – Propositional Logic: Equivalences
03/07/17 42
Module #1 - Logic
Equivalence Laws - Examples
• IdentityIdentity:: pp∧∧TT ⇔⇔ p pp p∨∨FF ⇔⇔ pp
• DominationDomination:: pp∨∨TT ⇔⇔ TT pp∧∧FF ⇔⇔ FF
• IdempotentIdempotent:: pp∨∨pp ⇔⇔ p pp p∧∧pp ⇔⇔ pp
• Double negation:Double negation: ¬¬¬¬pp ⇔⇔ pp
• Commutative:Commutative: pp∨∨qq ⇔⇔ qq∨∨p pp p∧∧qq ⇔⇔ qq∧∧pp
• Associative:Associative: ((pp∨∨qq))∨∨rr ⇔⇔ pp∨∨((qq∨∨rr))
((pp∧∧qq))∧∧rr ⇔⇔ pp∧∧((qq∧∧rr))
Topic #1.1 – Propositional Logic: Equivalences
03/07/17 43
Module #1 - Logic
More Equivalence Laws
• DistributiveDistributive:: pp∨∨((qq∧∧rr)) ⇔⇔ ((pp∨∨qq))∧∧((pp∨∨rr))
pp∧∧((qq∨∨rr)) ⇔⇔ ((pp∧∧qq))∨∨((pp∧∧rr))
• De Morgan’sDe Morgan’s::
¬¬((pp∧∧qq)) ⇔⇔ ¬¬pp ∨∨ ¬¬qq
¬¬((pp∨∨qq)) ⇔⇔ ¬¬pp ∧∧ ¬¬qq
• Trivial tautology/contradictionTrivial tautology/contradiction::
pp ∨∨ ¬¬pp ⇔⇔ TT pp ∧∧ ¬¬pp ⇔⇔ FF
Topic #1.1 – Propositional Logic: Equivalences
Augustus
De Morgan
(1806-1871)
03/07/17 44
Module #1 - Logic
Defining Operators via Equivalences
Using equivalences, we canUsing equivalences, we can definedefine operatorsoperators
in terms of other operators.in terms of other operators.
• Exclusive or:Exclusive or: pp⊕⊕qq ⇔⇔ ((pp∨∨qq))∧¬∧¬((pp∧∧qq))
pp⊕⊕qq ⇔⇔ ((pp∧¬∧¬qq))∨∨((qq∧¬∧¬pp))
• Implies:Implies: pp→→qq ⇔⇔ ¬¬pp ∨∨ qq
• Biconditional:Biconditional: pp↔↔qq ⇔⇔ ((pp→→qq)) ∧∧ ((qq→→pp))
pp↔↔qq ⇔⇔ ¬¬((pp⊕⊕qq))
Topic #1.1 – Propositional Logic: Equivalences
03/07/17 45
Module #1 - Logic
An Example Problem
• Check using a symbolic derivation whetherCheck using a symbolic derivation whether
((pp ∧∧ ¬¬qq)) →→ ((pp ⊕⊕ rr)) ⇔⇔ ¬¬pp ∨∨ qq ∨∨ ¬¬rr..
((pp ∧∧ ¬¬qq)) →→ ((pp ⊕⊕ rr)) [Expand definition of[Expand definition of →→]]
⇔⇔ ¬¬((pp ∧∧ ¬¬qq)) ∨∨ ((pp ⊕⊕ rr)) [Expand defn. of[Expand defn. of ⊕⊕]]
⇔⇔ ¬¬((pp ∧∧ ¬¬qq)) ∨∨ ((((pp ∨∨ rr)) ∧∧ ¬¬((pp ∧∧ rr))))
[DeMorgan’s Law][DeMorgan’s Law]
⇔⇔ ((¬¬pp ∨∨ qq)) ∨∨ ((((pp ∨∨ rr)) ∧∧ ¬¬((pp ∧∧ rr))))
cont.cont.
Topic #1.1 – Propositional Logic: Equivalences
03/07/17 46
Module #1 - Logic
Example Continued...
((¬¬pp ∨∨ qq)) ∨∨ ((((pp ∨∨ rr)) ∧∧ ¬¬((pp ∧∧ rr)))) ⇔⇔ [[∨∨ commutes]commutes]
⇔⇔ ((qq ∨∨ ¬¬pp)) ∨∨ ((((pp ∨∨ rr)) ∧∧ ¬¬((pp ∧∧ rr)))) [[∨∨ associative]associative]
⇔⇔ qq ∨∨ ((¬¬pp ∨∨ ((((pp ∨∨ rr)) ∧∧ ¬¬((pp ∧∧ rr))))) [distrib.) [distrib. ∨∨ overover ∧∧]]
⇔⇔ qq ∨∨ ((((((¬¬pp ∨∨ ((pp ∨∨ rr)))) ∧∧ ((¬¬pp ∨∨ ¬¬((pp ∧∧ rr))))))
[assoc.][assoc.] ⇔⇔ qq ∨∨ ((((((¬¬pp ∨∨ pp)) ∨∨ rr)) ∧∧ ((¬¬pp ∨∨ ¬¬((pp ∧∧ rr))))))
[trivail taut.][trivail taut.] ⇔⇔ qq ∨∨ ((((TT ∨∨ rr)) ∧∧ ((¬¬pp ∨∨ ¬¬((pp ∧∧ rr))))))
[domination][domination] ⇔⇔ qq ∨∨ ((TT ∧∧ ((¬¬pp ∨∨ ¬¬((pp ∧∧ rr))))))
[identity][identity] ⇔⇔ qq ∨∨ ((¬¬pp ∨∨ ¬¬((pp ∧∧ rr)))) ⇔⇔ cont.cont.
Topic #1.1 – Propositional Logic: Equivalences
03/07/17 47
Module #1 - Logic
End of Long Example
qq ∨∨ ((¬¬pp ∨∨ ¬¬((pp ∧∧ rr))))
[DeMorgan’s][DeMorgan’s] ⇔⇔ qq ∨∨ ((¬¬pp ∨∨ ((¬¬pp ∨∨ ¬¬rr))))
[Assoc.][Assoc.] ⇔⇔ qq ∨∨ ((((¬¬pp ∨∨ ¬¬pp)) ∨∨ ¬¬rr))
[Idempotent][Idempotent] ⇔⇔ qq ∨∨ ((¬¬pp ∨∨ ¬¬rr))
[Assoc.][Assoc.] ⇔⇔ ((qq ∨∨ ¬¬pp)) ∨∨ ¬¬rr
[Commut.][Commut.] ⇔⇔ ¬¬pp ∨∨ qq ∨∨ ¬¬rr
Topic #1.1 – Propositional Logic: Equivalences
03/07/17 48
Module #1 - Logic
Review: Propositional Logic
(§§1.1-1.2)
• Atomic propositions:Atomic propositions: pp,, qq,, rr, …, …
• Boolean operators:Boolean operators: ¬¬ ∧∧ ∨∨ ⊕⊕ →→ ↔↔
• Compound propositions: s :≡ (p ∧∧ ¬¬qq)) ∨∨ rr
• Equivalences:Equivalences: pp∧¬∧¬qq ⇔⇔ ¬¬((pp →→ qq))
• Proving equivalences using:Proving equivalences using:
– Truth tables.Truth tables.
– Symbolic derivations.Symbolic derivations. pp ⇔⇔ qq ⇔⇔ r …r …
Topic #1 – Propositional Logic
03/07/17 49
Module #1 - Logic
Predicate Logic (§1.3)
• Predicate logicPredicate logic is an extension ofis an extension of
propositional logic that permits conciselypropositional logic that permits concisely
reasoning about wholereasoning about whole classesclasses of entities.of entities.
• Propositional logic (recall) treats simplePropositional logic (recall) treats simple
propositionspropositions (sentences) as atomic entities.(sentences) as atomic entities.
• In contrast,In contrast, predicatepredicate logic distinguishes thelogic distinguishes the
subjectsubject of a sentence from itsof a sentence from its predicate.predicate.
– Remember these English grammar terms?Remember these English grammar terms?
Topic #3 – Predicate Logic
03/07/17 50
Module #1 - Logic
Subjects and Predicates
• In the sentence “The dog is sleeping”:In the sentence “The dog is sleeping”:
– The phrase “the dog” denotes theThe phrase “the dog” denotes the subjectsubject --
thethe objectobject oror entityentity that the sentence is about.that the sentence is about.
– The phrase “is sleeping” denotes theThe phrase “is sleeping” denotes the predicatepredicate--
a property that is truea property that is true ofof the subject.the subject.
• In predicate logic, aIn predicate logic, a predicatepredicate is modeled asis modeled as
aa functionfunction PP(·) from objects to propositions.(·) from objects to propositions.
– PP((xx) = “) = “xx is sleeping” (whereis sleeping” (where xx is any object).is any object).
Topic #3 – Predicate Logic
03/07/17 51
Module #1 - Logic
More About Predicates
• Convention: Lowercase variablesConvention: Lowercase variables xx,, yy,, z...z... denotedenote
objects/entities; uppercase variablesobjects/entities; uppercase variables PP,, QQ,, RR……
denote propositional functions (predicates).denote propositional functions (predicates).
• Keep in mind that theKeep in mind that the result ofresult of applyingapplying aa
predicatepredicate PP to an objectto an object xx is theis the proposition Pproposition P((xx).).
But the predicateBut the predicate PP itselfitself ((e.g. Pe.g. P=“is sleeping”) is=“is sleeping”) is
notnot a proposition (not a complete sentence).a proposition (not a complete sentence).
– E.g.E.g. ifif PP((xx) = “) = “xx is a prime number”,is a prime number”,
PP(3) is the(3) is the propositionproposition “3 is a prime number.”“3 is a prime number.”
Topic #3 – Predicate Logic
03/07/17 52
Module #1 - Logic
Propositional Functions
• Predicate logicPredicate logic generalizesgeneralizes the grammaticalthe grammatical
notion of a predicate to also includenotion of a predicate to also include
propositional functions ofpropositional functions of anyany number ofnumber of
arguments, each of which may takearguments, each of which may take anyany
grammatical role that a noun can take.grammatical role that a noun can take.
– E.g.E.g. letlet PP((xx,,y,zy,z) = “) = “xx gavegave yy the gradethe grade zz”, then if”, then if
x=x=“Mike”,“Mike”, yy=“Mary”,=“Mary”, zz=“A”, then=“A”, then PP((xx,,yy,,zz) =) =
“Mike gave Mary the grade A.”“Mike gave Mary the grade A.”
Topic #3 – Predicate Logic
03/07/17 53
Module #1 - Logic
Universes of Discourse (U.D.s)
• The power of distinguishing objects fromThe power of distinguishing objects from
predicates is that it lets you state thingspredicates is that it lets you state things
aboutabout manymany objects at once.objects at once.
• E.g., letE.g., let PP((xx)=“)=“xx+1>+1>xx”. We can then say,”. We can then say,
“For“For anyany numbernumber xx,, PP((xx) is true” instead of) is true” instead of
((00+1>+1>00)) ∧∧ ((11+1>+1>11)) ∧∧ ((22+1>+1>22)) ∧∧ ......
• The collection of values that a variableThe collection of values that a variable xx
can take is calledcan take is called xx’s’s universe of discourseuniverse of discourse..
Topic #3 – Predicate Logic
03/07/17 54
Module #1 - Logic
Quantifier Expressions
• QuantifiersQuantifiers provide a notation that allowsprovide a notation that allows
us tous to quantifyquantify (count)(count) how manyhow many objects inobjects in
the univ. of disc. satisfy a given predicate.the univ. of disc. satisfy a given predicate.
• ““∀∀”” is the FORis the FOR∀∀LL orLL or universaluniversal quantifier.quantifier.
∀∀xx PP((xx) means) means for allfor all x in the u.d.,x in the u.d., PP holds.holds.
• ““∃∃”” is theis the ∃∃XISTS orXISTS or existentialexistential quantifier.quantifier.
∃∃x Px P((xx) means) means therethere existsexists anan xx in the u.d.in the u.d.
(that is, 1 or more)(that is, 1 or more) such thatsuch that PP((xx) is true.) is true.
Topic #3 – Predicate Logic
03/07/17 55
Module #1 - Logic
The Universal Quantifier ∀
• Example:Example:
Let the u.d. of x beLet the u.d. of x be parking spaces at NSUparking spaces at NSU..
LetLet PP((xx) be the) be the predicatepredicate ““xx is full.”is full.”
Then theThen the universal quantification of Puniversal quantification of P((xx),),
∀∀xx PP((xx), is the), is the proposition:proposition:
– ““All parking spaces at NSU are full.”All parking spaces at NSU are full.”
– i.e.i.e., “Every parking space at NSU is full.”, “Every parking space at NSU is full.”
– i.e.i.e., “For each parking space at NSU, that space is full.”, “For each parking space at NSU, that space is full.”
Topic #3 – Predicate Logic
03/07/17 56
Module #1 - Logic
The Existential Quantifier ∃
• Example:Example:
Let the u.d. of x beLet the u.d. of x be parking spaces at NSUparking spaces at NSU..
LetLet PP((xx) be the) be the predicatepredicate ““xx is full.”is full.”
Then theThen the existential quantification of Pexistential quantification of P((xx),),
∃∃xx PP((xx), is the), is the propositionproposition::
– ““Some parking space at NSU is full.”Some parking space at NSU is full.”
– ““There is a parking space at NSU that is full.”There is a parking space at NSU that is full.”
– ““At least one parking space at NSU is full.”At least one parking space at NSU is full.”
Topic #3 – Predicate Logic
03/07/17 57
Module #1 - Logic
Quantifier Equivalence Laws
• Definitions of quantifiers: If u.d.=a,b,c,…Definitions of quantifiers: If u.d.=a,b,c,…
∀∀x Px P((xx)) ⇔⇔ PP(a)(a) ∧∧ PP(b)(b) ∧∧ PP(c)(c) ∧∧ ……
∃∃x Px P((xx)) ⇔⇔ PP(a)(a) ∨∨ PP(b)(b) ∨∨ PP(c)(c) ∨∨ ……
• From those, we can prove the laws:From those, we can prove the laws:
¬∀¬∀x Px P((xx)) ⇔⇔ ∃∃xx ¬¬PP((xx))
¬∃¬∃x Px P((xx)) ⇔⇔ ∀∀xx ¬¬PP((xx))
• WhichWhich propositionalpropositional equivalence laws canequivalence laws can
be used to prove this?be used to prove this?
Topic #3 – Predicate Logic
03/07/17 58
Module #1 - Logic
Free and Bound Variables
• An expression likeAn expression like PP((xx) is said to have a) is said to have a
free variablefree variable xx (meaning,(meaning, xx is undefined).is undefined).
• A quantifier (eitherA quantifier (either ∀∀ oror ∃∃)) operatesoperates on anon an
expression having one or more freeexpression having one or more free
variables, andvariables, and bindsbinds one or more of thoseone or more of those
variables, to produce an expression havingvariables, to produce an expression having
one or moreone or more boundbound variablesvariables..
Topic #3 – Predicate Logic
03/07/17 59
Module #1 - Logic
Example of Binding
• PP((x,yx,y) has 2 free variables,) has 2 free variables, xx andand yy..
∀ ∀∀xx PP((xx,,yy) has 1 free variable, and one bound) has 1 free variable, and one bound
variable.variable. [Which is which?][Which is which?]
• ““PP((xx), where), where xx=3” is another way to bind=3” is another way to bind xx..
• An expression withAn expression with zerozero free variables is a bona-free variables is a bona-
fide (actual) proposition.fide (actual) proposition.
• An expression withAn expression with one or moreone or more free variables isfree variables is
still only a predicate:still only a predicate: e.g.e.g. letlet QQ((yy) =) = ∀∀xx PP((xx,,yy))
Topic #3 – Predicate Logic
03/07/17 60
Module #1 - Logic
Nesting of Quantifiers
Example: Let the u.d. ofExample: Let the u.d. of xx && yy be people.be people.
LetLet LL((xx,,yy)=“)=“xx likeslikes yy”” (a predicate w. 2 f.v.’s)(a predicate w. 2 f.v.’s)
ThenThen ∃∃y Ly L((x,yx,y) = “There is someone whom) = “There is someone whom xx
likes.”likes.” (A predicate w. 1 free variable,(A predicate w. 1 free variable, xx))
ThenThen ∀∀xx ((∃∃y Ly L((x,yx,y)) =)) =
“Everyone has someone whom they like.”“Everyone has someone whom they like.”
(A __________ with ___ free variables.)(A __________ with ___ free variables.)
Topic #3 – Predicate Logic
03/07/17 61
Module #1 - Logic
Quantifier Exercise
IfIf RR((xx,,yy)=“)=“xx relies uponrelies upon yy,” express the,” express the
following in unambiguous English:following in unambiguous English:
∀∀xx((∃∃y Ry R((x,yx,y))=))=
∃∃yy((∀∀xx RR((x,yx,y))=))=
∃∃xx((∀∀y Ry R((x,yx,y))=))=
∀∀yy((∃∃x Rx R((x,yx,y))=))=
∀∀xx((∀∀y Ry R((x,yx,y))=))=
Everyone has someone to rely on.
There’s a poor overburdened soul whom
everyone relies upon (including himself)!
There’s some needy person who relies
upon everybody (including himself).
Everyone has someone who relies upon them.
Everyone relies upon everybody,
(including themselves)!
Topic #3 – Predicate Logic
03/07/17 62
Module #1 - Logic
Nested quantifiers
AssumeAssume S(x,y)S(x,y) means “means “xx seessees yy””
u.d.=all peopleu.d.=all people
What does the following formula mean?What does the following formula mean?
∀∀xSxS((x,ax,a))
03/07/17 63
Module #1 - Logic
Nested quantifiers
AssumeAssume S(x,y)S(x,y) means “means “xx seessees yy”.”.
u.d.=all peopleu.d.=all people
∀∀xSxS((x,ax,a) means) means
“For every“For every xx,, xx seessees aa””
In other words,In other words,
“Everyone sees“Everyone sees aa””
03/07/17 64
Module #1 - Logic
Nested quantifiers
What does the following formula mean?What does the following formula mean?
∀∀xx((∃∃y Sy S((x,yx,y))))
03/07/17 65
Module #1 - Logic
Nested quantifiers
∀∀xx((∃∃y Sy S((x,yx,y)) means “)) means “For everyFor every xx, there exists, there exists
aa yy such thatsuch that xx seessees y”y”
In other words:In other words:
“Everyone sees someone”“Everyone sees someone”
03/07/17 66
Module #1 - Logic
Interactions between
quantifiers and connectives
Let the u.d. beLet the u.d. be parking spaces at NSUparking spaces at NSU..
LetLet PP((xx) be “) be “xx is occupied.”is occupied.”
Let Q(Let Q(xx) be “) be “xx is free of charge.”is free of charge.”
1.1. ∃∃xx ((QQ((xx)) ∧∧ PP((xx))))
2.2. ∀∀xx ((QQ((xx)) ∧∧ PP((xx))))
3.3. ∀∀xx ((QQ((xx)) →→PP((xx))))
4.4. ∃∃xx ((QQ((xx)) →→ PP((xx))))
03/07/17 67
Module #1 - Logic
I. Construct English paraphrases
Let the u.d. beLet the u.d. be parking spaces at NSUparking spaces at NSU..
LetLet PP((xx) be “) be “xx is occupied.”is occupied.”
Let Q(Let Q(xx) be “) be “xx is free of charge.”is free of charge.”
1.1. ∃∃xx ((QQ((xx)) ∧∧ PP((xx))))
2.2. ∀∀xx ((QQ((xx)) ∧∧ PP((xx))))
3.3. ∀∀xx ((QQ((xx)) →→PP((xx))))
4.4. ∃∃xx ((QQ((xx)) →→ PP((xx))))
03/07/17 68
Module #1 - Logic
I. Construct English paraphrases
1.1. ∃∃xx ((QQ((xx)) ∧∧ PP((xx))) Some places are free of) Some places are free of
charge and occupiedcharge and occupied
2.2. ∀∀xx ((QQ((xx)) ∧∧ PP((xx))) All places are free of) All places are free of
charge and occupiedcharge and occupied
3.3. ∀∀xx ((QQ((xx)) →→PP((xx))) All places that are free) All places that are free
of charge are occupiedof charge are occupied
4.4. ∃∃xx ((QQ((xx)) →→ PP((xx))) For some places x, if x) For some places x, if x
is free of charge then x is occupiedis free of charge then x is occupied
03/07/17 69
Module #1 - Logic
About the last of these
4.4. ∃∃xx ((QQ((xx)) →→ PP((xx))) “For some x, if x is free of) “For some x, if x is free of
charge then x is occupied”charge then x is occupied”
∃∃xx ((QQ((xx)) →→ PP((xx)))) is true iff, for some place a,is true iff, for some place a,
QQ((aa)) →→ PP((aa) is true.) is true.
QQ((aa)) →→ PP((aa)) is true iffis true iff
QQ((aa) is false) is false oror PP((aa) is true) is true
(conditional is only false in one row of table!)(conditional is only false in one row of table!)
So,So, the formula meansthe formula means “Some places are either“Some places are either
not free of charge or occupied”not free of charge or occupied”
03/07/17 70
Module #1 - Logic
About the last of these
4.4. ∃∃xx ((QQ((xx)) →→ PP((xx)))) When confused by aWhen confused by a
conditional: re-write it usingconditional: re-write it using negationnegation andand
disjunctiondisjunction::
∃∃xx ((¬¬QQ((xx)) ∨∨ PP((xx)))) ⇔⇔ (p. 67)(p. 67)
∃∃xx ¬¬QQ((xx)) ∨∨ ∃∃x Px P((xx)) “Some places are“Some places are
not free of charge or some places arenot free of charge or some places are
occupied”occupied”
03/07/17 71
Module #1 - Logic
• Combinations to remember:Combinations to remember:
1.1. ∃∃xx ((QQ((xx)) ∧∧ PP((xx))))
2.2. ∀∀xx ((QQ((xx)) →→PP((xx))))
03/07/17 72
Module #1 - Logic
Natural language is ambiguous!
• ““Everybody likes somebody.”Everybody likes somebody.”
– For everybody, there is somebody they like,For everybody, there is somebody they like,
∀∀∀xx ∃∃yy LikesLikes((xx,,yy))
– or, there is somebody (a popular person) whomor, there is somebody (a popular person) whom
everyone likes?everyone likes?
∀∃∃yy ∀∀xx LikesLikes((xx,,yy))
• ““Somebody likes everybody.”Somebody likes everybody.”
– Same problem: Depends on context, emphasis.Same problem: Depends on context, emphasis.
[Probably more likely.]
Topic #3 – Predicate Logic
03/07/17 73
Module #1 - Logic
End of §1.3-1.4, Predicate Logic
• From these sections you should have learned:From these sections you should have learned:
– Predicate logic notation & conventionsPredicate logic notation & conventions
– Conversions: predicate logicConversions: predicate logic ↔↔ clear Englishclear English
– Meaning of quantifiers, equivalencesMeaning of quantifiers, equivalences
– Simple reasoning with quantifiersSimple reasoning with quantifiers
• Upcoming topics:Upcoming topics:
– Introduction to proof-writing.Introduction to proof-writing.
– Then: Set theory –Then: Set theory –
• a language for talking about collections of objects.a language for talking about collections of objects.
Topic #3 – Predicate Logic

More Related Content

What's hot

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
 
First order predicate logic (fopl)
First order predicate logic (fopl)First order predicate logic (fopl)
First order predicate logic (fopl)
chauhankapil
 
RuleML2015: Binary Frontier-guarded ASP with Function Symbols
RuleML2015: Binary Frontier-guarded ASP with Function SymbolsRuleML2015: Binary Frontier-guarded ASP with Function Symbols
RuleML2015: Binary Frontier-guarded ASP with Function Symbols
RuleML
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicPalGov
 
Unit i
Unit iUnit i
Unit i
TPLatchoumi
 
C# Natural Language Engine
C# Natural Language EngineC# Natural Language Engine
C# Natural Language Engine
Ian Mercer
 
Learning Morphological Rules for Amharic Verbs Using Inductive Logic Programming
Learning Morphological Rules for Amharic Verbs Using Inductive Logic ProgrammingLearning Morphological Rules for Amharic Verbs Using Inductive Logic Programming
Learning Morphological Rules for Amharic Verbs Using Inductive Logic Programming
Guy De Pauw
 
continuity and differentiability - differentiation introduction, chain rule
continuity and differentiability  - differentiation introduction, chain rulecontinuity and differentiability  - differentiation introduction, chain rule
continuity and differentiability - differentiation introduction, chain rule
LiveOnlineClassesInd
 
Differentiation introduction, chain rule
Differentiation introduction, chain ruleDifferentiation introduction, chain rule
Differentiation introduction, chain rule
LiveOnlineClassesInd
 
Glue Semantics for Proof Theorists
Glue Semantics for Proof TheoristsGlue Semantics for Proof Theorists
Glue Semantics for Proof Theorists
Valeria de Paiva
 
Doppl development iteration #4
Doppl development   iteration #4Doppl development   iteration #4
Doppl development iteration #4
Diego Perini
 
RuleML2015 The Herbrand Manifesto - Thinking Inside the Box
RuleML2015 The Herbrand Manifesto - Thinking Inside the Box RuleML2015 The Herbrand Manifesto - Thinking Inside the Box
RuleML2015 The Herbrand Manifesto - Thinking Inside the Box
RuleML
 
Proof-Theoretic Semantics: Point-free meaninig of first-order systems
Proof-Theoretic Semantics: Point-free meaninig of first-order systemsProof-Theoretic Semantics: Point-free meaninig of first-order systems
Proof-Theoretic Semantics: Point-free meaninig of first-order systems
Marco Benini
 

What's hot (20)

Syntax and semantics of propositional logic
Syntax and semantics of propositional logicSyntax and semantics of propositional logic
Syntax and semantics of propositional logic
 
AI Lesson 12
AI Lesson 12AI Lesson 12
AI Lesson 12
 
First order predicate logic (fopl)
First order predicate logic (fopl)First order predicate logic (fopl)
First order predicate logic (fopl)
 
RuleML2015: Binary Frontier-guarded ASP with Function Symbols
RuleML2015: Binary Frontier-guarded ASP with Function SymbolsRuleML2015: Binary Frontier-guarded ASP with Function Symbols
RuleML2015: Binary Frontier-guarded ASP with Function Symbols
 
Jarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logicJarrar.lecture notes.aai.2011s.ch7.p logic
Jarrar.lecture notes.aai.2011s.ch7.p logic
 
Unit i
Unit iUnit i
Unit i
 
AI Lesson 11
AI Lesson 11AI Lesson 11
AI Lesson 11
 
Fol
FolFol
Fol
 
C# Natural Language Engine
C# Natural Language EngineC# Natural Language Engine
C# Natural Language Engine
 
Learning Morphological Rules for Amharic Verbs Using Inductive Logic Programming
Learning Morphological Rules for Amharic Verbs Using Inductive Logic ProgrammingLearning Morphological Rules for Amharic Verbs Using Inductive Logic Programming
Learning Morphological Rules for Amharic Verbs Using Inductive Logic Programming
 
continuity and differentiability - differentiation introduction, chain rule
continuity and differentiability  - differentiation introduction, chain rulecontinuity and differentiability  - differentiation introduction, chain rule
continuity and differentiability - differentiation introduction, chain rule
 
Differentiation introduction, chain rule
Differentiation introduction, chain ruleDifferentiation introduction, chain rule
Differentiation introduction, chain rule
 
J79 1063
J79 1063J79 1063
J79 1063
 
Glue Semantics for Proof Theorists
Glue Semantics for Proof TheoristsGlue Semantics for Proof Theorists
Glue Semantics for Proof Theorists
 
Doppl development iteration #4
Doppl development   iteration #4Doppl development   iteration #4
Doppl development iteration #4
 
AI Lesson 15
AI Lesson 15AI Lesson 15
AI Lesson 15
 
RuleML2015 The Herbrand Manifesto - Thinking Inside the Box
RuleML2015 The Herbrand Manifesto - Thinking Inside the Box RuleML2015 The Herbrand Manifesto - Thinking Inside the Box
RuleML2015 The Herbrand Manifesto - Thinking Inside the Box
 
Proof-Theoretic Semantics: Point-free meaninig of first-order systems
Proof-Theoretic Semantics: Point-free meaninig of first-order systemsProof-Theoretic Semantics: Point-free meaninig of first-order systems
Proof-Theoretic Semantics: Point-free meaninig of first-order systems
 
AI Lesson 09
AI Lesson 09AI Lesson 09
AI Lesson 09
 
AI Lesson 16
AI Lesson 16AI Lesson 16
AI Lesson 16
 

Viewers also liked

Graph theory discrete mathmatics
Graph theory discrete mathmaticsGraph theory discrete mathmatics
Graph theory discrete mathmatics
Biplab Debnath
 
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDiscrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Dr. Khaled Bakro
 
Chapter Three Review
Chapter Three ReviewChapter Three Review
Chapter Three ReviewNBress
 
Hasin Hayder: Motivated team and getting most out of it
Hasin Hayder: Motivated team and getting most out of itHasin Hayder: Motivated team and getting most out of it
Hasin Hayder: Motivated team and getting most out of itSQABD
 
Hasin: Bangla Input Manager jQuery Plugin
Hasin: Bangla Input Manager jQuery PluginHasin: Bangla Input Manager jQuery Plugin
Hasin: Bangla Input Manager jQuery Plugin
SQABD
 
Discrete maths tutorials
Discrete maths tutorialsDiscrete maths tutorials
Discrete maths tutorials
DIT University
 
Logic
LogicLogic
LogicH K
 
TIU CET Review Math Session 2 by Young Einstein
TIU CET Review Math Session 2 by Young EinsteinTIU CET Review Math Session 2 by Young Einstein
TIU CET Review Math Session 2 by Young Einstein
youngeinstein
 
FHSD Strategic Plan Celebrations
FHSD Strategic Plan CelebrationsFHSD Strategic Plan Celebrations
FHSD Strategic Plan CelebrationsFrancis Howell
 
Properties of equality and Proving
Properties of equality and ProvingProperties of equality and Proving
Properties of equality and ProvingMariele Brutas
 
Chapter 6 base_number
Chapter 6 base_numberChapter 6 base_number
Chapter 6 base_number
Nazrul Shah
 
Identity & Equality Properties (Algebra1 1_4)
Identity & Equality Properties (Algebra1 1_4)Identity & Equality Properties (Algebra1 1_4)
Identity & Equality Properties (Algebra1 1_4)
rfant
 
Properties Of Equality
Properties Of EqualityProperties Of Equality
Properties Of Equality
Grenada High School
 
Module - 1 Discrete Mathematics and Graph Theory
Module - 1 Discrete Mathematics and Graph TheoryModule - 1 Discrete Mathematics and Graph Theory
Module - 1 Discrete Mathematics and Graph Theory
Adhiyaman Manickam
 
Dm1
Dm1Dm1
Principle of mathematical induction
Principle of mathematical inductionPrinciple of mathematical induction
Principle of mathematical induction
Kriti Varshney
 

Viewers also liked (18)

Graph theory discrete mathmatics
Graph theory discrete mathmaticsGraph theory discrete mathmatics
Graph theory discrete mathmatics
 
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكروDiscrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
Discrete mathematics Ch2 Propositional Logic_Dr.khaled.Bakro د. خالد بكرو
 
Chapter Three Review
Chapter Three ReviewChapter Three Review
Chapter Three Review
 
Hasin Hayder: Motivated team and getting most out of it
Hasin Hayder: Motivated team and getting most out of itHasin Hayder: Motivated team and getting most out of it
Hasin Hayder: Motivated team and getting most out of it
 
Hasin: Bangla Input Manager jQuery Plugin
Hasin: Bangla Input Manager jQuery PluginHasin: Bangla Input Manager jQuery Plugin
Hasin: Bangla Input Manager jQuery Plugin
 
Discrete maths tutorials
Discrete maths tutorialsDiscrete maths tutorials
Discrete maths tutorials
 
Logic
LogicLogic
Logic
 
TIU CET Review Math Session 2 by Young Einstein
TIU CET Review Math Session 2 by Young EinsteinTIU CET Review Math Session 2 by Young Einstein
TIU CET Review Math Session 2 by Young Einstein
 
FHSD Strategic Plan Celebrations
FHSD Strategic Plan CelebrationsFHSD Strategic Plan Celebrations
FHSD Strategic Plan Celebrations
 
Properties of equality and Proving
Properties of equality and ProvingProperties of equality and Proving
Properties of equality and Proving
 
Chapter 6 base_number
Chapter 6 base_numberChapter 6 base_number
Chapter 6 base_number
 
Identity & Equality Properties (Algebra1 1_4)
Identity & Equality Properties (Algebra1 1_4)Identity & Equality Properties (Algebra1 1_4)
Identity & Equality Properties (Algebra1 1_4)
 
Properties Of Equality
Properties Of EqualityProperties Of Equality
Properties Of Equality
 
Module - 1 Discrete Mathematics and Graph Theory
Module - 1 Discrete Mathematics and Graph TheoryModule - 1 Discrete Mathematics and Graph Theory
Module - 1 Discrete Mathematics and Graph Theory
 
Dm1
Dm1Dm1
Dm1
 
Math task 3
Math task 3Math task 3
Math task 3
 
Math
MathMath
Math
 
Principle of mathematical induction
Principle of mathematical inductionPrinciple of mathematical induction
Principle of mathematical induction
 

Similar to Nsu module 01-logic-final

4535092.ppt
4535092.ppt4535092.ppt
4535092.ppt
ntabdelnaiem
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)
SHUBHAM KUMAR GUPTA
 
Foundation_Logic_1.pptx discrete mathematics
Foundation_Logic_1.pptx discrete mathematicsFoundation_Logic_1.pptx discrete mathematics
Foundation_Logic_1.pptx discrete mathematics
SherwinSangalang3
 
continuity of module 2.pptx
continuity of module 2.pptxcontinuity of module 2.pptx
continuity of module 2.pptx
AnkitaVerma776806
 
First Order Logic
First Order LogicFirst Order Logic
First Order Logic
MianMubeen3
 
Logic programming (1)
Logic programming (1)Logic programming (1)
Logic programming (1)Nitesh Singh
 
"SSC" - Geometria e Semantica del Linguaggio
"SSC" - Geometria e Semantica del Linguaggio"SSC" - Geometria e Semantica del Linguaggio
"SSC" - Geometria e Semantica del Linguaggio
Alumni Mathematica
 
Logic in Predicate and Propositional Logic
Logic in Predicate and Propositional LogicLogic in Predicate and Propositional Logic
Logic in Predicate and Propositional Logic
ArchanaT32
 
Lecture1.pptx
Lecture1.pptxLecture1.pptx
Lecture1.pptx
jonathanG19
 
ARTIFICIAL INTELLIGENCE---UNIT 4.pptx
ARTIFICIAL INTELLIGENCE---UNIT 4.pptxARTIFICIAL INTELLIGENCE---UNIT 4.pptx
ARTIFICIAL INTELLIGENCE---UNIT 4.pptx
RuchitaMaaran
 
How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...
How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...
How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...
L. Thorne McCarty
 
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
Asst.prof M.Gokilavani
 
10 logic+programming+with+prolog
10 logic+programming+with+prolog10 logic+programming+with+prolog
10 logic+programming+with+prolog
baran19901990
 
Exchanging More than Complete Data
Exchanging More than Complete DataExchanging More than Complete Data
Exchanging More than Complete Datanet2-project
 
Formal methods 1 - introduction
Formal methods   1 - introductionFormal methods   1 - introduction
Formal methods 1 - introduction
Vlad Patryshev
 
AI_Session 21 First order logic.pptx
AI_Session 21 First order logic.pptxAI_Session 21 First order logic.pptx
AI_Session 21 First order logic.pptx
Asst.prof M.Gokilavani
 
AI_session 22 inference and unification.pptx
AI_session 22 inference and unification.pptxAI_session 22 inference and unification.pptx
AI_session 22 inference and unification.pptx
Asst.prof M.Gokilavani
 
Building WordSpaces via Random Indexing from simple to complex spaces
Building WordSpaces via Random Indexing from simple to complex spacesBuilding WordSpaces via Random Indexing from simple to complex spaces
Building WordSpaces via Random Indexing from simple to complex spaces
Pierpaolo Basile
 

Similar to Nsu module 01-logic-final (20)

Logic
LogicLogic
Logic
 
4535092.ppt
4535092.ppt4535092.ppt
4535092.ppt
 
Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)Predicate logic_2(Artificial Intelligence)
Predicate logic_2(Artificial Intelligence)
 
Foundation_Logic_1.pptx discrete mathematics
Foundation_Logic_1.pptx discrete mathematicsFoundation_Logic_1.pptx discrete mathematics
Foundation_Logic_1.pptx discrete mathematics
 
continuity of module 2.pptx
continuity of module 2.pptxcontinuity of module 2.pptx
continuity of module 2.pptx
 
First Order Logic
First Order LogicFirst Order Logic
First Order Logic
 
Logic programming (1)
Logic programming (1)Logic programming (1)
Logic programming (1)
 
"SSC" - Geometria e Semantica del Linguaggio
"SSC" - Geometria e Semantica del Linguaggio"SSC" - Geometria e Semantica del Linguaggio
"SSC" - Geometria e Semantica del Linguaggio
 
Logic in Predicate and Propositional Logic
Logic in Predicate and Propositional LogicLogic in Predicate and Propositional Logic
Logic in Predicate and Propositional Logic
 
Lecture1.pptx
Lecture1.pptxLecture1.pptx
Lecture1.pptx
 
ARTIFICIAL INTELLIGENCE---UNIT 4.pptx
ARTIFICIAL INTELLIGENCE---UNIT 4.pptxARTIFICIAL INTELLIGENCE---UNIT 4.pptx
ARTIFICIAL INTELLIGENCE---UNIT 4.pptx
 
How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...
How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...
How to Ground A Language for Legal Discourse In a Prototypical Perceptual Sem...
 
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdfAI3391 Artificial intelligence Unit IV Notes _ merged.pdf
AI3391 Artificial intelligence Unit IV Notes _ merged.pdf
 
10 logic+programming+with+prolog
10 logic+programming+with+prolog10 logic+programming+with+prolog
10 logic+programming+with+prolog
 
Exchanging More than Complete Data
Exchanging More than Complete DataExchanging More than Complete Data
Exchanging More than Complete Data
 
Formal methods 1 - introduction
Formal methods   1 - introductionFormal methods   1 - introduction
Formal methods 1 - introduction
 
AI_Session 21 First order logic.pptx
AI_Session 21 First order logic.pptxAI_Session 21 First order logic.pptx
AI_Session 21 First order logic.pptx
 
AI_session 22 inference and unification.pptx
AI_session 22 inference and unification.pptxAI_session 22 inference and unification.pptx
AI_session 22 inference and unification.pptx
 
AI Lesson 17
AI Lesson 17AI Lesson 17
AI Lesson 17
 
Building WordSpaces via Random Indexing from simple to complex spaces
Building WordSpaces via Random Indexing from simple to complex spacesBuilding WordSpaces via Random Indexing from simple to complex spaces
Building WordSpaces via Random Indexing from simple to complex spaces
 

Recently uploaded

CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSCW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
veerababupersonal22
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation & Control
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
WENKENLI1
 
Steel & Timber Design according to British Standard
Steel & Timber Design according to British StandardSteel & Timber Design according to British Standard
Steel & Timber Design according to British Standard
AkolbilaEmmanuel1
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
obonagu
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
Pratik Pawar
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
SyedAbiiAzazi1
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
ssuser7dcef0
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
Kamal Acharya
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
ChristineTorrepenida1
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
gdsczhcet
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Teleport Manpower Consultant
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Soumen Santra
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
thanhdowork
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
gestioneergodomus
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
Kamal Acharya
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Sreedhar Chowdam
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
SUTEJAS
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
AmarGB2
 
Basic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparelBasic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparel
top1002
 

Recently uploaded (20)

CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERSCW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
CW RADAR, FMCW RADAR, FMCW ALTIMETER, AND THEIR PARAMETERS
 
Water Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdfWater Industry Process Automation and Control Monthly - May 2024.pdf
Water Industry Process Automation and Control Monthly - May 2024.pdf
 
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdfGoverning Equations for Fundamental Aerodynamics_Anderson2010.pdf
Governing Equations for Fundamental Aerodynamics_Anderson2010.pdf
 
Steel & Timber Design according to British Standard
Steel & Timber Design according to British StandardSteel & Timber Design according to British Standard
Steel & Timber Design according to British Standard
 
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
在线办理(ANU毕业证书)澳洲国立大学毕业证录取通知书一模一样
 
weather web application report.pdf
weather web application report.pdfweather web application report.pdf
weather web application report.pdf
 
14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application14 Template Contractual Notice - EOT Application
14 Template Contractual Notice - EOT Application
 
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
NUMERICAL SIMULATIONS OF HEAT AND MASS TRANSFER IN CONDENSING HEAT EXCHANGERS...
 
Cosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdfCosmetic shop management system project report.pdf
Cosmetic shop management system project report.pdf
 
Unbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptxUnbalanced Three Phase Systems and circuits.pptx
Unbalanced Three Phase Systems and circuits.pptx
 
Gen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdfGen AI Study Jams _ For the GDSC Leads in India.pdf
Gen AI Study Jams _ For the GDSC Leads in India.pdf
 
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdfTop 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
Top 10 Oil and Gas Projects in Saudi Arabia 2024.pdf
 
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTSHeap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
Heap Sort (SS).ppt FOR ENGINEERING GRADUATES, BCA, MCA, MTECH, BSC STUDENTS
 
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
RAT: Retrieval Augmented Thoughts Elicit Context-Aware Reasoning in Long-Hori...
 
DfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributionsDfMAy 2024 - key insights and contributions
DfMAy 2024 - key insights and contributions
 
Final project report on grocery store management system..pdf
Final project report on grocery store management system..pdfFinal project report on grocery store management system..pdf
Final project report on grocery store management system..pdf
 
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&BDesign and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
Design and Analysis of Algorithms-DP,Backtracking,Graphs,B&B
 
Understanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine LearningUnderstanding Inductive Bias in Machine Learning
Understanding Inductive Bias in Machine Learning
 
Investor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptxInvestor-Presentation-Q1FY2024 investor presentation document.pptx
Investor-Presentation-Q1FY2024 investor presentation document.pptx
 
Basic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparelBasic Industrial Engineering terms for apparel
Basic Industrial Engineering terms for apparel
 

Nsu module 01-logic-final

  • 1. 03/07/17 1 Module #1 - Logic North South University Dept. of Computer Science & Engineering CSE 173 Discrete Mathematics Dr. Mohammad R. Rahman Slides for a Course Based on the TextSlides for a Course Based on the Text Discrete Mathematics & Its ApplicationsDiscrete Mathematics & Its Applications (5(5thth Edition)Edition) by Kenneth H. Rosenby Kenneth H. Rosen
  • 2. 03/07/17 2 Module #1 - Logic Module #1: The Fundamentals of Logic Rosen 5Rosen 5thth ed., §§1.1-1.4ed., §§1.1-1.4 ~6-8 lectures~6-8 lectures
  • 3. 03/07/17 3 Module #1 - Logic Module #1: Foundations of Logic (§§1.1-1.4) Mathematical Logic is a tool for working with elaborate compound statements. It includes: • A formal language for expressing them. • A concise notation for writing them. • A methodology for objectively reasoning about their truth or falsity. • It is the foundation for expressing formal proofs in all branches of mathematics.
  • 4. 03/07/17 4 Module #1 - Logic Foundations of Logic: Overview • Propositional logic (Propositional logic (§1.1-1.2)§1.1-1.2):: – Basic definitions. (§1.1)Basic definitions. (§1.1) – Equivalence rules & derivations. (§1.2)Equivalence rules & derivations. (§1.2) • Predicate logic (§1.3-1.4)Predicate logic (§1.3-1.4) – Predicates.Predicates. – Quantified predicate expressions.Quantified predicate expressions. – Equivalences & derivations.Equivalences & derivations.
  • 5. 03/07/17 5 Module #1 - Logic Propositional Logic (§1.1) Propositional LogicPropositional Logic is the logic of compoundis the logic of compound statements built from simpler statementsstatements built from simpler statements using so-calledusing so-called BooleanBoolean connectives.connectives. Some applications in computer science:Some applications in computer science: • Design of digital electronic circuits.Design of digital electronic circuits. • Expressing conditions in programs.Expressing conditions in programs. • Queries to databases & search engines.Queries to databases & search engines. Topic #1 – Propositional Logic George Boole (1815-1864) Chrysippus of Soli (ca. 281 B.C. – 205 B.C.)
  • 6. 03/07/17 6 Module #1 - Logic Definition of a Proposition Definition:Definition: AA propositionproposition (denoted(denoted pp,, qq,, rr, …) is simply:, …) is simply: • aa statementstatement ((i.e.i.e., a declarative sentence), a declarative sentence) – with some definite meaningwith some definite meaning, (not vague or ambiguous), (not vague or ambiguous) • having ahaving a truth valuetruth value that’s eitherthat’s either truetrue ((TT) or) or falsefalse ((FF)) – it isit is nevernever both, neither, or somewhere “in between!”both, neither, or somewhere “in between!” • However, you might notHowever, you might not knowknow the actual truth value,the actual truth value, • and, the truth value mightand, the truth value might dependdepend on the situation or context.on the situation or context. • However with probability theory,However with probability theory, we assignwe assign degrees of certaintydegrees of certainty (“between”(“between” TT andand FF) to propositions.) to propositions. – But for now: think True/False only!But for now: think True/False only! Topic #1 – Propositional Logic
  • 7. 03/07/17 7 Module #1 - Logic Examples of Propositions • ““It is raining.”It is raining.” (In a given situation.)(In a given situation.) • ““Beijing is the capital of China.” • “1 + 2 = 3”Beijing is the capital of China.” • “1 + 2 = 3” But, the following areBut, the following are NOTNOT propositions:propositions: • ““Who’s there?”Who’s there?” (interrogative, question)(interrogative, question) • ““La la la la la.”La la la la la.” (meaningless interjection)(meaningless interjection) • ““Just do it!”Just do it!” (imperative, command)(imperative, command) • ““Yeah, I sorta dunno, whatever...”Yeah, I sorta dunno, whatever...” (vague)(vague) • ““1 + 2”1 + 2” (expression with a non-true/false value)(expression with a non-true/false value) Topic #1 – Propositional Logic
  • 8. 03/07/17 8 Module #1 - Logic AnAn operatoroperator oror connectiveconnective combines one orcombines one or moremore operandoperand expressions into a largerexpressions into a larger expression. (expression. (E.g.E.g., “+” in numeric exprs.), “+” in numeric exprs.) • UnaryUnary operators take 1 operand (operators take 1 operand (e.g.,e.g., −−3);3); binarybinary operators take 2 operands (operators take 2 operands (egeg 33 ×× 4).4). • PropositionalPropositional oror BooleanBoolean operatorsoperators operateoperate on propositionson propositions (or their truth values)(or their truth values) instead of on numbers.instead of on numbers. Operators / Connectives Topic #1.0 – Propositional Logic: Operators
  • 9. 03/07/17 9 Module #1 - Logic Some Popular Boolean Operators Formal NameFormal Name NicknameNickname ArityArity SymbolSymbol Negation operatorNegation operator NOTNOT UnaryUnary ¬¬ Conjunction operatorConjunction operator ANDAND BinaryBinary ∧∧ Disjunction operatorDisjunction operator OROR BinaryBinary ∨∨ Exclusive-OR operatorExclusive-OR operator XORXOR BinaryBinary ⊕⊕ Implication operatorImplication operator IMPLIESIMPLIES BinaryBinary →→ Biconditional operatorBiconditional operator IFFIFF BinaryBinary ↔↔ Topic #1.0 – Propositional Logic: Operators
  • 10. 03/07/17 10 Module #1 - Logic The Negation Operator The unaryThe unary negation operatornegation operator “¬” (“¬” (NOTNOT)) transforms a prop. into its logicaltransforms a prop. into its logical negationnegation.. E.g.E.g. IfIf pp = “I have brown hair.”= “I have brown hair.” then ¬then ¬pp = “I do= “I do notnot have brown hair.”have brown hair.” TheThe truth tabletruth table for NOT:for NOT: p ¬p T F F T T :≡ True; F :≡ False “:≡” means “is defined as” Operand column Result column Topic #1.0 – Propositional Logic: Operators
  • 11. 03/07/17 11 Module #1 - Logic The Conjunction Operator The binaryThe binary conjunction operatorconjunction operator ““∧∧” (” (ANDAND)) combines two propositions to form theircombines two propositions to form their logicallogical conjunctionconjunction.. E.g.E.g. IfIf pp=“I will have salad for lunch.” and=“I will have salad for lunch.” and q=q=“I will have steak for dinner.”, then“I will have steak for dinner.”, then pp∧∧qq=“I will have salad for lunch=“I will have salad for lunch andand I will have steak for dinner.”I will have steak for dinner.” Remember: “∧∧” points up like an “A”, and it means “” points up like an “A”, and it means “∧∧NDND”” ∧∧NDND Topic #1.0 – Propositional Logic: Operators
  • 12. 03/07/17 12 Module #1 - Logic • Note that aNote that a conjunctionconjunction pp11 ∧∧ pp22 ∧∧ …… ∧∧ ppnn ofof nn propositionspropositions will have 2will have 2nn rowsrows in its truth table.in its truth table. • Also: ¬ andAlso: ¬ and ∧∧ operations together are suffi-operations together are suffi- cient to expresscient to express anyany Boolean truth table!Boolean truth table! Conjunction Truth Table p q p∧q F F F F T F T F F T T T Operand columns Topic #1.0 – Propositional Logic: Operators
  • 13. 03/07/17 13 Module #1 - Logic The Disjunction Operator The binaryThe binary disjunction operatordisjunction operator ““∨∨” (” (OROR)) combines two propositions to form theircombines two propositions to form their logicallogical disjunctiondisjunction.. pp=“My car has a bad engine.”=“My car has a bad engine.” q=q=“My car has a bad carburetor.”“My car has a bad carburetor.” pp∨∨qq=“Either my car has a bad engine,=“Either my car has a bad engine, oror my car has a bad carburetor.”my car has a bad carburetor.” After the downward- pointing “axe” of “∨∨”” splits the wood, yousplits the wood, you can take 1 piece OR thecan take 1 piece OR the other, or both.other, or both. ∨∨ Topic #1.0 – Propositional Logic: Operators Meaning is like “and/or” in English.
  • 14. 03/07/17 14 Module #1 - Logic • Note thatNote that pp∨∨qq meansmeans thatthat pp is true, oris true, or qq isis true,true, or bothor both are true!are true! • So, this operation isSo, this operation is also calledalso called inclusive or,inclusive or, because itbecause it includesincludes thethe possibility that bothpossibility that both pp andand qq are true.are true. • ““¬” and “¬” and “∨∨” together are also universal.” together are also universal. Disjunction Truth Table p q p∨ q F F F F T T T F T T T T Note difference from AND Topic #1.0 – Propositional Logic: Operators
  • 15. 03/07/17 15 Module #1 - Logic Nested Propositional Expressions • Use parentheses toUse parentheses to group sub-expressionsgroup sub-expressions:: ““I just saw my oldI just saw my old ffriendriend, and either, and either he’she’s ggrownrown oror I’veI’ve sshrunkhrunk.” =.” = ff ∧∧ ((gg ∨∨ ss)) – ((ff ∧∧ gg)) ∨∨ ss would mean something differentwould mean something different – ff ∧∧ gg ∨∨ ss would be ambiguouswould be ambiguous • By convention, “¬” takesBy convention, “¬” takes precedenceprecedence overover both “both “∧∧” and “” and “∨∨”.”. – ¬¬ss ∧∧ ff means (¬means (¬ss)) ∧∧ ff ,, notnot ¬ (¬ (ss ∧∧ ff)) Topic #1.0 – Propositional Logic: Operators
  • 16. 03/07/17 16 Module #1 - Logic A Simple Exercise LetLet pp=“It rained last night”,=“It rained last night”, qq=“The sprinklers came on last night,”=“The sprinklers came on last night,” rr=“The lawn was wet this morning.”=“The lawn was wet this morning.” Translate each of the following into English:Translate each of the following into English: ¬¬pp == rr ∧∧ ¬¬pp == ¬¬ rr ∨∨ pp ∨∨ q =q = “It didn’t rain last night.” “The lawn was wet this morning, and it didn’t rain last night.” “Either the lawn wasn’t wet this morning, or it rained last night, or the sprinklers came on last night.” Topic #1.0 – Propositional Logic: Operators
  • 17. 03/07/17 17 Module #1 - Logic The Exclusive Or Operator The binaryThe binary exclusive-or operatorexclusive-or operator ““⊕⊕” (” (XORXOR)) combines two propositions to form theircombines two propositions to form their logical “exclusive or” (exjunction?).logical “exclusive or” (exjunction?). pp = “I will earn an A in this course,”= “I will earn an A in this course,” qq == “I will drop this course,”“I will drop this course,” pp ⊕⊕ qq = “I will either earn an A in this course,= “I will either earn an A in this course, or I will drop it (but not both!)”or I will drop it (but not both!)” Topic #1.0 – Propositional Logic: Operators
  • 18. 03/07/17 18 Module #1 - Logic • Note thatNote that pp⊕⊕qq meansmeans thatthat pp is true, oris true, or qq isis true, buttrue, but not bothnot both!! • This operation isThis operation is calledcalled exclusive or,exclusive or, because itbecause it excludesexcludes thethe possibility that bothpossibility that both pp andand qq are true.are true. • ““¬” and “¬” and “⊕⊕” together are” together are notnot universal.universal. Exclusive-Or Truth Table p q p⊕ q F F F F T T T F T T T F Note difference from OR. Topic #1.0 – Propositional Logic: Operators
  • 19. 03/07/17 19 Module #1 - Logic Note thatNote that EnglishEnglish “or” can be“or” can be ambiguousambiguous regarding the “both” case!regarding the “both” case! ““Pat is a singer orPat is a singer or Pat is a writer.” -Pat is a writer.” - ““Pat is a man orPat is a man or Pat is a woman.” -Pat is a woman.” - Need context to disambiguate the meaning!Need context to disambiguate the meaning! For this class, assume “or” meansFor this class, assume “or” means inclusiveinclusive.. Natural Language is Ambiguous p q p "or" q F F F F T T T F T T T ? ∨ ⊕ Topic #1.0 – Propositional Logic: Operators
  • 20. 03/07/17 20 Module #1 - Logic The Implication Operator TheThe implicationimplication pp →→ qq states thatstates that pp impliesimplies q.q. I.e.I.e., If, If pp is true, thenis true, then qq is true; but ifis true; but if pp is notis not true, thentrue, then qq could be either true or false.could be either true or false. E.g.E.g., let, let pp = “You study hard.”= “You study hard.” qq = “You will get a good grade.”= “You will get a good grade.” pp →→ q =q = “If you study hard, then you will get“If you study hard, then you will get a good grade.”a good grade.” (else, it could go either way)(else, it could go either way) Topic #1.0 – Propositional Logic: Operators antecedent consequent
  • 21. 03/07/17 21 Module #1 - Logic Implication Truth Table • pp →→ qq isis falsefalse onlyonly whenwhen pp is true butis true but qq isis notnot true.true. • pp →→ qq doesdoes notnot saysay thatthat pp causescauses qq!! • pp →→ qq doesdoes notnot requirerequire thatthat pp oror qq are ever trueare ever true!! • E.g.E.g. “(1=0)“(1=0) →→ pigs can fly” is TRUE!pigs can fly” is TRUE! p q p→q F F T F T T T F F T T T The only False case! Topic #1.0 – Propositional Logic: Operators
  • 22. 03/07/17 22 Module #1 - Logic Examples of Implications • ““If this lecture ever ends, then the sun willIf this lecture ever ends, then the sun will rise tomorrow.”rise tomorrow.” TrueTrue oror FalseFalse?? • ““If Tuesday is a day of the week, then I amIf Tuesday is a day of the week, then I am a penguin.”a penguin.” TrueTrue oror FalseFalse?? • ““If 1+1=6, then Bush is president.”If 1+1=6, then Bush is president.” TrueTrue oror FalseFalse?? • ““If the moon is made of green cheese, then IIf the moon is made of green cheese, then I am richer than Bill Gates.”am richer than Bill Gates.” TrueTrue oror FalseFalse?? Topic #1.0 – Propositional Logic: Operators
  • 23. 03/07/17 23 Module #1 - Logic Difference between English Language and Logic • The way we have defined implications is more generalThe way we have defined implications is more general than the meaning attached to English Language.than the meaning attached to English Language. • Consider a sentence like,Consider a sentence like, – ““If it is sunny today, then we will go to beach”If it is sunny today, then we will go to beach” • In normal language there is a relationship betweenIn normal language there is a relationship between antecedent and consequent.antecedent and consequent. • Now Let us consider this exampleNow Let us consider this example – ““If it is Friday, then 2+3=5”If it is Friday, then 2+3=5” • In logic, we consider the sentenceIn logic, we consider the sentence TrueTrue since thesince the conclusion is trueconclusion is true
  • 24. 03/07/17 24 Module #1 - Logic More about Discrepancy • In English, a sentence “ifIn English, a sentence “if pp thenthen qq” usually really” usually really implicitlyimplicitly means something like,means something like, • ““In all possible situationsIn all possible situations, if, if pp thenthen qq.”.” – That is, “ForThat is, “For pp to be true andto be true and qq false isfalse is impossibleimpossible.”.” – Or, “IOr, “I guaranteeguarantee that no matter what, ifthat no matter what, if pp, then, then qq.”.” • In mathematical concept of an implication isIn mathematical concept of an implication is independent of a cause and effect relationshipindependent of a cause and effect relationship between hypothesis and conclusionbetween hypothesis and conclusion • The implication only specifies the truth values; it isThe implication only specifies the truth values; it is not based on English usage.not based on English usage.
  • 25. 03/07/17 25 Module #1 - Logic English Phrases Meaning p → q • ““pp impliesimplies qq”” • ““ifif pp, then, then qq”” • ““ifif pp,, qq”” • ““whenwhen pp,, qq”” • ““wheneverwhenever pp,, qq”” • ““qq ifif pp”” • ““qq whenwhen pp”” • ““qq wheneverwhenever pp”” • ““pp only ifonly if qq”” • ““pp is sufficient foris sufficient for qq”” • ““qq is necessary foris necessary for pp”” • ““qq follows fromfollows from pp”” • ““qq is implied byis implied by pp”” We will see some equivalentWe will see some equivalent logic expressions later.logic expressions later. Topic #1.0 – Propositional Logic: Operators
  • 26. 03/07/17 26 Module #1 - Logic Converse, Inverse, Contrapositive Some terminology, for an implicationSome terminology, for an implication pp →→ qq:: • ItsIts converseconverse is:is: qq →→ pp.. • ItsIts inverseinverse is:is: ¬¬pp →→ ¬¬qq.. • ItsIts contrapositivecontrapositive:: ¬¬qq →→ ¬¬ p.p. • One of these three has theOne of these three has the same meaningsame meaning (same truth table) as(same truth table) as pp →→ qq. Can you figure. Can you figure out which?out which? Topic #1.0 – Propositional Logic: Operators
  • 27. 03/07/17 27 Module #1 - Logic How do we know for sure? Proving the equivalence ofProving the equivalence of pp →→ qq and itsand its contrapositive using truth tables:contrapositive using truth tables: p q ¬q ¬p p→q ¬q →¬p F F T T T T F T F T T T T F T F F F T T F F T T Topic #1.0 – Propositional Logic: Operators
  • 28. 03/07/17 28 Module #1 - Logic The biconditional operator • TheThe biconditionalbiconditional pp ↔ qq is theis the proposition that is true when p andproposition that is true when p and q have the same truth values, and isq have the same truth values, and is false otherwise.false otherwise. • pp ↔ qq is true preciously when bothis true preciously when both the implicationsthe implications pp →→ qq andand qq →→ pp are trueare true • The terminology “if and only if q”The terminology “if and only if q” is used foris used for pp ↔ qq Topic #1.0 – Propositional Logic: Operators p q p ↔q F F T F T F T F F T T T
  • 29. 03/07/17 29 Module #1 - Logic Biconditional Truth Table • pp ↔ qq means thatmeans that pp andand qq have thehave the samesame truth value.truth value. • Note this truth table is theNote this truth table is the exactexact oppositeopposite ofof ⊕⊕’s!’s! Thus,Thus, pp ↔ qq means ¬(means ¬(pp ⊕⊕ qq)) • pp ↔ qq doesdoes notnot implyimply thatthat pp andand qq are true, or that either of them causesare true, or that either of them causes the other, or that they have a common cause.the other, or that they have a common cause. Topic #1.0 – Propositional Logic: Operators p q p ↔q F F T F T F T F F T T T
  • 30. 03/07/17 30 Module #1 - Logic English Equivalent • ““p is necessary and sufficient for q”p is necessary and sufficient for q” • ““if p then q, and conversely.”if p then q, and conversely.” • ““p iff q”p iff q” • Example: p: You can take the flight and q:Example: p: You can take the flight and q: You buy a ticketYou buy a ticket • pp ↔ q: “ You can take the flight if and onlyq: “ You can take the flight if and only if you buy a ticket”if you buy a ticket”
  • 31. 03/07/17 31 Module #1 - Logic Translating English Sentences 1.1. You can access the Internet from campusYou can access the Internet from campus only if you are a computer science majoronly if you are a computer science major or you are not a freshman.or you are not a freshman. 2.2. You cannot ride the roller coaster if youYou cannot ride the roller coaster if you are under 4 feet tall unless you are olderare under 4 feet tall unless you are older than 16 years old.than 16 years old. 3.3. The automated reply cannot be sent whenThe automated reply cannot be sent when the file system is full.the file system is full.
  • 32. 03/07/17 32 Module #1 - Logic System Specifications • System and software engineers take requirements inSystem and software engineers take requirements in natural language and produce precise and unambiguousnatural language and produce precise and unambiguous specifications that could be used as the basis of systemspecifications that could be used as the basis of system development.development. • System specifications should not contain conflictingSystem specifications should not contain conflicting requirements.requirements. • Propositional expressions representing these specificationsPropositional expressions representing these specifications need to beneed to be consistentconsistent :: • there must be an assignment of truth values to the variablethere must be an assignment of truth values to the variable in the expressions that makes all the expressions truein the expressions that makes all the expressions true
  • 33. 03/07/17 33 Module #1 - Logic Example: System Specifications Are the system specifications consistent?Are the system specifications consistent? • The diagnostic message is stored in theThe diagnostic message is stored in the buffer or it is retransmittedbuffer or it is retransmitted • The diagnostic message is not stored in theThe diagnostic message is not stored in the buffer.buffer. • If the diagnostic message is stored in theIf the diagnostic message is stored in the buffer, then it is retransmitted.buffer, then it is retransmitted.
  • 34. 03/07/17 34 Module #1 - Logic Some Alternative Notations Name: not and or xor implies iff Propositional logic: ¬∧ ∨ ⊕ → ↔ Boolean algebra: p pq + ⊕ C/C++/Java (wordwise): ! && || != == C/C++/Java (bitwise): ~ & | ^ Logic gates: Topic #1.0 – Propositional Logic: Operators
  • 35. 03/07/17 35 Module #1 - Logic Bits and Bit Operations • AA bitbit is ais a bibinary (base 2) dignary (base 2) digitit: 0 or 1.: 0 or 1. • Bits may be used to represent truth values.Bits may be used to represent truth values. • By convention:By convention: 0 represents “false”; 1 represents “true”.0 represents “false”; 1 represents “true”. • Boolean algebraBoolean algebra is like ordinary algebrais like ordinary algebra except that variables stand for bits, + meansexcept that variables stand for bits, + means “or”, and multiplication means “and”.“or”, and multiplication means “and”. Topic #2 – Bits John Tukey (1915-2000)
  • 36. 03/07/17 36 Module #1 - Logic Bitwise Operations • Boolean operations can be extended toBoolean operations can be extended to operate on bit strings as well as single bits.operate on bit strings as well as single bits. • E.g.:E.g.: 01 1011 011001 1011 0110 11 0001 110111 0001 1101 11 1011 1111 Bit-wise ORBit-wise OR 01 0001 0100 Bit-wise ANDBit-wise AND 10 1010 1011 Bit-wise XORBit-wise XOR Topic #2 – Bits
  • 37. 03/07/17 37 Module #1 - Logic End of §1.1 You have learned about:You have learned about: • Propositions: WhatPropositions: What they are.they are. • Propositional logicPropositional logic operators’operators’ – Symbolic notations.Symbolic notations. – English equivalents.English equivalents. – Logical meaning.Logical meaning. – Truth tables.Truth tables. • Atomic vs. compoundAtomic vs. compound propositions.propositions. • Alternative notations.Alternative notations. • Bits and bit-strings.Bits and bit-strings. • Next section: §1.2Next section: §1.2 – PropositionalPropositional equivalences.equivalences. – How to prove them.How to prove them.
  • 38. 03/07/17 38 Module #1 - Logic Propositional Equivalence (§1.2) TwoTwo syntacticallysyntactically ((i.e.,i.e., textually) differenttextually) different compound propositions may be thecompound propositions may be the semanticallysemantically identical (identical (i.e.,i.e., have the samehave the same meaning). We call themmeaning). We call them equivalentequivalent. Learn:. Learn: • VariousVarious equivalence rulesequivalence rules oror lawslaws.. • How toHow to proveprove equivalences usingequivalences using symbolicsymbolic derivationsderivations.. Topic #1.1 – Propositional Logic: Equivalences
  • 39. 03/07/17 39 Module #1 - Logic Tautologies and Contradictions AA tautologytautology is a compound proposition that isis a compound proposition that is truetrue no matter whatno matter what the truth values of itsthe truth values of its atomic propositions are!atomic propositions are! Ex.Ex. pp ∨∨ ¬¬pp [What is its truth table?][What is its truth table?] AA contradictioncontradiction is a compound propositionis a compound proposition that isthat is falsefalse no matter what!no matter what! Ex.Ex. pp ∧∧ ¬¬pp [Truth table?][Truth table?] Other compound props. areOther compound props. are contingenciescontingencies.. Topic #1.1 – Propositional Logic: Equivalences
  • 40. 03/07/17 40 Module #1 - Logic Logical Equivalence Compound propositionCompound proposition pp isis logicallylogically equivalentequivalent to compound propositionto compound proposition qq,, writtenwritten pp⇔⇔qq,, IFFIFF the compoundthe compound propositionproposition pp↔↔qq is a tautology.is a tautology. Compound propositionsCompound propositions pp andand qq are logicallyare logically equivalent to each otherequivalent to each other IFFIFF pp andand qq contain the same truth values as each othercontain the same truth values as each other inin allall rows of their truth tables.rows of their truth tables. Topic #1.1 – Propositional Logic: Equivalences
  • 41. 03/07/17 41 Module #1 - Logic Ex.Ex. Prove thatProve that pp∨∨qq ⇔⇔ ¬¬((¬¬pp ∧∧ ¬¬qq).). p q pp∨∨qq ¬¬pp ¬¬qq ¬¬pp ∧∧¬¬qq ¬¬((¬¬pp ∧∧¬¬qq)) F F F T T F T T Proving Equivalence via Truth Tables F T T T T T T T T T F F F F F F F F T T Topic #1.1 – Propositional Logic: Equivalences
  • 42. 03/07/17 42 Module #1 - Logic Equivalence Laws - Examples • IdentityIdentity:: pp∧∧TT ⇔⇔ p pp p∨∨FF ⇔⇔ pp • DominationDomination:: pp∨∨TT ⇔⇔ TT pp∧∧FF ⇔⇔ FF • IdempotentIdempotent:: pp∨∨pp ⇔⇔ p pp p∧∧pp ⇔⇔ pp • Double negation:Double negation: ¬¬¬¬pp ⇔⇔ pp • Commutative:Commutative: pp∨∨qq ⇔⇔ qq∨∨p pp p∧∧qq ⇔⇔ qq∧∧pp • Associative:Associative: ((pp∨∨qq))∨∨rr ⇔⇔ pp∨∨((qq∨∨rr)) ((pp∧∧qq))∧∧rr ⇔⇔ pp∧∧((qq∧∧rr)) Topic #1.1 – Propositional Logic: Equivalences
  • 43. 03/07/17 43 Module #1 - Logic More Equivalence Laws • DistributiveDistributive:: pp∨∨((qq∧∧rr)) ⇔⇔ ((pp∨∨qq))∧∧((pp∨∨rr)) pp∧∧((qq∨∨rr)) ⇔⇔ ((pp∧∧qq))∨∨((pp∧∧rr)) • De Morgan’sDe Morgan’s:: ¬¬((pp∧∧qq)) ⇔⇔ ¬¬pp ∨∨ ¬¬qq ¬¬((pp∨∨qq)) ⇔⇔ ¬¬pp ∧∧ ¬¬qq • Trivial tautology/contradictionTrivial tautology/contradiction:: pp ∨∨ ¬¬pp ⇔⇔ TT pp ∧∧ ¬¬pp ⇔⇔ FF Topic #1.1 – Propositional Logic: Equivalences Augustus De Morgan (1806-1871)
  • 44. 03/07/17 44 Module #1 - Logic Defining Operators via Equivalences Using equivalences, we canUsing equivalences, we can definedefine operatorsoperators in terms of other operators.in terms of other operators. • Exclusive or:Exclusive or: pp⊕⊕qq ⇔⇔ ((pp∨∨qq))∧¬∧¬((pp∧∧qq)) pp⊕⊕qq ⇔⇔ ((pp∧¬∧¬qq))∨∨((qq∧¬∧¬pp)) • Implies:Implies: pp→→qq ⇔⇔ ¬¬pp ∨∨ qq • Biconditional:Biconditional: pp↔↔qq ⇔⇔ ((pp→→qq)) ∧∧ ((qq→→pp)) pp↔↔qq ⇔⇔ ¬¬((pp⊕⊕qq)) Topic #1.1 – Propositional Logic: Equivalences
  • 45. 03/07/17 45 Module #1 - Logic An Example Problem • Check using a symbolic derivation whetherCheck using a symbolic derivation whether ((pp ∧∧ ¬¬qq)) →→ ((pp ⊕⊕ rr)) ⇔⇔ ¬¬pp ∨∨ qq ∨∨ ¬¬rr.. ((pp ∧∧ ¬¬qq)) →→ ((pp ⊕⊕ rr)) [Expand definition of[Expand definition of →→]] ⇔⇔ ¬¬((pp ∧∧ ¬¬qq)) ∨∨ ((pp ⊕⊕ rr)) [Expand defn. of[Expand defn. of ⊕⊕]] ⇔⇔ ¬¬((pp ∧∧ ¬¬qq)) ∨∨ ((((pp ∨∨ rr)) ∧∧ ¬¬((pp ∧∧ rr)))) [DeMorgan’s Law][DeMorgan’s Law] ⇔⇔ ((¬¬pp ∨∨ qq)) ∨∨ ((((pp ∨∨ rr)) ∧∧ ¬¬((pp ∧∧ rr)))) cont.cont. Topic #1.1 – Propositional Logic: Equivalences
  • 46. 03/07/17 46 Module #1 - Logic Example Continued... ((¬¬pp ∨∨ qq)) ∨∨ ((((pp ∨∨ rr)) ∧∧ ¬¬((pp ∧∧ rr)))) ⇔⇔ [[∨∨ commutes]commutes] ⇔⇔ ((qq ∨∨ ¬¬pp)) ∨∨ ((((pp ∨∨ rr)) ∧∧ ¬¬((pp ∧∧ rr)))) [[∨∨ associative]associative] ⇔⇔ qq ∨∨ ((¬¬pp ∨∨ ((((pp ∨∨ rr)) ∧∧ ¬¬((pp ∧∧ rr))))) [distrib.) [distrib. ∨∨ overover ∧∧]] ⇔⇔ qq ∨∨ ((((((¬¬pp ∨∨ ((pp ∨∨ rr)))) ∧∧ ((¬¬pp ∨∨ ¬¬((pp ∧∧ rr)))))) [assoc.][assoc.] ⇔⇔ qq ∨∨ ((((((¬¬pp ∨∨ pp)) ∨∨ rr)) ∧∧ ((¬¬pp ∨∨ ¬¬((pp ∧∧ rr)))))) [trivail taut.][trivail taut.] ⇔⇔ qq ∨∨ ((((TT ∨∨ rr)) ∧∧ ((¬¬pp ∨∨ ¬¬((pp ∧∧ rr)))))) [domination][domination] ⇔⇔ qq ∨∨ ((TT ∧∧ ((¬¬pp ∨∨ ¬¬((pp ∧∧ rr)))))) [identity][identity] ⇔⇔ qq ∨∨ ((¬¬pp ∨∨ ¬¬((pp ∧∧ rr)))) ⇔⇔ cont.cont. Topic #1.1 – Propositional Logic: Equivalences
  • 47. 03/07/17 47 Module #1 - Logic End of Long Example qq ∨∨ ((¬¬pp ∨∨ ¬¬((pp ∧∧ rr)))) [DeMorgan’s][DeMorgan’s] ⇔⇔ qq ∨∨ ((¬¬pp ∨∨ ((¬¬pp ∨∨ ¬¬rr)))) [Assoc.][Assoc.] ⇔⇔ qq ∨∨ ((((¬¬pp ∨∨ ¬¬pp)) ∨∨ ¬¬rr)) [Idempotent][Idempotent] ⇔⇔ qq ∨∨ ((¬¬pp ∨∨ ¬¬rr)) [Assoc.][Assoc.] ⇔⇔ ((qq ∨∨ ¬¬pp)) ∨∨ ¬¬rr [Commut.][Commut.] ⇔⇔ ¬¬pp ∨∨ qq ∨∨ ¬¬rr Topic #1.1 – Propositional Logic: Equivalences
  • 48. 03/07/17 48 Module #1 - Logic Review: Propositional Logic (§§1.1-1.2) • Atomic propositions:Atomic propositions: pp,, qq,, rr, …, … • Boolean operators:Boolean operators: ¬¬ ∧∧ ∨∨ ⊕⊕ →→ ↔↔ • Compound propositions: s :≡ (p ∧∧ ¬¬qq)) ∨∨ rr • Equivalences:Equivalences: pp∧¬∧¬qq ⇔⇔ ¬¬((pp →→ qq)) • Proving equivalences using:Proving equivalences using: – Truth tables.Truth tables. – Symbolic derivations.Symbolic derivations. pp ⇔⇔ qq ⇔⇔ r …r … Topic #1 – Propositional Logic
  • 49. 03/07/17 49 Module #1 - Logic Predicate Logic (§1.3) • Predicate logicPredicate logic is an extension ofis an extension of propositional logic that permits conciselypropositional logic that permits concisely reasoning about wholereasoning about whole classesclasses of entities.of entities. • Propositional logic (recall) treats simplePropositional logic (recall) treats simple propositionspropositions (sentences) as atomic entities.(sentences) as atomic entities. • In contrast,In contrast, predicatepredicate logic distinguishes thelogic distinguishes the subjectsubject of a sentence from itsof a sentence from its predicate.predicate. – Remember these English grammar terms?Remember these English grammar terms? Topic #3 – Predicate Logic
  • 50. 03/07/17 50 Module #1 - Logic Subjects and Predicates • In the sentence “The dog is sleeping”:In the sentence “The dog is sleeping”: – The phrase “the dog” denotes theThe phrase “the dog” denotes the subjectsubject -- thethe objectobject oror entityentity that the sentence is about.that the sentence is about. – The phrase “is sleeping” denotes theThe phrase “is sleeping” denotes the predicatepredicate-- a property that is truea property that is true ofof the subject.the subject. • In predicate logic, aIn predicate logic, a predicatepredicate is modeled asis modeled as aa functionfunction PP(·) from objects to propositions.(·) from objects to propositions. – PP((xx) = “) = “xx is sleeping” (whereis sleeping” (where xx is any object).is any object). Topic #3 – Predicate Logic
  • 51. 03/07/17 51 Module #1 - Logic More About Predicates • Convention: Lowercase variablesConvention: Lowercase variables xx,, yy,, z...z... denotedenote objects/entities; uppercase variablesobjects/entities; uppercase variables PP,, QQ,, RR…… denote propositional functions (predicates).denote propositional functions (predicates). • Keep in mind that theKeep in mind that the result ofresult of applyingapplying aa predicatepredicate PP to an objectto an object xx is theis the proposition Pproposition P((xx).). But the predicateBut the predicate PP itselfitself ((e.g. Pe.g. P=“is sleeping”) is=“is sleeping”) is notnot a proposition (not a complete sentence).a proposition (not a complete sentence). – E.g.E.g. ifif PP((xx) = “) = “xx is a prime number”,is a prime number”, PP(3) is the(3) is the propositionproposition “3 is a prime number.”“3 is a prime number.” Topic #3 – Predicate Logic
  • 52. 03/07/17 52 Module #1 - Logic Propositional Functions • Predicate logicPredicate logic generalizesgeneralizes the grammaticalthe grammatical notion of a predicate to also includenotion of a predicate to also include propositional functions ofpropositional functions of anyany number ofnumber of arguments, each of which may takearguments, each of which may take anyany grammatical role that a noun can take.grammatical role that a noun can take. – E.g.E.g. letlet PP((xx,,y,zy,z) = “) = “xx gavegave yy the gradethe grade zz”, then if”, then if x=x=“Mike”,“Mike”, yy=“Mary”,=“Mary”, zz=“A”, then=“A”, then PP((xx,,yy,,zz) =) = “Mike gave Mary the grade A.”“Mike gave Mary the grade A.” Topic #3 – Predicate Logic
  • 53. 03/07/17 53 Module #1 - Logic Universes of Discourse (U.D.s) • The power of distinguishing objects fromThe power of distinguishing objects from predicates is that it lets you state thingspredicates is that it lets you state things aboutabout manymany objects at once.objects at once. • E.g., letE.g., let PP((xx)=“)=“xx+1>+1>xx”. We can then say,”. We can then say, “For“For anyany numbernumber xx,, PP((xx) is true” instead of) is true” instead of ((00+1>+1>00)) ∧∧ ((11+1>+1>11)) ∧∧ ((22+1>+1>22)) ∧∧ ...... • The collection of values that a variableThe collection of values that a variable xx can take is calledcan take is called xx’s’s universe of discourseuniverse of discourse.. Topic #3 – Predicate Logic
  • 54. 03/07/17 54 Module #1 - Logic Quantifier Expressions • QuantifiersQuantifiers provide a notation that allowsprovide a notation that allows us tous to quantifyquantify (count)(count) how manyhow many objects inobjects in the univ. of disc. satisfy a given predicate.the univ. of disc. satisfy a given predicate. • ““∀∀”” is the FORis the FOR∀∀LL orLL or universaluniversal quantifier.quantifier. ∀∀xx PP((xx) means) means for allfor all x in the u.d.,x in the u.d., PP holds.holds. • ““∃∃”” is theis the ∃∃XISTS orXISTS or existentialexistential quantifier.quantifier. ∃∃x Px P((xx) means) means therethere existsexists anan xx in the u.d.in the u.d. (that is, 1 or more)(that is, 1 or more) such thatsuch that PP((xx) is true.) is true. Topic #3 – Predicate Logic
  • 55. 03/07/17 55 Module #1 - Logic The Universal Quantifier ∀ • Example:Example: Let the u.d. of x beLet the u.d. of x be parking spaces at NSUparking spaces at NSU.. LetLet PP((xx) be the) be the predicatepredicate ““xx is full.”is full.” Then theThen the universal quantification of Puniversal quantification of P((xx),), ∀∀xx PP((xx), is the), is the proposition:proposition: – ““All parking spaces at NSU are full.”All parking spaces at NSU are full.” – i.e.i.e., “Every parking space at NSU is full.”, “Every parking space at NSU is full.” – i.e.i.e., “For each parking space at NSU, that space is full.”, “For each parking space at NSU, that space is full.” Topic #3 – Predicate Logic
  • 56. 03/07/17 56 Module #1 - Logic The Existential Quantifier ∃ • Example:Example: Let the u.d. of x beLet the u.d. of x be parking spaces at NSUparking spaces at NSU.. LetLet PP((xx) be the) be the predicatepredicate ““xx is full.”is full.” Then theThen the existential quantification of Pexistential quantification of P((xx),), ∃∃xx PP((xx), is the), is the propositionproposition:: – ““Some parking space at NSU is full.”Some parking space at NSU is full.” – ““There is a parking space at NSU that is full.”There is a parking space at NSU that is full.” – ““At least one parking space at NSU is full.”At least one parking space at NSU is full.” Topic #3 – Predicate Logic
  • 57. 03/07/17 57 Module #1 - Logic Quantifier Equivalence Laws • Definitions of quantifiers: If u.d.=a,b,c,…Definitions of quantifiers: If u.d.=a,b,c,… ∀∀x Px P((xx)) ⇔⇔ PP(a)(a) ∧∧ PP(b)(b) ∧∧ PP(c)(c) ∧∧ …… ∃∃x Px P((xx)) ⇔⇔ PP(a)(a) ∨∨ PP(b)(b) ∨∨ PP(c)(c) ∨∨ …… • From those, we can prove the laws:From those, we can prove the laws: ¬∀¬∀x Px P((xx)) ⇔⇔ ∃∃xx ¬¬PP((xx)) ¬∃¬∃x Px P((xx)) ⇔⇔ ∀∀xx ¬¬PP((xx)) • WhichWhich propositionalpropositional equivalence laws canequivalence laws can be used to prove this?be used to prove this? Topic #3 – Predicate Logic
  • 58. 03/07/17 58 Module #1 - Logic Free and Bound Variables • An expression likeAn expression like PP((xx) is said to have a) is said to have a free variablefree variable xx (meaning,(meaning, xx is undefined).is undefined). • A quantifier (eitherA quantifier (either ∀∀ oror ∃∃)) operatesoperates on anon an expression having one or more freeexpression having one or more free variables, andvariables, and bindsbinds one or more of thoseone or more of those variables, to produce an expression havingvariables, to produce an expression having one or moreone or more boundbound variablesvariables.. Topic #3 – Predicate Logic
  • 59. 03/07/17 59 Module #1 - Logic Example of Binding • PP((x,yx,y) has 2 free variables,) has 2 free variables, xx andand yy.. ∀ ∀∀xx PP((xx,,yy) has 1 free variable, and one bound) has 1 free variable, and one bound variable.variable. [Which is which?][Which is which?] • ““PP((xx), where), where xx=3” is another way to bind=3” is another way to bind xx.. • An expression withAn expression with zerozero free variables is a bona-free variables is a bona- fide (actual) proposition.fide (actual) proposition. • An expression withAn expression with one or moreone or more free variables isfree variables is still only a predicate:still only a predicate: e.g.e.g. letlet QQ((yy) =) = ∀∀xx PP((xx,,yy)) Topic #3 – Predicate Logic
  • 60. 03/07/17 60 Module #1 - Logic Nesting of Quantifiers Example: Let the u.d. ofExample: Let the u.d. of xx && yy be people.be people. LetLet LL((xx,,yy)=“)=“xx likeslikes yy”” (a predicate w. 2 f.v.’s)(a predicate w. 2 f.v.’s) ThenThen ∃∃y Ly L((x,yx,y) = “There is someone whom) = “There is someone whom xx likes.”likes.” (A predicate w. 1 free variable,(A predicate w. 1 free variable, xx)) ThenThen ∀∀xx ((∃∃y Ly L((x,yx,y)) =)) = “Everyone has someone whom they like.”“Everyone has someone whom they like.” (A __________ with ___ free variables.)(A __________ with ___ free variables.) Topic #3 – Predicate Logic
  • 61. 03/07/17 61 Module #1 - Logic Quantifier Exercise IfIf RR((xx,,yy)=“)=“xx relies uponrelies upon yy,” express the,” express the following in unambiguous English:following in unambiguous English: ∀∀xx((∃∃y Ry R((x,yx,y))=))= ∃∃yy((∀∀xx RR((x,yx,y))=))= ∃∃xx((∀∀y Ry R((x,yx,y))=))= ∀∀yy((∃∃x Rx R((x,yx,y))=))= ∀∀xx((∀∀y Ry R((x,yx,y))=))= Everyone has someone to rely on. There’s a poor overburdened soul whom everyone relies upon (including himself)! There’s some needy person who relies upon everybody (including himself). Everyone has someone who relies upon them. Everyone relies upon everybody, (including themselves)! Topic #3 – Predicate Logic
  • 62. 03/07/17 62 Module #1 - Logic Nested quantifiers AssumeAssume S(x,y)S(x,y) means “means “xx seessees yy”” u.d.=all peopleu.d.=all people What does the following formula mean?What does the following formula mean? ∀∀xSxS((x,ax,a))
  • 63. 03/07/17 63 Module #1 - Logic Nested quantifiers AssumeAssume S(x,y)S(x,y) means “means “xx seessees yy”.”. u.d.=all peopleu.d.=all people ∀∀xSxS((x,ax,a) means) means “For every“For every xx,, xx seessees aa”” In other words,In other words, “Everyone sees“Everyone sees aa””
  • 64. 03/07/17 64 Module #1 - Logic Nested quantifiers What does the following formula mean?What does the following formula mean? ∀∀xx((∃∃y Sy S((x,yx,y))))
  • 65. 03/07/17 65 Module #1 - Logic Nested quantifiers ∀∀xx((∃∃y Sy S((x,yx,y)) means “)) means “For everyFor every xx, there exists, there exists aa yy such thatsuch that xx seessees y”y” In other words:In other words: “Everyone sees someone”“Everyone sees someone”
  • 66. 03/07/17 66 Module #1 - Logic Interactions between quantifiers and connectives Let the u.d. beLet the u.d. be parking spaces at NSUparking spaces at NSU.. LetLet PP((xx) be “) be “xx is occupied.”is occupied.” Let Q(Let Q(xx) be “) be “xx is free of charge.”is free of charge.” 1.1. ∃∃xx ((QQ((xx)) ∧∧ PP((xx)))) 2.2. ∀∀xx ((QQ((xx)) ∧∧ PP((xx)))) 3.3. ∀∀xx ((QQ((xx)) →→PP((xx)))) 4.4. ∃∃xx ((QQ((xx)) →→ PP((xx))))
  • 67. 03/07/17 67 Module #1 - Logic I. Construct English paraphrases Let the u.d. beLet the u.d. be parking spaces at NSUparking spaces at NSU.. LetLet PP((xx) be “) be “xx is occupied.”is occupied.” Let Q(Let Q(xx) be “) be “xx is free of charge.”is free of charge.” 1.1. ∃∃xx ((QQ((xx)) ∧∧ PP((xx)))) 2.2. ∀∀xx ((QQ((xx)) ∧∧ PP((xx)))) 3.3. ∀∀xx ((QQ((xx)) →→PP((xx)))) 4.4. ∃∃xx ((QQ((xx)) →→ PP((xx))))
  • 68. 03/07/17 68 Module #1 - Logic I. Construct English paraphrases 1.1. ∃∃xx ((QQ((xx)) ∧∧ PP((xx))) Some places are free of) Some places are free of charge and occupiedcharge and occupied 2.2. ∀∀xx ((QQ((xx)) ∧∧ PP((xx))) All places are free of) All places are free of charge and occupiedcharge and occupied 3.3. ∀∀xx ((QQ((xx)) →→PP((xx))) All places that are free) All places that are free of charge are occupiedof charge are occupied 4.4. ∃∃xx ((QQ((xx)) →→ PP((xx))) For some places x, if x) For some places x, if x is free of charge then x is occupiedis free of charge then x is occupied
  • 69. 03/07/17 69 Module #1 - Logic About the last of these 4.4. ∃∃xx ((QQ((xx)) →→ PP((xx))) “For some x, if x is free of) “For some x, if x is free of charge then x is occupied”charge then x is occupied” ∃∃xx ((QQ((xx)) →→ PP((xx)))) is true iff, for some place a,is true iff, for some place a, QQ((aa)) →→ PP((aa) is true.) is true. QQ((aa)) →→ PP((aa)) is true iffis true iff QQ((aa) is false) is false oror PP((aa) is true) is true (conditional is only false in one row of table!)(conditional is only false in one row of table!) So,So, the formula meansthe formula means “Some places are either“Some places are either not free of charge or occupied”not free of charge or occupied”
  • 70. 03/07/17 70 Module #1 - Logic About the last of these 4.4. ∃∃xx ((QQ((xx)) →→ PP((xx)))) When confused by aWhen confused by a conditional: re-write it usingconditional: re-write it using negationnegation andand disjunctiondisjunction:: ∃∃xx ((¬¬QQ((xx)) ∨∨ PP((xx)))) ⇔⇔ (p. 67)(p. 67) ∃∃xx ¬¬QQ((xx)) ∨∨ ∃∃x Px P((xx)) “Some places are“Some places are not free of charge or some places arenot free of charge or some places are occupied”occupied”
  • 71. 03/07/17 71 Module #1 - Logic • Combinations to remember:Combinations to remember: 1.1. ∃∃xx ((QQ((xx)) ∧∧ PP((xx)))) 2.2. ∀∀xx ((QQ((xx)) →→PP((xx))))
  • 72. 03/07/17 72 Module #1 - Logic Natural language is ambiguous! • ““Everybody likes somebody.”Everybody likes somebody.” – For everybody, there is somebody they like,For everybody, there is somebody they like, ∀∀∀xx ∃∃yy LikesLikes((xx,,yy)) – or, there is somebody (a popular person) whomor, there is somebody (a popular person) whom everyone likes?everyone likes? ∀∃∃yy ∀∀xx LikesLikes((xx,,yy)) • ““Somebody likes everybody.”Somebody likes everybody.” – Same problem: Depends on context, emphasis.Same problem: Depends on context, emphasis. [Probably more likely.] Topic #3 – Predicate Logic
  • 73. 03/07/17 73 Module #1 - Logic End of §1.3-1.4, Predicate Logic • From these sections you should have learned:From these sections you should have learned: – Predicate logic notation & conventionsPredicate logic notation & conventions – Conversions: predicate logicConversions: predicate logic ↔↔ clear Englishclear English – Meaning of quantifiers, equivalencesMeaning of quantifiers, equivalences – Simple reasoning with quantifiersSimple reasoning with quantifiers • Upcoming topics:Upcoming topics: – Introduction to proof-writing.Introduction to proof-writing. – Then: Set theory –Then: Set theory – • a language for talking about collections of objects.a language for talking about collections of objects. Topic #3 – Predicate Logic

Editor's Notes

  1. We normally attribute propositional logic to George Boole, who first formalized it. Actually the particular formal notation we will present is not precisely Boole’s; he originally spoke of logic in terms of sets, not propositions, and he also used Boolean algebra notation such as AB, A+B, rather than the A /\ B, A \/ B notation we will use. But, he was the first to mathematically formalize these kinds of concepts in preserved writings. Boole’s formalization of logic was developed further by the philosopher Frege. However, even though logic was not formalized as such until the 1800’s, the basic ideas of it go all the way back to the ancient Greeks. Aristotle (ca. 384-322 B.C.) developed a detailed system of logic (though one that was not quite as convenient and powerful as the modern one), and Chrysippus of Soli (ca. 281-205 B.C.) introduced a logic centered around logic AND, inclusive and exclusive OR, NOT, and implication, similarly to Boole’s. Chrysippus’ logic apparently included all of the key rules that Boole’s logic had. However, his original works were unfortunately lost; we only have fragments quoted by other authors.
  2. Later in the course, we will see that operators can themselves be defined in terms of functions. This slide doesn’t define them that way because we haven’t defined functions yet. But for your reference, when you come back to study this section after learning about functions, in general, an n-ary operator O on any set S (the domain of the operator) is a function O:S^n->S mapping n-tuples of members of S (the operands) to members of S. “S^n” here denotes S with n as a superscript, that is, the nth Cartesian power of S. All this will be defined later when we talk about set theory. For Boolean operators, the set we are dealing with is B={True,False}. A unary Boolean operator U is a function U:B->B, while a binary Boolean operator T is a function T:(B,B)->B. Binary operators are conventionally written in between their operands, while unary operators are usually written in front of their operands. (One exception is the post-increment and post-decrement operators in C/C++/Java, which are written after their operands.)
  3. OR is also commutative and associative. The animated picture on the right is just a memory device to help you remember that the disjunction operator is symbolized with a downward-pointing wedge, like the blade of an axe, because it “splits” a proposition into two parts, such that you can take either part (or both), if you are trying to decide how to make the whole proposition true. Note that the meaning of disjunction is like the phrase “and/or” which is sometimes used in informal English. “The car has a bad engine and/or a bad carburetor.”
  4. As an exercise, drop the truth tables for f /\ (g \/ s) and (f /\ g) \/ s to see that they’re different, and thus the parentheses are necessary. Precedence conventions such as the one in the second bullet help to reduce the number of parentheses needed in expressions. Note that negation, with its tight binding (high precedence), and with its position to the left of its operand, behaves similarly to a negative sign in arithmetic. There is also a precedence convention that you see sometimes (for example, in the C programming language) that AND takes precedence over OR. However, this convention is not quite universally accepted, not all systems adopt it. Therefore, to be safe, you should always include parentheses whenever you are mixing ANDs and ORs in a single sequence of binary operators.
  5. For slides that have interactive exercises, it may be a good idea to stop the class for a minute to allow the students to discuss the problem with their neighbors, then call on someone to answer. This will help keep the students engaged in the lecture activity.
  6. Note that the definition of “p implies q” says: “If p is true, then q is true, and if p is not true, then q is either true or false.” Well, saying that q is either true or false is not saying anything, since any proposition is, by the very definition of a proposition, either true or false. So, the last part of that sentence (covering the case where p is not true) is not really saying anything. So we may as well say the definition is, “If p is true, then q is true.” Sometimes the antecedent is called the hypothesis and the consequent is called the conclusion.
  7. Let’s consider the rows of the truth table, one at a time. In the first row, p is false and q is false. Now, let’s consider the definition of p->q. It says “If p is true, then q is true, but if p is false, then q is either true or false.” Well, in this case, p is false, and q is either true or false (namely false), so the second part of the statement is true. But, of course that part is true, since it is just a tautology that q is either true or false. In other words, and if is always true when its antecedent is false. Similarly, the second row is True. The third row is false, since p is true but q is false, so it is not the case that if p is true then q is true. Finally, in the fourth row, since p is true and q is true, it is the case that if q is true then q is true. Many students have trouble with the implication operator. When we say, “A implies B”, it is just a shorthand for “either not A, or B”. In other words, it is just the statement that it is NOT the case that A is true and B is false. This often seems wrong to students, because when we say “A implies B” in everyday English, we mean that if somehow A were to become true in some way, somehow, the statement B would automatically be thereby made true, as a result. This does not seem to be the case in general when A and B are just two random false statements (such as the example in the last bullet). (However in this case, we might make a convoluted argument that the antecedent really DOES effectively imply the consequent: Note that if 1=0, then if a given pig flies 0 times in his life, then he also flies 1 time, thus he can fly.) In any case, perhaps a more accurate and satisfying English rendering of the true meaning of the logical claim “A implies B”, might be just, “the possibility that A implies B is not contradicted directly by the truth values of A and B”. In other words, “it is not the case that A is true and B is false.” (Since that combination of truth values would directly contradict the hypothesis that A implies B.)
  8. The first one is true because T->T is True. It doesn’t matter that my lecture ending is not the cause of the sun rising tomorrow. The second one is false for me, because although Tuesday is a day of the week, I am most certainly NOT a penguin. (But, if a penguin were to say this statement, then it would be true for him.) The third one is true, because 1+1 is not equal to 6. F->T is True. The last one is true, because the moon is not made of green cheese. F->F is True.
  9. Also, note that the converse and inverse of p->q also have the same meaning as each other.
  10. Also, p IFF q is equivalent to (p -> q) /\ (q -> p). (“/\” being the AND wedge)
  11. Bits can also be defined in terms of sets, if you like, by the convention that the empty set {} represents 0, and the set containing the empty set {{}} represents 1. Or more generally, any two distinct objects can represent the two bit-values or truth-values.
  12. The answers are present, but hidden, as white text on a white background. The slide can be done in class as an exercise, with the instructor typing in the students’ answers in the space provided. Then the correct answers can be revealed by selecting the bottom 3 rows and changing their font color unconditionally to black.