# Memory Management in Resource-Bounded Agents

In artificial intelligence, multi agent systems constitute an interesting typology of society modeling, and have in this regard vast fields of application, which extend to the human sciences. Logic is often used to model such kind of systems as it is easier to verify the explainability and validation, so for this reason we have tried to manage agents' memory extending a previous work by inserting the concept of time.

## Authors

• 2 publications
09/18/2019

### A Temporal Module for Logical Frameworks

In artificial intelligence, multi agent systems constitute an interestin...
09/19/2012

### Modeling and Verification of a Multi-Agent Argumentation System using NuSMV

Autonomous intelligent agent research is a domain situated at the forefr...
10/01/2020

### Multi-Agent Systems based on Contextual Defeasible Logic considering Focus

In this paper, we extend previous work on distributed reasoning using Co...
11/30/2011

### Stability of Evolving Multi-Agent Systems

A Multi-Agent System is a distributed system where the agents or nodes p...
04/16/2020

### MARLeME: A Multi-Agent Reinforcement Learning Model Extraction Library

Multi-Agent Reinforcement Learning (MARL) encompasses a powerful class o...
02/15/2021

### What Do We Want From Explainable Artificial Intelligence (XAI)? – A Stakeholder Perspective on XAI and a Conceptual Model Guiding Interdisciplinary XAI Research

Previous research in Explainable Artificial Intelligence (XAI) suggests ...
07/11/2018

### Proactive Intervention to Downtrend Employee Attrition using Artificial Intelligence Techniques

To predict the employee attrition beforehand and to enable management to...
##### This week in AI

Get the week's most popular data science and artificial intelligence research sent straight to your inbox every Saturday.

## 1 Introduction

Memory in an agent system is a process of reasoning: it is the learning process of strengthening a concept. The interaction between an agent and the environment can play an important role in constructing its memory and may affect its future behaviour. In fact, through memory an agent is potentially able to recall and to learn from experiences so that its beliefs and its future course of action are grounded in these experiences. In computational logic, [3] introduces DLEK (Dynamic Logic of Explicit beliefs and Knowledge) as a logical formalization of the short-term and long-term memory. The underlying idea is to represent reasoning about the formation of beliefs through perception and inference in non-omniscient resource-bounded agents. DLEK has however no notion of time, while agents’ actual perceptions are inherently timed and so are many of the inferences drawn from such perceptions. In this paper we present an extension of LEK/DLEK to T-LEK/T-DLEK (“Timed LEK” and “Timed DLEK”) obtained by introducing a special function which associates to each belief the arrival time and controls timed inferences. Through this function it is easier to keep the evolution of the surrounding world under control and the representation is more complete. This abstract is an evolution version of [4], where we have introduced explicit time instants and time intervals in formulas, and it is extracted from [5].

## 2 T-LEK and T-DLEK

As in [3], our logic consists of two different components: a static component, called T-LEK, which is mix between an Epistemic Logic and Metric Temporal Logic, and a dynamic component, called T-DLEK, which extends the static one with mental operations, which are vary important for “controlling” beliefs (adds new belief, update belief, etc).

### 2.1 Syntax

In our scenario we fix where and are predicates, that can be equal or not. Moreover stands for “p is true from the time instant to with (Temporal Representation of the external world); as a special case we can have which stands for “p is true in the time instant . Obviously we can have predicates with more terms than only two but in that case we fix that the first two must be those that identify the time duration of the belief (i.e. which means “the agent knows that the door is open from time 1 to time 3”). Instead in the previous work [4] we considered atoms of the form with , which are the conjunction and also stand for with ; we have decided to change approach because is too detached from propositional logic.

Below is the definition of the formulas of the language , with a slight abuse, in this grammar we use as terminal symbol standing for time intervals (possibly specified through arithmetic expressions, as said earlier):

 φ,ψ :=p(t_1,t_2) | ¬φ | □_Iφ | Bφ | Kφ| φ ∧ ψ| φ → ψ

Other Boolean connectives , , are defined from and as usual. In the formula the MTL Interval “always” operator is applied to a formula; is a “time-interval” which is a closed finite interval or an infinite interval (considered open on the upper bound), for any expressions/values such that and will sometimes be written simply as . The operator is intended to denote belief and the operator to denote knowledge. More precisely, identifies beliefs present in the working memory, instead identifies what rules present in the background knowledge.

