# When You Must Forget: beyond strong persistence when forgetting in answer set programming

Among the myriad of desirable properties discussed in the context of forgetting in Answer Set Programming (ASP), strong persistence naturally captures its essence. Recently, it has been shown that it is not always possible to forget a set of atoms from a program while obeying this property, and a precise criterion regarding what can be forgotten has been presented, accompanied by a class of forgetting operators that return the correct result when forgetting is possible. However, it is an open question what to do when we have to forget a set of atoms, but cannot without violating this property. In this paper, we address this issue and investigate three natural alternatives to forget when forgetting without violating strong persistence is not possible, which turn out to correspond to the different possible relaxations of the characterization of strong persistence. Additionally, we discuss their preferable usage, shed light on the relation between forgetting and notions of relativized equivalence established earlier in the context of ASP, and present a detailed study on their computational complexity.

## Authors

• 8 publications
• 10 publications
• 17 publications
• 41 publications
07/29/2019

### A Syntactic Operator for Forgetting that Satisfies Strong Persistence

Whereas the operation of forgetting has recently seen a considerable amo...
07/14/2021

### Forgetting in Answer Set Programming – A Survey

Forgetting - or variable elimination - is an operation that allows the r...
09/18/2019

### On the Strong Equivalences of LPMLN Programs

By incorporating the methods of Answer Set Programming (ASP) and Markov ...
07/21/2017

### On the Computation of Paracoherent Answer Sets

Answer Set Programming (ASP) is a well-established formalism for nonmono...
08/10/2021

### On the Foundations of Grounding in Answer Set Programming

We provide a comprehensive elaboration of the theoretical foundations of...
11/09/2020

### A Syntactic Approach to Studying Strongly Equivalent Logic Programs

In the field of Answer Set Programming (ASP), two logic programs are str...
11/17/2018

### Advanced Memory Buoyancy for Forgetful Information Systems

Knowledge workers face an ever increasing flood of information in their ...
##### 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

A fundamental conclusion drawn in [Gonçalves et al. (2016c)] is that it is sometimes impossible to forget a set of atoms from an answer set program while obeying important desirable properties, notably the so-called strong persistence. However, even in such cases, we may be forced to forget – just imagine a court ordering the elimination of illegally acquired information. In this paper, we thoroughly investigate how to forget when it is impossible to obey strong persistence.

Forgetting is an operation that allows the removal from a knowledge base of middle variables no longer deemed relevant. Its importance is witnessed by its application, e.g., to cognitive robotics [Lin and Reiter (1997), Liu and Wen (2011), Rajaratnam et al. (2014)], resolving conflicts [Lang et al. (2003), Zhang and Foo (2006), Eiter and Wang (2008), Lang and Marquis (2010)], and ontology abstraction and comparison [Wang et al. (2010), Kontchakov et al. (2010), Konev et al. (2012), Konev et al. (2013)]. With its early roots in Boolean Algebra [Lewis (1918)], it has been extensively studied within classical logic [Bledsoe and Hines (1980), Lang et al. (2003), Larrosa (2000), Larrosa et al. (2005), Middeldorp et al. (1996), Moinard (2007), Weber (1986)] and, more recently, in the context of Answer Set Programming (ASP) [Leite (2017)]. The non-monotonic rule-based nature of ASP creates very unique challenges to the development of forgetting operators – just as it happened with other belief change operations such as revision and update, cf. [Alferes et al. (2000), Eiter et al. (2002), Sakama and Inoue (2003), Slota and Leite (2012), Delgrande et al. (2013), Slota and Leite (2014)] – making it a special endeavour with unique characteristics distinct from those for classical logic. This led to the introduction of several forgetting operators and classes of operators [Zhang and Foo (2006), Eiter and Wang (2008), Wong (2009), Wang et al. (2012), Wang et al. (2013), Knorr and Alferes (2014), Wang et al. (2014), Delgrande and Wang (2015), Gonçalves et al. (2016c)] (c.f. [Gonçalves et al. (2016b)] for a recent critical survey).

From [Gonçalves et al. (2016b)] it stood out that strong persistence (SP) [Knorr and Alferes (2014)] – a property essentially requiring that all existing relations between the atoms not to be forgotten be preserved – best captures the essence of forgetting in the context of ASP. However, as shown in [Gonçalves et al. (2016c)], sometimes the atoms to be forgotten play such a pivotal role that they cannot be forgotten without violating (SP). The class of situations when forgetting is possible was characterized through a criterion –  – that can be applied to any answer set program and set of atoms , holding whenever cannot be forgotten from , and not holding otherwise. For those cases when forgetting is possible, [Gonçalves et al. (2016c)] also presents a class of forgetting operators that satisfy (SP), dubbed .

But what if  is true and we nevertheless must forget? This may happen for legal and privacy issues, including, for example, to enforce the new EU General Data Protection Regulation [European Parliament (2016)], which includes the right to be forgotten – the person’s right to ask a corporation to eliminate private data – or the implementation of court orders to eliminate certain pieces of illegally acquired or maintained information. Tools that can help companies and users automate the operation of forgetting should be able to handle not only situations where we can achieve the required forgetting without violating strong persistence, but also situations where such ideal forgetting is not possible. Towards developing a theoretical ground on which such universally applicable tools can be based, in this paper, we thoroughly address the question of how to forget when  is true, along three different ways.

