Computational Logic. Davide Martinenghi. Spring Free University of Bozen-Bolzano. Computational Logic Davide Martinenghi (1/30)

Similar documents
Propositional Logic Language

Part 1: Propositional Logic

Propositional Logic: Gentzen System, G

3 Propositional Logic

Deductive Systems. Lecture - 3

Propositional Logic: Models and Proofs

Decision Procedures for Satisfiability and Validity in Propositional Logic

Foundations of Artificial Intelligence

Propositional Reasoning

LOGIC PROPOSITIONAL REASONING

Propositional and Predicate Logic - V

Propositional Logic: Evaluating the Formulas

Logic and Inferences

The Calculus of Computation: Decision Procedures with Applications to Verification. Part I: FOUNDATIONS. by Aaron Bradley Zohar Manna

Description Logics. Deduction in Propositional Logic. franconi. Enrico Franconi

Classical Propositional Logic

Propositional and First Order Reasoning

Propositional Resolution

COMP219: Artificial Intelligence. Lecture 20: Propositional Reasoning

Mathematical Logic Propositional Logic - Tableaux*

Formal Verification Methods 1: Propositional Logic

7. Propositional Logic. Wolfram Burgard and Bernhard Nebel

Clause/Term Resolution and Learning in the Evaluation of Quantified Boolean Formulas

Foundations of Artificial Intelligence

CS156: The Calculus of Computation

Foundations of Artificial Intelligence

Introduction to Artificial Intelligence Propositional Logic & SAT Solving. UIUC CS 440 / ECE 448 Professor: Eyal Amir Spring Semester 2010

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Part 1: Propositional Logic

Propositional Calculus - Semantics (3/3) Moonzoo Kim CS Dept. KAIST

6. Logical Inference

Computational Logic Chapter 2. Propositional Logic

Resolution In Propositional Logic

Propositional and Predicate Logic. jean/gbooks/logic.html

Reduced Ordered Binary Decision Diagrams

2.5.2 Basic CNF/DNF Transformation

Computation and Logic Definitions

Title: Logical Agents AIMA: Chapter 7 (Sections 7.4 and 7.5)

SAT Solvers: Theory and Practice

Propositional Logic: Methods of Proof. Chapter 7, Part II

Solvers for the Problem of Boolean Satisfiability (SAT) Will Klieber Aug 31, 2011

Propositional Logic: Methods of Proof (Part II)

Proof Methods for Propositional Logic

Lecture Notes on SAT Solvers & DPLL

Propositional logic. Programming and Modal Logic

Logic: First Order Logic

Version January Please send comments and corrections to

Propositional Logic. Methods & Tools for Software Engineering (MTSE) Fall Prof. Arie Gurfinkel

Chapter 11: Automated Proof Systems (1)

Chapter 11: Automated Proof Systems

