tautology checking continued

Slides:



Advertisements
Similar presentations
Introducing Formal Methods, Module 1, Version 1.1, Oct., Formal Specification and Analytical Verification L 5.
Advertisements

Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara
Goals Determine the true value of statements with AND, OR, IF..THEN. Negate statements with the connectives above Construct truth tables Understand when.
CSE Winter 2008 Introduction to Program Verification January 24 tautology checking, take 2.
ISBN Chapter 3 Describing Syntax and Semantics.
Describing Syntax and Semantics
The Language of Propositional Logic The Syntax and Semantics of PL.
Propositional Equivalence Goal: Show how propositional equivalences are established & introduce the most important such equivalences.
Adapted from Discrete Math
Discrete Mathematics Goals of a Discrete Mathematics Learn how to think mathematically 1. Mathematical Reasoning Foundation for discussions of methods.
Intro to Discrete Structures
DEDUCTIVE DATABASE.
Declarative vs Procedural Programming  Procedural programming requires that – the programmer tell the computer what to do. That is, how to get the output.
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Barnett/Ziegler/Byleen Finite Mathematics 11e1 Chapter 7 Review Important Terms, Symbols, Concepts 7.1. Logic A proposition is a statement (not a question.
Propositional Calculus CS 270: Mathematical Foundations of Computer Science Jeremy Johnson.
3.2 Semantics. 2 Semantics Attribute Grammars The Meanings of Programs: Semantics Sebesta Chapter 3.
Programming Languages and Design Lecture 3 Semantic Specifications of Programming Languages Instructor: Li Ma Department of Computer Science Texas Southern.
CSE Winter 2008 Introduction to Program Verification January 31 proofs through simplification.
1 Introduction to Abstract Mathematics Expressions (Propositional formulas or forms) Instructor: Hayk Melikya
CS6133 Software Specification and Verification
CSE Winter 2008 Introduction to Program Verification January 15 tautology checking.
1 Propositional Logic: Fundamental Elements for Computer Scientists 0. Motivation for Computer Scientists 1. Propositions and Propositional Variables 2.
CSE Winter 2008 Introduction to Program Verification for-loops; review.
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.
CSE 425: Functional Programming I Programs as Functions Some programs act like mathematical functions –Associate a set of input values from the function’s.
CSE Winter 2008 Introduction to Program Verification February 5 calculating with simplify.
Propositional Logic. Assignment Write any five rules each from two games which you like by using propositional logic notations.
CS-7081 Application - 1. CS-7082 Example - 2 CS-7083 Simplifying a Statement – 3.
CENG 424-Logic for CS Introduction Based on the Lecture Notes of Konstantin Korovin, Valentin Goranko, Russel and Norvig, and Michael Genesereth.
CSE 20: Discrete Mathematics for Computer Science Prof. Shachar Lovett.
Chapter 1 Logic and Proof.
Chapter 1 Propositional Logic
Introduction to Deductive Proofs
Propositional Logic.
Propositional Equivalence
Computer Science cpsc322, Lecture 20
Propositional Calculus: Boolean Functions and Expressions
Representation, Syntax, Paradigms, Types
Introduction to Algebra
COMPUTING FUNDAMENTALS
Propositional Calculus: Boolean Functions and Expressions
Propositional Calculus: Boolean Algebra and Simplification
Administrivia Course Web:
1.2 Propositional Equivalences
Chapter 1 The Foundations: Logic and Proof, Sets, and Functions
Logics for Data and Knowledge Representation
Representation, Syntax, Paradigms, Types
Representation, Syntax, Paradigms, Types
Back to “Serious” Topics…
Computer Security: Art and Science, 2nd Edition
The Logic of Declarative Statements
Discrete Mathematics CMP-200 Propositional Equivalences, Predicates & Quantifiers, Negating Quantified Statements Abdul Hameed
CSE 321 Discrete Structures
1.2 Propositional Equivalences
Boolean Expressions to Make Comparisons
Representation, Syntax, Paradigms, Types
Computer Science cpsc322, Lecture 20
TRUTH TABLES.
This Lecture Substitution model
1.2 Propositional Equivalences
CPSC 121: Models of Computation
CPSC 121: Models of Computation
Discrete Structures Prepositional Logic 2
Logical and Rule-Based Reasoning Part I
Representations & Reasoning Systems (RRS) (2.2)
Truth tables.
Propositional Satisfiability
Presentation transcript:

tautology checking continued CSE 3341.03 Winter 2008 Introduction to Program Verification January 17 tautology checking continued

Extras > Propositional Logic Questions translating formal logic notations into tautology input examples of problems we can work with using tautology try question 4: r -> (p ^ ~r) translates to what? how could you use tautology to assist with question 6?

translation issues exercise 2.10. how to get started? failure to show that a translation is a tautology may just mean incomplete or faulty analysis of the English e. g. “Either a rose is red or it isn’t. analysis into P or Q, with P = “Either a rose is red” ?? Q = “it isn’t” ??

general vs specific propositions "If the above formulae are true, and the car has gas, and I have money and an umbrella, can I go on a picnic?" Notice how the propositions can be divided into general background statements and facts about a specific situation, which generate an implication check: background and facts implies hypothesis Apply this idea to Exercise 2.12

Ch. 3. descriptive statements using propositional functions with only Boolean variables makes it difficult to construct descriptive statements we always have to set up equations that identify the variables p = “he will come by the 8:15 train” q = “he will come by the 9:15 train”, etc.

terms it would be nice if we could use English phrases or mathematical expressions as the names of variables English examples: 'the car has gas', 'I have money', etc. mathematical expressions: f(x) > 0, . . for this we need a new datatype: a very useful one called a term used in programming languages that support symbolic computation: Lisp, Prolog

terms in mark-up languages recently this datatype has become very important through the development of mark-up languages, particularly HTML & XML. HTML example: <html> <head> <title> . . . </title> </head> <body>. . . page content . . . </body> </html>

term structure a term is a labelled ordered tree every sub-tree has a labelled root the sub-trees of a term are ordered the structure of a term is described in terms of: the functor = label of the root the arity = number of subtrees the list of subtrees = arguments (or just args)

notation for terms general notation for terms uses the form of a function applied to arguments fun(a1, t(a2)) what’s the functor? arity? args? what’s a term of arity 0? numbers, constants like a1, x, 'I have money', etc. what's html's arity in the HTML example?

operators for terms of arity 1 or 2, we can use operators (if defined) arity matters: in - a, - is not the same functor as in b - a my first definition of a functor as the label of the root of a term wasn’t precise. The functor is characterized by both the label and the arity. -/1= negation -/2 = subtraction

terms as propositional functions replace arguments in logical terms by variables and you have a propositional function 0=0 or not 0=0. (a tautology) equal(0, 0) or unequal(0, 0). not a tautology same as P or Q: contingent!

distinction between logical and non-logical terms functor = true/0 or false/0 or logical operation example: f(true(0)) and w('1a',y)

non-logical vs logical terms meaning of a logical term is defined by the logical computations we do with it meanings for non-logical terms will have to be determined by some other computation coming up in Ch. 4

terms vs. functions terms need not be evaluated can be processed purely as symbolic expressions not associated with a value the expression a+a denotes a function, call it twice/1 a+a = twice(a) the function has one argument, but the term has two

wang to handle logical statements involving terms, we use another tautology checker: wang uses a very different algorithm than tautology in computer science, a profusion of equivalent but different algorithms is interesting and important -- definitely not a nuisance to be avoided

terms instead of variables tautology program required 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 functor begins with lower-case letter

semantics vs syntax the tautology algorithm (checking the truth table) operates on the semantics of Boolean logic what the Boolean functions evaluate to wang operates syntactically no evaluation, just syntactic operations such as comparison greater expressivity!

using the wang program 3.3 tells you what you can input to wang terms interpreted as variables begin with lower-case p implies (q implies p). there are other alternatives: ‘It is Monday’ implies ‘It is Monday’. implies(p, implies(q, p)).