next up previous contents index
Next: Class RewriteCache Up: The rewrite statement Previous: Using an internal

Using an external index

External indices are specified in a similar manner. Given a datatype Foo and an external index named bar, the rewriter invokes calls to the following functions:

int get_bar_state(Foo) const;
void set_bar_state(Foo, int);
Typically, these are implemented as member functions in the rewrite class.

The rewriter uses the function get_bar_state to lookup previously cached information set by the function set_bar_state. Typically, the implementation of the two functions can be implemented as hash tables, using the addresses of the terms as hash functions and pointer equality comparisons. Note that caching can be lossy; i.e. it is perfectly alright for the cache to eliminate cached information to keep its size under control. If no cache information is found, the function get_bar_state should return BURS::undefined_state.





Allen Leung
Mon Apr 7 14:33:55 EDT 1997