Hypothetical Database Temporal Reasoning with

0 downloads 0 Views 227KB Size Report
Chomicki for checking dynamic database integrity constraints into a situation- ... By doing this, we are able to: (1) Answer queries about a whole hypothetical evo ...
Hypothetical Database Temporal Reasoning with History Encoding Marcelo Arenas and Leopoldo Bertossi Ponti cia Universidad Catolica de Chile Escuela de Ingenieria Departamento de Ciencia de Computacion fmarenas,[email protected] y

Abstract

In this paper we integrate a history{encoding based methodology developed by Chomicki for checking dynamic database integrity constraints into a situationcalculus based speci cation of relational database updates as proposed by Reiter. By doing this, we are able to: (1) Answer queries about a whole hypothetical evolution of a database, without having to update the entire database and keep all the information associated to the generated states, (2) State and prove dynamic integrity constraints as static integrity constraints, (3) Transform non markovian preconditions for updates into markovian preconditions. All these results, although motivated by problems in database theory, can be applied to theories of action and change in general. The methodology presented here takes advantage of translations between rst order past temporal logic formulas and state bounded situation calculus queries and constraints.

Keywords: databases, updates, action, time, deduction, integrity constraints.

This research has been partially supported by a FONDECYT Grant (# 1971304). Part of this work has been done during the second author's sabbatical at the Technical University of Berlin. He is grateful to Ralf Kutsche and the \Computergestuzte Informationssysteme" (CIS) group for their support and hospitality; and to the Graduierten Kolleg \Verteilte Informationssysteme", the DAAD and the Catholic University of Chile (DIPUC) for their nancial support. We are grateful to Javier Pinto for his generous support. y Corresponding and Current Address: TU Berlin, FB Informatik, CIS - Sekr. EN7, Einsteinufer 17, D-10587 Berlin, Germany. [email protected] 

1

1 Introduction In [15], as an application of his solution to the frame problem [14], Ray Reiter proposed to specify the transaction based evolution of relational database by means of a particular kind of axioms written in the situation calculus (SC) [13]. In [3] the implementation and the functionalities of a computational system for doing automated reasoning from and about these speci cations are reported. Our motivation in this paper goes in the same direction, namely, in that of investigating how to use or apply a established formalism, in this case, the one mentioned before, to (a) formulate in the precise terms of the formalism some concrete reasoning problems, and (b) provide computational solutions to those problems on the basis of the underlying formalism and the problem representation, hopefully deductive solutions. We are originally motivated by the problem of answering queries about di erent states1 in the evolution of a relational database, when the database is virtually updated by the execution of a sequence of primitive transactions. For example, we want to consider queries of the form \Has it always been the case that the database has satis ed a given condition C?", or \Has there been a state of the database where a certain condition C has been satis ed?", or \Has the salary of some employee decreased along the database evolution?". Reiter raised this problem in the context of his speci cations of transaction based database updates [15]. The problem was treated in detail in [17] and a solution was implemented as reported in [3]. Nevertheless that solution is based on a kind of minimal progression of the database that depended on a detailed syntactical processing of the axioms of the speci cation, and on the particular syntactical form of them. In this paper we reconsider this problem and we propose a new solution that relies on processing the query itself, rather than the underlying axioms. This is done on the basis of (1) a reformulation of the query as a query stated in rst order past temporal logic (FOPTL) [9, 10]2, (2) a reformulation of Chomicki's history encoding methodology for eciently checking temporal integrity constraints, in the context of SC speci cations of database updates, and, in particular, (3) a speci cation in the SC of the evolution of new history encoding auxiliary relations that are generated from the query. 1 2

In this paper we do no make any distinction between states and situations. We can also use temporal logic as the original query language.

2

Although there is no explicit time in our situation calculus, for their similarity with dynamic integrity constraints [15], also called \temporal constraints" [8], we call these queries \temporal queries"3. Furthermore, we call this queries \hypothetical" because we have an initial, physical database at an initial state S0 and a list T of primitive transactions A1; : : :; An, that virtually update the database, producing new states S1; : : : ; Sn; and we want to answer a query about the generated sequence of states, without physically updating the whole database accordingly (and possibly keeping the data for every intermediate state). We are interested in querying this virtual evolution of the database. It turns out that the methodology we develop for answering queries can be adapted to give a solution to other reasoning problems. Here we show how to transform dynamic integrity constraints into static integrity constraints, so that any available methodology for handling static integrity constraints can be adapted for the dynamic case. In particular, we can take advantage of our results on automated proving of static integrity constraints [4] when dealing with the dynamic case. The other problem we solve consists in transforming preconditions for action executions that depend on the history of the database into preconditions that depend on the local, execution state. The former are called \non markovian transactions", and the later \markovian transactions". In this paper we can identify the following contributions: (1) An extension of Chomicki's methodology to the case in which there is a speci cation of the evolution of the database; and so (2) The possibility of doing hypothetical reasoning along a virtual evolution of the database (Chomicki considers physical updates of the database) and this with user de ned primitive transactions (as opposed to only insertions, deletions and modi cations, as usual); (3) A general solution to the problem of answering temporal queries in the context of Reiter's speci cations of database updates, and this solution works both in a progressive as in a regressive way; (4) A general transformation mechanism of dynamic integrity constraints into static integrity constraints, in a context like Reiter's, where both kind of constraints are expected to be logical consequences of the speci cation; and (5) A general mechanism for transforming In some papers, they are called \historical queries", but this name may cause confusions with work done by the temporal databases community that calls \historical" the queries about valid time, rather than about transaction time [18], which can be better associated to the situations of the situation calculus. 3

3

history dependent preconditions for action executions into preconditions to be evaluated at the execution state. For lack of space we do not state nor prove general theorems, but they can be found in the extended version of this paper [2]. In general, we consider our paper as a contribution in the direction of modeling and doing hypothetical reasoning in databases, a subject that has not received enough attention from the database community (but see [5, 6]). We think hypothetical reasoning will become more and more important in databases that are used for decision support, where \what if" questions are relevant, as the ones emerging in on-line analytical processing (OLAP) and datawarehousing [7].

2 Speci cations of DB Updates We will show the main ingredients of a speci cation in the SC of transaction based database updates, as proposed by Reiter in [15]. The situation calculus is a family of languages of many sorted predicate logic used to represent knowledge and reason about dynamic domains that are subject to discrete changes caused by action executions. In its languages, we nd domain individuals, states and actions at the same rst order object level, then rst order quanti cations over all these sorts of individuals are possible. They are usually denoted by x, s, a, respectively. In every SC language we nd a constant for an initial state, S0, a function symbol, do, so that do(a; s) denotes the successor state that results from the execution of action a at state s. We also nd a predicate Poss(a; s) with the intended meaning that action a is possible at state s. In a particular SC language we will nd function names for parameterized primitive transactions (actions), A(x), and names for tables, F (x; s), that is, predicates with a single state argument ( uents). If T is a sequence of action terms A1; : : : ; An, to be executed in that order, we abbreviate the situation do(An ; do(An?1 ; do(: : : do(A1; s); : : :)) with do(T; s). As in [12], we will assume that the following foundational axioms of the situation calculus underly any database speci cation4 : 1. Unique Names Axioms for Actions: Ai(x) = Aj (y), for all di erent action names Ai; Aj ; 8

8

8

6

In this paper, a \database speci cation" is always a speci cation of the dynamics of a database. 4

4

(x; y)[A(x) = A(y) x = y]. 2. Unique Names Axioms for States: S0 = do(a; s), do(a1; s1) = do(a2; s2) a1 = a2 s1 = s2. 3. For some reasoning tasks we need an Induction Axiom on States: P [(P (S0) s a (P (s) P (do(a; s))) s P (s)]. A speci cation of the transaction based updates on a particular database will contain the following axioms: 4. A set, 0, of SC sentences that do not mention any state term other than S0. This is knowledge about the initial state, and state independent knowledge. 5. Action Precondition Axioms (APA): For each action name A, a precondition axiom of the form (x; s)[Poss(A(x); s) A (x; s)], where A(x; s) is a SC formula that is simple in s, that is, it contains no state term other than s, in particular, no do symbol, no quanti cations on states, and no occurrences of the Poss predicate [15]. 6. Successor State Axioms (SSA): For every table F (x; s), an axiom of the form (a; s)Poss(a; s) x[F (x; do(a; s)) F (x; a; s)]; (1) where F is a formula simple in s, in particular, it does not contain the do symbol. Provided there is complete knowledge at the initial state, as is usually the case in relational databases, this axiom completely determines the contents of table F at an arbitrary legal database state, i.e. reached from S0 by a nite sequence of transactions that are possible at their execution states. We are usually interested in reasoning about the states which are accessible in this form from the initial situation. For this purpose, an accessibility relation on states, , can be de ned from the induction axiom plus the conditions: s < S0, s < do(a; s0) Poss(a; s0) s s0. We will denote this speci cation with . It includes the initial database 0 and the de nition of the accessibility relation. In the context of such DB speci cations, a temporal query is a SC sentence ' in which all the states involved, including quanti ed states, lie on a nite state path S0 S1 Sn , with Si = do(Ai ; do(Ai?1; : : : ; do(A1; S0) : : :)), for a sequence of ground actions terms A1; : : : ; An, for some n.5 The query is true i  = '. A static integrity constraint is a formula '(s), simple in the state variable s and without further free variables, such that  = s (S0 s '(s)) [15, 12]. A dynamic (or temporal) integrity constraint is a SC sentence

8



6



^

8



8

^ 8 8



8



8

 8





:





^



  

j

j

5

8





A precise syntactical de nition can be found in the extended version of this paper.

5

of the form s1 sn(C (S0; s1; : : :; sn ) '(s1; : : :; sn )), that should be entailed by . Here, C (S0; s1; : : :; sn) is a formula that imposes a linear order constraint on the states S0; s1; : : :; sn in terms of the accessibility predicate 6. 8

8





3 History Encoding and FOPTL Chomicki [8] considered the problem of checking temporal constraints stated in FOPTL. These are constraints that talk about, and relate, di erent states of the database. There we nd a sequence of transactions that are physically executed, and in order to minimize the cost of checking, one progressively updates new de ned relations, or auxiliary views, r 's, that correspond to the temporal subformulas, 's, in the constraint. These views encode part of the database evolution up to a current database state. They are de ned and updated in such a way that they store the historical information that is relevant to give an answer to the query about the satisfaction of the integrity constraint once the nal (current) state is reached. Then a new, non temporal, but local and static query can be posed at the nal state. In this paper we will combine our reconstruction of Chomicki's history encoding in the context of database speci cations with the possibility, opened by those speci cations, of reasoning about the database evolution without having to physically update the database. Then, we can apply the methodology in hypothetical temporal reasoning. We can say that while Chomicki answers the query by positioning at the nal physical state of the database, we query a single future, virtual state from the initial, physical state. In this way, virtual update makes possible to apply the methodology to any temporal query, whereas with physical update it can be applied to xed, predetermined temporal queries only. First order past temporal logic is an extension of rst order logic (FOL). In its languages time is implicit, discrete and linearly ordered; formulas are evaluated on structures at certain times (found at the semantical level, but not at the object level). There are new rules for building formulas: If ' and are formulas, then (a) ', with the intended meaning \' was Dynamic integrity constraints are usually of this form, but the results we will present in this paper still hold if we admit more involved quanti cations on several states, related by the accessibility relation. 6

6

true in the previous time", and (b) ' since , with the intended meaning \ became true at some time in the past and from that time on, ' has been true", are also formulas. Other temporal operators can be de ned: 3' =def True since ', with the intended meaning \Sometime in the past ' was true", and 2' =def 3 ', with the intended meaning \Always in the past ' was true". Formulas are interpreted in nite sequences of structures, Di , indexed by discrete linear time: (a) For 0 < i n, D0; : : : ; Dn =i ' i D0; : : : ; Dn =i?1 '. (b) For 0 < i n, D0; : : : ; Dn =i ' since i there is j < i such that D0; : : : ; Dn =j and for all j < k i, D0; : : : ; Dn =k '. Here =i means evaluation at time i, i.e. wrt Di, and non temporal FOL formulas are evaluated as usual. Notice that every model of the situation calculus restricted to a nite path in the SC tree gives rise to a sequence of FOL structures: DS0 ; DS1 ; : : :; DS . These sequences can be used to interpret FOPTL formulas, and we may write DS0 ; DS1 ; : : : ; DS ; : : :; DS =S '. :



:

j

j



j

j



j

j

n

i

n

j

i

4 SC vs. FOPTL There is a sort of equivalence between FOPTL and SC for a particular kind of queries and constraints (but not in general between temporal logic and rst order logic [1]). In our SC queries we have all the explicitly and implicitly mentioned states linearly ordered and bounded above by a current state (usually a virtual one)7. This is because they refer to the states arising from the execution of a particular sequence of primitive transactions. Consider a sequence of database states DS0 ; : : :; DS originated by the execution of a sequence T : A1; : : : ; An of primitive transactions. For every temporal query in the SC about these states, there exists a FOPTL query to be posed at the nal state Sn (wrt to the sequence of structures DS0 , ..., DS ) that has the same answer (this translation can be done with the \previous" temporal operator). On the other side, for every FOPTL formula to be evaluated at state Sn, there is a SC temporal formula mentioning the sequence of states S0; : : : ; Sn that gives the same answer. In both cases, we n

n

In the extended version of this paper we give a precise syntactical characterization of this kind of formulas. 7

7

say that the formulas are answer{equivalent in Sn 8.

Examples: 1. s (S0 s < Sn

xP (x; s)) and 3 xP (x) are answer{ equivalent in Sn . Notice that we omit the situation argument in the tables appearing in the FOPTL version of the query. 2. Has Sue been working in department 13 in all states generated by sequence T at S0?: s (S0 s Sn emp(Sue; 13; s)). This SC query is answer{ equivalent in state Sn (= do(T; S0)) to the FOPTL sentence emp(Sue; 13) 2emp(Sue; 13). 3. Was Joe hired as an employee of a lower rank before becoming a chief executive ocer?: s (S0 s do(T; S0 ) s0 (S0 s0 < s emp(Joe; s0) ceo(Joe; s0)) s00 (s s00 do(T; S0) emp(Joe; s00) ceo(Joe; s00))). This formula is answer{equivalent in state do(WT; S0) to the formula 2(emp(Joe) ceo(Joe)) emp(Joe) ceo(Joe) [emp(Joe) ceo(Joe)] since [emp(Joe) ceo(Joe) 2(emp(Joe) ceo(Joe))]. 9

8







^ 8

8



^

9



^ :



^ 8

^ 8

^:



^

^

^









^

^

^

^:

5 Extending Speci cations from Queries Our starting point consists of a SC speci cation  and a FOPTL sentence ' (possibly arising from a SC query as illustrated in the previous section) to be evaluated at the nal state S = Sn = do(T; S0), that results from the virtual update of the DB. So, ' implicitly refers to all states between S0 and S . What we want to obtain is a new SC speci cation H that extends , and a SC sentence 'h(S ), such that the answer to the original query coincides with the answer obtained from the evaluation of 'h(S ) wrt H . The new sentence refers only to the state S , and H contains a speci cation of the dynamics of new, history encoding, auxiliary relations. We will generate rst 'h and next H . For a FOPTL formula ' we de ne the SC formula 'h(S ) by induction, including new relations names for each temporal subformula of ': 1. If ' is of the form t1 = t2, where t1 and t2 are terms (for domain individuals), then 'h =def '. 2. If ' is of the form F (t) , then 'h =def F (t; S ). 3. If ' is , then 'h =def ( h). :

:

General translation mechanisms between the two logics are considered in the extended version. 8

8

4. (' )h =def ('h h), where is any of the usual binary propositional connectives. 5. (Q')h =def Q('h), where Q is any of the usual FOL quanti ers. 6. If ' is  (x), with non temporal, then 'h =def R'(x; S ), where R' is a new table name. 7. If '(x) is (x) since (x), where (x) and (x) are non temporal formulas, then 'h =def R'(x; S ), where R' is a new table name. By bottom{up transformation of a FOPTL formula ', we can always obtain such a formula 'h. Notice that this is a SC formula that is simple in the state S , it talks about an isolated state, S . Now we specify the dynamics of the new tables by means of SSAs. We have to consider the last two cases in the previous inductive de nition: (a) Let (x) be of the form  (x). This formula is true at a given state i (x) is true at the previous state. Then, the new table R (x; s) has the following SSA: (a; s)Poss(a; s) x (R (x; do(a; s)) h(x; s)): At the initial state (x) is false for each x, because S0 has no predecessor state, so we specify x R (x; S0). (b) Let (x) be of the form (x) since (x). This formula is true at a state s, with predecessor state s0, i ( since ) was true at s0 and is still true at s, or became true at s and  became true at s0. This is equivalent to saying that (( since ) ) is true at s0 and is true at s. Then, for R (x; s) it holds: h ( (a; s)Poss(a; s) x(R (x; do(a; s)) x; do(a; s)) (R (x; s) h(x; s)): This is not a SSA (of the form (1)), because there is a do(a; s) term in h on the RHS. But we can get rid of it applying Reiter's regression operator , that takes a formula, instantiated at a successor state of the form do(A; s), into a formula instantiated at the previous state, s. For doing this, uses the SSAs of the tables appearing in h(x; do(a; s)) [14, 15]. So, we obtain: (a; s)Poss(a; s) x (R (x; do(a; s)) [ h(x; do(a; s))] (R (x; s) h (x; s))): Notice that the application of the regression operator leaves the RHS of the equivalence above as a simple formula in s. Also notice that when is a 





8

 8

8



:

_

8

 8



^

_

R

R

8

 8

 R

^

_

9

FOPTL sentence, then the SC formula R (s) becomes a situation dependent propositional predicate. Finally, we also specify x R (x; S0). 8

:

Examples: 1. Let (x) be the temporal formula 3P (x). Since 3P (x) True since P (x), we obtain the following SSA for the new table R (x; s): (a; s)Poss(a; s)

8

x (R (x; do(a; s))

 8



[True ] (R (x; s) P (x; s)));

 R

^

_

which is equivalent to: (a; s)Poss(a; s)

x (R (x; do(a; s)) R (x; s) P (x; s)): 2. Assume the original speci cation  contains the following SSA for the

uent P (x; s): (a; s)Poss(a; s) x(P (x; do(a; s)) a = A(x) P (x; s) a = B (x)): We want to evaluate the query P (x) since (3Q(x)). If is 3Q(x), then we introduce a new table R with SSA: (a; s)Poss(a; s) x (R (x; do(a; s)) R (x; s) Q(x; s)): Introducing R in the query, we obtain P (x) since R (x). If this formula is (x), for the new table R we have: (a; s)Poss(a; s) x (R (x; do(a; s)) [P (x; do(a; s))] (R (x; s) R (x; s))). Replacing [P (x; do(a; s))] by the RHS of the SSA for P , we obtain: (a; s)Poss(a; s) x (R (x; do(a; s)) (a = A(x) P (x; s) a = B (x)) (R (x; s) R (x; s))). 8

8

 8



 8

8



 8

8

 8

_

_

^



6

_

 R

^

_

R

8

 8



_

^

6

^

_

6 Answering Hypothetical Temporal Queries Now we want to answer a SC temporal query posed to a virtual trajectory of the database from S0 to Sn = do(T; S0) (as before):  = ? If ' is a FOPTL sentence that is answer{equivalent to at Sn , then we can obtain the same answer by asking: D0; : : :; Dn =S '. But asking this is equivalent to asking whether H = 'h(do(T; S0)) holds, where H j

j

j

10

n

contains a speci cation of the auxiliary history encoding relations generated from ', and 'h(do(T; S0)) is a SC sentence. Notice that 'h is instantiated at the nal state do(T; S0), and this is the only state mentioned in the formula. So, we can see that we have transformed our problem of answering a temporal query wrt to a virtually updated database into the temporal projection problem of AI [11], that is, the problem of querying a future state obtained by the execution of an actions sequence. To solve this problem we may apply some existing techniques for Reiter like speci cations, e.g. Reiter's query regression [15] or minimal rolling forward of the database based on information that is relevant to the query [3, 17].

7 Dynamic Integrity Constraints are Static We can use our methodology to transform Dynamic Integrity Constraints (DICs) into Static Integrity Constraints (SICs). Actually, Chomicki's work [8] has to do with checking DICs statically. In our case, with our reformulation of Chomicki's methodology in terms of a speci cation of the dynamics of the history encoding relations, we can rewrite DICs as SC sentences expressing SICs, which can be proven as such from the (extended) speci cation of the database dynamics. In particular, we can use the methodology for proving SIC by automated induction presented in [4], and possibly others, like [16]. Let be a DIC expressed in the SC. As IC, it is expected to be true at every particular legal state s of the database. Nevertheless, for being dynamic, we can nd quanti cations on previous states, and then, it does not talk about the current state only. In general, we will think a DIC as a sentence talking about several states of the DB, but that has to be satis ed locally, at every legal state. On the basis of this assumption, we generate from a new SC constraint 0(s)), where 0(s) is obtained from by relativising all the s(S0 s quanti cations over states to s, e.g. if there is a quanti er s0 in , we replace it by s0 s. If 0(s) has an answer{equivalent FOPTL sentence ' at s, then we generate the SC formula 'h(s), as a new SIC, and a new speci cation H as in section 5. It is possible to prove that:  = i H = s (S0 s 'h (s)). 8







9

9



j

j

8





11

Example: Consider a speci cation  of a DB of employees with a salary

table Sal (e; m; s), where e is the employee, m is the salary, and s is the situational argument. Let be the usual DIC telling that an employee's salary cannot decrease: (s0; s00)(S0 s0 < s00 (e; m0; m00)((Sal (e; m0; s0) Sal (e; m00; s00)) m0 m00): 8



8



^



(2)



It must hold in every legal current state s of the DB, that is, as a sentence, it must follow from . Consider a new formula 0(s): (s0; s00)(S0 s0 < s00 s (e; m0; m00)((Sal (e; m0; s0) Sal (e; m00; s00)) m0 m00)). Sentence (2) holds in every legal state if and only if from  follows s (S0 s 0(s)). Now, 0(s) is answer{equivalent at s to the FOPTL sentence

8





 8

^





8





(e; m0; m00)((3Sal (e; m0) Sal (e; m00)) m0 m00) 2 (e; m0; m00)((3Sal (e; m0) Sal (e; m00)) m0 m00):

8

^

8



^





^



(3)

If (e; m0) is 3Sal (e; m0), we create a table R with speci cation: (e; m0) R (e; m0; S0); (a; s)Poss(a; s) (e; m0) 8

:

8

R (e; m0; do(a; s))  R (e; m0; s) _ Sal(e; m0; s):

 8

(4) (5)

Introducing R in (3) we obtain: (e; m0; m00)((R (e; m0) Sal (e; m00)) m0 m00) 2 (e; m0; m00)((R (e; m0) Sal (e; m00)) m0 m00): 8

^

8



^





^



(6)

If is the temporal subformula 2 (e; m0; m00)((R (e; m0) Sal (e; m00)) m0 m00), we create a table R with speci cation: 8

^





R (S0); (a; s)Poss(a; s) R (do(a; s)) R (s)

8



(7)

0 00 0 ^ 8(e; m ; m )((R (e; m ; s) ^ Sal (e; m00; s))  m0  m00): (8)



12

Introducing R in (6), we obtain (e; m0; m00)((R (e; m0; s) Sal (e; m00; s)) m0 m00) R (s): Thus, the original DIC holds in every state if and only if the speci cation H , consisting of  plus (4), (5), (7) and (8), entails the following SIC: 8



^



^

s (S0 s [ (e; m0; m00)((R (e; m0; s) Sal (e; m00; s)) m0 m00) R (s)]):

8



 8

^





^

8 Non Markovian Transactions As we saw in section 2, the formalism for specifying DB updates contains preconditions for action executions that depend on the current state of the database, only. Many concepts and algorithms that have originated from this formalism are based on this kind of \markovian" APAs. Nevertheless, there are natural scenarios in which the conditions for executing an action should depend on a longer history of the database. For example, in a voters database we might have the following APA for action vote : (x; y; s) (Poss (vote (x; y); s) n(Age (x; n; s) n 18) V s0(S s0 s InJail (x; s0))): Candidate (y; s) 0 That is, x can vote for y as long as y is a candidate, x is not younger than 18, and x has never been in jail. This is a \non markovian" transaction. We can use the machinery developed so far for transforming non markovian primitive transactions into markovian transactions. We start from a database speci cation  with an APA for the primitive transaction A of the form (x; s) Poss (A(x); s) (x; s); (9) where (x; s) is not necessarily simple in s, but has all the states mentioned in it, quanti ed or not, lying between S0 and s. If has an answer{equivalent FOPTL formula '(x) in s, then we can generate a new speci cation 0H from H , in its turn obtained from '(x) as before, but with the original APA (9) replaced by the new APA: (x; s) Poss (A(x); s) 'h (x; s): As before, the new speci cation contains SSAs for the auxiliary tables introduced by the construction of 'h (x; s). It is possible to prove that: (a) Both speci cations de ne the same accessible states, and (b) At every accessible state, action A is possible in the old sense i it is possible in the new sense.

8



9

^

8

8





8



13





^

 :

Example: We can apply the methodology to the voters example. In the

original APA for vote (x; y), the formula s0(S0 s0 < s InJail (x; s0)) is answer{equivalent in s to 2 Jail (x). So, we generate a new speci cation 0H , extending , except for the fact that it has: 1. A new table R (x; s) that contains, at state s, the people x that have not been in jail before state s, whose speci cation consists of x R (x; S0) and (a; s)Poss(a; s) x (R (x; do(a; s)) R (x; s) InJail (x; s)). 2. The original APA for action A replaced by (x; y; s) (Poss (vote (x; y); s) n(Age (x; n; s) n 18) Candidate (y; s) V InJail (x; s) R (x; s)). 8



 :

:

8

8

 8

8





9

^:

^

:



^

^



References [1] S. Abiteboul, L. Herr, and J. Van der Bussche. Temporal versus First{Order Logic to Query Temporal Databases. In Proc. ACM Symposium on Principles of Database Systems (PODS'96), pages 49{57, 1996. [2] M. Arenas and L. Bertossi. Hypothetical Temporal Reasoning with History Encoding (Extended Version). Can be found as ext-temporal.ps in http://dcc.ing.puc.cl/ bertossi/, 1997. [3] L. Bertossi, M. Arenas, and C. Ferretti. SCDBR: An Automated Reasoner for Speci cations of Database Updates. Journal of Intelligent Information Systems, To appear. [4] L. Bertossi, J. Pinto, P. Saez, D. Kapur, and M. Subramaniam. Automating Proofs of Integrity Constraints in the Situation Calculus. In Foundations of Intelligent Systems. Proc. Ninth International Symposium on Methodologies for Intelligent Systems (ISMIS'96), Zakopane, Poland, pages 212{222. Springer, LNAI 1079, 1996. [5] A. Bonner. Hypothetical Datalog: Complexity and Expressivity. Theoretical Computer Science, 76(1):3{51, 1990. [6] A. Bonner and M. Kifer. Transaction Logic Programming. In J. Chomicki and G. Saake, editors, Logics for Databases and Information Systems. Kluwer Academic Publishers, To appear. [7] S. Chaudhuri and U. Dayal. An Overview of Datawarehousing and OLAP Technology. SIGMOD Record, 26(1):65{74, March 1997.

14

[8] J. Chomicki. Ecient Checking of Temporal Integrity Constraints Using Bounded History Encoding. ACM Transactions on Database Systems, 20(2):149{186, June 1995. [9] A. Thayse (ed.). From Modal Logic to Deductive Databases. J. Wiley & Sons, 1989. [10] D. Gabbay, I. Hodkinson, and M. Reynolds. Temporal Logic: Mathematical Foundations and Computational Aspects, volume 1. Oxford University Press, 1994. [11] S. Hanks and D. McDermott. Default Reasoning, Nonmonotonic Logics, and the Frame Problem. In Proc. National Conference on Arti cail Intelligence, pages 328{333, 1986. [12] F. Lin and R. Reiter. State Constraints Revisited. Journal of Logic and Computation, 4(5):655{678, 1994. Special Issue on Action and Processes. [13] J. McCarthy and P. Hayes. Some Philosophical Problems from the Standpoint of Arti cial Intelligence. In B. Meltzer and D. Michie, editors, Machine Intelligence, volume 4, pages 463{502, Edinburgh, Scotland, 1969. Edinburgh University Press. [14] R. Reiter. The Frame Problem in the Situation Calculus: a Simple Solution (Sometimes) and a Completeness Result for Goal Regression. In V. Lifschitz, editor, Arti cial Intelligence and Mathematical Theory of Computation: Papers in Honor of John McCarthy, pages 359{380. Academic Press, 1991. [15] R. Reiter. On Specifying Database Updates. Journal of Logic Programming, 25(1):53{91, 1995. [16] T. Sheard and D. Stemple. Automatic Veri cation of Database Transaction Safety. ACM Transactions on Database Systems, 14(3):322{368, 1989. [17] B. Siu and L. Bertossi. Answering Historical Queries in Databases (Extended Abstract). In Proc. XVI International Conference of the Chilean Computer Science Society (SCCC'96), M. V. Zelkowitz and P. Straub (eds.), pages 56{ 66, 1996. [18] R. Snodgrass and I. Ahn. Temporal Databases. IEEE Computer, September:35{42, 1986.

15