src/Pure/General/table.ML
author wenzelm
Wed, 10 Jun 1998 11:53:37 +0200
changeset 5015 44fd9e09c637
child 5681 464913c6086a
permissions -rw-r--r--
moved table.ML to General/table.ML;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
5015
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
     1
(*  Title:      Pure/table.ML
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
     2
    ID:         $Id$
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
     3
    Author:     Markus Wenzel, TU Muenchen
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
     4
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
     5
Generic tables and tables indexed by strings.  No delete operation.
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
     6
Implemented as balanced 2-3 trees.
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
     7
*)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
     8
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
     9
signature KEY =
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    10
sig
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    11
  type key
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    12
  val ord: key * key -> order
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    13
end;
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    14
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    15
signature TABLE =
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    16
sig
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    17
  type key
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    18
  type 'a table
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    19
  exception DUP of key
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    20
  exception DUPS of key list
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    21
  val empty: 'a table
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    22
  val is_empty: 'a table -> bool
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    23
  val dest: 'a table -> (key * 'a) list
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    24
  val lookup: 'a table * key -> 'a option
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    25
  val update: (key * 'a) * 'a table -> 'a table
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    26
  val update_new: (key * 'a) * 'a table -> 'a table                 (*exception DUP*)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    27
  val make: (key * 'a) list -> 'a table                             (*exception DUPS*)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    28
  val extend: 'a table * (key * 'a) list -> 'a table                (*exception DUPS*)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    29
  val merge: ('a * 'a -> bool) -> 'a table * 'a table -> 'a table   (*exception DUPS*)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    30
  val lookup_multi: 'a list table * key -> 'a list
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    31
  val make_multi: (key * 'a) list -> 'a list table
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    32
  val dest_multi: 'a list table -> (key * 'a) list
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    33
  val map: ('a -> 'b) -> 'a table -> 'b table
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    34
end;
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    35
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    36
functor TableFun(Key: KEY): TABLE =
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    37
struct
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    38
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    39
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    40
(* datatype table *)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    41
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    42
type key = Key.key;
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    43
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    44
datatype 'a table =
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    45
  Empty |
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    46
  Branch2 of 'a table * (key * 'a) * 'a table |
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    47
  Branch3 of 'a table * (key * 'a) * 'a table * (key * 'a) * 'a table;
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    48
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    49
exception DUP of key;
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    50
exception DUPS of key list;
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    51
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    52
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    53
val empty = Empty;
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    54
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    55
fun is_empty Empty = true
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    56
  | is_empty _ = false;
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    57
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    58
fun dest Empty = []
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    59
  | dest (Branch2 (left, p, right)) = dest left @ [p] @ dest right
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    60
  | dest (Branch3 (left, p1, mid, p2, right)) =
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    61
      dest left @ [p1] @ dest mid @ [p2] @ dest right;
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    62
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    63
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    64
(* lookup *)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    65
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    66
fun lookup (Empty, _) = None
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    67
  | lookup (Branch2 (left, (k, x), right), key) =
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    68
      (case Key.ord (key, k) of
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    69
        LESS => lookup (left, key)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    70
      | EQUAL => Some x
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    71
      | GREATER => lookup (right, key))
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    72
  | lookup (Branch3 (left, (k1, x1), mid, (k2, x2), right), key) =
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    73
      (case Key.ord (key, k1) of
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    74
        LESS => lookup (left, key)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    75
      | EQUAL => Some x1
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    76
      | GREATER =>
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    77
          (case Key.ord (key, k2) of
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    78
            LESS => lookup (mid, key)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    79
          | EQUAL => Some x2
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    80
          | GREATER => lookup (right, key)));
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    81
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    82
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    83
(* update *)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    84
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    85
fun compare (k1, _) (k2, _) = Key.ord (k1, k2);
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    86
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    87
datatype 'a growth =
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    88
  Stay of 'a table |
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    89
  Sprout of 'a table * (key * 'a) * 'a table;
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    90
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    91
fun insert pair Empty = Sprout (Empty, pair, Empty)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    92
  | insert pair (Branch2 (left, p, right)) =
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    93
      (case compare pair p of
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    94
        LESS =>
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    95
          (case insert pair left of
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    96
            Stay left' => Stay (Branch2 (left', p, right))
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    97
          | Sprout (left1, q, left2) => Stay (Branch3 (left1, q, left2, p, right)))
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    98
      | EQUAL => Stay (Branch2 (left, pair, right))
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
    99
      | GREATER =>
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   100
          (case insert pair right of
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   101
            Stay right' => Stay (Branch2 (left, p, right'))
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   102
          | Sprout (right1, q, right2) =>
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   103
              Stay (Branch3 (left, p, right1, q, right2))))
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   104
  | insert pair (Branch3 (left, p1, mid, p2, right)) =
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   105
      (case compare pair p1 of
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   106
        LESS =>
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   107
          (case insert pair left of
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   108
            Stay left' => Stay (Branch3 (left', p1, mid, p2, right))
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   109
          | Sprout (left1, q, left2) =>
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   110
              Sprout (Branch2 (left1, q, left2), p1, Branch2 (mid, p2, right)))
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   111
      | EQUAL => Stay (Branch3 (left, pair, mid, p2, right))
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   112
      | GREATER =>
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   113
          (case compare pair p2 of
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   114
            LESS =>
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   115
              (case insert pair mid of
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   116
                Stay mid' => Stay (Branch3 (left, p1, mid', p2, right))
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   117
              | Sprout (mid1, q, mid2) =>
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   118
                  Sprout (Branch2 (left, p1, mid1), q, Branch2 (mid2, p2, right)))
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   119
          | EQUAL => Stay (Branch3 (left, p1, mid, pair, right))
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   120
          | GREATER =>
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   121
              (case insert pair right of
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   122
                Stay right' => Stay (Branch3 (left, p1, mid, p2, right'))
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   123
              | Sprout (right1, q, right2) =>
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   124
                  Sprout (Branch2 (left, p1, mid), p2, Branch2 (right1, q, right2)))));
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   125
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   126
fun update (pair, tab) =
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   127
  (case insert pair tab of
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   128
    Stay tab => tab
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   129
  | Sprout br => Branch2 br);
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   130
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   131
fun update_new (pair as (key, _), tab) =
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   132
  if is_none (lookup (tab, key)) then update (pair, tab)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   133
  else raise DUP key;
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   134
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   135
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   136
(* make, extend, merge tables *)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   137
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   138
fun add eq ((tab, dups), (key, x)) =
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   139
  (case lookup (tab, key) of
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   140
    None => (update ((key, x), tab), dups)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   141
  | Some x' =>
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   142
      if eq (x, x') then (tab, dups)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   143
      else (tab, dups @ [key]));
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   144
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   145
fun enter eq (tab, pairs) =
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   146
  (case foldl (add eq) ((tab, []), pairs) of
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   147
    (tab', []) => tab'
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   148
  | (_, dups) => raise DUPS dups);
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   149
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   150
fun extend tab_pairs = enter (K false) tab_pairs;
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   151
fun make pairs = extend (empty, pairs);
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   152
fun merge eq (tab1, tab2) = enter eq (tab1, dest tab2);
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   153
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   154
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   155
(* tables with multiple entries per key (preserving order) *)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   156
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   157
fun lookup_multi tab_key = if_none (lookup tab_key) [];
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   158
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   159
fun cons_entry ((key, x), tab) =
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   160
  update ((key, x :: lookup_multi (tab, key)), tab);
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   161
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   162
fun make_multi pairs = foldr cons_entry (pairs, empty);
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   163
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   164
fun dest_multi tab =
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   165
  flat (map (fn (key, xs) => map (Library.pair key) xs) (dest tab));
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   166
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   167
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   168
(* map *)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   169
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   170
fun map _ Empty = Empty
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   171
  | map f (Branch2 (left, (k, x), right)) =
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   172
      Branch2 (map f left, (k, f x), map f right)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   173
  | map f (Branch3 (left, (k1, x1), mid, (k2, x2), right)) =
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   174
      Branch3 (map f left, (k1, f x1), map f mid, (k2, f x2), map f right);
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   175
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   176
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   177
end;
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   178
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   179
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   180
(*tables indexed by strings*)
44fd9e09c637 moved table.ML to General/table.ML;
wenzelm
parents:
diff changeset
   181
structure Symtab = TableFun(type key = string val ord = string_ord);