Representing Actions over Dynamic Domains

2 downloads 0 Views 169KB Size Report
1 Introduction. Given a dynamic system, state change occurs over the domain of the system ... obtain a speci c value proposition On(a; b) after M ove(a; b) by substituting x ... An action proposition with destroying e ect is an expression of the form ..... need to perform these two action sequentially in order to burn the letter. This.
Representing Actions over Dynamic Domains Yan Zhang1 and Norman Y. Foo2 1

School of Computing and Information Technology University of Western Sydney Penrith South DC, NSW 1797, Australia E-mail: [email protected] 2 School of Computer Science and Engineering University of New South Wales NSW 2052, Australia E-mail: [email protected]

Abstract. Current action theories are usually based on static domains in the sense that objects in the domain are xed and actions only change properties or relationships related to these objects, but cannot create new objects or destroy current objects in the domain. In this paper, we propose a new action language called D which handles dynamic domains. In the context of D actions may not only have normal e ects as in other action theories, but also have e ects of creating or destroying things in the domain. D has a similar syntax of A family languages but with a di erent model theoretic semantics in which a term is allowed to be unde ned in the domain at some states. We also investigate the semantic properties of D in detail and illustrate how our approach overcomes the diculty in representing actions over dynamic domains.

1 Introduction Given a dynamic system, state change occurs over the domain of the system if some actions are executed. Conventionally, the domain of a system may be viewed as a collection of objects dealt with in the system activities. For example, in the blocks world, its domain could include a number of blocks and a table, and the e ects of actions related to this world may change positions or colors of these blocks. By examining current action theories, e.g. [2,7], it is clear that these approaches only consider static domains in reasoning about change where objects in the domain are usually xed from the beginning and actions may just change objects' properties (e.g. paint block a to red color) or relationships among di erent objects (e.g. move block a onto b). However, in many situations, the domain we deal with is dynamic. For instance, a tower may be built from three individual blocks. But before the proper action/actions of building a tower is/are performed, there is no such object called tower consisting of these three blocks in the domain. Also, after burning a letter, this letter then no longer exists in the domain. In this paper, we propose a new action language called D which handles dynamic domains. In the context of D actions may not only have normal e ects

as in other action theories, but also have e ects of creating or destroying things in the domain. D has a similar syntax to A family languages but with a di erent model theoretic semantics in which a term of D is allowed to be unde ned in the domain at some states. We also investigate the semantic properties of D in detail and illustrate how our approach overcomes the diculty in representing actions over dynamic domains. The paper is organized as follows. Section 2 describes the syntax of D, and Section 3 proposes a model theoretic semantics for D. Section 4 investigates the semantic properties of D in detail. Finally, Section 5 concludes the paper with some discussions.

2 Syntax of D D is based on an arbitrary rst order language with an extra nonempty set

of symbols that are called action constructors or actions. An action constructor may take variables to denote a generic action while by substituting these variables with ground terms, it forms a speci c action. For example, we can view Move(x; y) to be a generic action of moving x onto y, while Move(a; b) is considered as an instance of Move(x; y) where a and b are constants. A formula of D is any rst order formula in the language without occurrence of any action constructors. There are di erent types of propositions in D as de ned below. A value proposition is an expression with one of the following two forms: (1) C after A; (2) destroyed P1 ;    ; Pk after A; where C is a formula, P1;    ; Pk are atoms, and A is a string of actions. (1)

states that C holds after the sequence of actions A is executed in the initial state. For instance, On(x; y) after Move(x; y) is a value proposition, where On(x; y) is a formula and Move(x; y) is an action. As a special case, if A is an empty string, we rewrite (1) as the form initially C; (3) which we also call the initial value proposition. In this case, we restrict C to be a sentence (i.e. no free variable occurrence). Proposition (2), on the other hand, represents the fact that after performing A in the initial state, the objects characterized in atoms P1 ,   , Pk are destroyed (see next for more detail). Note that a value proposition of the form (1), (2) or (3) may include free variables. In this case, it actually represents a scheme of specifying a class of speci c propositions if we substitute these free variables with ground terms in