We first take a closer look at the class , which had only been considered for the case when  is false, and investigate how it behaves in general. One crucial observation is that it overestimates answer sets, i.e., forgetting preserves all existing answer sets, but new ones may be added, which indicates a violation of property (sC) (strengthened consequence).

Our second approach borrows from the notion of relativized equivalence [Eiter et al. (2007)], a generalization of strong equivalence that considers equivalence only w.r.t. a given subset of the language, and is characterized by the so-called -HT-models111Programs are relativized equivalent w.r.t.  if and only if they have the same -HT-models, which lead us to consider two novel ways to forget: a specific operator that simply returns all rules that are relativized equivalent to the original program w.r.t. the atoms not to be forgotten and, alternatively, a class of operators whose result is characterized by the set of -HT-models, omitting the atoms to be forgotten. The former operator turns out to be a member of the latter class. Whereas this class never overestimates answer sets, i.e., it obeys (sC), it may lose some of the original answer sets, which indicates a violation of property (wC) (weakened consequence).

The third approach tries to overcome a weakness of the second, i.e., its result diverges from even when it is possible to forget, and proposes a case-based definition that can be seen as a mixture of the previous two. Whereas it preserves all answer sets, i.e., it obeys both (sC) and (wC), it no longer satisfies (SI) (strong invariance), i.e., forgetting first and then adding some set of rules (not containing the atoms to be forgotten) is no longer (strongly) equivalent to adding first, and forgetting subsequently.

In this paper, we fully investigate these three alternatives. We characterize them by showing which subset of the properties previously considered in the literature each of them obeys, study their computational complexity, and relate them by considering further additional properties to help clarify their preferable usage. Perhaps one of the most interesting features of this set of alternatives stems from a characterisation of (SP) according to which a forgetting operator obeys (SP) if and only if it obeys (sC), (wC) and (SI). Hence, each of the three alternatives exactly corresponds to the relaxation of one of these three properties that characterize (SP).

Additional relevant results include a formal correspondence between -HT-models and HT-models allowing us to leverage beneficial properties of HT-models, such as monotonicity, in the realm of -HT-models, which do not satisfy them, and a complexity result for checking whether  holds.

The remainder of the paper starts with some background on forgetting in ASP, then proceeds with one section for each of the three approaches, followed by one on their complexity, and one with some brief concluding remarks.

## 2 Forgetting in ASP

In this section, we recall the necessary notions on answer set programming and forgetting.

### Logic programs

We assume a propositional signature , a finite set of propositional atoms222Often, the term propositional variable is used synonymously.. An

(extended) logic program

over is a finite set of (extended) rules of the form

 a1∨…∨ak←b1,...,bl,notc1,...,notcm,notnotd1,...,notnotdn, (1)

where all , and are atoms of .333Extended logic programs [Lifschitz et al. (1999)] are actually more expressive, but this form is sufficient here. Such rules are also commonly written in a more succinct way as

 A←B,notC,notnotD, (2)

where we have , , , , and we will use both forms interchangeably. By we denote the set of atoms appearing in . This class of logic programs, , includes a number of special kinds of rules : if , then we call disjunctive; if, in addition, , then is normal; if on top of that , then we call Horn, and fact if also . The classes of disjunctive, normal and Horn programs, , , and , are defined resp. as a finite set of disjunctive, normal, and Horn rules. Given a program and a set of atoms, the reduct is defined as .

An HT-interpretation is a pair s.t. . Given a program , an HT-interpretation is an HT-model of if and , where denotes the standard consequence relation for classical logic. We admit that the set of HT-models of a program are restricted to even if . We denote by the set of all HT-models of . A set of atoms is an answer set of if , but there is no such that . The set of all answer sets of is denoted by . We say that two programs are equivalent if and strongly equivalent, denoted by , if for any . It is well-known that exactly when  [Lifschitz et al. (2001)]. We say that is an HT-consequence of , denoted by , whenever . The -exclusion of a set of answer sets (a set of HT-interpretations) , denoted , is (). Finally, given two sets of atoms , we write whenever .

We recall the notion of -SE-models [Eiter et al. (2007)], but here adapted to -HT-models that focus on , instead of on . An HT-interpretation is called a -HT-interpretation if either or . A -HT-interpretation is a (relativized) -HT-model of if: ; for all with , ; and if , then there exists such that and . We denote by the set of all -HT-models of . Programs are relativized equivalent w.r.t. , denoted by , if for any s.t. . We have that exactly when  [Eiter et al. (2007)].

### Forgetting

Given a class of logic programs over , a forgetting operator (over ) is a partial function s.t. is a program over , for each and . We call the result of forgetting about from . Unless stated otherwise, in what follows, we will be focusing on , and we leave implicit. Furthermore, is called closed for if, for every and , we have . A class of forgetting operators (over ) is a set of forgetting operators (over ) s.t. . Such classes are usually described by a common definition/condition that each operator in the class has to satisfy (see [Gonçalves et al. (2016b)] for an overview on the many different kinds and forms of defining such classes).