Terms/atoms/formulas as defined so far are ground, namely there are no variables occurring therein. We introduce variables and use them in formulas in a restricted manner, as usual for example in answer set programming. Variables can occur in formulas in any place; constants can occur and are intended as place holders for elements of the Herbrand universe. More specifically, a ground instance of a term/atom/formula involving variables is obtained by uniformly substituting ground terms to all variables (grounding step), with the restriction that any variable occurring in an arithmetic expression (i.e., specifying a time instant) can be replaced by a (ground) arithmetic expressions only. Consequently, a non-ground term/atom/formula represents the possibly infinite set of its ground instances, namely, its grounding. Notice that the rational of considering ground formulas is that they represent perceptions (either new or already recorded in agent’s memory) coming in general from the external world (we say “in general” as, in fact, in some of the aforementioned agent-oriented frameworks perceptions can also result from internal events

, i.e., from an agent’s observations of its own internal activities). As it is customary in logic programming, variable symbols are indicated with an initial uppercase letter whereas constants/functions/predicates symbols are indicated with an initial lowercase letter.

The language of Temporalized DLEK (T-DLEK) is obtained by augmenting with the expression , where denotes a mental operation and is a ground formula. The mental operations that we consider are essentially the same as in [3]:

• , where is a ground formula of the form or : the mental operation that serves to form a new belief from a perception . A perception may become a belief whenever an agent becomes “aware” of the perception and takes it into explicit consideration. Notice that may be a negated atom.

• : believing both and , an agent starts believing their conjunction.

• , where is a ground atom, say : an agent, believing that is true and having in its long-term memory that implies (in some suitable time interval including ), starts believing that is true.

• where and are ground atoms, say and respectively: an agent, believing and having in the long-term memory that implies , removes the timed belief if the intervals match. Notice that, should be believed in a wider interval I such that , the belief is removed concerning intervals and , but it is left for the remaining sub-intervals (so, its is “restructured”).

The last mental operation, which is a sort of “update” or “restructuring operator”, substitutes ([3]), that instead represents arbitrary “forgetting”, i.e., removing a belief from the short-term memory. In fact in [3] there are , , and .

Example 1: We propose a small example to illustrate the form and the role of rules in the working memory and in the long-term memory. If at time it is starting raining, in the agent’s working memory there will be the following belief: . And if we have in the background knowledge and then the agent can infer , which is a new belief stored in the working memory. And if we have also
than the agent can infer which means that after getting the umbrella the agent can go around the shops.

Example 2: An example of a non-ground T-LEK formula is:

 K(□_[t_1,t_2](enrollment(T,T)) →□_[t_1,t_2](□_[T,T+14]send_payment(T_1,T_1)))

where we suppose that an agent knows that it is possible to enroll in the university in the period and that, after the enrollment, the payment must be sent within fourteen days (still staying within the interval ). Since, by the restrictions on formulas stated earlier, it must be the case that and both , must be in , only a finite set of ground instances of this formula can be formed by substituting natural numbers to the variables  (specifically, the maximum number of ground instances is assuming to pay on the last day ). In case one would consider the more general formula:

 K(□_[t_1,t_2](enrollment(T,T,X)) →□_[t_1,t_2](□_[T,T+14]send_payment(T_1,T_1,X)))

where represents a student of that university, i.e., holds for some ground instance of , then the set of ground instances would grow, as a different instance should be generated for each student (i.e., for each ground term replacing ). In practice, however, ground instances need not to be formed a priori, but rather they can be generated upon need when applying a rule; in the example, just one ground instance should be generated when some student intends to enroll in that university at a certain time .

### 2.2 Semantics

Semantics of DLEK and T-DLEK are both based on a set of worlds. In both DLEK and T-DLEK we have the valuation function: . Also we define the “time” function that associates to each formula the time interval in which this formula is true and operates as follows:

• , which stands for “p is true in the time interval where ; as a special case we have , which stands for “p is true in the time instant where (time instant);

• , which stands for “p is not true in the time interval where ;

• with , which means the unique smallest interval including both and ;

• ;

• ;

• where is a time interval in ;

• there are different cases depends on which kind of mental operations we applied:

1. ;

2. ;

3. ;

4. returns the restored interval where is true.

For a world , let be the minimum time instant of where and let be the supremum time instant (we can have ) among the atoms in . Then, whenever useful, we denote as where , which identifies the world in a given interval.

The notion of LEK/T-LEK model does not consider mental operations, discussed later, and is introduced by the following definition.

###### Definition 2.1

A T-LEK model is a tuple where:

• is the set of worlds;

• valuation function;

• “time” function;

• is the accessibility relation, required to be an equivalence relation so as to model omniscience in the background knowledge s.t. called epistemic state of the agent in , which indicates all the situations that the agent considers possible in the world or, equivalently any situation the agent can retrieve from long-term memory based on what it knows in world ;

• is a “neighbourhood” function, , defines, in terms of sets of worlds, what the agent is allowed to explicitly believe in the world ; , and :

1. if , then : each element of the neighbourhood is a set composed of reachable worlds;

2. if , then : if the world is compliant with the epistemic state of world , then the agent in the world should have a subset of beliefs of the world .

