Keywords: cuddIntro

Next: The SIS/VIS Interface Up: User's Manual Previous: Keeping Consistent Variable Orders

## Hooks

Hooks in CUDD are lists of application-specified functions to be run on certain occasions. Each hook is identified by a constant of the enumerated type Cudd_HookType . In Version 2.3.0 hooks are defined for these occasions:

- before garbage collection (CUDD_PRE_GC_HOOK);
- after garbage collection (CDD_POST_GC_HOOK);
- before variable reordering (CDD_PRE_REORDERING_HOOK).
- after variable reordering (CDD_POST_REORDERING_HOOK).

The current implementation of hooks is experimental and the number of hooks is likely to increase in the future. A function added to a hook receives a pointer to the manager, a pointer to a string, and a pointer to void as arguments; it must return 1 if successful; 0 otherwise. The second argument is either ``BDD'' or ``ZDD.'' This allows the hook functions to tell the type of diagram for which reordering or garbage collection takes place. The third argument varies depending on the hook. The hook functions called before or after garbage collection do not use it. The hook functions called before reordering are passed, in addition to the pointer to the manager, also the method used for reordering. The hook functions called after reordering are passed the start time. To add a function to a hook, one uses Cudd_AddHook . The function of a given hook are called in the order in which they were added to the hook.