Foundations of Logic Programming

Similar documents
Logic (3A) Young W. Lim 12/5/13

Marie Duží

Přednáška 12. Důkazové kalkuly Kalkul Hilbertova typu. 11/29/2006 Hilbertův kalkul 1

Informal Statement Calculus

Propositional Logic Language

Logic (3A) Young W. Lim 10/29/13

Logic (3A) Young W. Lim 11/2/13

Logic (3A) Young W. Lim 10/31/13

Advanced Topics in LP and FP

University of Aberdeen, Computing Science CS2013 Predicate Logic 4 Kees van Deemter

Strong AI vs. Weak AI Automated Reasoning

Propositional and Predicate Logic - XIII

Intelligent Agents. First Order Logic. Ute Schmid. Cognitive Systems, Applied Computer Science, Bamberg University. last change: 19.

Propositional Reasoning

An Intuitively Complete Analysis of Gödel s Incompleteness

6.825 Techniques in Artificial Intelligence. Logic Miscellanea. Completeness and Incompleteness Equality Paramodulation

Deductive Systems. Lecture - 3

Logic. Knowledge Representation & Reasoning Mechanisms. Logic. Propositional Logic Predicate Logic (predicate Calculus) Automated Reasoning

Advanced Topics in LP and FP

Propositional and Predicate Logic - V

Section Summary. Predicate logic Quantifiers. Negating Quantifiers. Translating English to Logic. Universal Quantifier Existential Quantifier

Lecture 11: Gödel s Second Incompleteness Theorem, and Tarski s Theorem

Prolog. Resolution (for beginners?) Resolution (cont.) Resolution (cont.) Unification. Resolution (still cont.) Resolution & Unification

Predicate Logic - Undecidability

Logical reasoning - Can we formalise our thought processes?

Temporal Logic - Soundness and Completeness of L

ICS141: Discrete Mathematics for Computer Science I

Propositional Logic Not Enough

(Refer Slide Time: 02:20)

CSC384: Intro to Artificial Intelligence Knowledge Representation II. Required Readings: 9.1, 9.2, and 9.5 Announcements:

by Yurii Khomskii There is a weaker notion called semi-representability:

Discrete Mathematics and Its Applications

COMP9414: Artificial Intelligence Propositional Logic: Automated Reasoning

Logic - recap. So far, we have seen that: Logic is a language which can be used to describe:

PROOFS IN PREDICATE LOGIC AND COMPLETENESS; WHAT DECIDABILITY MEANS HUTH AND RYAN 2.3, SUPPLEMENTARY NOTES 2

Introduction to Isabelle/HOL

3 Propositional Logic

First order Logic ( Predicate Logic) and Methods of Proof

Propositional Logic: Review

SOCRATES DID IT BEFORE GÖDEL

First-Order Logic First-Order Theories. Roopsha Samanta. Partly based on slides by Aaron Bradley and Isil Dillig

GÖDEL S THEOREM IS INVALID

23.1 Gödel Numberings and Diagonalization

Warm-Up Problem. Is the following true or false? 1/35

Chapter 7 R&N ICS 271 Fall 2017 Kalev Kask

Proofs: A General How To II. Rules of Inference. Rules of Inference Modus Ponens. Rules of Inference Addition. Rules of Inference Conjunction

Propositional Resolution

COMP9414: Artificial Intelligence First-Order Logic

Gödel s Incompleteness Theorems

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

Artificial Intelligence Chapter 7: Logical Agents

Examples: P: it is not the case that P. P Q: P or Q P Q: P implies Q (if P then Q) Typical formula:

Propositional Logic: Models and Proofs

SLD-Resolution And Logic Programming (PROLOG)

What are the recursion theoretic properties of a set of axioms? Understanding a paper by William Craig Armando B. Matos

Prolog and Logic Programming. CS152 Chris Pollett Dec. 3, 2008.

CogSysI Lecture 8: Automated Theorem Proving

3. The Logic of Quantified Statements Summary. Aaron Tan August 2017

Logic Programming (PLP 11) Predicate Calculus, Horn Clauses, Clocksin-Mellish Procedure

Propositional Resolution Introduction

Propositional natural deduction

Lecture Notes on Logic Programming

COMP 182 Algorithmic Thinking. Proofs. Luay Nakhleh Computer Science Rice University

