Compilative Constructive Negation in Constraint Logic Programs S S

6 downloads 371 Views 237KB Size Report
1 Introduction. The most popular semantics for normal logic programs is based on SLDNF- ...... Elsevier, Amsterdam and The MIT Press, Cambridge, 1990. 2.
Compilative Constructive Negation in Constraint Logic Programs Paola Bruscoli, Francesca Levi, Giorgio Levi, Maria Chiara Meo Dipartimento di Informatica, Universita di Pisa, C.so Italia, 40 - 56125 Pisa, Italy e-mail: [email protected] flevifran, levi, [email protected]

Abstract. In this paper we de ne a new compilative version of constructive negation (intensional negation) in CLP and we prove its (nonground) correctness and completeness wrt the 3-valued completion. We show that intensional negation is essentially equivalent to constructive negation and that it is indeed more ecient, as one would expect from the fact that it is a compilative technique, with the transformation and the associated normalization process being performed once and for all on the source program. We de ne several formal non-ground semantics, based either on the derivation rule or on the least xpoint of an immediate consequence operator. All these semantics are proved to correctly model the observable behavior, from the viewpoint of answer constraints. We give some equivalence theorems and we show that all our denotations are the non-ground representation of a single partial interpretation, which is P " !, where P is the Fitting's operator [12].

1 Introduction The most popular semantics for normal logic programs is based on SLDNFresolution (SLD-resolution with Negation As Failure) as operational semantics and on the program completion as declarative semantics [9, 19]. The reference xpoint semantics is usually based on Fitting's operator [12]. Unfortunately, the nice equivalence and completeness results proved for the semantics of positive logic programs [29, 2, 19, 1] are not valid in the case of normal programs. In particular, we need to impose strong conditions on programs and goals, in order to deal with various incompleteness problems (e.g. oundering, inconsistency of the completion, the combination of tertium non datur and non-termination). The completeness of SLDNF-resolution holds for a larger class of programs, if we consider the logical consequences of the completion Comp(P) in a 3-valued logic. Let S P be a normal program, G = L1 ; : : :; Ln be a normal goal, such that P fGg is allowed, if (L1 ^ : : : ^ Ln ) is a 3-valuedSlogical consequence of Comp(P), then there exists an SLDNF-refutation of P fGg which computes an answer  more general than . The 3-valued completion is also strongly related to the Fitting's operator P [12], which acts upon 3-valued interpretations. The minimal 3-valued model MP

of Comp(P) is its least xpoint P " . Kunen's semantics [17] is also de ned in terms of P , namely fL j P " n j=3 L for a nite ng = fL j Comp(P) j=3 Lg. If we choose the 3-valued completion, the only source of incompleteness has to do with the oundering problem, i.e. with non-ground negative literals. Another serious drawback of SLDNF is also related to the non-ground literal problem, namely the fact that Negation As Failure can only be used as a test and never computes answers. The problem of handling \non-ground" literals was tackled by various extensions of Negation As Failure, called constructive negation. Examples are intensional negation [3, 4], Chan's constructive negation [7, 8], fail substitutions [20] and fail answers [11, 10]. The idea of intensional negation, originally sketched in [25] and then formalized for positive logic programs in [3, 4], is the following. Given a normal program P, we derive a new program P 0, which contains clauses which allow us to compute the answers to negative queries. Example 1. Let P be the program feven(0) ; even(s(s(X))) even(X)g. The new clauses in P 0 generated by intensional negation are the following: feven: (s(0)) ; even: (s(s(X))) even: (X)g. A (possibly non-ground) literal of the form :even(t) (in a goal or in the body of a normal clause) is transformed to even: (t) and evaluated in P 0. The new clauses are built in such a way that the answers to negative queries are \the complement" of the set of answers to the corresponding positive query. The complement is computed by assuming the Domain Closure Axiom (DCA). The negative literals (not only in the goal, but also in clause bodies) can be replaced by (positive) calls to the new predicates. Note that if the result of intensional negation were really a positive program, we could simply apply SLDresolution. Moreover, the standard least Herbrand model and least xpoint of TP semantics would be applicable. Finally, the resulting denotation could be viewed as a 3-valued interpretation. Unfortunately, there exist logic programs for which the intensional negation transformation introduces universal quanti cation in clause bodies, coming from local variables in the original program. The standard semantics of positive logic programs is then applicable to the result of the intensional negation transformation for restricted classes of normal programs only [22]. The range of applicability of intensional negation was increased by de ning an extended derivation rule for positive logic programs with universal quanti cation parametric w.r.t. the DCA [18]. Chan's constructive negation, in its original formulation [7] can be described as follows. Let :A be a (possibly non-ground) literal in the normal program P. Let T be the complete SLD-tree rooted at A and let e1 ; : : :; en be the sets of equations in solved form corresponding to the answer substitutions computed by the success paths in T . The answer to :A is the (normalization of the) constraint :(e1 _ : : : _ en ). The normalization is a disjunction of constraints, i.e. equalities and inequalities. Note that Chan's constructive negation does not require the DCA. The application of the above inference rule is unde ned when the SLD?tree is in nite. The mechanism of negative literals evaluation, inherited from Negation