A preliminary definition before the Truth conditions : let a T-LEK model. Given a formula , for every ,  we define

 ∥φ∥M_w_I={v_I∈W∣M,v_I⊨φ}∩R(w_I).

Truth conditions for T-DLEK formulas are defined inductively as follows:

• iff and ;

• iff and ;

• iff and with ;

• iff or with ;

• iff or with ;

• iff   and ;

• iff for all , it holds that and ;

• iff and for all , it holds that ;

In particular, considering formulas of the forms and , we observe that if the set of worlds reachable from which entail in the very same model belongs to the neighbourhood of . Hence, knowledge pertains to formulas entailed in model in every reachable world, while beliefs pertain to formulas entailed only in some set of them, where this set must however belong to the neighbourhood and so it must be composed of reachable worlds. Thus, an agent is seen as omniscient with respect to knowledge, but not with respect to beliefs.

Concerning a mental operation performed by any agent , we have: iff and where Here represents a mental operation affecting the sets of beliefs. In particular, such operation can add new beliefs by direct perception, by means of one inference step, or as a conjunction of previous beliefs. When introducing new beliefs, the neighbourhood must be extended accordingly, as seen below; in particular, the new neighbourhood is defined for each of the mental operations as follows.

• Learning perceived belief:

with .

The agent adds to its beliefs perception (namely, an atom or the negation of an atom) perceived at a time in ; the neighbourhood is expanded to as to include the set composed of all the reachable worlds which entail in .

• Beliefs conjunction:

The agent adds as a belief if it has among its previous beliefs both and , with including all time instants referred to by them; otherwise the set of beliefs remain unchanged. The neighbourhood is expanded, if the operation succeeds, with those sets of reachable worlds where both formulas are entailed in .

• Belief inference:

The agent adds the ground atom as a belief in its short-term memory if it has among its previous beliefs and has in its background knowledge , where all the time stamps occurring in and in belong to . Observe that, if  does not include all time instants involved in the formulas, the operation does not succeed and thus the set of beliefs remains unchanged. If the operation succeeds then the neighbourhood is modified by adding as a new belief.

• Beliefs revision (applied only on ground atoms):
Given s.t. with and and and there is no interval s.t. where :

The agent believes that holds only in the interval and has the perception of where . Then, the agent replaces previous belief in the short-term memory with where . In general, the set is not necessarily an interval: being , with , and , we have that . Thus, is replaced by and (and similarly if ).

We write to denote that is true in all worlds , of every TLEK model .

Example 3: Let us consider the example of a person who is married or divorced, where s(he) can perform the action to be married or divorced. Let us assume that performed actions are recorded among an agent’s perceptions, with the due time stamp. For reader’s convenience, actions are denoted using a suffix “”. For simplicity, actions are supposed to always succeed and to produce an effect within one time instant. Let us consider the following rules (kept in long-term memory):

 K(marry(T,T)A→married(T+1,∞))K(divorce(T,T)A→divorced(T+1,∞)).

Let us now assume that a person married, e.g., at time ; then, a belief will be formed of the person is married from time  on; however, if that person later divorced, e.g., at time , as a consequence result that s(he) is divorced from time . It can be seen that the application of previous rules in consequence of an agent’s action of marring/divorcing determines some “belief restructuring” in the short-term memory of the agent. In absence of other rules concerning marriage, we intend that a person can not be simultaneously married and divorced. The related belief update is determined by the following rules:

 K(married(T,∞)→¬divorced(T,∞))K(divorced(T,∞)→¬married(T,∞))

With the above timing, the result of their application is that the belief formed at time , i.e., will be replaced by plus .

Property 1: For the mental operations previously considered we have the following (where are as explained earlier):

• .
Namely, as a consequence of the operation (thus after the perception of ) the agent adds to its beliefs.

• .
Namely, if an agent has and as beliefs, then as a consequence of the mental operation the agent starts believing ;

• .
Namely, if an agent has as one of its beliefs and has in its background knowledge, then as a consequence of the mental operation the agent starts believing ;

• where .
Namely, if an agent has as one of its beliefs, is not believed outside , the agent perceives where , and has in its background knowledge. Then after the mental operation the agent starts believing where .

## 3 Axiomatization and Canonical Models

The logic T-DLEK can be axiomatized as an extension of the axiomatization of DLEK as follows. We implicitly assume modus ponens, standard axioms for classical propositional logic, and the necessitation rule. The T-LEK axioms are the following:

1. ;

2. ;

3. ;

4. ;

5. .

The axiomatization of T-DLEK, involves these axioms:

1. where or or ;

2. ;

3. ;

4. ;

5. ;

6. ;

7. ;

8. ;

9.    where denotes the formula obtained by replacing  with  in .

We write to indicate that is a theorem of TDLEK.