MAI0203 Lecture 7: Inference and Predicate Calculus

Convert to clause form:

Propositional Logic. Logic. Propositional Logic Syntax. Propositional Logic

Argument. whenever all the assumptions are true, then the conclusion is true. If today is Wednesday, then yesterday is Tuesday. Today is Wednesday.

Introduction to Metalogic

LING 501, Fall 2004: Quantification

Chapter 16. Logic Programming. Topics. Logic Programming. Logic Programming Paradigm

Last Time. Inference Rules

Example. Lemma. Proof Sketch. 1 let A be a formula that expresses that node t is reachable from s

Deliberative Agents Knowledge Representation I. Deliberative Agents

Outline. Logical Agents. Logical Reasoning. Knowledge Representation. Logical reasoning Propositional Logic Wumpus World Inference

Propositional Logic: Part II - Syntax & Proofs 0-0

6. Logical Inference

Lecture Notes on Logic Programming

Resolution and Refutation

On some Metatheorems about FOL

Mathematics 114L Spring 2018 D.A. Martin. Mathematical Logic

The only sets are the empty set and those made by adjoining something to a set: s: Set(s) s = Ø x, s 2 : Set(s 2 ) s = { x s 2 }.

ILP = Logic, CS, ML Stop counting, start reasoning

Cogito ergo sum non machina!

First Order Logic: Syntax and Semantics

First-Order Theorem Proving and Vampire. Laura Kovács (Chalmers University of Technology) Andrei Voronkov (The University of Manchester)

Classical Propositional Logic

Proofs. Joe Patten August 10, 2018

CS1021. Why logic? Logic about inference or argument. Start from assumptions or axioms. Make deductions according to rules of reasoning.

An Early (1971) Conversation. Logic Programming (PLP 11.3) Horn Clauses Introduction to Prolog: Resolution, Unification.

Computational Logic. Recall of First-Order Logic. Damiano Zanardini

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

Introduction to Metalogic

CSCI.6962/4962 Software Verification Fundamental Proof Methods in Computer Science (Arkoudas and Musser) Chapter p. 1/33

Peano Arithmetic. CSC 438F/2404F Notes (S. Cook) Fall, Goals Now

Lecture 14 Rosser s Theorem, the length of proofs, Robinson s Arithmetic, and Church s theorem. Michael Beeson

Deduction by Daniel Bonevac. Chapter 3 Truth Trees

Predicate Logic 1. The Need for Predicate Logic. The Need for Predicate Logic. The Need for Predicate Logic. The Need for Predicate Logic

Propositional Logic. Fall () Propositional Logic Fall / 30

7.5.2 Proof by Resolution

Resolution (14A) Young W. Lim 8/15/14

Transcription:

