Logic Programming for Evolving Agents J.J. Alferes J.A. Leite L.M. Pereira.

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,
Justification-based TMSs (JTMS) JTMS utilizes 3 types of nodes, where each node is associated with an assertion: 1.Premises. Their justifications (provided.
C O N T E X T - F R E E LANGUAGES ( use a grammar to describe a language) 1.
1 An Event-Condition- Action Logic Programming Language J. J. Alferes F. Banti A. Brogi.
1 Semantic Description of Programming languages. 2 Static versus Dynamic Semantics n Static Semantics represents legal forms of programs that cannot be.
Suitcase example A suitcase has two latches, and is opened whenever both are up: open ← up(l1), up(l2) There is an action of toggling applicable to each.
Spin Tutorial (some verification options). Assertion is always executable and has no other effect on the state of the system than to change the local.
Logic in general Logics are formal languages for representing information such that conclusions can be drawn Syntax defines the sentences in the language.
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.
Ordering and Consistent Cuts Presented By Biswanath Panda.
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,
A Preliminary Study on Reasoning About Causes Pedro Cabalar AI Lab., Dept. of Computer Science University of Corunna, SPAIN.
Luís Moniz Pereira CENTRIA, Departamento de Informática Universidade Nova de Lisboa Pierangelo Dell’Acqua Dept. of Science and Technology.
CS 290C: Formal Models for Web Software Lecture 10: Language Based Modeling and Analysis of Navigation Errors Instructor: Tevfik Bultan.
Auto-Epistemic Logic Proposed by Moore (1985) Contemplates reflection on self knowledge (auto-epistemic) Allows for representing knowledge not just about.
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.
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.
Implementing Rational Features for Agents in Logic Programming Universidade Nova de Lisboa URL:
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.
Application of Logic Programming and Updates for the Semantic Web Luís Moniz Pereira Dresden, November 2003.
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.
Enabling Flexible Integration of Business and Technology Using Service-based Processes Jelena Zdravkovic, University of Gävle/Royal Institute of Technology.
Time, Clocks, and the Ordering of Events in a Distributed System Leslie Lamport (1978) Presented by: Yoav Kantor.
This is the first page of the log in, this is were you enter your unique details.
Tool Kit. Receiving an When you receive an , it will appear on the white box, which is the conversation list. To do this you will have.
CC0002NI – Computer Programming Computer Programming Er. Saroj Sharan Regmi Week 7.
Katanosh Morovat.   This concept is a formal approach for identifying the rules that encapsulate the structure, constraint, and control of the operation.
© The McGraw-Hill Companies, 2006 Chapter 4 Implementing methods.
CSNB234 ARTIFICIAL INTELLIGENCE
Dylan Bayliff. Contents: 1- Sending s & Using etiquette 2- Staying safe and Accessing 3- Open s 4- Replying to s 5- Setting up contacts.
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.
This PowerPoint presentation will show you how to use your productively and successfully.
Modelling Adaptive Controllers with Evolving Logic Programs Pierangelo Dell’Acqua Anna Lombardi Dept. of Science and Technology - ITN Linköping University,
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
EVOlving L ogic P rograms J.J. Alferes, J.A. Leite, L.M. Pereira (UNL) A. Brogi (U.Pisa)
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
Tool Kit. Receiving an When you receive an , it will appear on the white box, which is the conversation list. To do this you will have.
1 Logical Agents CS 171/271 (Chapter 7) Some text and images in these slides were drawn from Russel & Norvig’s published material.
Logical Agents Chapter 7. Outline Knowledge-based agents Logic in general Propositional (Boolean) logic Equivalence, validity, satisfiability.
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.
tool kit. USER GUIDE Etiquette (Acceptable use policy) – a list of rules that we observe Use a suitable subject in the - this helps.
Algorithm Discovery and Design Objectives: Interpret pseudocode Write pseudocode, using the three types of operations: * sequential (steps in order written)
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.
Artificial Intelligence Knowledge Representation.
Integrated ISO ILL for staff users Borrowing requests – part two Yoel Kortick 2007.
Logical Agents. Outline Knowledge-based agents Logic in general - models and entailment Propositional (Boolean) logic Equivalence, validity, satisfiability.
SQL Database Management
Knowledge Representation and Reasoning
EA C461 – Artificial Intelligence Logical Agent
Rules, RIF and RuleML.
Optimize Your Java Code By Tools
Logical Agents Chapter 7.
Java Programming Loops
Back to “Serious” Topics…
Logical Agents Chapter 7.
Java Programming Loops
CSNB234 ARTIFICIAL INTELLIGENCE
CGS 2545: Database Concepts Summer 2006
Representations & Reasoning Systems (RRS) (2.2)
Presentation transcript:

Logic Programming for Evolving Agents J.J. Alferes J.A. Leite L.M. Pereira A. Brogi

Logic Programming for agents LP paradigm provides: LP paradigm provides: Well-defined, general, integrative framework for specifying agents’ knowledge and behavior Well-defined, general, integrative framework for specifying agents’ knowledge and behavior Procedures (and accompanying implementations) for executing agents Procedures (and accompanying implementations) for executing agents To the latter accrues recent LP implementations for non-monotonic reasoning, such as: To the latter accrues recent LP implementations for non-monotonic reasoning, such as: XSB-Prolog ( XSB-Prolog ( DLV ( DLV ( smodels ( smodels (

LP for evolving agents LP can be seen as a good representation language for static knowledge LP can be seen as a good representation language for static knowledge In a dynamic environment, typical of the agency paradigm, classical LP is less than adequate. Lacks: In a dynamic environment, typical of the agency paradigm, classical LP is less than adequate. Lacks: Means of integrating knowledge updates from external sources (be it from user changes in the rules describing agent behavior, or simply from environment events) Means of integrating knowledge updates from external sources (be it from user changes in the rules describing agent behavior, or simply from environment events) Means for describing rules about the transition between states Means for describing rules about the transition between states Means for describing self-updates, and self-evolution of a program, and combining self-updates with external ones Means for describing self-updates, and self-evolution of a program, and combining self-updates with external ones

Updates of LPs by LPs Dynamic Logic Programming (DLP) [ALPPP] was introduced to address some of these concerns Dynamic Logic Programming (DLP) [ALPPP] was introduced to address some of these concerns It gives meaning to sequences of LPs It gives 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 Since LP can be used to describe knowledge states and also sequences of updating states, it’s only fit that LP is used too to describe transitions, and thus come up with such sequences Since LP can be used to describe knowledge states and also sequences of updating states, it’s only fit that LP is used too to describe transitions, and thus come up with such sequences

Summary Here we present EVOLP, a language generalizing LP to deal with updates and evolution. Here we present EVOLP, a language generalizing LP to deal with updates and evolution. We illustrate EVOLP’s usage by specifying an e- mail Personal Assistant Agent We illustrate EVOLP’s usage by specifying an e- mail Personal Assistant Agent For the implementation of EVOLP and the example, and also other implementations on updates (viz. DLP), see: For the implementation of EVOLP and the example, and also other implementations on updates (viz. DLP), see:

What do we need in EVOLP Programs must be allowed to evolve Programs must be allowed to evolve  Meaning of programs should be sequences of sets of literals, representing evolutions  Needed a construct to assert new 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

EVOLP 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, Body  I} Def(I) = {not A |  A ← Body)   P i, Body  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 ←)

Event-aware programs 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 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 2  …  P i  E i )

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

agent core Personal assistant agent for management able to: Personal assistant agent for management able to: Perform basic actions of sending, receiving, deleting messages Perform basic actions of sending, receiving, deleting messages Storing and moving messages between folders Storing and moving messages between folders Filtering spam messages Filtering spam messages Sending automatic replies and forwarding Sending automatic replies and forwarding Notifying the user of special situations Notifying the user of special situations All of this may depend on user specified criteria All of this may depend on user specified criteria The specification may change dynamically The specification may change dynamically

EVOLP for Assistant If the user specifies, once and for all, a consistent set of policies triggering actions, then any existing (commercial) assistant would do the job. If the user specifies, once and for all, a consistent set of policies triggering actions, then any existing (commercial) assistant would do the job. But if we allow the user to update its policies, and to specify both positive (e.g. “…must be deleted”) and negative (e.g. “…must not be deleted”) instances, soon the union of all policies becomes inconsistent But if we allow the user to update its policies, and to specify both positive (e.g. “…must be deleted”) and negative (e.g. “…must not be deleted”) instances, soon the union of all policies becomes inconsistent We cannot expect the user to debug the set of policy rules so as to invalidate all the old rules (instances) contravened by newer ones. We cannot expect the user to debug the set of policy rules so as to invalidate all the old rules (instances) contravened by newer ones. Some automatic way to resolve inconsistencies due to updates is needed. Some automatic way to resolve inconsistencies due to updates is needed.

EVOLP for Assistant (cont) EVOLP provides an automatic way of removing inconsistencies due to updates: EVOLP provides an automatic way of removing inconsistencies due to updates: With EVOLP the user simply states whatever new is to be done, and let the agent automatically determine which old rules may persist and which not. With EVOLP the user simply states whatever new is to be done, and let the agent automatically determine which old rules may persist and which not. We are not presupposing the user is contradictory, but just that he keeps updating its profile We are not presupposing the user is contradictory, but just that he keeps updating its profile EVOLP further allows: EVOLP further allows: Postponed addition of rules, depending on user specified criteria Postponed addition of rules, depending on user specified criteria Dynamic changes in policies, triggered by internal and/or external conditions Dynamic changes in policies, triggered by internal and/or external conditions Commands that span over various states Commands that span over various states …

An EVOLP Assistant In the following we show some policy rules of the EVOLP assistant. In the following we show some policy rules of the EVOLP assistant. A more complete set of rules, and the results given by EVOLP, can be found in the paper. A more complete set of rules, and the results given by EVOLP, can be found in the paper. Basic predicates: Basic predicates: New messages come as events of the form: New messages come as events of the form: newmsg(Identifier, From, Subject, Body) Messages are stored via predicates: Messages are stored via predicates: msg(Identifier, From, Subj, Body, TimeStamp) and in(Identifier, FolderName)

Simple EVOLP rules By default messages are stored in the inbox: By default messages are stored in the inbox: assert(msg(M,F,S,B,T)) ← newmsg(M,F,S,B), time(T), not delete(M). assert(in(M,inbox)) ← newmsg(M,F,S,B), not delete(M). assert(not in(M,F)) ← delete(M), in(M,F). Spam messages are to be deleted: Spam messages are to be deleted: delete(M) ← newmsg(M,F,S,B), spam(F,S,B). The definition of spam can be done by LP rules: The definition of spam can be done by LP rules: spam(F,S,B) ← contains(S,credit). This definition can later be updated: This definition can later be updated: not spam(F,S,B) ← contains(F,my_accountant).

More EVOLP rules Messages can be automatically moved to other folders. When that happens (not shown here) the user wants to be notified: Messages can be automatically moved to other folders. When that happens (not shown here) the user wants to be notified: notify(M) ← newmsg(M,F,S,B), assert(in(M,F)), assert(not in(M,inbox)). When a message is marked both for deletion and automatic move to another folder, the deletion should prevail: When a message is marked both for deletion and automatic move to another folder, the deletion should prevail: not assert(in(M,F)) ← move(M,F), delete(M). The user is organizing a conference, assigning papers to referees. After receipt of a referee’s acceptance, a new rule is to be added, which forwards to the referee any messages about assigned papers: The user is organizing a conference, assigning papers to referees. After receipt of a referee’s acceptance, a new rule is to be added, which forwards to the referee any messages about assigned papers: assert(send(R,S,B1) ← newmsg(M1,F,S,B1), contains(S,Id), assign(Id,R)) ← newmsg(M2,R,Id,B2), contains(B2,accept).

Conclusions We’ve presented EVOLP, and illustrated its usage in an agent application We’ve presented EVOLP, and illustrated its usage in an agent application EVOLP is a declarative, concise, simple and quite powerful language to reason about agents that evolve EVOLP is a declarative, concise, simple and quite powerful language to reason about agents that evolve EVOLP: a firm formal basis in which to express, implement, and reason about evolving agents EVOLP: a firm formal basis in which to express, implement, and reason about evolving agents