At the same time, previous work on forgetting in ASP has introduced a variety of desirable properties accompanying these classes of operators. In the following, we recall these properties and leave the details, e.g., on which class of forgetting operators satisfies which properties to [Gonçalves et al. (2016b), Gonçalves et al. (2016a)].444We omit (NP) from the list, as it has been shown there to coincide with (W). Unless stated otherwise, is a class of forgetting operators, and the class of programs over of a given .

• [align=left]

• satisfies strengthened Consequence if, for each , and , we have .

• satisfies weak Equivalence if, for each , and , we have whenever .

• satisfies Strong Equivalence if, for each , and : if , then .

• satisfies Weakening if, for each , and , we have .

• satisfies Positive Persistence if, for each , and : if , with and , then .

• satisfies Strong (addition) Invariance if, for each , and , we have for all programs with .

• satisfies Existence for , i.e., is closed for a class of programs if there exists s.t.  is closed for .

• satisfies Consequence Persistence if, for each , and , we have .

• satisfies weakened Consequence if, for each , and , we have .

• satisfies Strong Persistence if, for each , and , we have , for all programs with .

We refer to the recent critical survey [Gonçalves et al. (2016b)] for a discussion about existing relations between these properties, but we want to point out that the importance of (SP) is witnessed by the fact that if some class satisfies (SP), then it also satisfies basically all other mentioned properties (but (W) and (E), which is orthogonal).

###### Example 1

Consider the following program .

 a ←notb b ←notc e ←d d ←a

First, if we want to forget about an atom, then we expect that all rules that do not mention this atom should persist, while rules that do mention the atoms should no longer occur. For example, when forgetting about from , the first two rules should be contained in the result of the forgetting, while the latter two should not. At the same time, implicit dependencies should be preserved, such as, depending on via . Hence, we expect as follows:

 a ←notb b ←notc e ←a

In fact, many existing notions of forgetting in the literature (c.f. [Gonçalves et al. (2016b)]) provide precisely this result.

Now, consider forgetting about from . Note that contains an implicit dependency between and , namely, whenever becomes true, then so does , i.e., if we add, e.g., to the program, then is necessarily true. Different notions of (classes of) forgetting operators existing in the literature (see [Gonçalves et al. (2016b)]) would return the result of forgetting , but if we want to preserve property (SP), then must contain the rule . In fact, a valid result for such that satisfies (SP) is:

 a ←notnotc e ←d d ←a

Finally, if the atom to be forgotten does not appear at the same time in some rule body and some rule head, usually no dependencies need to be preserved. Consider forgetting about from , then, since only appears in the body of a rule, the result is:

 a ←notb b ← e ←d d ←a

## 3 On the Limits of Forgetting

As argued in [Gonçalves et al. (2016c)], (SP) is the central property one wants to ensure to hold when forgetting atoms from an answer set program, essentially because its definition intuitively requires that all (direct and indirect) dependencies between the atoms not to be forgotten be preserved. This is witnessed by the fact that any class of forgetting operators that satisfies (SP) also satisfies all other properties introduced in the literature, with the exception of (W), which has been shown to be incompatible with (SP) [Gonçalves et al. (2016b)]. However, it is also shown that it is not always possible to forget a set of atoms from a given program, that is, there is no forgetting operator that satisfies (SP) and that is defined for all pairs , called forgetting instances, where is a program and is a set of atoms to be forgotten from . The precise characterization of when it is not possible to forget while satisfying (SP) is given by means of criterion .

###### Definition 1 (Criterion Ω)

Let be a program over and . An instance satisfies criterion if there exists such that the set of sets

 RY={RY,A⟨P,V⟩∣A∈RelY⟨P,V⟩}

is non-empty and has no least element, where

 RY,A⟨P,V⟩ RelY⟨P,V⟩ ={A⊆V∣⟨Y∪A,Y∪A⟩∈HT(P) and ∄A′⊂A s.t.\ ⟨Y∪A′,Y∪A⟩∈HT(P)}.

The rationale is that each set is based on , which is a potential answer set of the result of forgetting. Taking property (SP) into account, an answer set of must be obtained from an answer set of , for some . So, the HT-models of the form in must be taken into account. This is captured by the set . Nevertheless, there are some such that is never an answer set of , for any over . This is captured by the condition of the set .

This criterion was shown to be sound and complete, i.e., it is not possible to forget about a set of atoms from a program exactly when satisfies criterion . A corresponding class of forgetting operators, , was introduced.

###### Definition 2 (SP-Forgetting)

Let be the class of forgetting operators defined by the following set:555The definition is slightly generalized from [Gonçalves et al. (2016c)] as is no longer restricted to be . Whenever , then the two versions naturally coincide.

 {f∣HT(f(P,V))={⟨X,Y⟩∣Y⊆A\textbackslashV∧X∈⋂RY}}

It was shown that every operator in satisfies (SP) for instances that do not satisfy . In fact, restricted to those instances, satisfies every property except (W), which makes this class of operators an ideal choice whenever forgetting is possible.

However, the question as to whether this class is also of any use in case  is satisfied has not been tackled. Given our focus on this problem, we first consider itself as a possible solution and characterize which of the well-known properties of forgetting are satisfied by in general, i.e., independently of whether  is satisfied or not.

###### Proposition 1

