contents index next

18. fsa_u_array: Updatable Arrays (15+16 trees)

This module provides an updatable array datastructure. The arrays are implemented using O'Keefe's N+K trees, with N=15 and K=16.

NB. Array indices start at 0: so 0 refers to the first element of the array.

Here's an overview of the predicates provided:

The N+K tree data-structure is described in The Craft of Prolog, by Richard A. O'Keefe, MIT Press, 1990, chapters 4.5. and 4.6.

18.1. List of Predicates

This section lists the predicates defined by this module.

18.1.1. fsa_u_array_new(-UpdatableFsaArray[,?Size])

Initializes UpdatableFsaArray as a new mutable array. In this implementation the optional Size argument is not used.

18.1.2. fsa_u_array_get(+Index,?Val[,?Default,]+UpdatableFsaArray)

Val is unified with the Index'th entry in UpdatableFsaArray.

18.1.3. fsa_u_array_put(+Index[,?OldVal],?Val,+UpdatableFsaArray0,?UpdatableFsaArray)

The Index'th entry in UpdatableFsaArray0 is updated to Val; UpdatableFsaArray is the resulting new array. OldVal is unified with the old value of Index.

contents index next