Indefinite Reasoning with Definite Rules - IJCAI

Report 2 Downloads 55 Views
I n d e f i n i t e Reasoning with D e f i n i t e Rules L . T h o r n e M c C a r t y and R o n v a n der M e y d e n Computer Science Department Rutgers University New Brunswick, NJ 08903, USA [email protected], [email protected] Abstract In t h i s p a p e r we present a n o v e l e x p l a n a t i o n o f t h e source o f i n d e f i n i t e i n f o r m a t i o n i n c o m m o n sense r e a s o n i n g : Indefinite information arises f r o m r e p o r t s a b o u t t h e w o r l d expressed i n t e r m s o f c o n c e p t s t h a t have been d e f i n e d usi n g only definite rules. A d o p t i n g this p o i n t of view, we show t h a t first-order logic is insuffic i e n t l y expressive t o h a n d l e i m p o r t a n t e x a m ples of c o m m o n sense r e a s o n i n g . As a r e m edy, we p r o p o s e t h e use of c i r c u m s c r i b e d defi n i t e rules, a n d we then investigate the p r o o f t h e o r y o f t h i s m o r e expressive f r a m e w o r k . W e consider t w o a p p r o a c h e s : F i r s t , prototypical proofs, a s p e c i a l t y p e of p r o o f by i n d u c t i o n , w h i c h yields a sound p r o o f theory. Second, we describe cases in w h i c h t h e r e exists a decision procedure f o r a n s w e r i n g queries, a p a r t i c u l a r l y s i g n i f i c a n t r e s u l t because i t shows t h a t i t i s possible t o have d e c i d a b l e q u e r y processing i n circ u m s c r i b e d t h e o r i e s t h a t are n o t e q u i v a l e n t t o any first order theory.

1

Introduction

C o m m o n sense r e a s o n i n g has a bias t o w a r d s definite information, as m a n y researchers have n o t e d . Thus J o h n s o n - L a i r d [1983] has a r g u e d t h a t h u m a n b e i n g s d r a w inferences i n p a r t i c u l a r " m e n t a l m o d e l s ' ' , a n d Levesque [1986] has u r g e d , for s i m i l a r reasons, t h e s t u d y o f " v i v i d k n o w l e d g e ' ' i n a r t i f i c i a l i n t e l l i g e n c e . T h i s bias t o w a r d s d e f i n i t e i n f o r m a t i o n has also p e r m e a t e d c o m p u t e r science p r o p e r . T h e f i e l d o f logic p r o g r a m m i n g , f o r e x a m p l e , is based on a subset of f i r s t - o r d e r logic consisti n g e n t i r e l y o f d e f i n i t e clauses. I n d e e d , M a k o w s k y [1985] has a r g u e d t h a t " H o r n f o r m u l a s m a t t e r " i n c o m p u t e r science precisely because t h e y have a u n i q u e m i n i m a l model. If t h i s is so, t h e n h o w does indefinite information arise i n c o m m o n sense r e a s o n i n g ? I n t h i s p a p e r , w e a d o p t a novel p o i n t of view on this question, a n d explore the consequences. We suggest (as a G e d a n k e n e x p e r i m e n t ) t h a t c o m m o n sense r e a s o n i n g is based e x c l u s i v e l y on definite rules, a n d t h a t i n d e f i n i t e i n f o r m a t i o n arises f r o m t h e a p p l i c a t i o n o f these d e f i n i t e rules t o d e f i n i t e f a c t s i n s i t u a -

890

Logic Programming

