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:
fsa_u_array_new/[1,2] create a new updatable array
fsa_u_array_get/[3,4] lookup a value from an updatable array
fsa_u_array_put/[4,5] update a value in an updatable array
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.
This section lists the predicates defined by this module.
Initializes UpdatableFsaArray as a new mutable array. In this implementation the optional Size argument is not used.
Val is unified with the Index'th entry in 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.