satisfies (wC), (SE), (PP), and (SI), but does not satisfy (wE), (W), (sC), (CP).

Regarding existence, it has already been shown in [Gonçalves et al. (2016c)] that is closed for extended programs and Horn programs, but not for disjunctive nor normal programs.

From the previous proposition, we observe that (W) is no longer the only property that does not hold. Notably, the fact that does not satisfy (CP), and in particular (sC), means that there are instances for which the result of forgetting about from has answer sets that do not correspond to answer sets in the original program , which is also why does not hold.

###### Example 2

Consider the following program .

 a ←p b ←notp p ←notnotp

Clearly, has six HT-models, , 666We follow a common convention and abbreviate sets in HT-interpretations such as with the sequence of its elements, ., and two answer sets and . Intuitively, yields an exclusive choice between and . If we take , then, , , , and . From this we have that , , , and . This means that for any , has three HT-models, , which means that has three answer sets, the two from ignoring , and , and additionally . Intuitively, this happens because using the intersection essentially discards both and (modulo the forgotten ).

This is in fact rather atypical as so far no class of forgetting operators that satisfies (wC), but not (sC), and thus not (CP), was known. Since the violation of (sC) may be seen as sufficient cause to render inadequate when  is satisfied – notably when the introduction of new answer sets as the result of forgetting cannot be accepted – alternatives need to be investigated.

## 4 Relativized Forgetting

In this section, we explore alternative ways to forgetting in ASP, borrowing from the notion of relativized equivalence [Eiter et al. (2007)]. Relativized equivalence is a generalization of strong equivalence that considers equivalence w.r.t. a given subset of the language, such that equivalence and strong equivalence are its special cases (for the empty and the entire language respectively). This fits naturally within the idea of forgetting in ASP, in particular w.r.t. property (SP), inasmuch as after forgetting about from we only allow the addition of programs over , so relativized (strong) equivalence should be applied accordingly.

Based on this idea, we first define a forgetting operator that simply considers all logical consequences w.r.t. relativized equivalence. This way, the result of forgetting about from amounts to the set of all rules (over ) that can be added to while preserving relativized equivalence. Given a program and , we consider the closure of given :

 Cn(P,V)={r∣{r}∈Ce and P∪{r}≡VP}.

Then, the result of forgetting about from is defined as

 fr(P,V)={r∣r∈Cn(P,V) and A({r})∩V=∅}.

The resulting program does not mention the forgotten atoms and we can show that this operator does not belong to .

###### Example 3

Recall program from Ex. 2. It can be verified that is strongly equivalent to the program:

 a ←notb ⊥ ←nota,notb b ←nota a∨b ←

Notably, this program does not have the answer set , which indicates that this operator does not belong to .

We can show that is well-defined, in the sense that testing relativized equivalence for each rule individually is the same as testing the entire set of rules as a whole.

###### Proposition 2

Let be a program, and programs over . Then, iff and .

As a consequence of the above result, is in fact the largest set of rules over that can be safely added to without changing its set of -HT-models.

###### Proposition 3

Let be a program and . Then, is the largest set of rules over the alphabet such that .

We could now define a (possibly singleton) class of operators that generalizes the idea of in a straightforward manner, and then study this class, but its definition would not be very concise, as we would always have to check for each rule whether it is relativized equivalent to the original program.

Instead, inspired by knowledge forgetting [Wang et al. (2014)], we follow a different idea, defining a class of forgetting operators that consider the -HT-models of and omit all occurrences of elements of from these. Formally:

 FR={f∣HT(f(P,V))=HTV(P)∥V}
###### Example 4

Recall Ex. 3. It can be verified that the result of forgetting for any coincides with that for .

It turns out that this correspondence is no mere coincidence. In fact, we show in the following that , and in the course of that, we establish a precise relation between the HT-models and the -HT-models of a program. This is an important contribution, since it allows the usage of well-known properties of HT-models, such as monotonicity, that are not satisfied by -HT-models (see [Eiter et al. (2007)]).

First, we introduce an alternative characterization of the -HT-models of a program based on its HT-models using the following notion.

###### Definition 3

Let be a program and . Then, is relevant for w.r.t.  if

1. [label=()]

2. for every s.t. .

denotes the set of all sets relevant for w.r.t. .

This notion is tightly connected with the sets in the definition of criterion , i.e., we can show that iff . This allows the alternative definition of a -HT-model in terms of HT-models.

###### Proposition 4

Let be a program and . Then, a -HT-interpretation is a -HT-model of iff the following conditions hold:

1. [label*=(0)]

2. ;

3. If , then there exists with such that .

We can now present an alternative characterization of the set of -HT-models of a program in terms of its set of HT-models. This result is particularly useful since it shows how the set of -HT-models of a program can be directly obtained from its set of HT-models.

###### Proposition 5

Let be a program and . Then,

 HTV(P)=⋃Y∈Rel(P,V)({⟨X% \textbackslashV,Y⟩:⟨X,Y⟩∈HT(P) and X⊂Y}∪{⟨Y,Y⟩}).

Based on that, we can show that is indeed a concrete forgetting operator in the class .

###### Theorem 1

Let be a program and . Then,

 HT(fr(P,V))∥V=HTV(P)∥V.

Interestingly, we are also able to provide an alternative characterization of that clarifies the relation to .