As Failure, is not \incremental", since it requires the construction of a full SLD-tree. This problem was solved in [8], by considering a nite part of the SLD-tree, de ned by a frontier, instead of the complete SLD?tree. Using the Constraint Logic Programming (CLP) notation [16, 15], each node of the frontier is a goal ei 2Bi containing both constraints (equalities) and literals. The literal :A is now rewritten as the result of the normalization of the formula :(e12B1 _ : : : _ en 2Bn ). The result of the computation is independent from the choice of the frontier. The above technique was then extended to CLP [27, 28] and a completeness result was proved. The problem of handling negation constructively has an alternative solution in the idea of using explicitely the formulas in the completion ( rst order program) as rewrite rules, with a suitable constraint extraction procedure. [24] has shown a top-down interpreter which is sound and complete w.r.t. three-valued logical consequences semantics. A similar method with a di erent proof of completeness is given in [5]. Stuckey's constructive negation can be shown to be an implementation of the above operational semantics. The distinctive feature of constructive negation, however, is that it handles general clauses rather than more complex rst order programs and that it is de ned as an extension of standard SLD-resolution (to which it gracefully reduces in the case of positive clauses). The idea is therefore that of using as much as possible the standard logic programming technology. We push forward this idea by de ning a compilative version of constructive negation in the line of intensional negation. As was the case of Stuckey's constructive negation we prove the (correctness and) completeness w.r.t. three-valued logic, without going through rst order programs. Intensional negation is clearly a \compile-time" technique. The transformation and the associated normalization process are performed once and for all on the source program. All the versions of constructive negation are instead interpretative. Intensional negation is therefore much more ecient. We show that both intensional and constructive negation can simply be viewed as mechanisms to eciently implement \computing in the completion". The optimization is concerned with the management of disjunctions, which are handled by using essentially the SLD?tree structure of positive Horn clauses. The resulting theory allows us to identify commonalities and di erences between the various constructive negation techniques. It is worth noting that there exists one example [11, 10] of constructive negation technique, which is not based on the program completion and is not therefore easily comparable to our technique. The second contribution of the paper is related to the formal semantics. None of the existing semantics for constructive negation correctly models answer constraints. We propose several formal (non-ground) denotations which are based either on the top-down derivation rules or on the bottom-up application of immediate consequences operators. All these semantics are proved to be correct (and fully abstract) with respect to the answer constraints observable. We give some equivalence theorems and we show that all our denotations are the non-ground representation of a single partial interpretation, which is P " !. There are several motivations for choosing the CLP setting instead of the

