home *** CD-ROM | disk | FTP | other *** search
-
- Listing 2
- Calls to procedure solve to answer query
-
-
- call to procedure matching rule
-
- solve(a,e) 1. a:- b,c,d
- solve(b,c,d,e) no matching rule
- solve(a,e) 2. a:- e,f
- solve(e,f,e) 5. e
- solve(f,e) 6. f
- solve(e) 5. e
- solve(NIL) write 'yes', recursion terminated
- solve(e) no matching rule
- (backing out of recursion we continue search)
- solve(f,e) no match
- solve(e,f,e) no match
- solve(a,e) no match, finished
-
-