EVOlving L ogic P rograms J.J. Alferes, J.A. Leite, L.M. Pereira (UNL) A. Brogi (U.Pisa)

Slides:



Advertisements
Similar presentations
Artificial Intelligence
Advertisements

Computer Science CPSC 322 Lecture 25 Top Down Proof Procedure (Ch 5.2.2)
Updates plus Preferences Luís Moniz Pereira José Júlio Alferes Centro de Inteligência Artificial Universidade Nova de Lisboa Portugal JELIA’00, Málaga,
Agents That Reason Logically Copyright, 1996 © Dale Carnegie & Associates, Inc. Chapter 7 Spring 2004.
Answer Set Programming Overview Dr. Rogelio Dávila Pérez Profesor-Investigador División de Posgrado Universidad Autónoma de Guadalajara
Propositional Logic Reading: C , C Logic: Outline Propositional Logic Inference in Propositional Logic First-order logic.
1 An Event-Condition- Action Logic Programming Language J. J. Alferes F. Banti A. Brogi.
ISBN Chapter 3 Describing Syntax and Semantics.
Fall Semantics Juan Carlos Guzmán CS 3123 Programming Languages Concepts Southern Polytechnic State University.
1 Semantic Description of Programming languages. 2 Static versus Dynamic Semantics n Static Semantics represents legal forms of programs that cannot be.
Comp 205: Comparative Programming Languages Semantics of Imperative Programming Languages denotational semantics operational semantics logical semantics.
1 Introduction to Computability Theory Lecture12: Reductions Prof. Amos Israeli.
Introduction to Computability Theory
Rule Updates These languages and methodologies are basically concerned with facts that change –There is a set of fluents (fact) –There are static rules.
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.
Constraint Logic Programming Ryan Kinworthy. Overview Introduction Logic Programming LP as a constraint programming language Constraint Logic Programming.
João Alcântara, Carlos Damásio and Luís Moniz Pereira Centro de Inteligência Artificial (CENTRIA) Depto. Informática,
Knowledge Representation & Reasoning.  Introduction How can we formalize our knowledge about the world so that:  We can reason about it?  We can do.
A Preliminary Study on Reasoning About Causes Pedro Cabalar AI Lab., Dept. of Computer Science University of Corunna, SPAIN.
Auto-Epistemic Logic Proposed by Moore (1985) Contemplates reflection on self knowledge (auto-epistemic) Allows for representing knowledge not just about.
Logic Programming for Evolving Agents J.J. Alferes J.A. Leite L.M. Pereira.
Models -1 Scientists often describe what they do as constructing models. Understanding scientific reasoning requires understanding something about models.
José Júlio Alferes Luís Moniz Pereira Centro de Inteligência Artificial - CENTRIA Universidade Nova de Lisboa, Portugal Pierangelo Dell’Acqua Dept. of.
Logical Agents Chapter 7. Why Do We Need Logic? Problem-solving agents were very inflexible: hard code every possible state. Search is almost always exponential.
Knowledge Representation & Reasoning (Part 1) Propositional Logic chapter 6 Dr Souham Meshoul CAP492.
Logical Agents Chapter 7. Why Do We Need Logic? Problem-solving agents were very inflexible: hard code every possible state. Search is almost always exponential.
On Testing Convexity and Submodularity Michal Parnas Dana Ron Ronitt Rubinfeld.
Knowledge Evolution Up to now we have not considered evolution of the knowledge In real situations knowledge evolves by: –completing it with new information.
Luís Moniz Pereira Centro de Inteligência Artificial - CENTRIA Universidade Nova de Lisboa Pierangelo Dell’Acqua Dept. of Science and.
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.
Combining Societal Agents’ Knowledge João Alexandre Leite José Júlio Alferes Luís Moniz Pereira CENTRIA – Universidade Nova de Lisboa Universidade de Évora,
Let remember from the previous lesson what is Knowledge representation
Luís Moniz Pereira Centro de Inteligência Artificial - CENTRIA Universidade Nova de Lisboa, Portugal Pierangelo Dell’Acqua Dept. of Science and Technology.
Logical Agents Chapter 7 Feb 26, Knowledge and Reasoning Knowledge of action outcome enables problem solving –a reflex agent can only find way from.
CS 330 Programming Languages 09 / 16 / 2008 Instructor: Michael Eckmann.
Describing Syntax and Semantics
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.
CHAPTER 10 Recursion. 2 Recursive Thinking Recursion is a programming technique in which a method can call itself to solve a problem A recursive definition.
CAS LX 502 Semantics 3a. A formalism for meaning (cont ’ d) 3.2, 3.6.
PROGRAMMING LANGUAGES The Study of Programming Languages.
1 Knowledge Based Systems (CM0377) Lecture 4 (Last modified 5th February 2001)
A Language for Updates with Multiple Dimensions João Alexandre Leite 1 José Júlio Alferes 1 Luís Moniz Pereira 1 Halina Przymusinska 2 Teodor Przymusinski.
Approaching a Problem Where do we start? How do we proceed?
Modelling Adaptive Controllers with Evolving Logic Programs Pierangelo Dell’Acqua Anna Lombardi Dept. of Science and Technology - ITN Linköping University,
Advanced Topics in Propositional Logic Chapter 17 Language, Proof and Logic.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Dr. Shazzad Hosain Department of EECS North South Universtiy Lecture 04 – Part A Knowledge Representation and Reasoning.
Slide 1 Propositional Definite Clause Logic: Syntax, Semantics and Bottom-up Proofs Jim Little UBC CS 322 – CSP October 20, 2014.
MINERVA A Dynamic Logic Programming Agent Architecture João Alexandre Leite José Júlio Alferes Luís Moniz Pereira ATAL’01 CENTRIA – New University of Lisbon.
Languages of Updates João Alexandre Leite New University of Lisbon Dagstuhl, 25 November, 2002Dagstuhl Seminar
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
L. M. Pereira, J. J. Alferes, J. A. Leite Centro de Inteligência Artificial - CENTRIA Universidade Nova de Lisboa, Portugal P. Dell’Acqua Dept. of Science.
SEVENTH DAY ADVENTIST GOVERNANCE SYSTEM POLICY DEVELOPMENT AND POLICY INTERPRETATION CHURCH GOVERNANCE SEMINAR PRESENTED BY M GWALA.
Computer Science CPSC 322 Lecture 22 Logical Consequences, Proof Procedures (Ch 5.2.2)
© Copyright 2008 STI INNSBRUCK Intelligent Systems Propositional Logic.
Rational Agency CSMC Introduction to Artificial Intelligence January 8, 2004.
Algorithm Discovery and Design Objectives: Interpret pseudocode Write pseudocode, using the three types of operations: * sequential (steps in order written)
SAFEWARE System Safety and Computers Chap18:Verification of Safety Author : Nancy G. Leveson University of Washington 1995 by Addison-Wesley Publishing.
Fall 2008Programming Development Techniques 1 Topic 17 Assignment, Local State, and the Environment Model of Evaluation Section 3.1 & 3.2.
1 Temporal logic. 2 Prop. logic: model and reason about static situations. Example: Are there truth values that can be assigned to x,y simultaneously.
1 Propositional Logic Limits The expressive power of propositional logic is limited. The assumption is that everything can be expressed by simple facts.
1 CSC 384 Lecture Slides (c) , C. Boutilier and P. Poupart CSC384: Intro to Artificial Intelligence  Jan 12 th  Announcements: Tutorial splits.
Logical Agents Chapter 7. Outline Knowledge-based agents Propositional (Boolean) logic Equivalence, validity, satisfiability Inference rules and theorem.
An argument-based framework to model an agent's beliefs in a dynamic environment Marcela Capobianco Carlos I. Chesñevar Guillermo R. Simari Dept. of Computer.
Chapter 12 Theory of Computation Introduction to CS 1 st Semester, 2014 Sanghyun Park.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
Programming Languages and Compilers (CS 421)
Programming Languages 2nd edition Tucker and Noonan
Knowledge Representation I (Propositional Logic)
Programming Languages 2nd edition Tucker and Noonan
Presentation transcript:

EVOlving L ogic P rograms J.J. Alferes, J.A. Leite, L.M. Pereira (UNL) A. Brogi (U.Pisa)

LP for KRR LP has been widely used for representing static knowledge LP has been widely used for representing static knowledge Attempts have been made to define LP frameworks that deal with dynamics of knowledge – LPs Updates Attempts have been made to define LP frameworks that deal with dynamics of knowledge – LPs Updates Here we present a simple and powerful approach for LPs Updates Here we present a simple and powerful approach for LPs Updates Why another approach? Why another approach?

Model updates of [MT] Language for updating KBs, with rules: Language for updating KBs, with rules: in(A 0 ) | out(A 0 ) ← in(A 1 ),..., out(A n ) Given the set of interpretations of an initial KB, and a set of revision rules, the set of interpretations of the resulting KB is obtained Given the set of interpretations of an initial KB, and a set of revision rules, the set of interpretations of the resulting KB is obtained Problems: Problems:  The resulting KB is only indirectly characterized  No intuitive results when the intentional part of the KB changes. Doesn’t work well for rules updates

Updates of LPs by LPs DLP [ALPPP] give meaning to sequences of LPs DLP [ALPPP] give meaning to sequences of LPs Intuitively a sequence of LPs is the result of updating P 1 with the rules in P 2, … Intuitively a sequence of LPs is the result of updating P 1 with the rules in P 2, … Inertia is applied to rules rather than to literals Inertia is applied to rules rather than to literals Older rules conflicting with newer applicable rules are rejected Older rules conflicting with newer applicable rules are rejected