tions where c o m m u n i c a t i o n is almost always incomplete. A n i n d i v i d u a l w h o receives r e p o r t s a b o u t t h e w o r l d does n o t u s u a l l y k n o w t h e d e f i n i t e f a c t s u p o n w h i c h these rep o r t s are b a s e d , a n d f o r such a n i n d i v i d u a l t h e w o r l d i s a ( c h a o t i c a l l y ! ) i n d e f i n i t e p l a c e . O u t o f necessity, a n i n d i v i d u a l i n t h i s s i t u a t i o n does i n d e f i n i t e r e a s o n i n g w i t h d e f i n i t e rules. If we adopt this p o i n t of view, however, it turns out t h a t the standard way of representing indefinite inform a t i o n in a r t i f i c i a l i n t e l l i g e n c e - i.e., by a first-order language capable of asserting disjunctive and existent i a l f a c t s - is i n a d e q u a t e . We show in S e c t i o n 3 t h a t f i r s t - o r d e r l o g i c c a n n o t express a s i m p l e f o r m o f i n d e f i n i t e i n f o r m a t i o n t h a t seems essential f o r c o m m o n sense r e a s o n i n g . I n s t e a d , we suggest in S e c t i o n 4 t h a t an adequate representation of indefinite i n f o r m a t i o n r e q u i r e s t h e use of circumscription [ M c C a r t h y , 1980; M c C a r t h y , 1986]. B u t c i r c u m s c r i p t i o n i s a second-order f o r m a l i s m . I s i t p l a u s i b l e t o p r o p o s e such a c o m p l e x l o g i c a l l a n g u a g e f o r such a m u n d a n e p u r p o s e as c o m m o n sense r e a s o n i n g ? W e b e l i e v e t h e answer is: Yes. T h e p r i n c i p a l t e c h n i c a l c o n t r i b u t i o n o f t h e present p a per, in Sections 5 a n d 6, is to suggest t w o new t e c h n i q u e s for c o m p u t i n g t h e inferences t h a t f o l l o w f r o m a circumscribed definite rulebase. These techniques a p p l y i n special cases, o f course, b u t t h e y seem p r o m i s i n g for various practical applications. In S e c t i o n 5, we d e v e l o p t h e n o t i o n of a prototypical proof, w h i c h is a s p e c i a l t y p e of i n d u c t i v e p r o o f . If a q u e r y is e n t a i l e d by a c i r c u m s c r i b e d r u l e b a s e , t h e n a p r o t o t y p i c a l p r o o f is guaranteed to exist, a n d if a p r o t o t y p i c a l p r o o f succeeds, t h e n a n i n d u c t i o n schema can be a u t o m a t i c a l l y generated. Furthermore, an ind u c t i o n s c h e m a i n o u r s y s t e m has v e r y s i m p l e a n d a p pealing proof-theoretic properties. T h i s means t h a t we c a n search s y s t e m a t i c a l l y f o r i n d u c t i v e p r o o f s , a t least i n c e r t a i n s p e c i a l cases t h a t seem t o b e o f c o n s i d e r a b l e p r a c t i c a l i m p o r t a n c e . These t e c h n i q u e s c a n n o t give u s a c o m p l e t e p r o o f p r o c e d u r e , o f course. B u t i n S e c t i o n 6 , we show t h a t an a c t u a l decision procedure exists f o r cert a i n o t h e r special cases t h a t seem t o b e o f p r a c t i c a l i m p o r t a n c e . P r e v i o u s w o r k o n c i r c u m s c r i p t i o n has t r i e d t o find conditions under w h i c h a circumscribed theory "collapses" to a first-order t h e o r y [ L i f s c h i t z , 1985], so t h a t s t a n d a r d theorem-provers for first-order logic could then b e a p p l i e d . H o w e v e r , these c o n d i t i o n s are e x t r e m e l y re-

s t r i c t i v e , a n d recent w o r k b y K o l a i t i s a n d P a p a d i m i t r i o u [1990] has s h o w n t h a t t h e existence o f a n e q u i v a l e n t f i r s t o r d e r t h e o r y i s i t s e l f a n u n d e c i d a b l e p r o p e r t y . O u r results i n S e c t i o n 6 i m p r o v e u p o n t h i s p r e v i o u s w o r k i n t w o w a y s : ( i ) w e show t h a t c o m p l e t e q u e r y - a n s w e r i n g i s possible even f o r t h e o r i e s w h o s e c i r c u m s c r i p t i o n i s n o t first-order; a n d (ii) we p r o v i d e a f u l l decision procedure i n such cases r a t h e r t h a n a s e m i - d e c i d a b l e p r o o f t h e o r y . T h e o v e r a l l f r a m e w o r k i n w h i c h w e have c o n d u c t e d t h i s research i s p r e s e n t e d i n S e c t i o n 2 , w h i c h i s based o n p r e v i o u s l y p u b l i s h e d w o r k [ M c C a r t y , 1988a; M c C a r t y , 1 9 8 8 b ; B o n n e r et al., 1989]. In S e c t i o n 2, we define p r e cisely w h a t w e m e a n b y a " d e f i n i t e " r u l e , a n d w e a r g u e t h a t o u r l o g i c s h o u l d b e intuitionistic, r a t h e r t h a n class i c a l , since i n t u i t i o n i s t i c l o g i c a d m i t s a l a r g e r class of rules t h a t have " d e f i n i t e " p r o p e r t i e s . Since o u r basic l a n g u a g e i s i n t u i t i o n i s t i c , t h o u g h , a n o t h e r n o v e l aspect of our work is t h a t we then w r i t e the circumscription a x i o m as a sentence in second-order intuitionistic logic. A l t h o u g h we state some of the properties of i n t u i t i o n i s t i c c i r c u m s c r i p t i o n i n S e c t i o n 4 , a m o r e d e t a i l e d discussion w i l l b e p r e s e n t e d i n a f o r t h c o m i n g p a p e r [ M c C a r t y , 1991].

2

Definite Rules