###### Theorem 2

Let be a program and . Then, can be given by the set

 {f∣HT(f(P,V))={⟨X,Y⟩∣Y⊆A\textbackslashV∧X∈⋃RY}}.

Thus, this notion of forgetting based on relativized equivalence differs from by considering the union of the relevant HT-models instead of the intersection, which explains the differences observed in Ex. 2 and 3.

Of course, whenever contains only one element, union and intersection coincide, which is always the case for Horn programs.

###### Proposition 6

Let and . Then, for every , we have that has at most one element.

Thus, when restricted to , coincides with .

###### Proposition 7

Let and . Then, for every and we have that .

Since this correspondence does not hold in general, we also establish which properties are satisfied by .

###### Proposition 8

satisfies (sC), (SE), (PP), (SI), (E), (E), but not (wE), (W), (wC), (CP), (E), (E).

In terms of the considered set of properties, and only differ with respect to (sC) and (wC). This difference, however, is crucial. Since satisfies (sC), it approximates the set of answer sets of , but, contrary to , never ends up adding new answer sets to the result of forgetting. However, it’s not all roses, as will become clear next.

## 5 Merging FSP and FR

We have shown that , which is based on relativized forgetting, is a better alternative than if our objective is to approximate the set of answer sets modulo the forgotten atoms, but not introduce new answer sets. However, has a drawback: there are cases where it is possible to forget while satisfying (SP), but the result for any does not coincide with the desired result (obtainable with operators from ).

###### Example 5

Consider the following program and that we want to forget about from .

 a ←p p ←notnotp

It is easy to check that does not satisfy , i.e., it is possible to forget about from while satisfying (SP). The result returned by any operator in is strongly equivalent to . However, for any is strongly equivalent to the empty program.

The difference between and , as shown in Thm. 2, lies in the usage of intersection and union in their respective definitions. The key point is that whenever has more than one element, even if there is a least one, union and intersection will not coincide. Taking this idea into account, we define a class of operators that aims at combining the delineated positive aspects of both and .

 FM={f∣HT(f(P,V))={⟨X,Y⟩∣ Y⊆A\textbackslashV and X∈⋃RY, if RY % has no least element, or X∈⋂RY, otherwise}}.

Whenever has a least element, then employs the intersection, whose result is precisely the least element, similar to and does therefore coincide with the desired ideal solution in this case, and whenever there is no least element it uses the union instead, just like .

###### Example 6

Consider the program of Ex. 2. The result of forgetting about from that program, for any , is strongly equivalent with that given in Ex. 3 for any . On the other hand, for the program given in Ex. 5, the result of forgetting about from that program, for any , is strongly equivalent to , and the same also holds for any operator in .

Still, if we consider only Horn programs, then this definition of coincides with both its constituents.

###### Proposition 9

Let and . Then, for every and we have that .

Moreover, unlike , we are able to show that, whenever it is possible to forget, coincides with .

###### Proposition 10

Let be a program and , such that does not satisfy . Then, for every and we have that .

The particular definition of ensures that yet again a different set of properties is satisfied by it.

###### Proposition 11

satisfies (sC), (wE), (SE), (wC), (CP), (PP), (E), (E), but not (W), (SI), (E), (E).

Contrary to and , the class satisfies both (wC) and (sC), and consequently (CP). Therefore, the result of forgetting according to preserves the answer sets of , but, unlike the other two, no longer satisfies (SI).

In fact, the answer sets are no longer preserved if a (non-empty) program over is added to . To capture this in a more precise way, we introduce generalizations of (wC) and (sC), which correspond to the two inclusions of (SP).

• [align=left]

• satisfies strengthened Strong Persistence if, for each , and , we have , for all with .

• satisfies weakened Strong Persistence if, for each , and , we have , for all with .

Property (wSP) guarantees that all answer sets of are preserved when forgetting, no matter which rules over are added to , but, for some such , does not prevent that the result of forgetting has more answer sets than . Vice versa, (sSP) does not guarantee the preservation of all answer sets of for some added over , but it ensures that all answer sets of the result of forgetting indeed correspond to answer sets of , independently of the added rules .

We can show that each of the three considered classes of forgetting operators only satisfies one of the two properties.

###### Theorem 3

satisfies (wSP), whereas and satisfy (sSP).

Since there is no class of forgetting operators that satisfies (SP) [Gonçalves et al. (2016c)], it is clear that does not satisfy (sSP), and that and do not satisfy (wSP). Thus, even though satisfies (wC), i.e., (wSP) for an empty , it does not for arbitrary ’s. Still, although both and satisfy (sSP), the following result shows that provides a better approximation in terms of property (SP).

###### Proposition 12

Let be a program, , , and . Then, for every with ,

 AS(f(P,V)∪R)⊆AS(f′(P,V)∪R).

Clearly, satisfies (SP) iff it satisfies (wSP) and (sSP). Since no can in general satisfy (SP), we basically obtain two kinds of relaxations on the conditions of (SP). But we can do even better: following results from [Gonçalves et al. (2016b)], we know that satisfies (SP) iff it satisfies (wC), (sC), and (SI). From the results in Props. 1, 8, and 11, we obtain that each of the three discussed classes corresponds to a unique relaxation of the conditions of (SP), implying that our study gives a complete account on which forgetting operators to use when (SP) cannot be satisfied, but only approximated.