the language. For example, from the scheme On(x; y) after Move(x; y) we may obtain a speci c value proposition On(a; b) after Move(a; b) by substituting x and y with a and b respectively. We call a value proposition without free variables closed. In the rest of the paper, without declaring explicitly a value proposition is usually referred to its closed form. An action proposition with normal e ect is an expression of the form A causes C if P; (4) where A is an action, and C and P are formulas. This proposition states that if in a state where precondition P is satis ed, then after A is executed, C should be satis ed in the resulting state. For instance, Move(x; y) causes On(x; y) ^ :Clear(y) if Clear(y) is an action proposition with normal e ect. An action proposition with creating e ect is an expression of the form A creates C if P; (5) where A is an action, and C and P are formulas. (5) represents the e ect of a special action which creates something. Intuitively, (5) asserts that if P is satis ed in a state, then after performing action A, C should be true in the resulting state. It is important to note that in any previous state where action A has not been performed, we cannot assume that C is false in that state. In fact, since the object that has property C is created by A, before A is performed, the object with property C does not exist. Consider the following proposition MakeFile(a) creates File(a) which expresses that action MakeFile(a) makes a le that has a name a. Clearly, before this action is executed, constant a does not denote to any speci c object in our domain. An action proposition with destroying e ect is an expression of the form A destroys P1;    ; Pk if P; (6) where A is an action, P1 ;    ; Pk are atoms and P is formula. Similarly, this proposition represents the e ect of a special action which destroys something. For instance, a proposition DeleteFile(a) destroys File(a) if File(a) expresses the e ect of action deleting a le. From our intuition, after deleting the le a, the le should not exist any more in our domain. In other words, after performing this action, the constant a in the language should no longer denote to any speci c object in our domain. As a result of this action, we may represent a value proposition as follows: destroyed File(a) after DeleteFile(a):

To generalize our presentation on action e ects, we specify a generalized

action proposition as the form

A causes C1 creates C2 destroys P1;    ; Pk if P:

(7)

Note that if no C2 and P1 ,   , Pk occur, (7) reduces to proposition (4). Similarly, if no C1 and P1 ,   , Pk occurs, it then reduces (5) and reduces to (6) if no C1 and C2 occurs. Generally, we will allow an action to have di erent types of e ects. For example, when an action creates something, it may also destroys some other thing at the same time, or it may also produce some normal e ects. This will be illustrated in next section. Without confusion, in our context, we will simply call (4) - (7) action propositions. According to our previous discussion, an action proposition with free variable occurrences is viewed as an action scheme, from which we can obtain a class of ground action propositions by substituting these free variables with ground terms. Finally, a constraint is an expression of the form

always C;

(8)

where C is a sentence. As the usual function of domain constraints, (8) simply states that C should be satis ed in all possible states. Now we specify a domain description  of D to be a nite set of initial value propositions, action propositions and constraints.

3 Semantics of D In this section, we de ne a formal semantics for language D. The basic idea is as follows. We rst propose a new structure for an arbitrary rst order language L in which we allow a syntactic term of the language to be unde ned in the domain of quali cation. Within this structure, a truth value function is de ned on any formula of L that may include those unde ned terms in the domain. Then we extend this truth value function to D by specifying proper truth conditions on value propositions and constraints. Finally, we de ne a state transition function on this type of structures.

3.1

d-Structures

Let L be an arbitrary rst order language. A d-structure of L is de ned as follows. De nition 1. A d-structure M of L is any ordered pair (D; F ), where D is a set of objects (to be called the domain) and F is a unary function such that: (i) F is total to assign every n-placed predicate symbol P a set of ordered nplaced tuples of elements of D; (ii) F is partial to assign every de ned ground term an element of D.