A brief introduction to Logic. (slides from

CHAPTER 10. Gentzen Style Proof Systems for Classical Logic

WHAT IS AN SMT SOLVER? Jaeheon Yi - April 17, 2008

02 Propositional Logic

A Resolution Method for Modal Logic S5

Propositional Resolution

Propositional Logic: Methods of Proof (Part II)

1 Efficient Transformation to CNF Formulas

Lecture 10: Gentzen Systems to Refinement Logic CS 4860 Spring 2009 Thursday, February 19, 2009

Duality in Knowledge Compilation Techniques

Logic: Propositional Logic (Part I)

Propositional Resolution Part 1. Short Review Professor Anita Wasilewska CSE 352 Artificial Intelligence

Inference Methods In Propositional Logic

Foundations of Artificial Intelligence

Topics in Model-Based Reasoning

Agenda. Artificial Intelligence. Reasoning in the Wumpus World. The Wumpus World

Chapter 3: Propositional Calculus: Deductive Systems. September 19, 2008

Introduction to Logic in Computer Science: Autumn 2006

On Sequent Calculi for Intuitionistic Propositional Logic

Introduction to Artificial Intelligence. Logical Agents

EE562 ARTIFICIAL INTELLIGENCE FOR ENGINEERS

Induction on Failing Derivations

Natural Deduction. Formal Methods in Verification of Computer Systems Jeremy Johnson

The Wumpus Game. Stench Gold. Start. Cao Hoang Tru CSE Faculty - HCMUT

Inference Methods In Propositional Logic

CS156: The Calculus of Computation Zohar Manna Autumn 2008

CS 380: ARTIFICIAL INTELLIGENCE

COMP3702/7702 Artificial Intelligence Week 5: Search in Continuous Space with an Application in Motion Planning " Hanna Kurniawati"

First-Order Theorem Proving and Vampire

Intelligent Agents. Pınar Yolum Utrecht University

Logical Inference. Artificial Intelligence. Topic 12. Reading: Russell and Norvig, Chapter 7, Section 5

Tutorial 1: Modern SMT Solvers and Verification

Logic: Propositional Logic Truth Tables

Logical Agents. Chapter 7

Kecerdasan Buatan M. Ali Fauzi

Knowledge base (KB) = set of sentences in a formal language Declarative approach to building an agent (or other system):

Propositional Resolution Introduction

Introduction to Logic in Computer Science: Autumn 2007

Syntax of FOL. Introduction to Logic in Computer Science: Autumn Tableaux for First-order Logic. Syntax of FOL (2)

Normal Forms of Propositional Logic

Comp487/587 - Boolean Formulas

Developing Modal Tableaux and Resolution Methods via First-Order Resolution

Propositional Calculus - Deductive Systems

On the Complexity of the Reflected Logic of Proofs

Language of Propositional Logic

Foundations of Artificial Intelligence

Propositional Logic. Testing, Quality Assurance, and Maintenance Winter Prof. Arie Gurfinkel

CS 380: ARTIFICIAL INTELLIGENCE PREDICATE LOGICS. Santiago Ontañón

Chapter 3 Deterministic planning

Class Assignment Strategies

Transcription:

Computational Logic Davide Martinenghi Free University of Bozen-Bolzano Spring 2010 Computational Logic Davide Martinenghi (1/30)

Propositional Logic - sequent calculus To overcome the problems of natural deduction, Gentzen introduced sequent calculus In sequent calculus, assumptions are replaced by conditions A sequent is an expression of the form F G, where F (the antecedent) and G (the succedent) are multisets of propositional formulas Informally, this means that under hypotheses F at least one of the formulas in G is provable Inference rules are of the form S 1... S n r S where S i, n 0 are sequents called conditions, S is a sequent called conclusion, and r is the name of the rule Computational Logic Davide Martinenghi (2/30)

Propositional Logic - sequent calculus In contrast to natural deduction, sequent calculus contains only introduction rules for each connective; but one on the left- and another on the right-hand side of There are also some structural rules and one axiom Computational Logic Davide Martinenghi (3/30)

Propositional Logic - sequent calculus Axiom and Structural Rules H, F G, H axiom F G, H H, F G F G cut H, H, F G H, F G CL F G, H, H F G, H CR Computational Logic Davide Martinenghi (4/30)

Propositional Logic - sequent calculus Logical Rules F G, H 1 H 2, F G (H 1 H 2 ), F G L H 1, F G, H 2 F G, (H 1 H 2 ) R H 1, H 2, F G (H 1 H 2 ), F G L F G, H 1 F G, H 2 F G, (H 1 H 2 ) R H 1, F G H 2, F G (H 1 H 2 ), F G L F G, H 1, H 2 F G, (H 1 H 2 ) R F G, H H, F G L H, F G F G, H R Computational Logic Davide Martinenghi (5/30)

Propositional Logic - sequent calculus A proof of a sequent S is inductively defined as follows: An axiom S is a proof If T1,..., T n are proofs of S 1,..., S n, respectively, and there is an instance of an inference rule of the form then the following is a proof S 1,..., S n S T 1,..., T n S Computational Logic Davide Martinenghi (6/30)

Propositional Logic - sequent calculus Example of proofs in the sequent calculus axiom F F R F, F R (F F) axiom axiom A, (C D) B, A B, A, (C D) B L A, (A B), (C D) B Computational Logic Davide Martinenghi (7/30)

Propositional Logic - sequent calculus Theorem Propositional sequent calculus is sound and complete Cut is the only rule in which the condition contains a formula which does not occur in the conclusion From a proof search point of view, this is not desirable Fortunately, Gentzen showed in his main theorem (Hauptsatz) that the cut rule is admissible, i.e., that applications of the cut rule can be eliminated On the other hand, lemmas may shorten proofs considerably Intelligent and domain-dependent heuristics for using lemmas are necessary for guiding automatic theorem provers Computational Logic Davide Martinenghi (8/30)

Propositional logic - DPLL Historically, the first implementation of an algorithm for deciding whether a propositional formula is unsatisfiable was by Paul Gilmore in 1960; he used the so-called quantification method which turned out to be inefficient Martin Davis and Hilary Putnam introduced a more efficient method also in 1960; it was then significantly improved by G. Logemann and Donald Loveland, so it is called DPLL procedure It is a negative calculus for showing unsatisfiability of a formula Computational Logic Davide Martinenghi (9/30)

Propositional logic - DPLL DPLL Procedure Input: a propositional formula F in CNF Output: yes if it is unsatisfiable; no otherwise If F contains the empty clause, then terminate with yes If none of the following rules is applicable, then terminate with no Tautology: a clause is removed if it contains a pair of complementary atoms A and A Pure Literal: a clause is removed if it contains a literal L, and F does not contain an occurrence of the complementary literal L Unit Clause: remove literal L in a clause if F contains { L} Subsumption: remove clauses that are supersets of other clauses in F Splitting: if F is of the form (G 1 L)... (G m L) (H 1 L)... (H n L) G with L and L not occurring in G i, H j, G, replace F by the CNF of (G 1... G m G) (H 1... H n G) Computational Logic Davide Martinenghi (10/30)

Propositional logic - DPLL Example of DPLL application F = {{A, B, C}, {A, B}, { A}, {C}, {D}} {{A, B, C}, {A, B}, { A}, {C}, {D}} unit clause {{B, C}, {A, B}, { A}, {C}, {D}} unit clause {{B, C}, { B}, { A}, {C}, {D}} pure literal {{B, C}, { B}, {C}, {D}} unit clause {{B}, { B}, {C}, {D}} unit clause {{}, { B}, {C}, {D}} termination rule F is unsatisfiable Computational Logic Davide Martinenghi (11/30)

Propositional logic - DPLL Theorem The DPLL procedure is sound and complete Computational Logic Davide Martinenghi (12/30)

Propositional logic - semantic tableaux Semantic tableaux are another tool to show logical entailment by showing unsatisfiability of the negated formula So it is a negative calculus In order to simplify the presentation, we assume that the connectives and have already been removed from the input formula A tableau is a tree whose nodes are labeled with formulas; the root of the tree is labeled with the formula to be shown unsatisfiable Each branch represents the conjunction of all formulas appearing in it; the tableau represents the disjunction of all its branches Then a formula in a tableau is unsatisfiable iff all its branches are unsatisfiable; this means that each branch contains a formula and its negation (i.e., it is a closed branch) Computational Logic Davide Martinenghi (13/30)

Propositional logic - semantic tableaux Example of a tableau A B (C A) Computational Logic Davide Martinenghi (14/30)

Propositional logic - semantic tableaux Tableaux construction rules 1. Start with a single node labeled with the formula 2. If a branch contains G, then expand the branch with a new node G 3. If a branch contains G 1 G 2, then expand the branch with two new nodes G 1 and G 2 4. If a branch contains (G 1 G 2 ), then add a left and right child G 1 and G 2 to the last node of the branch 5. If a branch contains G 1 G 2, then add a left and right child G 1 and G 2 to the last node of the branch 6. If a branch contains (G 1 G 2 ), then expand the branch with two new nodes G 1 and G 2 Computational Logic Davide Martinenghi (15/30)

Propositional logic - semantic tableaux Example of tableau construction ( (C ((D E) ( E P))) (C (D P))) Computational Logic Davide Martinenghi (16/30)

Propositional logic - semantic tableaux Tableaux proofs can be significantly shorter than proofs by truth tabling Theorem The propositional tableaux method is sound and complete Computational Logic Davide Martinenghi (17/30)

Propositional logic - resolution To overcome the inefficiency of previous calculi in proving unsatisfiability of FOL formulas, in 1965 J. Alan Robinson developed the resolution principle If {L, L 1,..., L n } and { L, K 1,..., K m } are two clauses, then {L 1,..., L n, K 1,..., K m } is their resolvent If C 1 and C 2 are two clauses with resolvent C, then, as Robinson showed, C is a logical consequence of {C 1, C 2 } The resolution principle can be repeatedly used on initial clauses and their resolvents to show unsatisfiability until either the empty clause is reached, or no more resolution steps are possible Computational Logic Davide Martinenghi (18/30)

Propositional logic - resolution A deduction of a clause C from F in CNF is a finite sequence of clauses C 1,..., C n = C such that each C i is either a clause in F, or a resolvent from previous C k, C j, with j, k < i A deduction of the empty clause from F is called a refutation Whenever this happens, F is unsatisfiable Theorem Resolution calculus for propositional logic is sound and refutation-complete i.e., F is unsatisfiable iff there is a refutation for F. Resolution is not complete in the standard sense. Computational Logic Davide Martinenghi (19/30)

Propositional Logic - BDDs There is another normal form which is important in the field of hardware design and hardware verification It is possible to check validity of CNF formulas in polynomial time, while it may take exponential time to check satisfiability The opposite is true for DNFs: easy satisfiability, hard tautology No conversion between normal forms is feasible Binary decision diagrams (BDD) are interesting because efficient algorithms exist for both satisfiability and tautology The if-then-else connective is defined as follows A F, G := (A F) ( A G) where A is a proposition, and F, G are formulas Computational Logic Davide Martinenghi (20/30)

Propositional Logic - BDDs It is possible to express all propositional connectives only with, and A is equivalent to A, A formula is said to be in if-then-else normal form if it is built only using,, Let F[A/ ] (F[A/ ]) denote the formula F in which every occurrence of proposition A is replaced by ( ) Then F A F[A/ ], F[A/ ], which is called the Shannon expansion of F The right-hand side formulas of the Shannon expansion of F have one proposition less than F The if-then-else normal form is obtained by iterating this transformation for all propositions in a formula until no Shannon expansion is possible Computational Logic Davide Martinenghi (21/30)

Propositional Logic - BDDs Binary decision trees A binary decision tree is defined inductively as follows: and are binary decision trees If T1 and T 2 are binary decision trees and p is a propositional variable, then p : (T 1, T 2 ) is a binary decision tree T 1 is the then branch T 2 is the else branch if-then-else normal forms can be seen as binary decision trees Computational Logic Davide Martinenghi (22/30)

Propositional Logic - BDDs Example of binary decision tree (P 1 Q 1 ) (P 2 Q 2 ) Computational Logic Davide Martinenghi (23/30)

Propositional Logic - BDDs A closer look reveals that some expressions or subtrees are identical To avoid this redundancy, we define binary decision diagram as a rooted, directed acyclic graph obtained from a binary decision tree in which all common subtrees are identified A BDD is ordered if the variables in each branch appear in the same order Ordered BDDs may still contain redundancies since there may be then and else branches both leading to the same node A BDD is reduced if no two nodes have the same variable name and then and else successors no node has identical then and else successors Reduced BDDs are compact representations of propositional formulas for which efficient algorithms are known for performing various logical operations on them Computational Logic Davide Martinenghi (24/30)

Propositional Logic - BDDs Example of reduced BDD (P 1 Q 1 ) (P 2 Q 2 ) Computational Logic Davide Martinenghi (25/30)