Arguably, is also more flexible in situations where we have to forget several atoms for which and do not provide the optimal overall choice.

###### Example 7

Consider the following program from which we want to forget about and .

 d ←c c ←notnotc a ←p b ←notp p ←notnotp

Clearly, allows us to correctly capture the result of forgetting about , in the sense that is part of the result of forgetting, but, at the same time, will introduce new answer sets in which both and are true. On the other hand, will avoid the latter problem, but will simply cancel all rules mentioning and . Here, certainly provides the best alternative as it avoids both problems and provides the desired result.

In practice, the choice between the three classes greatly depends on the application at hand. To help making this decision, we now identify, for each of the three classes, a set of conditions in favor of its choice over the other two.

The class should be chosen whenever:

• (SP) should hold for those instances that do not satisfy ;

• Rules that do not mention atoms to be forgotten should be preserved;

• All answer sets should be preserved; and

• We do not mind the appearance of new answer sets.

The class should be chosen whenever:

• Rules that do not mention atoms to be forgotten should be preserved;

• No new answer sets should appear;

• We do not mind that some answer sets may disappear; and

• We do not mind that (SP) does not hold even if does not hold.

The class should be chosen whenever:

• (SP) should hold for those instances that do not satisfy ;

• Answer sets should be preserved precisely (modulo the forgotten atoms); and

• We do not mind to change rules that do not mention atoms to be forgotten.

These conditions stem from the obtained results on which properties each of the classes of forgetting operators satisfies, and can be seen as a guideline for a more informed choice between the three alternative classes of operators.

## 6 Complexity

We assume familiarity with standard complexity concepts, such as NP. Given a complexity class , a oracle decides a given sub-problem from in one computation step. The class

contains the problems that can be decided in polynomial time by a non-deterministic Turing machine with unrestricted access to a

oracle. is the complementary class of . Thus, , and . We also recall that a language is in complexity class iff it is the intersection of a language in and a language in . Instead of we use the more common name . In addition, the following result will be useful due to the established correspondence between HT-and -HT-models in Prop. 5.

###### Proposition 13 ([Eiter et al. (2007)],Theorem 6.12.)

Given a program , an HT-interpretation , and , deciding whether is -complete.

Our first result is in the spirit of model-checking.

###### Lemma 6.1

Given program , , and HT-interpretation . Deciding whether is -complete. Hardness holds already for disjunctive programs.

Membership follows from guessing an interpretation and checking (cf. Proposition 13), while the hardness result can be adapted from the -hardness of ASP consistency, cf. [Eiter and Gottlob (1995)]. By means of this, we can determine the complexity of deciding whether a given program is strongly equivalent to the result of forgetting obtained by any .

###### Theorem 4

Given programs , , and , deciding whether (for ) is -complete. Hardness holds already for disjunctive programs.

Essentially, for the complementary problem, we guess an HT-interpretation and check that either or , but not both. The hardness result is then obtained by a reduction from -QSAT.

The next result provides the complexity of determining whether some occurs in the intersection of used in the definition of , and .

###### Lemma 6.2

Given program , , and HT-interpretation with , deciding whether is in .

Basically, we have to perform a - and a -test. The former decides whether , while the latter determines that for all , either or .

This Lemma allows us to obtain an identical result to Thm. 4 for .

###### Theorem 5

Given programs , , and , deciding whether (for ) is -complete. Hardness holds already for disjunctive programs.

The basic proof idea is very similar to the one sketched for Thm. 4, but subsituting the test with for .

Since the definition of is based on cases, deciding whether its condition holds, is computationally more expensive than the previous two (in Lemmas 6.1 and 6.2).

###### Lemma 6.3

Given program , , and HT-interpretation with , deciding whether , is in and in .

Fortunately though, since this test is both in and in , in the next result, we can basically solve the complementary problem of guessing an HT-interpretation and check that either or for , but not both, in one step.

###### Theorem 6

Given programs , , and , deciding whether (for ) is -complete. Hardness holds already for disjunctive programs.

Thus, determining whether for of any of the three considered classes of forgetting operators is always -complete. This shows that the choice which of the three classes of forgetting operators to use in a concrete situation is not influenced by their computational complexity.

Finally, we provide the complexity result for criterion , which on the one hand improves on a flaw for the membership result in [Gonçalves et al. (2016c)], but also includes the hardness result here.

###### Theorem 7

Let be a program over and . Deciding whether satisfies criterion  is -complete. Hardness holds already for disjunctive programs.

## 7 Concluding Remarks

We addressed the problem of forgetting in ASP when we must forget, even if satisfying the fundamental desirable property (SP) is not possible.

We thoroughly investigated three alternatives which, despite stemming from different starting points – one reusing a known class of forgetting operators, one exploring the concept of relativized equivalence, and one trying to get the best of the previous two – turn out to each correspond to the relaxation of one of three properties – (wC), (sC) and (SI) – that together characterize (SP). We characterized the three classes by showing which of the usually considered properties each obeys, established links between them, and investigated their computational complexity. The computational complexity turns out to be high, which is not surprising given, for example, the fact that, in classical logic, forgetting can only be expressed as a second-order axiom. Nevertheless, on the one hand, forgetting is an operation not expected to be done as regularly as for example model computation or query answering, while, on the other hand, at least for those classes that satisfy (SI), and , we can perform forgetting in a modular way focusing only on the relevant part of the program. Whether this can be extended also to remains an interesting open problem for future research.

