contents index next

21. fsa_u_hash: Updatable Hashes

This module provides an updatable hash data-structure on top of the updatable array datastructure.

Here's an overview of the predicates provided:

The hash function is taken from library(terms). The default size of the hashes is determined by the global variable hash_size.

21.1. List of Predicates

This section lists the predicates defined by this module.

21.1.1. fsa_u_hash_new(-UpdatableFsaHash[,Size])

Initializes a new UpdatableFsaHash with size Size; or default size if there is no second argument. The default size is determined by the global variable hash_size.

21.1.2. fsa_u_hash_get(+Key,?Val,+UpdatableFsaHash)

Val is unified with the value associated with Key in UpdatableFsaHash. If no such key exists in UpdatableFsaHash already, then the predicate fails.

21.1.3. fsa_u_hash_put(+Key,?Val,+UpdatableFsaHash0,?UpdatableFsaHash) fsa_u_hash_put(+Key,?OldVal,?Default,?Val,+UpdatableFsaHash0,?UpdatableFsaHash)

The value associated with Key in UpdatableFsaHash0 is updated to Val, resulting in the new hash UpdatableFsaHash. OldVal is unified with the old value (it it existed) or with Default (if it didn't exist).

contents index next