H o r n clauses p r o v i d e t h e s t a n d a r d e x a m p l e s o f d e f i n i t e rules, f o r a s i m p l e r e a s o n . E v e r y set o f p o s i t i v e H o r n clauses has a u n i q u e m i n i m a l H e r b r a n d i n t e r p r e t a t i o n [van E m d e n a n d K o w a l s k i , 1976; A p t a n d v a n E m d e n , 1982], o r , e q u i v a l e n t l y , an initial model [ G o g u e n a n d M e seguer, 1986; M a k o w s k y , 1985]. As a r e s u l t , a set of posi t i v e H o r n clauses, R, has b o t h t h e disjunctive property a n d t h e existential property: A d i s j u n c t i o n of a t o m i c f o r mulae, is entailed by R if and only if R or R B, and an existentially quantified atomic formula, is entailed by R if and only if for some g r o u n d s u b s t i t u t i o n C l o s e l y r e l a t e d is a p r o o f t h e o r e t i c p r o p e r t y , t h e existence of linear proofs. I n d e e d , it is f a i r to say t h a t it is t h e procedural interpretation of a declarative semantics, embodied in SLD-resolution [ L l o y d , 1987], t h a t m a k e s H o r n - c l a u s e logic such a p o w e r f u l t o o l f o r l o g i c p r o g r a m m i n g , f o r d e d u c t i v e databases and for knowledge representation in general. I t i s w e l l k n o w n t h a t these u s e f u l p r o p e r t i e s are lost i f w e m o v e b e y o n d t h e H o r n - c l a u s e subset o f f i r s t - o r d e r (classical) l o g i c . H o w e v e r , we c a n preserve these p r o p e r ties f o r a l a r g e r class of rules if we use first-order intuitionistic logic. C o n s i d e r t h e f o l l o w i n g e x a m p l e : (1)

G a b b a y , 1985; M c C a r t y , 1988a; M c C a r t y , 1 9 8 8 b ; M i l l e r , 1989: H a l l n a s a n d S c h r o e d e r - H e i s t e r , 1988; B o n n e r ct a/., 1989J, a n d h a v e been s h o w n t o b e u s e f u l f o r h y p o t h e t i c a l r e a s o n i n g [ B o n n e r , 1988], f o r l e g a l r e a s o n i n g [ M c C a r t y , 1989], f o r m o d u l a r l o g i c p r o g r a m m i n g [ M i l l e r , 1989]. a n d f o r n a t u r a l l a n g u a g e u n d e r s t a n d i n g [Pareschi, 1988]. N o t e t h a t a set o f r u l e s i n t h e f o r m ( 1 ) , i n t e r p r e t e d classically, w o u l d g i v e u s f u l l f i r s t - o r d e r l o g i c . H o w e v e r , i n t e r p r e t e d i n t u i t i o n i s t i c a l l y , these r u l e s g i v e us a p r o p e r subset o f f i r s t - o r d e r l o c k w i t h i n t e r e s t i n g s e m a n t i c p r o p erties [ M c C a r t y , 1 9 8 8 a ] . 1 F i r s t , a set o f i n t u i t i o n i s t i c e m b e d d e d i m p l i c a t i o n s R has a final Kripke model, w h i c h we denote by K * . T h i s means: G i v e n any K r i p k e m o d e l K of R, t h e r e exists a u n i q u e h o m o m o r p h i s m from K i n t o K * . S e c o n d , K * i s generic f o r H o r n - c l a u s e queries. T h i s m e a n s : A H o r n clause q u e r y is entailed by R if and only if i s t r u e i n K * . T h i r d , K * has a unique minimal substatc, d e n o t e d by . T a k e n t o g e t h e r , these results i m p l y t h a t R has t h e d i s j u n c t i v e a n d e x i s t e n t i a l p r o p e r t i e s f o r H o r n clause q u e r i e s , a s t r a i g h t f o r w a r d g e n e r a l i z a t i o n o f t h e f a c t t h a t a set o f (classical) p o s i t i v e H o r n clauses has t h e d i s j u n c t i v e a n d e x i s t e n t i a l p r o p e r ties f o r a t o m i c queries. For t h i s r e a s o n , i t i s a p p r o p r i a t e t o refer t o rules i n t h e f o r m (1) a s " d e f i n i t e " rules. T h e p r o o f theory for i n t u i t i o n i s t i c embedded implicat i o n s is also a s t r a i g h t f o r w a r d g e n e r a l i z a t i o n of t h e p r o o f t h e o r y f o r classical H o r n - c l a u s e l o g i c [ M c C a r t y , 1988b]. C o n s i d e r a rulebase c o n s i s t i n g o f (1) p l u s t h e f o l l o w i n g t w o rules:

(2) (3) Assume a database of assertions: 'Container (p)' and * Heated ( p ) ' , a n d consider the query: SterileContainer O u r p r o o f procedure begins by constructi n g an S L D - r e f u t a t i o n tree in an initial tableau, To, a n d proceeds u n t i l i t has r e d u c e d t h e o r i g i n a l q u e r y t o t h e goal: Note that this goal is a universally quantified i m p l i c a t i o n . At this p o i n t , t h e p r o o f p r o c e d u r e : ( i ) replaces t h e v a r i a b l e y w i t h a s p e c i a l c o n s t a n t ' ! y 1 ' a n d ( i i ) c o n s t r u c t s a n auxiliary tableau, T 1 , w i t h a g o a l ' D e a d ( ! y i ) ' a n d a d a t a b a s e c o n s i s t i n g o f t h e assertions ' B u g ( ! y 1 ) ' a n d ' I n s i d e ( ! y i , p ) \ T h i s g o a l succeeds, u s i n g rules ( 2 ) a n d ( 3 ) , w h i c h means t h a t t h e u n i v e r s a l l y q u a n t i f i e d i m p l i c a t i o n also succeeds. T h u s t h e o v e r a l l p r o o f succeeds, w i t h a d e f i n i t e answer substitution For a d d i t i o n a l examples of such p r o o f s , see [ M c C a r t y , 1 9 8 8 b ] .

3 T h i s e x p r e s s i o n s h o u l d be r e a d : "If every b u g y i n s i d e c o n t a i n e r x is a d e a d b u g , t h e n x is a s t e r i l e c o n t a i n e r / ' R e c a l l t h a t a p o s i t i v e H o r n clause i s a n i m p l i c a t i o n w i t h a n a t o m i c conclusion a n d w i t h a n antecedent consisting o f a c o n j u n c t i o n o f a t o m i c f o r m u l a e . B u t r u l e (1) has a H o r n clause " e m b e d d e d " i n i t s a n t e c e d e n t . W e c a l l such rules embedded implications [ M c C a r t y , 1988a; M c C a r t y , 1 9 8 8 b ] . I n t u i t i o n i s t i c e m b e d d e d i m p l i c a t i o n s have been s t u d i e d b y several researchers [ G a b b a y a n d R e y l e , 1984;

Indefinite Information

For c o m m o n sense r e a s o n i n g , d e f i n i t e rules b y themselves appear to be insufficient. Consider the following examp l e , discussed b y M o o r e [1982]. T h e r e are t h r e e b l o c k s : B l o c k ( a ) , B l o c k ( b ) , B l o c k ( c ) ; a n d t w o colors: Red and Green. T h e blocks are stacked in the f o l l o w i n g way: O n ( a , b ) , O n ( b , c ) ; a n d t h e t o p a n d b o t t o m b l o c k s are 1 T h e standard semantics for i n t u i t i o n i s t i c logic is K r i p k e semantics. See [ K r i p k e , 1965; F i t t i n g , 1969].

McCarty a n d van der Meyden

891

p a i n t e d green a n d r e d , r e s p e c t i v e l y : G r e e n ( a ) , R e d ( c ) . We do not know the color of the m i d d l e block, b u t we k n o w t h a t every block is p a i n t e d either red or green:

(4) W e w a n t t o k n o w i f t h e r e i s s o m e t h i n g g r e e n o n somet h i n g r e d , a s i t u a t i o n t h a t c o u l d be represented by the following predicate: (5) I n t u i t i v e l y , t h e answer s h o u l d b e : Yes. E i t h e r ' b ' i s a r e d b l o c k , i n w h i c h case ' a ' a n d ' b ' c o n s t i t u t e a g r e e n - o n - r e d p a i r , o r else ' b ' i s a green b l o c k , i n w h i c h case ' b ' a n d ' c ' constitute a green-on-red pair. H o w s h o u l d w e represent i n d e f i n i t e i n f o r m a t i o n o f t h i s sort? O n e a p p r o a c h i s t o a d d t w o n e w t y p e s o f rules t o our language:

(6) (7) We c a l l these rules disjunctive a n d existential assertions, respectively. T h e a d d i t i o n of disjunctive and existential assertions to a set of e m b e d d e d i m p l i c a t i o n s is e q u i v a l e n t t o f u l l f i r s t - o r d e r i n t u i t i o n i s t i c l o g i c , o f course, b u t there are reasons t o w r i t e a rulebase i n t h i s special f o r m . A l t h o u g h w e n o l o n g e r have t h e p r o p e r t i e s o f d e f i n i t e rules discussed i n S e c t i o n 2 , i t m a k e s sense t o s t a y a s close t o these p r o p e r t i e s a s p o s s i b l e . W e t h u s show i n [ M c C a r t y , 1990] t h a t a set o f rules i n t h e f o r m ( 1 ) , (6) a n d (7) has a f i n a l K r i p k e m o d e l , I * , a l t h o u g h I * does n o t , i n g e n e r a l , have a u n i q u e m i n i m a l s u b s t a t e . W e also i n v e s t i g a t e i n [ M c C a r t y , 1990] a n e x t e n s i o n o f t h e l i n e a r p r o o f p r o c e d u r e i n [ M c C a r t y , 1988b] w h i c h uses a l i m i t e d " d i s j u n c t i v e s p l i t t i i i g " o p e r a t i o n whenever it encounters a rule in the f o r m (6), a n d we show t h a t this p r o o f p r o cedure i s c o m p l e t e f o r i n t u i t i o n i s t i c ( b u t n o t classical) l o g i c . These r e s u l t s are r e l a t e d t o recent w o r k o n disjunctive logic programming [ M i n k e r a n d R a j a s e k a r , 1990; L o v e l a n d , 1987; L o v e l a n d , 1988]. B u t d o r u l e s i n t h e f o r m ( 6 ) a n d (7) r e a l l y c a p t u r e o u r c o m m o n sense r e a s o n i n g w i t h i n d e f i n i t e i n f o r m a t i o n ? Suppose t h e f o l l o w i n g d e f i n i t i o n i s p a r t o f t h e ' b l o c k s

world':

(8) (9)

M o r e o v e r , t h e r e is no set of f i r s t - o r d e r rules t h a t gives us t h e i n t u i t i v e l y c o r r e c t r e s u l t i n t h i s case, since t r a n s i t i v e closure c a n n o t b e d e f i n e d i n f i r s t - o r d e r l o g i c [ A h o a n d U l l m a n , 1979]. I s t h e r e a n a l t e r n a t i v e ?

4

Circumscription

I n t h i s s e c t i o n , w e consider a r a d i c a l l y d i f f e r e n t a p p r o a c h to the representation of indefinite i n f o r m a t i o n . Assume t h a t t h e r e exists a set of definite rules t h a t c a n be a p p l i e d to a w o r l d of definite f a c t s . A s s u m e also t h a t someone else has o b s e r v e d t h e w o r l d , a p p l i e d t h e r u l e s , a n d rep o r t e d some o f these d e f i n i t e c o n c l u s i o n s . O u r j o b i s t o m a k e inferences a b o u t t h e a c t u a l s t a t e o f t h e w o r l d , even t h o u g h w e h a v e n o t observed i t d i r e c t l y . For e x a m p l e , w e m i g h t b e t o l d t h a t block ' a ' i s above block ' b \ using t h e d e f i n i t i o n o f ' A b o v e ' i n rules ( 8 ) - ( 9 ) , a n d w e m i g h t want to k n o w whether there is s o m e t h i n g on 'b' T h e w o r l d c o u l d b e i n i n f i n i t e l y m a n y different states, w i t h infinitely m a n y different configurations of ' O n ' facts, all supporting the conclusion 'Above(a,b)' Our i n f o r m a t i o n a b o u t t h e w o r l d i s t h u s h i g h l y indefinite. Intui t i v e l y , h o w e v e r , w e o u g h t t o b e able t o c o n c l u d e t h a t is t r u e . T h e f o r m a l m a c h i n e r y w e need f o r t h i s a p p r o a c h i s p r o v i d e d b y M c C a r t h y ' s t h e o r y o f circumscription [ M c C a r t h y , 1980; M c C a r t h y , 1986]. Since w e are w o r k i n g w i t h i n t u i t i o n i s t i c l o g i c , h o w e v e r , we need to use an intuitionistic v e r s i o n o f t h e c i r c u m s c r i p t i o n a x i o m . Let R be a f i n i t e set of e m b e d d e d i m p l i c a t i o n s , a n d let P be a t u p l e consisting of the "def i n e d p r e d i c a t e s " t h a t a p p e a r o n t h e l e f t - h a n d sides o f the rules in R. L e t R ( P ) denote the c o n j u n c t i o n of the rules i n R , w i t h t h e p r e d i c a t e s y m b o l s i n P t r e a t e d a s free p a r a m e t e r s , a n d let R ( X ) b e t h e same a s R ( P ) b u t w i t h the predicate constants replaced by predicate variables Definition 4.1: T h e circumscription axiom i s t h e f o l l o w i n g sentence i n second o r d e r i n t u i t i o n i s t i c logic:2

a n d suppose w e h a v e been t o l d t h a t ' A b o v e ( a , b ) ' i s t r u e according to this definition. Is there something on ' b ' ? I n t u i t i v e l y , t h e answer s h o u l d b e : Yes. B u t i t i s s t a n d a r d p r a c t i c e [ K o w a l s k i , 1979] t o w r i t e t h e ' o n l y i f ' h a l f o f definition (8)~(9) as follows: Above(x,y) => O n ( x , y) V (3z)[Qn(x, z)

(10) A A b o v e ( z , y)]

