<> <> <> <> LRUCache: CEDAR DEFINITIONS = BEGIN <> Handle: TYPE = REF LRUCacheRep; <> LRUCacheRep: TYPE; HashProc: TYPE = PROC [REF] RETURNS [CARDINAL]; EqualProc: TYPE = PROC [REF, REF] RETURNS [BOOL]; Create: PROC [size: NAT, hash: HashProc_NIL, equal: EqualProc_NIL] RETURNS [Handle]; <> <> <<-hash returns always the same value given the same argument. >> <<-2 equal values (equal returns TRUE on them) must have the same hash key. >> <> <> <> Include: PROC [h: Handle, value: REF] RETURNS [index: NAT, insert: BOOL, used: REF]; <> <> << index: "index" of new inserted or re-used value in lru cache; 0<=index> << insert: value has been inserted into table [otherwise: old value re-used]. >> << used: the "equal" val found in table, or value again, if insert=TRUE.>> <> <> <> Fetch: PROC [h: Handle, index: NAT] RETURNS [used: REF]; <> <> <> Reset: PROC [h: Handle]; <> END.