next up previous
Next: About this document

A Sample of Typical Skeletons

This page gives additional definitions of skeletons which complement those of Chapter 6 of the book. It also supplies some definitions of predicates used in the skeletons and additions of Chapter 6.

Traversing a list recurses through each of its elements, H, an applies some test, , to it. The base case is an empty list, , allowing our search to end when we have run out of elements.

 

Decrementing a counter recurses through a sequence of positive integer values from X down to 0.

 

A recursive deconstruction of a binary term either succeeds by applying some test to the term C; or (if the term is composed from functor, F, with arguments A and B) it recurses on A and B; or it obtains some new term, T, from C and recurses on T.

 

succeeds if is the term constructed by replacing in C all instances of with .

constructs the conjunction of terms, , from B by replacing each term of the form in B with one of the form , where V is a new variable. is the set of all such variables.





Dave Stuart Robertson
Tue Jul 7 10:51:19 BST 1998