We also established relevant novel results concerning a correspondence between -HT-models and HT-models and a full complexity result for checking whether the criterion () that indicates whether it is possible to forget while satisfying (SP) holds.

It is also noteworthy that none of the other operators and classes of operators mentioned in the literature satisfy the properties satisfied by the three classes discussed in this paper (c.f. [Gonçalves et al. (2016b)]). The closest approximation is the operator [Wang et al. (2013)] which obeys the same set of properties previously found in the literature as , yet, unlike , it does not satisfy either of the inclusions of (SP), notably (sSP).

Avenues for future research include investigating different forms of forgetting which may be required in practice, such as those that preserve some aggregated meta-level information about the forgotten atoms, or even going beyond maintaining all relationships between non-forgotten atoms which may be required by certain legislation. This may also be of interest for semantics different from ASP, such as for forgetting under the well-founded semantics [Alferes et al. (2013), Knorr and Alferes (2014)].

### Acknowledgments

R. Gonçalves, M. Knorr and J. Leite were partially supported by FCT strategic project NOVA LINCS (UID/CEC/04516/2013). R. Gonçalves was partially supported by FCT grant SFRH/BPD/100906/2014 and M. Knorr by FCT grant SFRH/BPD/86970/2012. S. Woltran was supported by the Austrian Science Fund (FWF): Y698, P25521.

## References

• Alferes et al. (2013) Alferes, J. J., Knorr, M., and Wang, K. 2013. Forgetting under the well-founded semantics. In Procs. of LPNMR, P. Cabalar and T. C. Son, Eds. LNCS, vol. 8148. Springer, 36–41.
• Alferes et al. (2000) Alferes, J. J., Leite, J. A., Pereira, L. M., Przymusinska, H., and Przymusinski, T. C. 2000. Dynamic updates of non-monotonic knowledge bases. The Journal of Logic Programming 45, 1-3 (September/October), 43–70.
• Bledsoe and Hines (1980) Bledsoe, W. W. and Hines, L. M. 1980. Variable elimination and chaining in a resolution-based prover for inequalities. In Procs. of CADE, W. Bibel and R. A. Kowalski, Eds. LNCS, vol. 87. Springer, 70–87.
• Delgrande et al. (2013) Delgrande, J. P., Schaub, T., Tompits, H., and Woltran, S. 2013. A model-theoretic approach to belief change in answer set programming. ACM Trans. Comput. Log. 14, 2, 14.
• Delgrande and Wang (2015) Delgrande, J. P. and Wang, K. 2015. A syntax-independent approach to forgetting in disjunctive logic programs. In Procs. of AAAI, B. Bonet and S. Koenig, Eds. AAAI Press, 1482–1488.
• Eiter et al. (2002) Eiter, T., Fink, M., Sabbatini, G., and Tompits, H. 2002. On properties of update sequences based on causal rejection. Theory and Practice of Logic Programming (TPLP) 2, 6, 721–777.
• Eiter et al. (2007) Eiter, T., Fink, M., and Woltran, S. 2007. Semantical characterizations and complexity of equivalences in answer set programming. ACM Trans. Comput. Log. 8, 3, 1–53.
• Eiter and Gottlob (1995) Eiter, T. and Gottlob, G. 1995. On the computational cost of disjunctive logic programming: Propositional case.

Annals of Mathematics and Artificial Intelligence