What was still missing By then we knew how to give meaning to sequences of LPs By then we knew how to give meaning to sequences of LPs But how to come up with those sequences? But how to come up with those sequences? Changes maybe additions or retractions Changes maybe additions or retractions Updates maybe conditional on a present state Updates maybe conditional on a present state Some rules may represent (persistent) laws Some rules may represent (persistent) laws LUPS [APPP], EPI [EFST], and KABUL [Leite] are (command) language defined for these purposes LUPS [APPP], EPI [EFST], and KABUL [Leite] are (command) language defined for these purposes

Languages of Updates Sequences of commands build sequences of LPs Sequences of commands build sequences of LPs There are several types of commands: assert, assert event, retract, always, … There are several types of commands: assert, assert event, retract, always, … always (not a ← b, not c) when d, not e EPI extends LUPS to allow for: EPI extends LUPS to allow for: commands whose execution depends on other commands commands whose execution depends on other commands external events to condition the KB evolution external events to condition the KB evolution KABUL extends LUPS and EPI with nesting KABUL extends LUPS and EPI with nesting

Problems with these languages  Too many commands  Far from the spirit of LP  Complex  Difficult to prove properties  Fixed set of commands  Each encodes a high-level behavior for additions  Are those the only interesting behaviors? E.g.  Make additions dependent upon conditions that span over states  Model changes of (persistent) update commands One could further extend the language. But, where to stop? One could further extend the language. But, where to stop?

How to proceed  Instead of extending with new commands  Minimally add constructs and concepts to LP, to cope with evolution and updating (start from scratch) The result, EVOLP, provides a simpler, closer to traditional LP, and more general formulation of LP Updates The result, EVOLP, provides a simpler, closer to traditional LP, and more general formulation of LP Updates

What do we (really) need Programs must be allowed to evolve Programs must be allowed to evolve  Meaning of programs should be sequences of sets of literals, representing evolutions  Need a construct to assert new information ? Do we need a construct to retract old information?  nots in the heads to allow newer to supervene older rules Program evolution may me influenced by the outside Program evolution may me influenced by the outside  Allow external events  … written in the language of programs

Self-evolving LPs - Syntax EVOLP rules are Generalized LP rules (possibly with nots in heads) plus special predicate assert/1 EVOLP rules are Generalized LP rules (possibly with nots in heads) plus special predicate assert/1 The argument of assert is an EVOLP rule (i.e. arbitrary nesting of assert is allowed) The argument of assert is an EVOLP rule (i.e. arbitrary nesting of assert is allowed) Examples: Examples: assert( a ← not b) ← d, not e not a ← not assert( assert(a ← b)← not b), c EVOLP programs are sets of EVOLP rules EVOLP programs are sets of EVOLP rules

Meaning of Self-evolving LPs Determined by sequences of sets of literals Determined by sequences of sets of literals Each sequence represents a possible evolution Each sequence represents a possible evolution The n th set in a sequence represents what is true/false after n steps in that evolution The n th set in a sequence represents what is true/false after n steps in that evolution The first set in sequences is a SM of the LP, where assert/1 literals are viewed as normal ones The first set in sequences is a SM of the LP, where assert/1 literals are viewed as normal ones If assert(Rule) belongs to the n th set, then (n+1) th sets must consider the addition of Rule If assert(Rule) belongs to the n th set, then (n+1) th sets must consider the addition of Rule

Intuitive example a ← assert(b ←) assert(c ←) ← b At the beginning a is true, and so is assert(b ←) At the beginning a is true, and so is assert(b ←) Therefore, rule b ← is asserted Therefore, rule b ← is asserted At 2 nd step, b becomes true, and so does assert(c ←) At 2 nd step, b becomes true, and so does assert(c ←) Therefore, rule c ← is asserted Therefore, rule c ← is asserted At 3 rd step, c becomes true. At 3 rd step, c becomes true. <{a, assert(b ←)}, {a, b, assert(b ←), assert(c ←)}, {a, b, c, assert(b ←), assert(c ←)}>

Self-evolution definitions An evolution interpretation of P over L is a sequence of sets of atoms from L as An evolution interpretation of P over L is a sequence of sets of atoms from L as The evolution trace of is : The evolution trace of is : P 1 = P and P i = {R | assert(R)  I i-1 } (2 ≤ i ≤ n) Evolution traces contains the programs imposed by interpretations Evolution traces contains the programs imposed by interpretations We have now to check whether each n th set complies with the programs up to n-1 We have now to check whether each n th set complies with the programs up to n-1

