CSE 3341.03 Winter 2008 Introduction to Program Verification January 24 tautology checking, take 2.

Slides:



Advertisements
Similar presentations
Exercises for CS1512 Weeks 7 and 8 Propositional Logic 1 (questions + solutions)
Advertisements

Logic.
AE1APS Algorithmic Problem Solving John Drake.  Invariants – Chapter 2  River Crossing – Chapter 3  Logic Puzzles – Chapter 5 (13) ◦ Knights and Knaves.
Syllabus Every Week: 2 Hourly Exams +Final - as noted on Syllabus
1 Chapter 7 Propositional and Predicate Logic. 2 Chapter 7 Contents (1) l What is Logic? l Logical Operators l Translating between English and Logic l.
From Chapter 4 Formal Specification using Z David Lightfoot
1 Inference Rules and Proofs Z: Inference Rules and Proofs.
Let remember from the previous lesson what is Knowledge representation
Propositional Calculus Math Foundations of Computer Science.
Daniel Kroening and Ofer Strichman 1 Decision Procedures in First Order Logic Decision Procedures for Equality Logic.
The Language of Propositional Logic The Syntax and Semantics of PL.
Adapted from Discrete Math
SAT Solver Math Foundations of Computer Science. 2 Boolean Expressions  A Boolean expression is a Boolean function  Any Boolean function can be written.
Discrete Mathematics Goals of a Discrete Mathematics Learn how to think mathematically 1. Mathematical Reasoning Foundation for discussions of methods.
Intro to Discrete Structures
Chapter 2 – Fundamentals of Logic. Outline Basic Connectives and Truth Tables Logical Equivalence: The Laws of Logic Ligical Implication: Rules of Inference.
Systems Architecture I1 Propositional Calculus Objective: To provide students with the concepts and techniques from propositional calculus so that they.
CSE Winter 2008 Introduction to Program Verification January 29 how wang works.
Declarative vs Procedural Programming  Procedural programming requires that – the programmer tell the computer what to do. That is, how to get the output.
0 What logic is or should be Propositions Boolean operations The language of classical propositional logic Interpretation and truth Validity (tautologicity)
LDK R Logics for Data and Knowledge Representation PL of Classes.
1 CMSC 250 Discrete Structures CMSC 250 Lecture 1.
CS 381 DISCRETE STRUCTURES Gongjun Yan Aug 25, November 2015Introduction & Propositional Logic 1.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
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.
1 CA 208 Logic PQ PQPQPQPQPQPQPQPQ
CSE Winter 2008 Introduction to Program Verification January 31 proofs through simplification.
LDK R Logics for Data and Knowledge Representation Propositional Logic: Reasoning First version by Alessandro Agostini and Fausto Giunchiglia Second version.
1 Introduction to Abstract Mathematics Expressions (Propositional formulas or forms) Instructor: Hayk Melikya
Logical Agents ECE457 Applied Artificial Intelligence Spring 2007 Lecture #6.
Extra slides for Chapter 3: Propositional Calculus & Normal Forms Based on Prof. Lila Kari’s slides For CS2209A, 2009 By Dr. Charles Ling;
CS6133 Software Specification and Verification
CSE Winter 2008 Introduction to Program Verification January 15 tautology checking.
Section 3.4 Boolean Algebra. A link between:  Section 1.3: Logic Systems  Section 3.3: Set Systems Application:  Section 3.5: Logic Circuits in Computer.
Laws of Boolean Algebra Commutative Law Associative Law Distributive Law Identity Law De Morgan's Theorem.
CS2351 Artificial Intelligence Bhaskar.V Class Notes on Knowledge Representation - Logical Agents.
CSE Winter 2008 Introduction to Program Verification for-loops; review.
LDK R Logics for Data and Knowledge Representation Propositional Logic Originally by Alessandro Agostini and Fausto Giunchiglia Modified by Fausto Giunchiglia,
Propositional Logic Rather than jumping right into FOL, we begin with propositional logic A logic involves: §Language (with a syntax) §Semantics §Proof.
ARTIFICIAL INTELLIGENCE Lecture 2 Propositional Calculus.
1 Section 6.2 Propositional Calculus Propositional calculus is the language of propositions (statements that are true or false). We represent propositions.
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
Logical Agents ECE457 Applied Artificial Intelligence Spring 2008 Lecture #6.
1 Georgia Tech, IIC, GVU, 2006 MAGIC Lab Rossignac Lecture 01: Boolean Logic Sections 1.1 and 1.2 Jarek Rossignac.
1 Section 7.1 First-Order Predicate Calculus Predicate calculus studies the internal structure of sentences where subjects are applied to predicates existentially.
Logics for Data and Knowledge Representation ClassL (part 1): syntax and semantics.
March 3, 2016Introduction to Artificial Intelligence Lecture 12: Knowledge Representation & Reasoning I 1 Back to “Serious” Topics… Knowledge Representation.
Artificial Intelligence Logical Agents Chapter 7.
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
ECE457 Applied Artificial Intelligence Fall 2007 Lecture #6
Propositional Logic (a.k.a. Sentential Logic)
Chapter 7. Propositional and Predicate Logic
tautology checking continued
Propositional Calculus: Boolean Functions and Expressions
Knowledge Representation and Reasoning
Logics for Data and Knowledge Representation
Propositional Calculus: Boolean Functions and Expressions
Propositional Calculus: Boolean Algebra and Simplification
Elementary Metamathematics
Chapter 1 The Foundations: Logic and Proof, Sets, and Functions
Logics for Data and Knowledge Representation
Logics for Data and Knowledge Representation
CS 270 Math Foundations of CS
Back to “Serious” Topics…
PROPOSITIONAL LOGIC - SYNTAX-
Logics for Data and Knowledge Representation
CSE 321 Discrete Structures
Chapter 7. Propositional and Predicate Logic
Chapter 3: Selection Structures: Making Decisions
Presentation transcript:

CSE Winter 2008 Introduction to Program Verification January 24 tautology checking, take 2

terms -- review due date for exercise set 1: Feb. 11 term = labelled tree all these are terms: P implies Q, -w, z(1,q)!, 2+6*z a or f(b), x ≤ y - z true, ‘true’, ‘this is true’ label of the root = functor

term notation any term can be written in functional notation: f(arg1,..) root = function name subtrees = args if the functor is a logical or arithmetic operation, the term can be written with operator notation. Example: +(+(a, b), c) = a + b + c

interpreting terms terms, in general, are uninterpreted; they have no values but some terms can be interpreted as a function and evaluated e. g. the term 1+ 1 can be evaluated to 2 A+A can be evaluated if A is given a value

tautology program requires logical variables to be actual Prolog variables which are assigned truth-values in the testing for falsity. variable name begins with upper-case letter wang requires logical variables to be terms name begins with lower-case letter, or is quoted

semantics vs syntax the tautology algorithm (checking the truth table) operates on the semantics of Boolean logic what the Boolen functions evaluate to wang operates syntactically, which allows greater expressivity in the input

Exercise 3.2: English to logic again Let A  B represent “If the car has gas, then I can go to the store.”; B  C  D represents “If I can go to the store and I have money, then I can buy food.”; (D  (E  F))  G represents “If I have food and either the sun is shining or I have an umbrella, then today I can go on a picnic.” If the above formulae are true, and the car has gas, and I have money and an umbrella, can I go on a picnic? (('the car has gas' implies 'I can go to the store') and ('I can go to the store' and 'I have money' implies 'I can buy food') and (... implies 'I can go on a picnic') and 'the car has gas' and 'I have money' and 'I have an umbrella' implies 'I can go on a picnic'.

exercises 3.1, : x equals 0 if it is not less than 0, unless it is greater than : "Portia's caskets" two caskets; one of gold and one of silver. Which contains Portia's portrait? On the Gold casket: "The portrait is not in here." Silver: "Exactly one of the inscriptions is true."

convert to terms 'Silver inscription is true' 'Gold inscription is true' 'portrait is in Gold' 'portrait is in Silver'.

tie the facts together with logic premises? Describe what is known about the situation : 'Gold inscription is true' iff not 'portrait is in Gold' and 'Silver inscription is true' iff (('Silver inscription is true' or 'Gold inscription is true') and not ('Silver inscription is true' and 'Gold inscription is true') and 'portrait is in Gold' xor 'portrait is in Silver'. All this implies 'portrait is in Gold'.

sequents to understand Wang's algorithm, we need another way of structuring propositions sequent: represent an implication L implies R by a pair of lists: L >> R L and R are sets of terms. L represents the conjunction of its elements R represents the disjunction of its elements

examples p and q implies r or p sequent: {p, q} >> {r, p} what's the sequent for an arbitrary proposition P ? sequent: {true} >> {P} = {} >> {P} — why? (what is the truth-value of the empty conjunct?)

{P} >> {false} = P implies false = not P why is {P} >> {false} = {P} >> {}? (what is the truth-value of the empty disjunct?)

testing a sequent when is a sequent a tautology? when left-side and right-side overlap (p and...) implies (p or...)

how wang works use rewrite rules (p.29) to eliminate logical operators from the sequent, or split sequent into 2 shorter sequents any sequent (input) or generated with left- right overlap is a tautology any sequent with no logical operators and no overlap is not a tautology (why?) hint: treat non-logical terms as Boolean variables

so Wang's algorithm is data-driven, and rule-based why is termination guaranteed? why is it correct ? I. e., why does computing a valid/invalid sequent guarantee that the input proposition is valid or invalid?