Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or...
Transcript of Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or...
![Page 1: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/1.jpg)
Logical Form and Logical Equivalence
M260 2.1
![Page 2: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/2.jpg)
Logical Form Example 1
• If the syntax is faultyor execution results in division by zero,then the program will generate an error message.
• Thereforeif the computer does not generate an error messagethen the syntax is correctand the execution does not result in division by zero.
![Page 3: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/3.jpg)
Logical Form Example 2
• If x is a Real number such that x<-2 or x>2,then x2>4.
• Thereforeif x24,then x-2 and x2.
![Page 4: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/4.jpg)
Logical Form Example 1
• If (the syntax is faulty)or (execution results in division by zero),then (the program will generate an error message).
• Thereforeif (the computer does not generate an error message)then (the syntax is correct)and (the execution does not result in division by zero).
![Page 5: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/5.jpg)
Logical Form Example 1
• If (p)or (q),then (r).
• Thereforeif (not r)then (not p)and (not q).
![Page 6: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/6.jpg)
Logical Form Example 2
• If (x<-2) or (x>2),then (x2>4).
• Thereforeif (x24),then (x-2) and (x2).
![Page 7: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/7.jpg)
Logical Form Example 2
• If (p) or (q),then (r).
• Thereforeif (not r),then (not p) and (not q).
![Page 8: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/8.jpg)
Logical Form vs Content
• Examples 1 and 2 have the same form:If p or q, then r.therefore if not r, then not p and not q.
• These examples have different values for the propositional variables p and q.
![Page 9: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/9.jpg)
Formal Logic Goals
• Avoid Ambiguity
• Obtain Consistency
• Elucidate Proof Mechanisms
![Page 10: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/10.jpg)
Mathematical Vocabulary
• New terms are defined using previously defined terms.
• Initial terms remain undefined.
• Undefined terms in logic: sentence, true, false.
![Page 11: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/11.jpg)
Logic Symbols ~
• ~ denotes “not”
• Negation of p is ~p.
![Page 12: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/12.jpg)
Logic Symbols ~
denotes “and”
• Conjunction of p and q is p q. denotes “or”
• Disjunction of p and q is p q.
• Precedence: first ~ then and (unordered)
![Page 13: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/13.jpg)
Truth Values
• True
• False
![Page 14: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/14.jpg)
Precedence Examples
• ~p q• ~p ~q
• ~ (p q)
![Page 15: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/15.jpg)
Let p, q and r be 0<x, x<3, and x=3
• Rewrite x 3
• q r• Rewrite 0<x<3
• pq• Rewrite 0<x3
• p(q r)
![Page 16: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/16.jpg)
Negation Truth Table
p ~p
T F
F T
![Page 17: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/17.jpg)
Conjunction Truth Table
p q pq
T T T
T F F
F T F
F F F
![Page 18: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/18.jpg)
Disjunction Truth Table
p q p q
T T T
T F T
F T T
F F F
![Page 19: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/19.jpg)
Statement Form
• Statement variables
• Logical connectives
• Truth table
![Page 20: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/20.jpg)
Exclusive Or
• p or q but not both
• (p q) ~(p q)
• Do a truth table
![Page 21: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/21.jpg)
Exclusive Or Truth Table
p q p q p q ~(p q)(p q) ~(p q)
![Page 22: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/22.jpg)
Exclusive Or Truth Table
p q p q p q ~(p q)(p q) ~(p q)
T T
T F
F T
F F
![Page 23: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/23.jpg)
Exclusive Or Truth Table
p q p q p q ~(p q)(p q) ~(p q)
T T T T F
T F T F T
F T T F T
F F F F T
![Page 24: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/24.jpg)
Exclusive Or Truth Table
p q p q p q ~(p q)(p q) ~(p q)
T T T T F F
T F T F T T
F T T F T T
F F F F T F
![Page 25: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/25.jpg)
Logical Equivalence
• Statement Forms are logically equivalent if, and only if, they have the same truth tables.
• P Q
![Page 26: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/26.jpg)
Logical Equivalence Examples
• 6>2 2<6
• p q q p• p ~(~p)
![Page 27: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/27.jpg)
De Morgan’s Laws
• ~(p q) ~p ~ q
• ~(p q) ~p ~ q
• Do truth tables
![Page 28: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/28.jpg)
~(p q) ~p ~ q
p q ~p ~q p q ~(p q) ~p ~q
![Page 29: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/29.jpg)
~(p q) ~p ~ q
p q ~p ~q p q ~(p q) ~p ~q
T T
T F
F T
F F
![Page 30: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/30.jpg)
~(p q) ~p ~ q
p q ~p ~q p q ~(p q) ~p ~q
T T F F T F F
T F F T T F F
F T T F T F F
F F T T F T T
![Page 31: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/31.jpg)
Practice Negations
• John is six feet tall and weighs at least 200 pounds.
• John is not six feet tall or he weighs less than 200 pounds.
![Page 32: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/32.jpg)
Practice Negations
• The bus was late or Tom’s watch was slow.
• The bus was not late and Tom’s watch was not slow.
![Page 33: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/33.jpg)
Jim is tall and thin.
Logical And and Or are only allowed between statements.
![Page 34: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/34.jpg)
Tautologies and Contradictions
• A tautology is a statement form that is always true regardless of the values of the statement variables.
• A contradiction is a statement form that is always false regardless of the values of the statement variables
![Page 35: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/35.jpg)
Logically Equivalent Forms
• Commutative laws• Associative laws• Distributive laws• Identity laws• Negation laws• Double negative law
• Idempotent laws• De Morgan’s laws• Universal bound laws• Absorption laws• Negations of
tautologies and contradictions
![Page 36: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/36.jpg)
Logical Equivalences• pq _________ pq ________• (pq)r _______ (pq)r _______ • p(qr) ______ p(qr) _______• pt __________pc __________• p~p _________p~p _________• ~(~p) ________• pp __________pp __________• ~(pq ) _______ ~(pq ) _______• pt __________ pc __________• p(pq) ______ p(pq) ______• ~t ___________~c ___________
![Page 37: Logical Form and Logical Equivalence M260 2.1. Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.](https://reader036.fdocuments.in/reader036/viewer/2022062518/5697bf741a28abf838c7f976/html5/thumbnails/37.jpg)
Logical Equivalences• pq qp pq qp• (pq)r p(qr) (pq)r p(qr) • p(qr) (pq) (p r)• p(qr) (pq) (p r) • pt p pc p• p~p t p~p c• ~(~p) p• pp p pp p• ~(pq ) ~p~q ~(pq ) ~p~q • pt t pc c• p(pq) p p(pq) p• ~t c~c t