15, 3-4, 289–323.
• Eiter and Wang (2008) Eiter, T. and Wang, K. 2008. Semantic forgetting in answer set programming. Artif. Intell. 172, 14, 1644–1672.
• European Parliament (2016) European Parliament. 2016. General data protection regulation. Official Journal of the European Union L119/59.
• Gonçalves et al. (2016a) Gonçalves, R., Knorr, M., and Leite, J. 2016a. Forgetting in ASP: the forgotten properties. In Procs. of JELIA, L. Michael and A. C. Kakas, Eds. LNCS, vol. 10021. Springer, 543–550.
• Gonçalves et al. (2016b) Gonçalves, R., Knorr, M., and Leite, J. 2016b. The ultimate guide to forgetting in answer set programming. In Procs. of KR, C. Baral, J. Delgrande, and F. Wolter, Eds. AAAI Press, 135–144.
• Gonçalves et al. (2016c) Gonçalves, R., Knorr, M., and Leite, J. 2016c. You can’t always forget what you want: on the limits of forgetting in answer set programming. In Procs. of ECAI, M. S. Fox and G. A. Kaminka, Eds. IOS Press, 957–965.
• Knorr and Alferes (2014) Knorr, M. and Alferes, J. J. 2014. Preserving strong equivalence while forgetting. In Procs. of JELIA, E. Fermé and J. Leite, Eds. LNCS, vol. 8761. Springer, 412–425.
• Konev et al. (2012) Konev, B., Ludwig, M., Walther, D., and Wolter, F. 2012. The logical difference for the lightweight description logic EL. J. Artif. Intell. Res. (JAIR) 44, 633–708.
• Konev et al. (2013) Konev, B., Lutz, C., Walther, D., and Wolter, F. 2013. Model-theoretic inseparability and modularity of description logic ontologies. Artif. Intell. 203, 66–103.
• Kontchakov et al. (2010) Kontchakov, R., Wolter, F., and Zakharyaschev, M. 2010. Logic-based ontology comparison and module extraction, with an application to dl-lite. Artif. Intell. 174, 15, 1093–1141.
• Lang et al. (2003) Lang, J., Liberatore, P., and Marquis, P. 2003. Propositional independence: Formula-variable independence and forgetting. J. Artif. Intell. Res. (JAIR) 18, 391–443.
• Lang and Marquis (2010) Lang, J. and Marquis, P. 2010. Reasoning under inconsistency: A forgetting-based approach. Artif. Intell. 174, 12-13, 799–823.
• Larrosa (2000) Larrosa, J. 2000. Boosting search with variable elimination. In Procs. of CP, R. Dechter, Ed. LNCS, vol. 1894. Springer, 291–305.
• Larrosa et al. (2005) Larrosa, J., Morancho, E., and Niso, D. 2005. On the practical use of variable elimination in constraint optimization problems: ’still-life’ as a case study. J. Artif. Intell. Res. (JAIR) 23, 421–440.
• Leite (2017) Leite, J. 2017. A bird’s-eye view of forgetting in answer-set programming. In Procs. of LPNMR, M. Balduccini and T. Janhunen, Eds. LNAI, vol. 10377. Springer, 10–22.
• Lewis (1918) Lewis, C. I. 1918. A survey of symbolic logic. University of California Press. Republished by Dover, 1960.
• Lifschitz et al. (2001) Lifschitz, V., Pearce, D., and Valverde, A. 2001. Strongly equivalent logic programs. ACM Trans. Comput. Log. 2, 4, 526–541.
• Lifschitz et al. (1999) Lifschitz, V., Tang, L. R., and Turner, H. 1999. Nested expressions in logic programs. Ann. Math. Artif. Intell. 25, 3-4, 369–389.
• Lin and Reiter (1997) Lin, F. and Reiter, R. 1997. How to progress a database. Artif. Intell. 92, 1-2, 131–167.
• Liu and Wen (2011) Liu, Y. and Wen, X. 2011. On the progression of knowledge in the situation calculus. In Procs. of IJCAI, T. Walsh, Ed. IJCAI/AAAI, 976–982.
• Middeldorp et al. (1996) Middeldorp, A., Okui, S., and Ida, T. 1996. Lazy narrowing: Strong completeness and eager variable elimination. Theor. Comput. Sci. 167, 1&2, 95–130.
• Moinard (2007) Moinard, Y. 2007. Forgetting literals with varying propositional symbols. J. Log. Comput. 17, 5, 955–982.
• Rajaratnam et al. (2014) Rajaratnam, D., Levesque, H. J., Pagnucco, M., and Thielscher, M. 2014. Forgetting in action. In Procs. of KR, C. Baral, G. D. Giacomo, and T. Eiter, Eds. AAAI Press, 498–507.
• Sakama and Inoue (2003) Sakama, C. and Inoue, K. 2003. An abductive framework for computing knowledge base updates. Theory and Practice of Logic Programming (TPLP) 3, 6, 671–713.
• Slota and Leite (2012) Slota, M. and Leite, J. 2012. Robust equivalence models for semantic updates of answer-set programs. In Procs. of KR, G. Brewka, T. Eiter, and S. A. McIlraith, Eds. AAAI Press, 158–168.
• Slota and Leite (2014) Slota, M. and Leite, J. 2014. The rise and fall of semantic rule updates based on se-models. TPLP 14, 6, 869–907.
• Wang et al. (2013) Wang, Y., Wang, K., and Zhang, M. 2013. Forgetting for answer set programs revisited. In Procs. of IJCAI, F. Rossi, Ed. IJCAI/AAAI, 1163–1168.
• Wang et al. (2012) Wang, Y., Zhang, Y., Zhou, Y., and Zhang, M. 2012. Forgetting in logic programs under strong equivalence. In Procs. of KR, G. Brewka, T. Eiter, and S. A. McIlraith, Eds. AAAI Press, 643–647.
• Wang et al. (2014) Wang, Y., Zhang, Y., Zhou, Y., and Zhang, M. 2014. Knowledge forgetting in answer set programming. J. Artif. Intell. Res. (JAIR) 50, 31–70.
• Wang et al. (2010) Wang, Z., Wang, K., Topor, R. W., and Pan, J. Z. 2010. Forgetting for knowledge bases in DL-Lite. Ann. Math. Artif. Intell. 58, 1-2, 117–151.
• Weber (1986) Weber, A. 1986. Updating propositional formulas. In Expert Database Conf. 487–500.
• Wong (2009) Wong, K.-S. 2009. Forgetting in logic programs. Ph.D. thesis, The University of New South Wales.
• Zhang and Foo (2006) Zhang, Y. and Foo, N. Y. 2006. Solving logic program conflict through strong and weak forgettings. Artif. Intell. 170, 8-9, 739–778.