A n d u s i n g ( 1 0 ) , t h e f o r m a l answer t o o u r q u e r y is: N o . I t is straightforward to verify that the final K r i p k e model f o r rules ( 8 ) - ( 1 0 ) i n c l u d e s a s u b s t a t e t h a t c o n t a i n s a n i n f i n i t e sequence o f ' A b o v e ' r e l a t i o n s , a n d n o r e l a t i o n i n t h e f o r m ' O n ( w , b ) \ For e x a m p l e : Above(a, b), On(a,

892

c1),

Above(c1,b),

Logic Programming

W e d e n o t e t h i s expression b y C t r c u m ( R ( P ) ; P ) , a n d w e refer t o i t a s " t h e c i r c u m s c r i p t i o n o f P i n R ( P ) . " T h i s a x i o m has t h e same i n t u i t i v e m e a n i n g t h a t i t has i n classical l o g i c : I t states t h a t t h e e x t e n s i o n s o f t h e p r e d i cates in P are as s m a l l as p o s s i b l e , g i v e n t h e c o n s t r a i n t 2

We define second-order i n t u i t i o n i s t i c logic precisely in [ M c C a r t y , 1990], following standard accounts such as [Troelstra and van Dalen, 1988].

that R ( P ) must be true. Since the logic is intuitionistic, however, the axiom minimizes extensions at every substate of every Kripke model that satisfies R. 3 If R consists of rules ( 8 ) - ( 9 ) , then the circumscription o f ' A b o v e ' in R forces 'Above' to be the transitive closure of ' O n ' [McCarthy, 1980; Lifschitz, 1985], and this entails the following implication:

(11) We thus have a solution to the problem posed at the beginning of this section. How might we compute such inferences, in general? We discuss this question in [McCarty, 1990], and we summarize our results briefly here. Let us formulate the general query problem as follows: (12) where Q and R are embedded implications, and is an implication in the f o r m (11) w i t h a positive disjunctive or existential conclusion and an antecedent consisting of a conjunction of atomic formulae. Our approach is to construct a final Kripke model for under various assumptions about Q and R, and then to show that this final Kripke model is generic for the query In the present paper, we w i l l only consider the case in which R is a set of Horn clauses, but we w i l l analyze the general case of embedded implications in a forthcoming paper [McCarty, 199l]. For Horn clauses, the construction of the final Kripke model is simple, and is related to recent results of Kolaitis and Papamitriou [1990]. First, let K* be the final Kripke model for R itself, as defined in Section 2. Now let B be the set of base predicates in R, that is, the predicates that do not appear in P, and let b be the Herbrand base constructed using B alone. Define: where K * ( s ) denotes the set of substates s' in K* such that Intuitively, C* consists of the set of least fixpoints of the Horn clauses in ft applied to all possible combinations of ground atomic formulae that are constructible using the predicates in B. We then have the following result: T h e o r e m 4 . 2 : Let R be a set of Horn clauses, and let Q be a set of embedded implications. Let C be the largest subset of C* that satisfies Q. Then C is a final Kripke model for Circum(7t(P);P). Since we can also show that final Kripke models are generic for queries in the f o r m we can solve the query problem (12) by showing that is true in C. In the remainder of this paper, we w i l l investigate two ways to do this using certain additional assumptions about the f o r m of Q and R. As an illustration of our techniques, we w i l l work w i t h a single example that combines the two examples in Section 3. Let R be the following set of rules: ChristmasBlock

(13)

3 Note that we have written the circumscription axiom as a second-order universally-quantified embedded implication. Alternative versions, using negation and second-order existential quantification, which are equivalent in classical logic, would not be equivalent intuitionistically.

(14) (15) (16) (17) Intuitively, rules (13)-(14) define the concept of a 'ChristmasBlock', and rules (15)-(17) define the concept of a stack of 'ChristmasBlocks'. Suppose we are told that there exists a stack of 'ChristmasBlocks' in which block 'a' is above block 'b' and furthermore that ' a ' and ' b ' are painted green and red, respectively. Does it follow that there is something green on something red? Intuitively, the answer should be: Yes. Formally, we can pose this question by circumscribing the predicates 'ChristmasBlock,' ' O n C B ' and ' A b o v e C B ' in rules (13)(17), adding rule (5) to Q, and then asking whether the following implication is entailed: (18) We w i l l show how to solve this problem in the following two sections of the paper, using two different methods.

5

Prototypical Proofs

