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;Typically, these are implemented as member functions in the rewrite class.
void set_bar_state(Foo, int);
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
.