CS1502 Formal Methods in Computer Science Lecture Notes 3 Consequence Rules Boolean Connectives.

Slides:



Advertisements
Similar presentations
Propositional Equivalences
Advertisements

TRUTH TABLES The general truth tables for each of the connectives tell you the value of any possible statement for each of the connectives. Negation.
Lecture 10 varieties of necessity tautological equivalence
fitch rules for negation
1 Introduction to Abstract Mathematics Valid AND Invalid Arguments 2.3 Instructor: Hayk Melikya
Goals Determine the true value of statements with AND, OR, IF..THEN. Negate statements with the connectives above Construct truth tables Understand when.
CS128 – Discrete Mathematics for Computer Science
Propositional Logic. Negation Given a proposition p, negation of p is the ‘not’ of p.
Boolean Algebra Computer Science AND (today is Monday) AND (it is raining) (today is Monday) AND (it is not raining) (today is Friday) AND (it is.
1 Section 1.2 Propositional Equivalences. 2 Equivalent Propositions Have the same truth table Can be used interchangeably For example, exclusive or and.
1 Math 306 Foundations of Mathematics I Math 306 Foundations of Mathematics I Goals of this class Introduction to important mathematical concepts Development.
Proof by Deduction. Deductions and Formal Proofs A deduction is a sequence of logic statements, each of which is known or assumed to be true A formal.
Introduction to Logic Logical Form: general rules
First Order Logic. Propositional Logic A proposition is a declarative sentence (a sentence that declares a fact) that is either true or false, but not.
Chapter 2: The Logic of Compound Statements 2.1 Logical Forms and Equivalence 12.1 Logical Forms and Equivalences Logic is a science of the necessary laws.
CS1502 Formal Methods in Computer Science Lecture Notes 10 Resolution and Horn Sentences.
CS 1502 Formal Methods in Computer Science
The Foundations: Logic and Proofs
Discrete Mathematics Goals of a Discrete Mathematics Learn how to think mathematically 1. Mathematical Reasoning Foundation for discussions of methods.
INTRODUCTION TO LOGIC FALL 2009 Quiz Game. ConceptsTrue/FalseTranslations Informal Proofs Formal Proofs
The Foundations: Logic and Proofs
Discrete Mathematics and Its Applications
CS1502 Formal Methods in Computer Science Lecture Notes 1 Course Information Introduction to Logic Part 1.
Logic Introduction to Logic.
CS 285- Discrete Mathematics Lecture 2. Section 1.1 Propositional Logic Propositions Conditional Statements Truth Tables of Compound Propositions Translating.
Chapter 1 The Logic of Compound Statements. Section 1.1 Logical Form and Logical Equivalence.
BY: MISS FARAH ADIBAH ADNAN IMK. CHAPTER OUTLINE: PART III 1.3 ELEMENTARY LOGIC INTRODUCTION PROPOSITION COMPOUND STATEMENTS LOGICAL.
1 Propositional Logic Proposition 2 Propositions can be divided into simple propositions and compound propositions. A simple (or basic) proposition is.
CS1502 Formal Methods in Computer Science
Chapter 5 – Logic CSNB 143 Discrete Mathematical Structures.
Logical Form and Logical Equivalence Lecture 2 Section 1.1 Fri, Jan 19, 2007.
2.3Logical Implication: Rules of Inference From the notion of a valid argument, we begin a formal study of what we shall mean by an argument and when such.
Fallacies The proposition [(p  q)  q]  p is not a tautology, because it is false when p is false and q is true. This type of incorrect reasoning is.
INTRODUCTION TO LOGIC Jennifer Wang Fall 2009 Midterm Review Quiz Game.
LOGIC Lesson 2.1. What is an on-the-spot Quiz  This quiz is defined by me.  While I’m having my lectures, you have to be alert.  Because there are.
Chapter 7 Logic, Sets, and Counting
Chapter 3: Introduction to Logic. Logic Main goal: use logic to analyze arguments (claims) to see if they are valid or invalid. This is useful for math.
Propositional Logic. Propositions Any statement that is either True (T) or False (F) is a proposition Propositional variables: a variable that can assume.
Lecture 9 Conditional Statements CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Chapter 7 Logic, Sets, and Counting Section 1 Logic.
1/10/ Math/CSE 1019N: Discrete Mathematics for Computer Science Winter 2007 Suprakash Datta Office: CSEB 3043 Phone:
Propositional Logic ITCS 2175 (Rosen Section 1.1, 1.2)
Logical Form and Logical Equivalence Lecture 1 Section 1.1 Wed, Jan 12, 2005.
Logical Form and Logical Equivalence M Logical Form Example 1 If the syntax is faulty or execution results in division by zero, then the program.
Chapter 1: The Foundations: Logic and Proofs
Chapter 1: The Foundations: Logic and Proofs
TRUTH TABLES. Introduction The truth value of a statement is the classification as true or false which denoted by T or F. A truth table is a listing of.
ARTIFICIAL INTELLIGENCE Lecture 2 Propositional Calculus.
Mathematics for Comter I Lecture 3: Logic (2) Propositional Equivalences Predicates and Quantifiers.
The Logic of Boolean Connectives Chapter 4 Language, Proof and Logic.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01: Boolean Logic Sections 1.1 and 1.2 Jarek Rossignac.
Logic and Truth Tables Winter 2012 COMP 1380 Discrete Structures I Computing Science Thompson Rivers University.
Chapter 1. Chapter Summary  Propositional Logic  The Language of Propositions (1.1)  Logical Equivalences (1.3)  Predicate Logic  The Language of.
PHIL 012 2/14/2001 Logical Equivalence & Translation.
Chapter 1 Logic and proofs
2. The Logic of Compound Statements Summary
The Foundations: Logic and Proofs
COMP 1380 Discrete Structures I Thompson Rivers University
(CSC 102) Discrete Structures Lecture 2.
CSE 2353 – September 4th 2002 Logic.
The Boolean Connectives
The Foundations: Logic and Proofs
Principles of Computing – UFCFA3-30-1
Propositional Equivalences
Information Technology Department
CS 1502 Formal Methods in Computer Science
CS 220: Discrete Structures and their Applications
COMP 1380 Discrete Structures I Thompson Rivers University
Logic Logic is a discipline that studies the principles and methods used to construct valid arguments. An argument is a related sequence of statements.
The Foundations: Logic and Proofs
Presentation transcript:

CS1502 Formal Methods in Computer Science Lecture Notes 3 Consequence Rules Boolean Connectives

Symmetry of Identity a = b a = b 1) 2) 3) a = a = Introduction b = a = Elimination 1, 2

