Commit | Line | Data |
---|---|---|
7f918cf1 CE |
1 | (* Copyright (C) 2009 Matthew Fluet. |
2 | * Copyright (C) 1999-2006 Henry Cejtin, Matthew Fluet, Suresh | |
3 | * Jagannathan, and Stephen Weeks. | |
4 | * | |
5 | * MLton is released under a BSD-style license. | |
6 | * See the file MLton-LICENSE for details. | |
7 | *) | |
8 | ||
9 | signature FOREST_HEAP_STRUCTS = | |
10 | sig | |
11 | structure Key: BOUNDED_ORDER | |
12 | end | |
13 | ||
14 | signature FOREST_HEAP = | |
15 | sig | |
16 | include FOREST_HEAP_STRUCTS | |
17 | ||
18 | structure Elt: | |
19 | sig | |
20 | type 'a t | |
21 | val key: 'a t -> Key.t | |
22 | val value: 'a t -> 'a | |
23 | end | |
24 | ||
25 | type 'a t | |
26 | ||
27 | val empty: unit -> 'a t | |
28 | val insertLazy: 'a t * Key.t * 'a -> 'a Elt.t | |
29 | val insertEager: 'a t * Key.t * 'a -> 'a Elt.t | |
30 | val isEmpty: 'a t -> bool | |
31 | val deleteMin: 'a t -> 'a | |
32 | val decreaseKeySift: 'a t * 'a Elt.t * Key.t -> unit | |
33 | val decreaseKeyCut: 'a t * 'a Elt.t * Key.t -> unit | |
34 | val deleteSift: 'a t * 'a Elt.t -> unit | |
35 | val deleteCut: 'a t * 'a Elt.t -> unit | |
36 | val min: 'a t -> 'a Elt.t | |
37 | val newEager: (Key.t * 'a) list -> 'a t | |
38 | val newLazy: (Key.t * 'a) list -> 'a t | |
39 | (* unions second heap into first, destroys second heap *) | |
40 | val unionLazy: 'a t * 'a t -> unit | |
41 | val unionEager: 'a t * 'a t -> unit | |
42 | end |