(* Copyright 1992 Digital Equipment Corporation.           *)
(* Distributed only by permission.                         *)
(* Last modified on Thu Feb  9 09:05:07 PST 1995 by kalsow *)
(*      modified on Wed May  4 11:20:06 PDT 1994 by najork *)
(*      modified on Mon Aug 17 13:31:01 PDT 1992 by swart  *)
(*      modified on Tue Jul 21 06:11:10 1992 by mhb        *)

IMPORT FormsVBT, HashFmt, IntList;

OUTPUT Setup (data: FormsVBT.T[HashFmt.FormsVBT]; nBuckets: INTEGER[Fmt.Int]);
(* Call once at the beginning to identify for views how many
   buckets there are. *)

OUTPUT Insert (key: TEXT[]); 
(* Got a new item to insert. *)

OUTPUT Find (key: TEXT[]); 
(* Search for the item. *)

OUTPUT Delete (key: TEXT[]);
(* Got a new item to delete. *)

OUTPUT Compare(bucket: INTEGER[Fmt.Int]);

(* These two events used only by Linear Open Addressing with Smart Delete.  *) 
OUTPUT CheckDeletable(bucket:  INTEGER[Fmt.Int]);

OUTPUT CheckHashPosition(bucket: INTEGER[Fmt.Int]);

OUTPUT AddToBucket (key: TEXT[]; bucket: INTEGER[Fmt.Int]);
(* Adds the current element to the list at the given
   bucket.*)

OUTPUT DeleteFromBucket (key: TEXT[]; bucket: INTEGER[Fmt.Int];
markEmpty: BOOLEAN[Fmt.Bool]);

FEEDBACK ReportFind(item: TEXT[]);

UPDATE FindReport(buckets: IntList.T[HashFmt.IntList]);

FEEDBACK StopReportFind();

UPDATE StopFindReport();

(* 
**   The following regular expression defines the 
**   event stream generated by a Binpack algorithm:
**
**           Setup ((Insert Compare+ (AddToBucket | e)) |
**                  (Delete Compare+ (DeleteFromBucket | e)))* 
*)