Evolution Stable Models, with trace, is an evolution stable model of P, iff, with trace, is an evolution stable model of P, iff  1 ≤ i ≤ n, I i is a SM of the DLP: P 1  …  P i I is a stable model of P 1  …  P n iff I is a stable model of P 1  …  P n iff I = least( (  P i – Rej(I))  Def(I) ) where: Def(I) = {not A |  A ← Body)   P i } Def(I) = {not A |  A ← Body)   P i } Rej(I) = {L 0 ← Bd in Pi |  not L 0 ← Bd’)  Pj, Rej(I) = {L 0 ← Bd in Pi |  not L 0 ← Bd’)  Pj, i < j ≤ n, and Bd’  I} i < j ≤ n, and Bd’  I}

Simple example is an evolution SM of P: is an evolution SM of P: a ←assert(not a ←) ← b assert(b ← a) ← not cc ← assert(not a ←) The trace is The trace is a, assert(b ← a) a, b, c, assert(not a ←)

Example with various evolutions No matter what, assert c; if a is not going to be asserted, then assert b; if c is true, and b is not going to be asserted, then assert a. No matter what, assert c; if a is not going to be asserted, then assert b; if c is true, and b is not going to be asserted, then assert a. assert(b) ← not assert(a). assert(c) ← assert(a) ← not assert(b), c Paths in the graph below are evolution SMs Paths in the graph below are evolution SMs ast(b) ast(c) b,c,ast(b) ast(c) b,c,ast(a) ast(c) a,b,c,ast(b) ast(c) a,b,c,ast(a) ast(c)

Event-aware programs Self-evolving programs are autistic! Self-evolving programs are autistic! Events may come from the outside: Events may come from the outside: Observations of facts or rules Observations of facts or rules Assertion order Assertion order Both can be written in EVOLP language Both can be written in EVOLP language Influence from outside should not persist by inertia Influence from outside should not persist by inertia

Evolution Stable Models An event sequence is a sequence of sets of EVOLP rules. An event sequence is a sequence of sets of EVOLP rules., with trace, is an evolution SM of P given, iff, with trace, is an evolution SM of P given, iff  1 ≤ i ≤ n, I i is a SM of the DLP: P 1  …  P i  E i ) Note that, this way, events from the outside do not persist by inertia Note that, this way, events from the outside do not persist by inertia

Simple example The program says that: whenever c, assert a ← b The program says that: whenever c, assert a ← b The events were: 1 st c was perceived; 2 nd an order to assert b; 3 rd an order to assert not a The events were: 1 st c was perceived; 2 nd an order to assert b; 3 rd an order to assert not a P: assert(a ← b) ← c Events: Events: c, ← assert(a ← b) ← assert(b ← ) b, a, ← assert(not a ← ) b

LUPS as EVOLP The behavior of all LUPS commands can be constructed in EVOLP. Eg: The behavior of all LUPS commands can be constructed in EVOLP. Eg: always (not a ← b, not c) when d, not e always (not a ← b, not c) when d, not e coded as event: assert( assert(not a ← b, not c) ← d, not e ) always event (a ← b) when c always event (a ← b) when c coded as events: assert( assert(a ← b, ev(a ← b)) ← c ) assert( assert(ev(a ← b)) ← c ) plus: assert( not ev(R) ) ← ev(R), not assert(ev(R))

EVOLP features All LUPS and EPI features are EVOLP features: All LUPS and EPI features are EVOLP features: Rule updates; Persistent updates; simultaneous updates; events; commands dependent on other commands; … Rule updates; Persistent updates; simultaneous updates; events; commands dependent on other commands; … Many extra features (some of them in KABUL) can be programmed: Many extra features (some of them in KABUL) can be programmed: Commands that span over time Commands that span over time Events with incomplete knowledge Events with incomplete knowledge Updates of persistent laws Updates of persistent laws Assignments Assignments …

EVOLP possible applications Legal reasoning Legal reasoning Evolving systems, with external control Evolving systems, with external control Reasoning about actions Reasoning about actions Active Data (and Knowledge) Bases Active Data (and Knowledge) Bases Static program analysis of agents’ behavior Static program analysis of agents’ behavior …

… and also EVOLP is a concise, simple and quite powerful language to reason about KB evolution EVOLP is a concise, simple and quite powerful language to reason about KB evolution Powerful: it can do everything other update languages can, and much more Powerful: it can do everything other update languages can, and much more Simple and concise: much better to use for proving properties of KB evolution Simple and concise: much better to use for proving properties of KB evolution EVOLP: a firm formal basis in which to express, implement, and reason about dynamic KB EVOLP: a firm formal basis in which to express, implement, and reason about dynamic KB Opens up a number of research topics Opens up a number of research topics Much remains do be done… Much remains do be done…