Example Informal Proof Prove: If a is smaller than b and c is identical to b then c is larger than a. Since we are given that a is smaller than b, it follows that b must be larger than a. Moreover, since c is identical to b, it follows that c must be larger than a. QED

Consequence Rules There are three consequence “rules” in Fitch –Tautological Consequence (Taut Con) –First-order Consequence (FO Con) –Analytic Consequence (Ana Con) Cons rules are proof seekers that work behind the scenes. Success is indicated by the beloved blue check mark. Failure is indicated by the infamous red X. Cons rules are proof seekers that work behind the scenes. Success is indicated by the beloved blue check mark. Failure is indicated by the infamous red X.

Taut Con Weakest of the three Cons “rules” Attempts to prove if the current step follows from the cited statements by virtue of the truth-functional connectives. E.g., p ^ q can be replaced by p v q.

FO Con More powerful than Taut Con but weaker than Ana Con Attempts to prove if the current step follows from the cited steps by virtue of the truth-functional connectives, the quantifiers, and the identity predicate. E.g., a=b ^ b=c can be replaced by a=c.

Ana Con Most powerful Cons “rule” Attempts to prove if the current step follows from the cited steps by virtue of the truth-functional connectives, the quantifiers, the identity predicate and the meanings predicates of Tarski’s World. E.g., Cube(a) v Tet(a) v Dodec(a) is true under Ana Con

Example Formal Proof Larger(a,b) c = b Larger(a,b) c = b Smaller(b,a)Ana Con 1 c = c = Introduction b = c = Elim 2, 4 Smaller(c,a) = Elim 5, 3 1) 2) 3) 4) 5) 6) Prove: c is smaller than a

Explicit Proof of an Ana Con Step Proof performed by the system, behind the scenes

Showing Non-consequence To show Q is not a consequence of premises P 1, P 2, …, P n, create a world where the premises are all true and the conclusion Q is false.

