The idea of completion In LP one uses “if” but mean “iff” [Clark78] This doesn’t imply that -1 is not a natural number! With this program we mean: This.

Slides:



Advertisements
Similar presentations
C O - INDUCTIVE LOGIC PROGRAMMING AND ITS APPLICATIONS.
Advertisements

Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
SLD-resolution Introduction Most general unifiers SLD-resolution
Logic Programming Automated Reasoning in practice.
Justification-based TMSs (JTMS) JTMS utilizes 3 types of nodes, where each node is associated with an assertion: 1.Premises. Their justifications (provided.
Automated Reasoning Systems For first order Predicate Logic.
1.6 Behavioral Equivalence. 2 Two very important concepts in the study and analysis of programs –Equivalence between programs –Congruence between statements.
1 Logic Logic in general is a subfield of philosophy and its development is credited to ancient Greeks. Symbolic or mathematical logic is used in AI. In.
Inference and Reasoning. Basic Idea Given a set of statements, does a new statement logically follow from this. For example If an animal has wings and.
Closure Properties of CFL's
The coherence principle Generalizing WFS in the same way yields unintuitive results: pacifist(X)  not hawk(X) hawk(X)  not pacifist(X) ¬ pacifist(a)
Ontologies Reasoning Components Agents Simulations Default Reasoning and Negation As Failure in General Logic Programming Jacques Robin.
WFSX programming Prolog programming style, but with the WFSX semantics Requires: –A new proof procedure (different from SLDNF), complying with WFS, and.
Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara
Logic CPSC 386 Artificial Intelligence Ellen Walker Hiram College.
Logic.
Auto-Epistemic Logic Proposed by Moore (1985) Contemplates reflection on self knowledge (auto-epistemic) Permits to talk not just about the external world,
Logic Concepts Lecture Module 11.
1 Semantic Description of Programming languages. 2 Static versus Dynamic Semantics n Static Semantics represents legal forms of programs that cannot be.
Cs774 (Prasad)L7Negation1 Negation by Failure
Formal Logic Proof Methods Direct Proof / Natural Deduction Conditional Proof (Implication Introduction) Reductio ad Absurdum Resolution Refutation.
Introduction to Computability Theory
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
Default and Cooperative Reasoning in Multi-Agent Systems Chiaki Sakama Wakayama University, Japan Programming Multi-Agent Systems based on Logic Dagstuhl.
11 November 2005 Foundations of Logic and Constraint Programming 1 Negation: Declarative Interpretation ­An overview First Order Formulas and Logical Truth.
Auto-Epistemic Logic Proposed by Moore (1985) Contemplates reflection on self knowledge (auto-epistemic) Allows for representing knowledge not just about.
Existential Graphs and Davis-Putnam April 3, 2002 Bram van Heuveln Department of Cognitive Science.
Extended LPs In Normal LPs all the negative information is implicit. Though that’s desired in some cases (e.g. the database with flight connections), sometimes.
Search in the semantic domain. Some definitions atomic formula: smallest formula possible (no sub- formulas) literal: atomic formula or negation of an.
Last time Proof-system search ( ` ) Interpretation search ( ² ) Quantifiers Equality Decision procedures Induction Cross-cutting aspectsMain search strategy.
ASP vs. Prolog like programming ASP is adequate for: –NP-complete problems –situation where the whole program is relevant for the problem at hands èIf.
Complexity ©D.Moshkovitz 1 Paths On the Reasonability of Finding Paths in Graphs.
ASP vs. Prolog like programming ASP is adequate for: –NP-complete problems –situation where the whole program is relevant for the problem at hands èIf.
CSE115/ENGR160 Discrete Mathematics 01/20/11 Ming-Hsuan Yang UC Merced 1.
CSE 311 Foundations of Computing I Lecture 6 Predicate Logic, Logical Inference Spring
Discrete Mathematics and Its Applications
Notes for Chapter 12 Logic Programming The AI War Basic Concepts of Logic Programming Prolog Review questions.
1 Knowledge Based Systems (CM0377) Lecture 12 (Last modified 2nd May 2002)
Proof Systems KB |- Q iff there is a sequence of wffs D1,..., Dn such that Dn is Q and for each Di in the sequence: a) either Di is in KB or b) Di can.
DECIDABILITY OF PRESBURGER ARITHMETIC USING FINITE AUTOMATA Presented by : Shubha Jain Reference : Paper by Alexandre Boudet and Hubert Comon.
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
Steffen Staab Advanced Data Modeling 1 of 32 WeST Häufungspunkte Bifurkation: x n+1 = r x n (1-x n ) Startwert x 0 = 0,25.
Pattern-directed inference systems
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
Propositional Logic Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma Guadalajara
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
EVOlving L ogic P rograms J.J. Alferes, J.A. Leite, L.M. Pereira (UNL) A. Brogi (U.Pisa)
CS Introduction to AI Tutorial 8 Resolution Tutorial 8 Resolution.
ARTIFICIAL INTELLIGENCE [INTELLIGENT AGENTS PARADIGM] Professor Janis Grundspenkis Riga Technical University Faculty of Computer Science and Information.
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.
A Logic of Partially Satisfied Constraints Nic Wilson Cork Constraint Computation Centre Computer Science, UCC.
Automated Reasoning Systems For first order Predicate Logic.
Inverse Entailment in Nonmonotonic Logic Programs Chiaki Sakama Wakayama University, Japan.
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
1 Reasoning with Infinite stable models Piero A. Bonatti presented by Axel Polleres (IJCAI 2001,
Logic: Proof procedures, soundness and correctness CPSC 322 – Logic 2 Textbook §5.2 March 7, 2011.
1 Section 6.2 Propositional Calculus Propositional calculus is the language of propositions (statements that are true or false). We represent propositions.
Logic Program Semantics Background Luís Moniz Pereira U.I. at Jakarta, Jan/Feb 2006 AI Centre, Universidade Nova de Lisboa.
Metalogic Soundness and Completeness. Two Notions of Logical Consequence Validity: If the premises are true, then the conclusion must be true. Provability:
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
October 19th, 2007L. M. Pereira and A. M. Pinto1 Approved Models for Normal Logic Programs Luís Moniz Pereira and Alexandre Miguel Pinto Centre for Artificial.
Knowledge Based Systems
Propositional Logic Russell and Norvig: Chapter 6 Chapter 7, Sections 7.1—7.4 CS121 – Winter 2003.
The Propositional Calculus
Semantics of Datalog With Negation
Logic: Top-down proof procedure and Datalog
Computer Security: Art and Science, 2nd Edition
Negations of quantifiers
Presentation transcript:

The idea of completion In LP one uses “if” but mean “iff” [Clark78] This doesn’t imply that -1 is not a natural number! With this program we mean: This is the idea of Clark’s completion: Syntactically transform if’s into iff’s Use classical logic in the transformed theory to provide the semantics of the program ).())(( ).0( NnaturalNNs   )()(:0)(YnNYsXYXX 

Program completion The completion of P is the theory comp(P) obtained by:  Replace p(t)   by p(X)  X = t,   Replace p(X)   by p(X)   Y , where Y are the original variables of the rule  Merge all rules with the same head into a single one p(X)   1  …   n  For every q(X) without rules, add q(X)    Replace p(X)   by  X (p(X)   )

Completion Semantics Though completion’s definition is not that simple, the idea behind it is quite simple Also, it defines a non-classical semantics by means of classical inference on a transformed theory D Let comp(P) be the completion of P where not is interpreted as classical negation:  A is true in P iff comp(P) |= A  A is false in P iff comp(P) |= not A

SLDNF proof procedure By adopting completion, procedurally we have: not is “negation as finite failure” In SLDNF proceed as in SLD. To prove not A: –If there is a finite derivation for A, fail not A –If, after any finite number of steps, all derivations for A fail, remove not A from the resolvent (i.e. succeed not A) SLDNF can be efficiently implemented (cf. Prolog)

SLDNF example p  p. q  not p. a  not b. b  not c.  a  not b  b  not c  c XX  q  not p  p No success nor finite failure According to completion: –comp(P) |= {not a, b, not c} –comp(P) |  p, comp(P) |  not p –comp(P) |  q, comp(P) |  not q

Problems with completion Some consistent programs may became inconsistent: p  not p becomes p  not p Does not correctly deal with deductive closures edge(a,b).edge(c,d).edge(d,c). reachable(a). reachable(A)  edge(A,B), reachable(B). Completion doesn’t conclude not reachable(c), due to the circularity caused by edge(c,d) and edge(d,c) Circularity is a procedural concept, not a declarative one

Completion Problems (cont) Difficulty in representing equivalencies: bird(tweety). fly(B)  bird(B), not abnormal(B). abnormal(B)  irregular(B) irregular(B)  abnormal(B) Completion doesn’t conclude fly(tweety)! –Without the rules on the left fly(tweety) is true –An explanation for this would be: “the rules on the left cause a loop”. Again, looping is a procedural concept, not a declarative one When defining declarative semantics, procedural concepts should be rejected

Program stratification Minimal models don’t have “loop” problems But are only applicable to definite programs Generalize Minimal Models to Normal LPs: –Divide the program into strata –The 1st is a definite program. Compute its minimal model –Eliminate all nots whose truth value was thus obtained –The 2nd becomes definite. Compute its MM –…

Stratification example Least(P 1 ) = {a, b, not p} Processing this, P 2 becomes: c  true d  c, false Its minimal model, together with P 1 is: {a, b, c, not d, not p} Processing this, P 3 becomes: e  a, true f  false p  p a  b b c  not p d  c, not a e  a, not d f  not c P1P1 P2P2 P3P3 P The (desired) semantics for P is then: {a, b,c, not d, e, not f, not p}

Stratification D Let S 1 ;…;S n be such that S 1 U…U S n = H P, all the S i are disjoint, and for all rules of P: A  B 1,…,B m, not C 1,…,not C k if A  S i then: {B 1,…,B m }  U i j=1 S j {C 1,…,C k }  U i-1 j=1 S j Let P i contain all rules of P whose head belongs to S i. P 1 ;…;P n is a stratification of P

Stratification (cont) A program may have several stratifications: a b  a c  not a P1P1 P2P2 P3P3 P a b  a c  not a P1P1 P2P2 P or Or may have no stratification: b  not a a  not b D A Normal Logic Program is stratified iff it admits (at least) one stratification.

Semantics of stratified LPs D Let I|R be the restriction of interpretation I to the atoms in R, and P 1 ;…;P n be a stratification of P. Define the sequence: M 1 = least(P 1 ) M i+1 is the minimal models of P i+1 such that: M i+1 | (U i j=1 S j ) = M i M n is the standard model of P A is true in P iff A  M n Otherwise, A is false

Properties of Standard Model Let M P be the standard model of stratified P  M P is unique (does not depend on the stratification)  M P is a minimal model of P  M P is supported D A model M of program P is supported iff: A  M   (A  Body)  P : Body  M (true atoms must have a rule in P with true body)

Perfect models The original definition of stratification (Apt et al.) was made on predicate names rather than atoms. By abandoning the restriction of a finite number of strata, the definitions of Local Stratification and Perfect Models (Przymusinski) are obtained. This enlarges the scope of application: even(0) even(s(X))  not even(X) P1= {even(0)} P2= {even(1)  not even(0)}... The program isn’t stratified (even/1 depends negatively on itself) but is locally stratified. Its perfect model is: {even(0),not even(1),even(2),…}

Problems with stratification Perfect models are adequate for stratified LPs –Newer semantics are generalization of it But there are (useful) non-stratified LPs even(X)  zero(X)zero(0) even(Y)  suc(X,Y),not even(X)suc(X,s(X)) Is not stratified because (even(0)  suc(0,0),not even(0))  P No stratification is possible if P has: pacifist(X)  not hawk(X) hawk(Y)  not pacifist(X) This is useful in KR: “X is pacifist if it cannot be assume X is hawk, and vice-versa. If nothing else is said, it is undefined whether X is pacifist or hawk”

SLS procedure In perfect models not includes infinite failure SLS is a (theoretical) procedure for perfect models based on possible infinite failure No complete implementation is possible (how to detect infinite failure?) Sound approximations exist: –based on loop checking (with ancestors) –based on tabulation techniques (cf. XSB-Prolog implementation)

Stable Models Idea The construction of perfect models can be done without stratifying the program. Simply guess the model, process it into P and see if its least model coincides with the guess. If the program is stratified, the results coincide: –A correct guess must coincide on the 1st strata; –and on the 2nd (given the 1st), and on the 3rd … But this can be applied to non-stratified programs…

Stable Models Idea (cont) “Guessing a model” corresponds to “assuming default negations not”. This type of reasoning is usual in NMR –Assume some default literals –Check in P the consequences of such assumptions –If the consequences completely corroborate the assumptions, they form a stable model The stable models semantics is defined as the intersection of all the stable models (i.e. what follows, no matter what stable assumptions)

SMs: preliminary example a  not bc  a p  not q b  not ac  b q  not rr Assume, e.g., not r and not p as true, and all others as false. By processing this into P: a  falsec  a p  false b  falsec  b q  truer Its least model is {not a, not b, not c, not p, q, r} So, it isn’t a stable model: –By assuming not r, r becomes true –not a is not assumed and a becomes false

SMs example (cont) a  not bc  a p  not q b  not ac  b q  not rr Now assume, e.g., not b and not q as true, and all others as false. By processing this into P: a  truec  a p  true b  falsec  b q  falser Its least model is {a, not b, c, p, not q, r} I is a stable model The other one is {not a, b, c, p, not q, r} According to Stable Model Semantics: –c, r and p are true and q is false. –a and b are undefined

Stable Models definition D Let I be a (2-valued) interpretation of P. The definite program P/I is obtained from P by: deleting all rules whose body has not A, and A  I deleting from the body all the remaining default literals  P (I) = least(P/I) D M is a stable model of P iffM =  P (M). A is true in P iff A belongs to all SMs of P A is false in P iff A doesn’t belongs to any SMs of P (i.e. not A “belongs” to all SMs of P).

Properties of SMs Stable models are minimal models Stable models are supported If P is locally stratified then its single stable model is the perfect model Stable models semantics assign meaning to (some) non-stratified programs –E.g. the one in the example before

Importance of Stable Models Stable Models are an important contribution: –Introduce the notion of default negation (versus negation as failure) –Allow important connections to NMR. Started the area of LP&NMR –Allow for a better understanding of the use of LPs in Knowledge Representation –Introduce a new paradigm (and accompanying implementations) of LP It is considered as THE semantics of LPs by a significant part of the community. But...

Cumulativity D A semantics Sem is cumulative iff for every P: if A  Sem(P) and B  Sem(P) then B  Sem(P U {A}) (i.e. all derived atoms can be added as facts, without changing the program’s meaning) This property is important for implementations: –without cumulativity, tabling methods cannot be used

Relevance D A directly depends on B if B occur in the body of some rule with head A. A depends on B if A directly depends on B or there is a C such that A directly depends on C and C depends on B. D A semantics Sem is relevant iff for every P: A  Sem(P) iff A  Sem(Rel A (P)) where Rel A (P) contains all rules of P whose head is A or some B on which A depends on. Only this property allows for the usual top-down execution of logic programs.

Problems with SMs The only SM is {not a, c,b} a  not bc  not a b  not ac  not c Don’t provide a meaning to every program: –P = {a  not a} has no stable models It’s non-cumulative and non-relevant: –However b is not true in P U {c} (non-cumulative) P U {c} has 2 SMs: {not a, b, c} and {a, not b, c} –b is not true in Rel b (P) (non-relevance) The rules in Rel b (P) are the 2 on the left Rel b (P) has 2 SMs: {not a, b} and {a, not b}

Problems with SMs (cont) Its computation is NP-Complete The intersection of SMs is non-supported: c is true but neither a nor b are true. a  not bc  a b  not ac  b Note that the perfect model semantics: –is cumulative –is relevant –is supported –its computation is polynomial