Both logics T-LEK and T-DLEK are sound for the class of T-LEK models. The proof that T-DLEK is strongly complete can be achieved by using a standard canonical model argument.

The canonical T-LEK model is a tuple where:

• is the set of all maximal consistent subsets of ; so, as in [3], canonical models are constructed from worlds which are sets of syntactically correct formulas of the underlying language and are in particular the largest consistent ones. As before, each can be conveniently indicated as .

• For every and if and only if iff ; i.e., is an equivalence relation on knowledge; as before, we define . Thus, we cope with our extension from knowledge of formulas to knowledge of formulas.

• Analogously to [3], for , we define . Then, we put .

• is a valuation function defined as before.

• is a “time” function defined as before.

As stated in Lemma 2 of [3], there are the following immediate consequences of the above definition: if and , then

• for , it holds that if and only if such that we have ;

• for , if and then .

Thus, while -related worlds have the same knowledge and -related worlds have the same beliefs, as stated in Lemma 3 of [3] there can be -related worlds with different beliefs. The above properties can be used analogously to what is done in [3] to prove that, by construction, the following results hold:

###### Lemma 3.1

For all and , if but , it follows that there exists such that .

###### Lemma 3.2

For all and it holds that if and only if .

###### Lemma 3.3

For all then there exists such that .

Under the assumption that the interval is finite, the previous lemmas allow us to prove the following theorems. The limitation to finite intervals is not related to features of the proposed approach, but to well-known paradoxes of temporal logics on infinite intervals.

###### Theorem 3.1

T-LEK is strongly complete for the class of T-LEK models.

###### Theorem 3.2

T-DLEK is strongly complete for the class of T-LEK models.

With the new formalization of time intervals proposed in this paper, the proof of the previous Theorem immediately follows from the proof proposed in [3].

## 4 Conclusion

In this work we extended an existing approach to the logical modeling of short-term and long-term memories in Intelligent Resource-Bounded Agents by introducing the function, which manages the interval when an atom is true. Through this function we are also able to assign a “timing” to the epistemic operators and . Moreover we add the always operator of the Metric Temporal Logic to increase the expressiveness of our logic. We considered not just adding new beliefs, rather we introduced a new mental operation not provided in DLEK, to allow for removing/restructuring existing beliefs. The resulting T-DLEK logic shares similarities in the underlying principles with hybrid logics (cf., e.g., [2]) and with temporal epistemic logic (cf., e.g., [6]); as concerns the differences, the former has time instants but no time intervals, and the latter has neither time instants nor time intervals.

With regard to complexity for the mono agent case for LEK it has been proved that the satisfiability problem is decidable and it has been proved to be in NP-complete, instead for DLEK it has been conjectured to be PSPACE. It is easy to believe that our extensions cannot spoil decidability because the function do not interfere. Inference steps to derive new beliefs are analogous to D-LEK: just one modal rule at a time is used and a sharp separation is postulated between the working memory, where inference is performed, and the long-term memory. We are working on the extension to the multi-agent case, also reconsidering the complexity, and on the “Store” operation, which consist in managing the transition from working memory to long term memory.

## References

• [1]
• [2] Carlos Areces, Patrick Blackburn & Maarten Marx (2001):

Hybrid Logics: Characterization, Interpolation and Complexity

.
J. Symb. Log. 66(3), pp. 977–1010, doi:http://dx.doi.org/10.2307/2695090.
• [3] Philippe Balbiani, David Fernández Duque & Emiliano Lorini (2016): A Logical Theory of Belief Dynamics for Resource-Bounded Agents. In: Proceedings of the 2016 International Conference on Autonomous Agents & Multiagent Systems, Singapore, May 9-13, 2016, ACM, pp. 644–652.
• [4] Stefania Costantini, Andrea Formisano & Valentina Pitoni (2018): Timed Memory in Resource-Bounded Agents. In Chiara Ghidini, Bernardo Magnini, Andrea Passerini & Paolo Traverso, editors: AI*IA 2018 - Advances in Artificial Intelligence - XVIIth International Conference of the Italian Association for Artificial Intelligence, Proceedings, Lecture Notes in Computer Science 11298, Springer, pp. 15–29, doi:http://dx.doi.org/10.1305/ndjfl/1040046088.
• [5] Stefania Costantini & Valentina Pitoni (2019): Reasoning about Memory Management in Resource-Bounded Agents. In Alberto Casagrande & Eugenio Omodeo, editors: CILC 2019: Proceedings of the 34th Italian Conference on Computational Logic, 30, DBLP:conf/aiia/2018, https://cilc2019.units.it/CEUR/CILC2019/index.html, pp. 217–228.
• [6] Joeri Engelfriet (1996): Minimal Temporal Epistemic Logic. Notre Dame Journal of Formal Logic 37(2), doi:http://dx.doi.org/10.1305/ndjfl/1040046088.