Foundations of Logic Programming Deductive Logic e.g. of use: Gypsy specifications and proofs About deductive logic (Gödel, 1931) Interesting systems (with a finite number of axioms) are necessarily either: incomplete (there are statements that can't be proven) or inconsistent ( S such that S and S can be proven true) Interesting systems include Presberger Arithmetic (0,1,*,+) and Peano Arithmetic (0,1,+) Recall: all inconsistent systems are complete

First Order Predicate Logic Logic programming is based on FOPL FOPL is complete (J.A. Robinson & resolution theorem proving) "All clauses logically implied by an initial formula may be derived from the initial formula by the proof method." BUT FOPL is undecidable An attempt to prove a formula may go on forever, but there will be no indication when to stop without sacrificing formulae that can be proven. completeness of FOPL is of theoretical interest, but of limited practicality. (completeness is predicated on there being a search strategy that knows when to stop a particular unproductive line of deduction.) Higher order predicate logics (and calculi) - ones which allow predicates of predicates - are not complete. Foundations of Logic Programming Logic programming is based on Horn Clauses In the propositional calculus all formulae can be put in conjunctive normal form (disjuncts connected by ) Each disjunct can be expressed as: A 1 A 2... A m B 1 B 2... B n A 1 A 2... A m (B 1 B 2... B n ) A 1 A 2... A m (B 1 B 2... B n ) interpretations: m > 1 Conclusions are indefinite, one or more are true. m = 1 Horn clauses. m = 1, n > 0 (A B 1 B 2... B n ) -- definite clause, 1 conclusion m = 1, n = 0 (A ) unconditional definite clause (fact) m = 0, n > 0 negation of (B 1 B 2... B n ) m = 0, n = 0 the empty clause (contradiction) In logic, all clauses can be represented as Horn Clauses...

Proof by Refutation An important proof method: P: set of axioms Q: clause to be proven show P Q is false by deriving a contradiction i.e., assert Q and try to derive empty clause, which represents false. In this context, Q is called a goal. Propositional Horn Clause Resolution (PHC Resolution) In doing a refutation proof, the following general PHC resolution step can be performed: A 1 (B 1 B 2... B n ) A 1 A 2... A m (B 1 B 2... B n ) A 2... A m Keep applying this until is achieved. e.g. to prove A 2 More PHC Resolution (1) A 1 (2) A 2 A 1, A 3 (3) A 3 (4) A 2 -- negated goal proof leading to contradiction: (5) A 1, A 3 -- apply 2 & 4 (6) A 3 -- apply 1 & 5 (7) -- apply 3 & 6 Note: Prolog and other logic-based languages are based on this resolution proof strategy.

First Order Predicate Logic Predicates can have arguments: constants, variables, other functional terms. e.g. (1) a(x) m(x) (2) m(x) e(x) (3) e(c) (4) a(x) s(x) (5) s(b) (6) a(x) When we start dealing with variables, we need: Axiom of General Specification: A clause with logical variables is true for every set of values of the variables. Supports generalizing PHC resolution into Horn Clause Resolution (HCR) by systematically instantiating variables. "Unification e.g. 1) p(t) FOPL (cont) 2) q(x) p(x) 3) q(t) 4) q(t) p(t) (X = t) -- from (2), (3) and substitution 5) p(t) -- from (3) & (4) 6) -- from (1) and (5) resolution is combination of unification and elimination in one operation.

More Proofs Using: (1) a(x) m(x) (2) m(x) e(x) (3) e(c) (4) a(x) s(x) (5) s(b) (6) a(x) with goal a(x) (step (6)), we can derive: (7) m(x) -- applying (1) & (6) (8) e(x) -- applying (2) & (7) (9) X = c -- applying (3) & (8) also: (10) s(x) -- applying (4) & (6) (11) X = b -- applying (5) & (10) Alternative Proof Strategies Top Down: what we've just seen - collecting variable bindings. Start with goal and reduce into subgoals until there is only the empty subgoal. Bottom up: Combining facts with rules or rules with other rules.

Bottom Up Using: (1) a(x) m(x) (2) m(x) e(x) (3) e(c) (4) a(x) s(x) (5) s(b) (6) a(x) Combine rule (2) m(x) e(x) -- combining with fact (3) e(c) -- rule with yielding: m(c) -- a fact yields combined with rule (1) a(x) m(x) -- a new yields: a(c) -- fact or Combine rule (1) a(x) m(x) -- combining rules with rule (2) m(x) e(x) -- to make a new yields: a(x) e(x) -- rule -- allows us to make discoveries from known facts and rules. Closed World Assumption Inabilty to demonstrate that something is true means that it is false. assumes user made no typos and specified all things that need to be specified to properly identify true queries as true. leads to joining "unknown" and "not provably true" into one class. failing to prove something true leads to conclusion that it is false. CWA says that all things that are true have been specified as such or can be derived.

Closed World Assumption (2) Possible alternatives: (1) leave system alone; accept CWA (2) allow negation in clauses but not in conclusion of Horn Clauses (3) allow statement of negative conclusions: search positive; search negative; report unknown; (4) work in constrained environment where everything is known (5) work in statistical environment where answers are expressed in terms of likelihoods. About Prolog Prolog lends itself nicely to concurrency form: p0 :- p1, p2, p3, p4 ^---^---^---^---- can be executed concurrently(with communications about bindings) -- "AND parallelism" or: HG :-... { HG :-... { "OR... { parallelism" HG :-... {

About Prolog (2) Prolog and principles: Orthogonal - separates logic and control (assert, retract and cut violate this) regular - regular rules security - meaning of a program is determined by what a user writes <> simplicity - simple rules violates: localized cost - execution cost is determined by rule order defense in depth - misspellings alter meaning of program