In this section, we consider a class of inductive proofs in which the induction schema takes the f o r m of an intuitionistic embedded implication. We can think of these proofs as having two parts: The first part is a prototypical proof, and it is guaranteed to exist whenever the query is entailed by Circum(R(P);P). The second part involves the proof of an embedded implication w i t h an embedded second-order universal quantifier, and it is conjectured to exist whenever the prototypical proof succeeds. A l t h o u g h second-order intuitionistic logic is incomplete, in general, the fragment of second-order logic that we use to state the induction schema happens to have a complete proof procedure. This means that it is possible to automate the search for a solution to our sample problem, and to certain other similar problems. First, note that rules (13)-(15) in our sample problem are nonrecursive Horn clauses. For such rules, the solution is the same in intuitionistic logic as it is in classical logic [Reiter, 1982; Lifschitz, 1985]. Let Comp(7t) denote Clark's Predicate Completion [Clark, 1978]. We then have the following result, which is proven in [McCarty, 1990]: T h e o r e m 5 . 1 : Let R be a set of nonrecursive Horn clauses. Then Circum(R(P);P) is equivalent to

Comp(R).

The remaining rules in our sample problem have a simple f o r m , suggesting the following: D e f i n i t i o n 5.2: R is a linear recursive definition of the predicate A if it consists of: 1. A Horn clause w i t h ' A ( X ) ' on the left-hand side and a conjunction of nonrecursive predicates on the right-hand side, and 2. A Horn clause that is linear recursive in A,

McCarty a n d van der Meyden

893

'Green(a)' and 'Red(b)' in its data base, and w i t h 'GreenOnRed' as its goal. Our first step is to show, if possible, that this proof succeeds using the prototypical definition in (19). However, the reader can easily verify that there exists an SLD-refutation proof of 'GreenOnRed' in this tableau using rules (5) and (19), and using Comp(R) applied to rule (15). Moreover, from an inspection of this proof, it is apparent that there also exists a proof of the following universally quantified i m plication: (21) Let us call this implication Then is the following universally quantified i m plication: (22) and if we can prove (22) we w i l l also have a proof of our original query (18). Therefore, using the induction schema in Definition 5.3, we t r y to prove This goal is an implication w i t h a second-order universal quantifier, so we create a new tableau, we add to the data base, and we t r y to prove in T1. Let us write out each of these schemata in detail, is the following implication: (23) and

is equivalent to the following implication:

To prove (24), we instantiate x and z to the special constants ' and we add the right-hand side of (24) to the data base of T 1 , and we try to prove the left-hand side of (24). The remaining details are somewhat tedious, but the reader should be able to check that this proof does in fact go through. The main point to note is that the proof now uses Comp(R) applied to rules (13) and (14), which yields a disjunctive assertion. We thus need to apply the "disjunctive s p l i t t i n g " operation discussed in Section 3. When this final step succeeds, however, the inductive proof itself succeeds, and the query is shown to be true. The justification for our approach can be found in the following two theorems, which are proven in [McCarty, 1990] using our results on final Kripke models. In the statement of these theorems, S(A) denotes the set of all induction schemata for A that can be constructed using Definition 5.3, and V(A) denotes the prototypical definition of A given by Definition 5.2. B o t h theorems apply to the situation in which R is a linear recursive definition, Q is a set of embedded implications, and is an implication w i t h a positive disjunctive or existential conclusion and an antecedent consisting of a conjunction of atomic formulae. T h e o r e m 5.4:

894

Logic Programming

T h e o r e m 5.5: Theorem 5.4 tells us that inductive proofs are sound but not necessarily complete, while Theorem 5.5 tells us that prototypical proofs are complete but not necessarily sound. Together, these theorems sanction the strategy we illustrated in our example: T r y to find a prototypical proof first, and then use this proof to suggest a suitable induction schema. Our sample problem is still relatively simple, but we have constructed proofs of this sort for more difficult problems. In particular, we have applied our techniques to prove various properties of P R O L O G programs [Kanamori and F u j i t a , 1986; Elkan and McAllester, 1988]. For example, let ' A p p e n d ( l , m , n ) ' be defined as usual. Let 'Reverse(r,*)' be defined as follows: Reverse(nil, nil)

We can then show that [Reverse(x,y) Rever8e(y,x)]' is entailed by the circumscription of ' A p pend' and 'Reverse' in this rulebase. For the details of this proof, see [McCarty, 1990]. 6

A Decision Procedure

We have shown in Theorem 5.4 that a certain class of i n duction schemata provides a sound inference procedure for circumscribed definite rules. Furthermore, the structure of these schemata allows us to use a complete proof theory for second-order embedded implications in the i n ductive step of the proof. This raises the question: Is the resulting proof theory for the circumscribed rulebase itself complete? We show in this section that it is not. In fact there can be no such proof theory, since the query problem w i l l be shown to be not even semi-decidable. Nevertheless, we w i l l demonstrate that one can still find interesting classes of decidable queries. Our results are significant since they show that, even in cases where the circumscription of a theory is not first-order equivalent, it is possible to decide certain broad classes of queries. We refer the reader to [van der Meyden, 1990] for proofs of the results in this section. For the remainder of this section we restrict our attention to rules R which contain only positive Horn clauses w i t h o u t function symbols, i.e., all programs are D A T A L O G programs [Chandra and Harel, 1982]. Furthermore, we require that there be no repeated variables in the heads of rules. 4 We consider the following restricted formulation of the query problem: (25) where D is a set of ground base and defined atoms, and is a closed positive existential formula in the base and defined predicates, i.e., a formula constructed using only the operators and The proof of the following result is by an encoding of the containment problem for context-free languages: 4