Invalid Argument 1. SameRow(b,c) 2. SameRow(a,d) 3. SameRow(d,f) 4. LeftOf(a,b) 5. LeftOf(f,c) 1. SameRow(b,c) 2. SameRow(a,d) 3. SameRow(d,f) 4. LeftOf(a,b) 5. LeftOf(f,c)

Boolean Connectives Negation  Conjunction  Disjunction  These are truth-functional connectives It is not the case that And, but, moreover Or

Negation P PPPP TF FT

Negation Facts One translation of  P is It is not the case that P.  (a = b) is equivalent to a  b   P is equivalent to P P PPPP  P P P P TFT FTF

The Game Used to understand the truth value of a complex sentence Strategy: Given a sentence of the form    P that you believe to be True (False) implies   P is False (True) implies  P is True (False) implies P is False (True)

Assessment is incorrect

Conjunction and Disjunction PQ P  Q P  Q TTTT TFFT FTFT FFFF

Game Revisited If you believe P  Q is true you will be asked to select the disjunct that is true. If you believe P  Q is false Tarski’s World will attempt to find a disjunct that is true. If you believe P  Q is true Tarski’s World will attempt to find a conjunct that is false. If you believe P  Q is false you will be asked to select a conjunct that is false.

Game Example In lecture

Translation Both A and B Either A or B Neither A nor B A  B A  B  (A  B) Both c and e are cubes. Cube(c)  Cube(e) Either c or e is a cube. Cube(c)  Cube(e) Neither c nor e is a cube.  (Cube(c)  Cube(e))

Translation John entered the car and drove to his home Entered ^ Drove(john,car(john),house(john)) –OK? No – the truth functional connectives connect sentences, not predicates Entered(john,car(john)) ^ Drove(john,house(john)) –This is OK English sentences often convey more information than their straightforward logical meanings, e.g., temporal order in “John entered the car and drove home” That’s OK: in this class, you can just give the straightforward translation into logic

Translation I will vote for Smith or I will vote for Jones Straightforward literal translation: Vote(I,smith) v Vote(I,jones) Vote(I,smith) v Vote(I,jones) Logic “or” is inclusive or. But “or” in our English sentence is exclusive or – I’ll vote for one of them but not both We can define exclusive or using ^ and v: P xor Q equiv: (P ^ ~Q) v (Q ^ ~P) (Vote(I,smith) ^ ~Vote(I,jones)) v (Vote(I,jones) ^ ~Vote(I,smith)) Unless the text says otherwise, assume inclusive “or” (even when it says “Either A or B”)

Avoid Ambiguity A  B  C(A  B)  C Both either A or B and C A  (B  C) Either A or both B and C A  B  C(A  B)  C Either both A and B or C A  (B  C) Both A and either B or C Either both Max is at home and Claire is tall or Carl is happy. [Home(Max)  Tall(Claire)]  Happy(Carl)

Avoid Ambiguity Let’s look at that example again; Either both Max is at home and Claire is tall or Carl is happy [Home(max) ^ Tall(claire)] v Happy(carl) Home(max) ^ (Tall(claire) v Happy(carl)) Translation: Both Max is at home and either Claire is tall or Carl is happy.

Equivalences Two FOL sentences P and Q mean the same thing (are logically equivalent, written P  Q) iff they have the same truth value in all situations. If two sentences are logically equivalent, you can substitute one for the other. Identity Laws: P ^ T  P; P v F  P Domination Laws: P v T  T; P ^ F  F Idempotent Laws: P v P  P; P ^ P  P Double Negation: ~~P  P Commutative Laws: P v Q  Q v P; P ^ Q  Q ^ P Associative Laws: (P v Q) v R  P v (Q v R) (P ^ Q) ^ R  P ^ (Q ^ R) (P ^ Q) ^ R  P ^ (Q ^ R) Distributive Laws: P v (Q ^ R)  (P v Q) ^ (P v R) P ^ (Q v R)  (P ^ Q) v (P ^ R) P ^ (Q v R)  (P ^ Q) v (P ^ R) DeMorgan’s Laws: ~(P ^ Q)  ~P v ~Q ~(P v Q)  ~P ^ ~Q ~(P v Q)  ~P ^ ~Q