next up previous contents index
Next: Backtrackable Updates Up: The storage Module: Associative Previous: The storage Module: Associative   Contents   Index

Non-backtrackable Storage

storage_insert_keypair(+StorageName,+Key, +Value, ?Inserted)

Insert the given Key-Value pair into the database. If the pair is new, then Inserted unifies with 1. If the pair is already in the database, then Inserted unifies with 0. If the database already contains a pair with the given key that is associated with a different value, then Inserted unifies with -1. The first argument, Storage, must be an atom naming the storage to be used. Different names denote different storages. In both cases the predicate succeeds.

storage_delete_keypair(+StorageName, +Key, ?Deleted)

Delete the key-value pair with the given key from the databases. If the pair was in the database then Deleted unifies with 1. If it was not in the databases then Deleted unifies with 0. The first argument, Storage, must be an atom naming the storage to be used. Different names denote different storages. In both cases the predicate succeeds.

storage_find_keypair(+StorageName, +Key, ?Value)

If the database has a key pair with the given key, then Value unifies with the value stored in the database. If no such pair exists in the database, then the goal fails.

Note that this predicate works with non-backtrackable associative arrays described above as well as with the backtrackable ones, described below.

storage_insert_fact(+StorageName, +Fact, ?Inserted)

Similar to keypair insertion, but this primitive inserts facts rather than key pairs.

storage_delete_fact(+StorageName, +Fact, ?Inserted)

Similar to keypair deletion, but this primitive deletes facts rather than key pairs.

storage_find_fact(+StorageName, +Fact)

Similar to keypair finding, but this primitive finds facts facts rather than key pairs.


next up previous contents index
Next: Backtrackable Updates Up: The storage Module: Associative Previous: The storage Module: Associative   Contents   Index
Luis Fernando P. de Castro 2003-06-27