<> <> <> <> DIRECTORY DragOpsCross USING [Word, wordsPerPage, ZerosWord]; SparseMemory: CEDAR DEFINITIONS = BEGIN OPEN DragOpsCross; <> IndexInPage: TYPE = [0..wordsPerPage); IndexInBank: TYPE = [0..4*(16384/wordsPerPage) ); IndexInSpace: TYPE = IndexInPage; IndexInBase: TYPE = IndexInBank; WordParts: TYPE = MACHINE DEPENDENT RECORD [ <> inBase: IndexInBase, inSpace: IndexInSpace, inBank: IndexInBank, inPage: IndexInPage]; Base: TYPE = REF BaseRep; BaseRep: TYPE = ARRAY IndexInBase OF Space; Space: TYPE = REF SpaceRep; SpaceRep: TYPE = ARRAY IndexInSpace OF Bank; Bank: TYPE = REF BankRep; BankRep: TYPE = ARRAY IndexInBank OF Page; Page: TYPE = REF PageRep; PageRep: TYPE = RECORD [ props: REF _ NIL, -- for attachment of user data words: ARRAY IndexInPage OF Word ]; <> NoMore: ERROR; Create: PROC RETURNS [Base]; <> < NOT Probe[base, index]>> Fetch: PROC [base: Base, index: Word, default: Word _ ZerosWord] RETURNS [Word]; <> < Fetch[base, index, default] = default>> FetchWithCode: PROC [base: Base, index: Word] RETURNS [word: Word, present: BOOL]; <> < FetchWithCode[base, index, default] = [0, FALSE]>> FetchPage: PROC [base: Base, index: Word] RETURNS [Page]; <> Store: PROC [base: Base, index: Word, new: Word _ ZerosWord]; <> <> <> <>> <> <> <<=> Fetch[base', x, default] = 0>> <<>> Probe: PROC [base: Base, index: Word] RETURNS [present: BOOL]; <> < NOT Probe[base, index]>> NextPresent: PROC [base: Base, start: Word] RETURNS [Word]; <> <>> <> < >> <> < Probe[base, index]>> END.