Note that a d-structure M is usually associated with a set of ground terms of L where each term in the set is de ned in M (i.e. mapped to some object in the domain of M) and all other ground terms of L are then unde ned in M. Clearly, if the set of de ned ground terms is identical to the set of all ground terms of L, a d-structure is reduced to a classical rst order structure of L. De nition 2. Given a d-structure M = (D; F ), a primary assignment M in M is a partial unary function from the set of sentences of L to fT, Fg such that (i) if ' is of the form P(a1;    ; an) and F (ai ) is de ned for every i (1  i  n), then M (') = T if (F (a1);    ; F (an)) 2 F (P), and otherwise M (') = F; (ii) (a) if ' is of the form a = b and both F (a) and F (b) are de ned, then M (') = T if F (a) = F (b), and otherwise M (') = F; (b) if ' is of the form a = b and exactly one of F (a) and F (b) is de ned, then M (') = F; (iii) for any other ', M (') is not de ned. De nition 3. Given a d-structure M = (D; F ), a completion of M is a dstructure M 0 = (D0 ; F 0) such that (i) D  D0 ; (ii) for any predicate symbol P , F (P)  F 0 (P); (iii) for every individual ground term a, F 0(a) is de ned and F 0 (a) = F (a) if F (a) is also de ned. Intuitively, a completion M 0 of M is a classical structure in which every ground term is de ned, and for a term that is de ned in M, its interpretation in M 0 is consistent to that in M. For a given d-structure M, M may have many di erent completions. We denote the set of all completions of M as Comp(M). De nition 4. Let M = (D; F ) be a d-structure, M 0 = (D0 ; F 0) a completion of M . A supplementary assignment M;M in M with respect to completion M 0 is a total unary function from the set of sentences of L to fT; Fg such that (i) if ' is atomic and M (') is de ned, then M;M (') = M ('); (ii) if ' is atomic and M (') is not de ned, then M;M (') = M ('); (iii) if ' is of the form : , then M;M (') = T i M;M ( ) = F, and otherwise M;M (') = F; (iv) if ' is of the form ^ , then M;M (') = T i M;M ( ) = M;M () = T, and otherwise M;M (') = F; (v) if ' is of the form 8x then M;M (') = T i M;M ( x [a]) = T for every individual ground term a such that F (a) is de ned, and otherwise M;M (') = F. De nition 5. Let M = (D; F ) be a d-structure, and Comp(M) the set of all completions of M . The assignment M in M is a partial unary function from the set of sentences of L to fT; Fg such that (i) M (') = T i M;M (') = T for every completion M 0 of M in Comp(M); (ii) M (') = F i M;M (') = F for every completion M 0 of M in Comp(M); 0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

0

(iii) M (') is not de ned in all other cases. De nition 6. A sentence ' is d-satis able i there exists some d-structure M such that M (') = T. ' is d-invalid i there exists some d-structure M , either M (') = F or M (') is not de ned. ' is d-valid, denoted as j=d ', i ' is not d-invalid.

3.2 Transition Function, Models and Entailment Consider two d-structures M1 = (D1 ; F1) and M2 = (D2 ; F2) which are associated with two sets of ground terms of L, named C M1 and C M2 respectively, where only terms in C M1 and C M2 are de ned in M1 and M2 respectively. We say that M1 and M2 are comparable if for every ground term a 2 C M1 \ C M2 , F1(a) = F2(a). Let M1 and M2 be two comparable d-structures associated with two set of ground terms C M1 and C M2 respectively. We de ne the di erence be-

tween M1 and M2 , denoted as Diff d (M1 ; M2), to be the set of ground atoms as follows: Diff d (M1 ; M2) = fP(a1;    ; an) j for any a1;    ; an 2 C M1 \ C M2 ; M1 (P(a1;    ; an)) 6= M1 (P(a1 ;    ; an))g: (9) To simplify our following presentation, we consider each action proposition in a generalized form (7):

A causes C1 creates C2 destroys P1;    ; Pk if P: De nition 7. A transition function Res maps a d-structure to another d-structure according to a ground action proposition, where Res(A; M) is de ned as follows. (i) If M (P) = T1 , then Res(A; M) = M 0, where M 0 is a d-structure such that M and M 0 are comparable, in which C M = C M [ fa1;    ; an j a1;    ; an occur in C2g ? fa01;    ; a0m j P 0(   ; a0i;   ) is one of P1;    ; Pk (1  i  m)g, and M (C1 ^ C2) = T; (ii) If M (P) = F or unde ned, or M (P) = T but there is no M 0 satis es the above condition, then Res(A; M) = M . Res is called a minimal transition function if Diff d (M; Res(A; M)) is minimal with respect to the set inclusion for any A and M . The meaning of a transition function de ned above is quite intuitive. If the precondition of A is true in M, then A changes M to a comparable M 0 in which the de ned terms are those de ned terms in M together with adding some new de ned terms if A creates new objects and eliminating some de ned terms from M if A destroys some things. 1 That is, the precondition of A is d-satis ed in M . 0

0

We can extend the transition function to the case of a sequence of ground actions A. Res(A; M) is de ned as follows. If A = , i.e. empty string, then Res(A; M) = M, otherwise, Res(A; M) = Res(A; Res(A0 ; M)), where A = A0 A. A sequence of actions A is called a subsequence of A0 if the relation holds: A0 = A1A2    Ak    An and A = A1 A2    Ak . We say that action A is executable in M if M (P) = T (note that P is the precondition of A). A sequence of two actions A1A2 is executable in M if A1 is executable in M and there exists some M 0 in which A2 is executable while M 0 = Res(A1 ; M). Generally, a sequence of actions A is executable in M if any of its subsequences is executable in M. Now we are in a position to provide a formal semantics for value propositions and constraints in D. De nition 8. Given a d-structure M and a transition function Res, a pair = (M; Res) is a signature of D with respect to M and Res. The satisfaction of ground value propositions and constraints in is de ned as follows. (i) A value proposition of the form C after A is d-satis ed in if M (C) = T where Res(A; M) = M 0; (ii) A value proposition of the form destroyed P1 ;    ; Pk after A is d-satis ed in if there exists a subsequence A0 of A such that A0 is executable in M and contains actions A1 ;    ; Al with destroying e ects including P1;    ; Pk ; (iii) A constraint of the form always C is d-satis ed in if M (C) = T and M (C) = T where Res(A; M) = M 0 and A is any action sequence. Proposition 1. Let = (M; Res) be a signature of D. If a value proposition destroyed P1;    ; Pk after A is d-satis ed in , then M (Pi ) is not de ned for i = 1;    ; k, where M 0 = Res(M; A). De nition 9. Given a domain description . A signature = (M; Res) of D is a model of  if (i) the set C M of de ned terms in M is formed by including all ground terms occurring the initial value propositions and constraints of  , (ii) every initial value proposition and constraint of  are d-satis ed in , and (iii) Res is minimal. A ground value proposition or constraint  is d-entailed by  , denoted as  j=d , if  is d-satis ed in every model of  . Example 1. Burning A Letter. Consider a scenario where a robot needs to destroy a letter. If two actions, for example, striking a match and burning something with the lighted match, are available for the robot, then the robot may need to perform these two action sequentially in order to burn the letter. This domain can be easily formalized within our action language D. Firstly, we have the following initial value propositions: initially Match(a); (10) 0

0

0

initially Letter(b);

(11) which express that a is a match and b is a letter. We also specify two action propositions: Strike(x) causes Lighted(x) if Match(x); (12)

Burn(x; y) destroyed Letter(y) if Match(x) ^ Lighted(x) ^ Letter(y): (13) The rst action proposition (12) says that if x is a match, then striking x causes that x is lighted, while (13) represents the action of burning a letter y with the lighted match x. Now a domain description  L consists of propositions (10) -(13). Then without much diculty, we can derive the following desired results:  L j=d Lighted(a) after Strike(a),  L j=d destroyed Letter(b) after Strike(a); Burn(a; b).

4 Semantic Properties of Domain Descriptions In this section, we further investigate some semantic properties of domain descriptions. Firstly, we show that if no function symbols occur in language D and a domain description  does not include action propositions with creating or destroying e ects, then there exists a corresponding action language D0 where  can be characterized by the language A-like model theoretic semantics [2] on D0. Formally, let D be an action language without function symbols and  a domain description on D that does not include action propositions with creating and destroying e ects. We specify an action language D0 which is obtained from D by restricting all constants in D0 to be those occurring in the initial value propositions and constraints in . Then for any signature = (M; Res) of D, we can specify a reduced signature 0 = (M 0 ; Res0 ) of D0 as follows: (i) M 0 is a classical rst order structure on D0 obtained from M by setting C M to be the set of all constants of D0 (see De nitions 1 and 2). (ii) The truth value of a rst order sentence ' in M 0 is then de ned as the usual way in the rst order logic. For example, ' is satis ed in M 0, denoted as M 0 j= ', i ' is true in M 0. (iii) Let M1 and M2 be two structures on D0 . Diff(M1 ; M2) denotes the set of all ground atoms that have di erent truth values in M1 and M2 respectively. (iv) For an action proposition of the form A causes C if P, the transition function Res0 is de ned as Res0 (A; M1 ) = M2 where M2 j= C if M1 j= P, otherwise Res0 (A; M1 ) = M1 2 . Res0 is minimal if Diff(M1 ; Res0 (A; M1 )) is minimal for any A and M1 . (v) The satisfaction of ground value propositions and constraints in 0 = (M 0 ; Res0) is de ned as in De nition 8 by replacing M (C) = T with M j= C and without considering actions with destroying e ects (i.e. condition (ii) in De nition 8). Then we say that a reduced signature 0 = (M 0 ; Res0 ) is a reduced model of  on D0 if 0 is generated from the above procedure such that every initial value proposition and constraint of  are satis ed in 0 and Res0 is minimal. It can 2 Note that here both M1 and M2 are structures on D . 0

0

be verifed that the above semantics for  on D0 is coincident with the one for A language proposed by Gelfond and Lifschitz in [2]. Given a value proposition or constraint ,  is entailed by , denoted as  j= , if  is satis ed in every reduced model of . Then we have the following result.

Theorem 1. (Reduction Theorem) Let D be an action language without function symbols,  a domain description on D that does not include action propositions with creating and destroying e ects, and D0 is a language obtained from D by restricting all constants in D0 to be those occurring in initial value propositions and constraints of  . Then for any value proposition or constraint  on D0 ,  j=d  i  j= . Theorem 2. (Creating E ect Theorem) Given a domain description , suppose  j=d C(t) after A where t is a ground term occurring in C . If there is a subsequence A0 of A such that t does not occur in any C 0 such that  j=d C 0 after A0 , then an action with the form A creates C 00(t) if P must be in A after A0, i.e. A = A0    A   .

Theorem 2 states that if an object is in the domain after executing a sequence of actions, but it is not in the domain sometime earlier, then this object must be created by an action sometime later. Similarly, the following theorem says that if an object is destroyed from the domain after performing a sequence of actions, and it is in the domain sometime before, then this object must be destroyed by an action sometime later. Theorem 3. (Destroying E ect Theorem) Given a domain description , suppose  j=d destroyed P1(t) after A where t is a ground term occuring in predicate P1. If there is a a subsequence A0 of A such that  j=d C(t) after A0 , then an action with the form A destroys P1(t);    if P must be in A after A0 , i.e. A = A0    A   . Now we investigate the monotonicity properties of domain descriptions. It is well known that monotonicity is an important property for knowledge representation and reasoning that can be used to simplify a reasoning procedure. However, like most of other systems of reasoning about change, our action formulation based on language D is nonmonotonic: by adding more action propositions or constraints into a domain description, the set of value propositions entailed by the expanded domain description may shrink. Instead, our domain descriptions indeed satisfy a kind of restricted monotonicity which characterizes an important feature for the underlying reasoning principle. Given a domain description , an action sequence A is executable in  if for each model = (M; Res) of , A is executable in M. Then we have the following result. Theorem 4. (Restricted Monotonicity) Let  be a domain description on D.  0 is a domain description obtained from  by adding more initial value propositions. Then for any value proposition  with the form C after A or destroyed P1;    ; Pk after A where A is executable in ,  j=d  implies  0 j=d .

5 Further Discussions

In this paper, we propose a new action language D which can represent actions with creating or destroying e ects over dynamic domains. Although D shares the syntactic feature of A family languages, it has a signi cantly di erent model theoretic semantics compared to previous action theories. This new semantics also provides a foundation to handle dynamic domains in reasoning about change. People may argue that within the classic logic framework, there may have other alternatives to represent actions with creating or destroying e ects. For instance, using the A language, it seems feasible to represent action of burning a letter as the following proposition: Burn(x; y) causes :Letter(y) if Match(x) ^ Lighted(x) ^ Letter(y). However, in general, this is not correct if we want to add a constraint to characterize all objects in the domain that we want to deal with: always 8x(Match(x)_ Letter(x)). This constraint intuitively says that all objects to be dealt with in the domain are either matches or letters. Considering that after burining y, :Letter(y) is held, then the domain constraint becomes invalid. On the other hand, Free logic has been studied in philosophical logics [1] in which terms can denote somethings that are not in the universe. Nevertheless, to the best of our knowledge, there is no detailed study on how free logic can be applied in reasoning about action and change, it is not clear to us yet whether we can directly use free logic to achieve our purpose addressed in this paper. In this sense, it appears that our work here presents an original contribution to handle dynamic domains in reasoning about action and change. Furthermore, our results also show that the complexity of reasoning within the D lanuage is not harder than that in the original A language [5,8].

References 1. E. Bencivenga, Free logic. Handbook of Philosophical Logic, Vol. III, pp373-426, 1986. 2. M. Gelfond and V. Lifschitz, Representing action and change by logic programs. Journal of Logic Programming, 17: 301-322 (1993). 3. E. Giunchiglia and V. Lifschitz, An action language based on causal explanation: preliminary report. In Proceedings of AAAI-98, pp 623-630, 1998. 4. G.N. Kartha and V. Lifschitz, Actions with indirect e ects (Preliminary report). In Proceedings of Kr'94. 1994. 5. P. Liberatore, The complexity if the language A. Electronic Transactions on Arti cial Intelligence, Vol. 1 (1997) 13-38. 6. V. Lifschitz, Two components of an action language. Annals of Mathematics and Arti cial Intelligence, 21 (1997), pp. 305-320. 7. M. Winslett. Reasoning about action using a possible models approach. In Proceedings of AAAI-88, pages 89-93, 1988. 8. Y. Zhang and N.Y. Foo The language D - An action language over dynamic domains. Manuscript, January 2002.

Suggest Documents