logic programming one. First, even if we start from normal logic programs, constructive negation forces the introduction of (universally quanti ed) inequalities. One can stay within the logic programming setting based on substitutions only by assuming the DCA. This is, for example, the solution chosen in [20]. The most natural solution is then choosing the instance of CLP, where constraints are equalities and inequalities on the Herbrand domain. Moving to CLP allows us to get more generality and to use the only existing formalization of constructive negation [27] for which there exists a completeness theorem. All the proofs of the results reported in the paper can be found in [6].

2 The language and its semantic domains We will rst recall the basic CLP concepts as de ned in [16]. A rst order language is de ned on a function symbol set denoted by , a predicate symbol set denoted by  and a collection of variables denoted by V . ( [ V ) and () denote the set of terms and ground terms (i.e. terms without variables) built on  and V . A (; )-atom is an element p(t1 ; : : :; tn) where p 2  is n-ary and ti 2 ( [ V ), i = 1; : : :; n. A (; )-literal is a (; )-atom or its negation. A (; )- constraint is a well formed formula over the alphabets  and . The empty constraint is denoted by true. In the following the symbol  will denote a nite sequence of objects (variables, terms, atoms etc.). If t is a syntactic object, FV (t) is the set of variables which are not explicitly quanti ed in t. A sentence is a well formed formula with no free variables. De nition1. (CLP normal programs) [16] Let  = C [B and C \B = ;. A (; )-normal program is a nite set of clauses of the form H c2 or H c2B1 ; : : :; Bn where c is a nite (C ; )-constraint, H (the head) is a (B ; )-atom of the  where X is a sequence of distinct variables and B1 ; : : :; Bn (the body) form p(X), are (B ; )-literals. A normal goal is a program clause with no head and with a non-empty body. De nition2. Let  = C [ B and C \ B = ;. A (B ; )-constrained  where c is a (C ; )-constraint and p(X)  atom is an object of the form c2p(X), is a (B ; )-atom. A structure > > > < q(X; Y ) X = a2:r(X; Y; Y ) = Y ) X 6= a2r(X; Y; Z) > > ; : q(X; r(X; Y; Z) Y = b2 0 Then, the transformed program P is 8 : (X; Y ) : (X; Y ) X 6= a28Z:(X = a _ r: (X; Y; Z)) 9 p(X) true 2 q q > > > > = < q(X; Y ) X = a2r: (X; Y; Y ) q: (X; Y ) X = a2r(X; Y; Y ) : : q(X; Y ) X = 6 a 2 r(X; Y; Z) q (X; Y ) true 2 8 Z:(X = a _ r (X; Y; Z)); > > > > Y; Z) Y = b2 r(X; Y; Y ) > > ; : pr(X; : (X) true28Y:q(X; Y ) : r (X; Y; Z) Y 6= b2 The clauses of P 0 can contain universally quanti ed disjunctions of literals in the body. Therefore we need a notion of complex goal, similar to the one introduced for constructive negation [27], and the derivation rule must be de ned for complex goals. In addition to universally quanti ed disjunctions, since all the quanti ers need to be made explicit, complex goals contain also existentially quanti ed conjunctions.

De nition8. A complex goal is:

- p(t), for every predicate symbol p occurring in the transformed program.

 2B1; : : :; Bn ) where Z is a (possibly empty) set of variables, c is a con- 9Z:(c straint and the Bi 's are complex goals.  _ B1 _ : : : _ Bn ), where Z is a (possibly empty) set of variables, c is a - 8Z:(c constraint and the Bi 's are complex goals. A goal G can be viewed as the (operationally equivalent) goal (true2G). The following de nitions give the syntax of transformed programs, generated by intensional negation, and the corresponding sequential SLD8 -derivation. G !8 P G0 denotes an SLD8 -derivation of the goal G0 from G in the transformed program P 0, corresponding to P. De nition9. A transformed program clause has the form H c2B1 ; : : :; Bn,  or p: (X),  c is a constraint and each Bi is a where H is an atom of the form p(X) complex goal, for i = 1; : : :; n. A transformed program P 0 is a set of transformed program clauses. De nition10. (SLD8 -resolution step) Let P 0 be a transformed program, Gk be a complex goal and R be a selection rule. Gk+1 is derived from Gk in P 0 by R i the following conditions hold.  c2B 2 1. if Gk = p(t) then if there exists a renamed apart clause C = p(X) 0 0     P , such that Y = FV (C) and c = 9Y :(c ^ X = t) is satis able then Gk+1 = (c0 2) if B is empty, (i) 0     Gk+1 = (c 29Y :(c ^ X = t2B)) otherwise. (ii)  q 2B1 ; : : :; Bj ; : : :; Bn) then let Bj be the goal selected by R 2. if Gk = 9Z:(c  be the goal derived in one SLD8 -resolution step from Bj . in Gk and (c0 2B) 0 If cq ^ c is satis able then  q ^ c02B1 ; : : :; Bj ?1; B;  Bj +1 ; : : :; Bn). Gk+1 = 9Z:(c  3. if Gk = 8Z:(cq _ B1 _ : : : _ Bj _ : : : _ Bn ) then let Bj be the goal selected by R in Gk and F = f(c1 2B1 ); : : :; (cm 2Bm )g be the set of all the subgoals obtained from Bj in one SLD8 -resolution step. If F is empty then  q _ B1 _ : : : _ Bj ?1 _ Bj +1 _ : : : _ Bn ). Gk+1 = 8Z:(c (i) Otherwise let I  f1; : : :; mg such that 8r = 1; : : W :; m; r 2 I i Br is not  q _ j 2J cj ). Then, if c0 is empty, J = f1; : : :; mg n I and let c0 = 8Z:(c satis able, Gk+1 = (c0 2), (ii) and if :c0 is satis able,  ((cq _ Wj 2J cj ) _ B1 _ : : :_ Bj ?1 _ Wi2I (ci 2Bi ) _ Bj +1 _ : : :_ Bn ). Gk+1 = 8Z: 0

Some remarks about the above de nition are in order. The Gk+1 computed in 1:ii contains the constraint c0 = 9Y :(c ^ X = t). Such a choice is motivated by the fact that the nal constraint computed by Gk is more speci ed than c0 . Therefore c0 allows us to prune those branches that would fail in conjunction with other goals. Note that the correctness of de nition 1 derives from the equivalence  ^ B)  $ 9X:(c)  ^9X:(c  ^ B):  In case 3, in order to ensure the completeness 9X:(c we must extract as much constraint information as possible from the set of all the subgoals obtained from Bj . This is re ected in case 3:ii. In order to

achieve this result we separate the constraints out by using the equivalence  _ B)  $ 8X:(c)  _ 8X:(c  _ B):  8X:(c Example 3. Let P be the normal program de ning the function plus  U; Z) U = 0 ^ Z = X 2 P = plus(X; plus(X; U; Z) U = s(Y ) ^ Z = s(W)2plus(X; Y; W) P 0 is the union of P with the set of clauses de ning plus: : plus: (X; U; Z) (U 6= 0 _ Z 6= X) ^ 8Y; W:(U 6= s(Y ) _ Z 6= s(W))2 plus: (X; U; Z) (U 6= 0_Z 6= X)28Y; W:((U 6= s(Y )_Z 6= s(W))_plus: (X; Y; W)): Given the goal G = plus: (s(0); s(0); Z), the SLD8 -derived goal is G1 = c0 28Y; W:(c1 _ plus: (s(0); Y; W)); where c1 = (s(0) 6= s(Y ) _ Z 6= s(W)) and c0 = (s(0) 6= 0 _ Z 6= s(0)) jZ true, and thus, it can be omitted. By selecting the underlined goal we obtain two derived goals { G02 = 8Y; W:c02 where c0 = c1 _ ((Y 6= 0 _ W 6= s(0)) ^ 8Y1 ; W1:(Y 6= s(Y1 ) _ W 6= s(W1 ))) and 8Y; W:c0 jZ 8Y; W; Y1; W1:((s(0) 6= s(Y ) _ Z 6= s(W))_ ((Y 6= 0_W 6= s(0))^(Y 6= s(Y1 )_W 6= s(W1 )))) jZ 8Y; W; Y1; W1:((Y 6= 0 _ Z 6= s(W) _ W 6= s(0) _ Y 6= s(Y1 ))^ (Y 6= 0 _ Z 6= s(W) _ W 6= s(0) _ W 6= s(W1 ))) jZ 8Y; W; W1:(true ^ (Z 6= s(W) _ W 6= s(0) _ W 6= s(W1 ))) jZ Z 6= s(s(0)): { G002 = 8Y; W:(c0 _ Y 6= 0 _ W 6= s(0)2 8Y1 ; W1:((Y 6= s(Y1 ) _ W 6= s(W1 )) _ plus: (s(0); Y1; W1 ))). Note that from G02 we obtain the expected solution.

4.1 Top-down semantics

Given a normal program P and the corresponding transformed one P 0, we de ne the top-down semantics of P in such a way that it fully characterizes the computed answer constraints. We rst introduce an intermediate semantics O0 (P 0) for a transformed program P 0. Since in P 0 we have atoms of the form p: (t) where p: is a new predicate symbol, we need to consider an extension of B (denoted by B: ), by introducing the constrained atoms over such new predicates. De nition11. Let P 0 be a transformed program.  2 B: j true2p(X)  !8 P c2 and X are distinct variablesg. O0(P 0 ) = fc2p(X) De nition12. Let P be a normal program and P 0 be the corresponding transformed program. The top-down semantics of P is O8(P) = hO+8 (P); O?8 (P)i;  2 B j c2p(X)  2 O0 (P 0)g and where O+8 (P) = fc2p(X) 8 :   2 O0 (P 0)g. O? (P) = fc2p(X) 2 B j c2p (X) As shown in the following, this top-down semantics fully characterizes the computed answer constraints for normal goals. 0

Example 4. Let P be the normal program in example 2.

O+8 (P)= f X 6= a2p(X); X = a2p(X); Y = b2r(X; Y; Z); X = a^Y = 6 b2q(X; Y ); X 6= a ^ Y = b2q(X; Y )g O?8 (P)= f X =6 a ^ Y =6 b2q(X; Y ); X =a ^ Y =b2q(X; Y ); Y 6= b2r(X; Y; Z)g: We can now de ne the equivalence '8 on programs induced by computed answers and we show that O8(P) correctly captures answer constraints. De nition13. Let P1; P2 be normal programs, P10 ; P20 be the corresponding

transformed programs, G be a normal goal and G~ be the complex goal obtained by replacing each literal :p(t) in G with p: (t). P1 '8 P2 if for each normal goal 8 c 2 i G~ ! 8 c 2 and c   c where X = FV (G). G, G~ ! 1 jX 2 P1 1 P2 2 0 Theorem 14. Let P be a transformed program and G = (c02r1(t1); : : :; rk(tk )) 8 c i 8i = 1; : : :; k; there exists c0 2r (X ) 2 be a complex goal. Then G ! P i i i O0 (P 0), renamed apart, such that c0 = (c0 ^ Vi=1;:::;k c0i ^ Vi=1;:::;k Xi = ti ) is satis able and c jFV (G) c0 . Corollary 15. Let P1 and P2 be normal programs. P1 '8 P2 i O8(P1 )=O8(P2). We give a formal top-down semantics also for constructive negation. G CN !P G0 denotes an SLDCN-derivation of the goal G0 from G in the normal program P, as de ned in [27, 28]. De nition16. Let P be a normal program. The top-down semantics of P is denoted by OCN (P) = hO+CN (P); O?CN (P)i, where  j true2p(X)  CN O+CN (P) = fc2p(X) ! P c2 and X are distinct variablesg; CN  j true2:p(X)  CN O? (P) = fc2p(X) ! P c2 and X are distinct variablesg: Results similar to those proved for intensional negation on the observational equivalence and on the correctness wrt answer constraints are valid for constructive negation as well [6]. Example 5. Let P be the normal program de ned in example 2 O+CN (P) = fX 6= a2p(X); X = a2p(X); Y = b2r(X; Y; Z); X = a ^ Y 6= b2q(X; Y ); X 6= a ^ Y = b2q(X; Y )g O?CN (P) = fX 6= a ^ Y 6= b2q(X; Y ); X = a ^ Y = b2q(X; Y ); (X 6= a ^ Y 6= b) _ (X = a ^ Y = b)2q(X; Y ); Y 6= b2r(X; Y; Z)g Note that the denotations O8(P) and OCN (P) for the program in example 2 are quite similar, even if not identical. This issue will be discussed later. 0

0

0

4.2 Bottom-up semantics

We de ne the bottom-up semantics of P by introducing an immediate consequence operator TP for the corresponding transformed program P 0. The de nition of TP is based on an unfolding operator UnfC (I), where C is a clause and I  B: . In turn such an operator is based on ?G (I), which denotes the unfolding of a goal G wrt I  B: . 0

0

De nition17. Let G be a complex goal and let I  B: . The unfolding of G

wrt I, ?G(I), is de ned as follows. { G = p(t) (or G = p: (t)).  2 I; renamed apart, ?G(I) = fc j there exists c02p(X) 0    0 ^ (X = t)); c is satis ableg: Z = FV (c 2p(X)); c = 9Z:(c  { G = 9Z:(cq 2B1 ; : : :; Bn).  q ^ Vi=1;:::;n ci ); ?G(I) = fc j 8i=1; : : :; n; there exists ci 2 ?B (I); c= 9Z:(c c is satis ableg:  { G = 8Z:(cq _ B1 _ : : : _ Bn ). W ?G(I) = fc j 8i = 1; : : :; n;WJi nite subset of ?B (I); ci = d2J d;  q _ i=1;:::;n ci ); c is satis ableg: c = 8Z:(c i

i

i

 c0 2L1; : : :; Lk be a transformed clause and let De nition18. Let C = p(X) : I  B . The unfolding of C wrt I, UnfC (I) is de ned as follows  2p(X)  j c 2 ?(c02L1 ;:::;L ) (I); Z = FV (C)Sn X g UnfC (I) = f9Z:c k

The unfolding of a set of transformed clauses Q wrt I is UnfQ (I) = C 2Q UnfC (I): De nition19. Let P 0 be a transformed program and I  B: . TP (I) = UnfP (I): 0

0

In the following, given a partial -interpretation Ip , we denote by  j c2p(X)  2 Ip? g 2 }(B: ). Ibp = Ip+ [ fc2p: (X) We de ne the immediate consequence transformation associated to a normal program P as follows.

De nition20. Let P be a normal program, P 0 be the associated transformed

one and Ip be a partial -interpretation. Then  j c2p: (X)  2 TP (Ibp )gi.  j c2p(X)  2 TP (Ibp )g; fc2p(X) TP8 (Ip ) = hfc2p(X) 0

0

The following proposition shows that TP8 is well de ned, i.e. given a partial -interpretation Ip , TP8(Ip ) is a partial -interpretation too. In other words the result of the application of the operator TP8 to a partial -interpretation is a pair hJp+ ; Jp? i which satis es the consistency condition of a partial -interpretation (i.e. [Jp+ ] \ [Jp? ] = ;).

Proposition21. Let P be a normal program and let Ip be a partial -interpretation. Then TP8(Ip ) is a partial -interpretation.

Corollary22. Let P be a normal program. Then TP8 " ! is a partial -interpretation.

In what follows, we show that TP8 is continuous wrt I ordered by set inclusion on the components of the pairs. First we introduce the partial order relation 3 on the set of partial -interpretations I . De nition23. Let Ip , Jp 2 I . Ip 3 Jp i Ibp  c Jp .

The relation 3 is an ordering on I . Given S 3 I there exists glb(S) = hTI 2S Ip+ ; TI 2S Ip? i 2 I . The bottom element of (I ; 3) is the partial interpretation h;; ;i. Note that, given two partial -interpretations I and J, lubfI; J g does not necessarily exist. This holds for the consistency condition of partial -interpretations. For example let us consider I = hfX = a2p(X)g; ;i and J = h;; fX = a2p(X)gi. An upper bound U = hU + ; U ?i of fI; J g must be such that hfX = a2p(X)g; fX = a2p(X)gi 3 U. Therefore [U + ] \ [U ?] = 6 ;. However every chain in (I ; 3) has a least upper bound in I obtained by componentwise union of the elements in the chain. Therefore (I ; 3) is a complete p

p

semi-lattice.

Proposition24. Let P be a normal program. TP8 is continuous in (I ; 3). The xpoint semantics of normal programs is the following. De nition25. Let P be a normal program. F 8(P) = lfp(TP8 ) = TP8 " !. By corollary 22 it follows that F 8(P) is a partial -interpretation.

4.3 Relations between the top-down and the bottom-up semantics

We give some results which relate top-down and bottom-up semantics. In particular we prove that, given a normal program P, O8(P) 3 F 8(P) and F 8(P) 3 O8(P), where the ordering 3 is de ned below. The equality O8(P) = F 8(P) does not hold. Therefore the functional semantics does not characterize the operational behavior of the program wrt answer constraints. However the equality [O8(P)] = [F 8(P)] holds. Proposition26. Let P be a normal program. O8(P) 3 F 8(P). A corollary of proposition 26 is that O8 (P) is a partial -interpretation. In order to better re ect the properties of partial -interpretations, we introduce a new preorder  on sets in }(B: ), and we generalize it to partial -interpretations providing the new preorder 3 . De nition27. Let I1 , I2 2 }(B: ), Ip ; Jp 2 I . I1  I2 i 8A1 2 I1 9A2 2 I2 such that A1 v A2 and Ip 3 Jp i Ibp  Jbp . Corollary 28. Let P be a normal program. F 8(P) 3 O8(P). From corollary 28 and proposition 26, the ground instances of the operationally derived constrained atoms are exactly the ones obtained by using the bottom q _ B1 _ : : : _ Bk ), the up technique. Note that in the case of a goal G = 8Z:(c behavior of the top-down rule di ers from the one of TP , since in the rst one choice only of the computed constraints for (B1 _ : : : _ Bk ) is allowed while in the latter the possible choices are all the subsets of computed constraints for those subgoals. A di erent de nition for TP , re ecting exactly the operational behavior, would lead to an operator non-monotonic wrt (I ; 3). Theorem 29. Let P be a normal program. [F 8(P)] = [O8(P)]. 0

0

5 Correctness and completeness In this section we show that [O8(P)] = [F 8(P)] = P " !, where P is Fitting's operator described in [12] and extended to constraint logic programs in [13]. The proof is based on the analysis of the relation between [F 8(P)] and P . In such a way a completeness and correctness result is inherited by intensional negation. Given a complex goal G, we denote by G the formula obtained from G by replacing each occurrence of an atom of the form p: (t) by :p(t). Moreover, given a normal goal G, we denote by G~ the complex goal obtained from G by replacing each occurrence of a literal of the form :p(t) by p: (t).

Proposition30. Let P be a normal program and Ip be a nite partial -interpretation. Then [TP8 (Ip )] = P ([Ip ]).

We now show that TP8 " n has the same ground information as P " n, for nite n. The equivalence holds since for each nite n, TP8 " n is a nite partial -interpretation.

Proposition31. Let P be a normal program. 8n  0, [TP8 " n] = P " n and [O8(P)] = [F 8(P)] = P " !. Using our terminology, theorem 6 of [26] (which is a generalization of theorem 6.3 in [17] for languages other than those with in nitely many function symbols of all arities) can be stated for CLP as follows. The notation th(