This last restriction is made to simplify the presentation only; our results still hold if it is removed.

T h e o r e m 6 . 1 ; For arbitrary D A T A L O G rules R, sets of ground atoms D and positive existential queries the problem D Circum(7l(P);P) is undecidable. We w i l l now show that the complement of the query problem is recursively enumerable. Define an expansion of a defined a t o m A(x) by R to be any set E(x) of base atoms such that either 1. E = { B 1 ( x ; b ) , . . . , B n ( x ; b ) } for some tuple b of new constants, and for some rule

in R such that all the B i are base predicates, or 2.

for some tuple b of new constants, and for some rule

in R such that all the B i are base predicates, all the A j are defined predicates, and each Ej(x;y) is an expansion of Aj(x; y) by R. Also, if a is a tuple of constants, then we say that E(a) is an expansion of A (a) by R if E(x) is an expansion of A(x) by R. We write ExpandR(A) for the set of expansions of A by R.. If D is a set of ground atoms in both base and defined predicates, then an expansion of D by R is any set of ground atoms obtained f r o m D by replacing each defined a t o m A D by an expansion of A by R. For example, let R consist of the rules (13)-(17). Then the set:

is an expansion of D = {Green(a), AboveCB(a, b), Red(b)}. The following proposition shows that we may restrict attention to a denumerable set of models of a particular form when answering queries:

Lemma 6.2 shows that the problem of deciding that a query is not entailed is semi-decidable, since it suffices to find a single expansion of D in which the query fails. It follows f r o m this and Theorem 6.1 that is not a recursively enumerable set. Thus the techniques of Section 5 can only provide sufficient conditions for answering queries. In spite of these undecidability results, there exist broad classes of queries for which the query problem can be shown to be decidable, even in cases when the circumscription of R is not equivalent to a first-order theory. Define a query to be basic if it contains occurrences of base predicates only.

McCarty a n d van der M e y d e n

895

decidable for sets of atoms D and queries containing the predicate P as well as the base predicates. These results are all consequences of a theorem of Courcelle [1990] concerning graph grammars. In general, we retain decidability when we permit in the query any predicate to which the rulebase gives a definition expressible in monadic second-order logic. Unfortunately, it can be shown to be undecidable whether a rulebase defines a predicate expressible in monadic second-order logic, so we must be content w i t h enumerating special cases, as above, if we wish to go beyond the class of basic queries. 7

Conclusion

We have presented two approaches to answering queries in the presence of indefinite information, both of which are able to handle the "stack of Christmas blocks" example. The reader may have wondered why, since the method of Section 6 is a decision procedure, one would bother w i t h the prototypical proofs of Section 5? The reason is that the the decision procedure works for a smaller class of rules than the prototypical proofs. On the other hand, the price paid by the prototypical proofs for their ability to deal w i t h a potentially larger set of examples is logical incompleteness. It would be interesting to determine the extent to which this incompleteness corresponds to the incompleteness of human reasoning when faced w i t h indefinite information of comparable logical complexity. References [McCarty, 1988a] L.T. McCarty. Clausal intuitionistic logic. I. Fixed-point semantics. Journal of Logic Programming, 5 ( 1 ) : 1 - 3 1 , 1988. [McCarty, 1988b] L.T. McCarty. Clausal intuitionistic logic. I I . Tableau proof procedures. Journal of Logic Programming, 5(2):93-132, 1988. [McCarty, 1990] L.T. McCarty. C o m p u t i n g w i t h prototypes. Technical Report L R P - T R - 2 2 , Computer Science Department, Rutgers University, 1990. A preliminary version of this paper was presented at the Bar Ran Symposium on the Foundations of Artificial Intelligence, Ramat Gan, Israel, June 1989. [McCarty, 1991] L.T. McCarty. Circumscribing embedded implications. In A. Nerode et al., editors, Proceedings, First International Workshop on Logic Programming and Non-Monotonic Reasoning, page (forthcoming). M I T Press, 1991. [van der Meyden, 1990] R. van der Meyden. Recursively indefinite databases. In S. Abiteboul and P.C. Kanellakis, editors, Proceedings of the Third International Conference on Database Theory, pages 364-378. Springer LNCS No. 470, 1990. N o t e : These references are truncated because of space limitations. A f u l l list of references is available from the authors on request.

896

Logic Programming