next up previous contents index
Next: Non-backtrackable Storage Up: Modification of the Database Previous: Modification of the Database   Contents   Index

The storage Module: Associative Arrays and Backtrackable Updates

XSB provides a high-level interface that supports efficient storage and querying of key-value pairs. A key-value pair is an association between keys and the corresponding values. There can be at most one value associated with a given key. A key-value pair can be stored, deleted or queried. XSB provides two sets of predicates for handling such pairs: backtrackable and non-backtrackable. The backtrackable primitives for insertion and deletion of key-value pairs commit their changes to the database only if the goal succeeds. Otherwise, if the goal fails, the change is undone. Similarly, XSB provides primitive for backtrackable updates analogous to assert and retract. The semantics of backtrackable updates is defined using Transaction logic [6].

All the predicates described in this section must be imported from module storage.



Subsections

Luis Fernando P. de Castro 2003-06-27