src/HOLCF/Tools/fixrec_package.ML
author huffman
Thu Feb 26 10:28:53 2009 -0800 (2009-02-26)
changeset 30131 6be1be402ef0
parent 29585 c23295521af5
child 30132 243a05a67c41
permissions -rw-r--r--
use TheoryData to keep track of pattern match combinators
wenzelm@23152
     1
(*  Title:      HOLCF/Tools/fixrec_package.ML
wenzelm@23152
     2
    Author:     Amber Telfer and Brian Huffman
wenzelm@23152
     3
wenzelm@23152
     4
Recursive function definition package for HOLCF.
wenzelm@23152
     5
*)
wenzelm@23152
     6
wenzelm@23152
     7
signature FIXREC_PACKAGE =
wenzelm@23152
     8
sig
wenzelm@23152
     9
  val legacy_infer_term: theory -> term -> term
wenzelm@23152
    10
  val legacy_infer_prop: theory -> term -> term
wenzelm@28084
    11
  val add_fixrec: bool -> (Attrib.binding * string) list list -> theory -> theory
haftmann@29581
    12
  val add_fixrec_i: bool -> ((binding * attribute list) * term) list list -> theory -> theory
wenzelm@28084
    13
  val add_fixpat: Attrib.binding * string list -> theory -> theory
haftmann@29581
    14
  val add_fixpat_i: (binding * attribute list) * term list -> theory -> theory
huffman@30131
    15
  val add_matchers: (string * string) list -> theory -> theory
huffman@30131
    16
  val setup: theory -> theory
wenzelm@23152
    17
end;
wenzelm@23152
    18
wenzelm@23152
    19
structure FixrecPackage: FIXREC_PACKAGE =
wenzelm@23152
    20
struct
wenzelm@23152
    21
wenzelm@23152
    22
(* legacy type inference *)
wenzelm@23152
    23
wenzelm@23152
    24
fun legacy_infer_term thy t =
wenzelm@24493
    25
  singleton (Syntax.check_terms (ProofContext.init thy)) (Sign.intern_term thy t);
wenzelm@23152
    26
wenzelm@24680
    27
fun legacy_infer_prop thy t = legacy_infer_term thy (TypeInfer.constrain propT t);
wenzelm@23152
    28
wenzelm@23152
    29
huffman@26045
    30
val fix_eq2 = @{thm fix_eq2};
huffman@26045
    31
val def_fix_ind = @{thm def_fix_ind};
wenzelm@23152
    32
wenzelm@23152
    33
wenzelm@23152
    34
fun fixrec_err s = error ("fixrec definition error:\n" ^ s);
wenzelm@23152
    35
fun fixrec_eq_err thy s eq =
wenzelm@26939
    36
  fixrec_err (s ^ "\nin\n" ^ quote (Syntax.string_of_term_global thy eq));
wenzelm@23152
    37
wenzelm@23152
    38
(* ->> is taken from holcf_logic.ML *)
wenzelm@23152
    39
(* TODO: fix dependencies so we can import HOLCFLogic here *)
wenzelm@23152
    40
infixr 6 ->>;
huffman@26045
    41
fun S ->> T = Type (@{type_name "->"},[S,T]);
wenzelm@23152
    42
wenzelm@23152
    43
(* extern_name is taken from domain/library.ML *)
wenzelm@23152
    44
fun extern_name con = case Symbol.explode con of 
wenzelm@23152
    45
		   ("o"::"p"::" "::rest) => implode rest
wenzelm@23152
    46
		   | _ => con;
wenzelm@23152
    47
wenzelm@23152
    48
val mk_trp = HOLogic.mk_Trueprop;
wenzelm@23152
    49
wenzelm@23152
    50
(* splits a cterm into the right and lefthand sides of equality *)
wenzelm@23152
    51
fun dest_eqs t = HOLogic.dest_eq (HOLogic.dest_Trueprop t);
wenzelm@23152
    52
wenzelm@23152
    53
(* similar to Thm.head_of, but for continuous application *)
huffman@26045
    54
fun chead_of (Const(@{const_name Rep_CFun},_)$f$t) = chead_of f
wenzelm@23152
    55
  | chead_of u = u;
wenzelm@23152
    56
wenzelm@23152
    57
(* these are helpful functions copied from HOLCF/domain/library.ML *)
wenzelm@23152
    58
fun %: s = Free(s,dummyT);
wenzelm@23152
    59
fun %%: s = Const(s,dummyT);
wenzelm@23152
    60
infix 0 ==;  fun S ==  T = %%:"==" $ S $ T;
wenzelm@23152
    61
infix 1 ===; fun S === T = %%:"op =" $ S $ T;
huffman@26045
    62
infix 9 `  ; fun f ` x = %%:@{const_name Rep_CFun} $ f $ x;
wenzelm@23152
    63
wenzelm@23152
    64
(* builds the expression (LAM v. rhs) *)
huffman@26045
    65
fun big_lambda v rhs = %%:@{const_name Abs_CFun}$(Term.lambda v rhs);
wenzelm@23152
    66
wenzelm@23152
    67
(* builds the expression (LAM v1 v2 .. vn. rhs) *)
wenzelm@23152
    68
fun big_lambdas [] rhs = rhs
wenzelm@23152
    69
  | big_lambdas (v::vs) rhs = big_lambda v (big_lambdas vs rhs);
wenzelm@23152
    70
wenzelm@23152
    71
(* builds the expression (LAM <v1,v2,..,vn>. rhs) *)
wenzelm@23152
    72
fun lambda_ctuple [] rhs = big_lambda (%:"unit") rhs
wenzelm@23152
    73
  | lambda_ctuple (v::[]) rhs = big_lambda v rhs
wenzelm@23152
    74
  | lambda_ctuple (v::vs) rhs =
huffman@26045
    75
      %%:@{const_name csplit}`(big_lambda v (lambda_ctuple vs rhs));
wenzelm@23152
    76
wenzelm@23152
    77
(* builds the expression <v1,v2,..,vn> *)
wenzelm@23152
    78
fun mk_ctuple [] = %%:"UU"
wenzelm@23152
    79
|   mk_ctuple (t::[]) = t
huffman@26045
    80
|   mk_ctuple (t::ts) = %%:@{const_name cpair}`t`(mk_ctuple ts);
wenzelm@23152
    81
wenzelm@23152
    82
(*************************************************************************)
wenzelm@23152
    83
(************* fixed-point definitions and unfolding theorems ************)
wenzelm@23152
    84
(*************************************************************************)
wenzelm@23152
    85
wenzelm@23152
    86
fun add_fixdefs eqs thy =
wenzelm@23152
    87
  let
wenzelm@23152
    88
    val (lhss,rhss) = ListPair.unzip (map dest_eqs eqs);
huffman@26045
    89
    val fixpoint = %%:@{const_name fix}`lambda_ctuple lhss (mk_ctuple rhss);
wenzelm@23152
    90
    
wenzelm@23152
    91
    fun one_def (l as Const(n,T)) r =
wenzelm@23152
    92
          let val b = Sign.base_name n in (b, (b^"_def", l == r)) end
wenzelm@23152
    93
      | one_def _ _ = fixrec_err "fixdefs: lhs not of correct form";
wenzelm@23152
    94
    fun defs [] _ = []
wenzelm@23152
    95
      | defs (l::[]) r = [one_def l r]
huffman@26045
    96
      | defs (l::ls) r = one_def l (%%:@{const_name cfst}`r) :: defs ls (%%:@{const_name csnd}`r);
wenzelm@23152
    97
    val (names, pre_fixdefs) = ListPair.unzip (defs lhss fixpoint);
wenzelm@23152
    98
    
wenzelm@23152
    99
    val fixdefs = map (apsnd (legacy_infer_prop thy)) pre_fixdefs;
wenzelm@23152
   100
    val (fixdef_thms, thy') =
haftmann@29585
   101
      PureThy.add_defs false (map (Thm.no_attributes o apfst Binding.name) fixdefs) thy;
wenzelm@25132
   102
    val ctuple_fixdef_thm = foldr1 (fn (x,y) => @{thm cpair_equalI} OF [x,y]) fixdef_thms;
wenzelm@23152
   103
    
wenzelm@23152
   104
    val ctuple_unfold = legacy_infer_term thy' (mk_trp (mk_ctuple lhss === mk_ctuple rhss));
wenzelm@23152
   105
    val ctuple_unfold_thm = Goal.prove_global thy' [] [] ctuple_unfold
wenzelm@23152
   106
          (fn _ => EVERY [rtac (ctuple_fixdef_thm RS fix_eq2 RS trans) 1,
wenzelm@23152
   107
                    simp_tac (simpset_of thy') 1]);
wenzelm@23152
   108
    val ctuple_induct_thm =
wenzelm@23152
   109
          (space_implode "_" names ^ "_induct", ctuple_fixdef_thm RS def_fix_ind);
wenzelm@23152
   110
    
wenzelm@23152
   111
    fun unfolds [] thm = []
wenzelm@23152
   112
      | unfolds (n::[]) thm = [(n^"_unfold", thm)]
wenzelm@23152
   113
      | unfolds (n::ns) thm = let
wenzelm@25132
   114
          val thmL = thm RS @{thm cpair_eqD1};
wenzelm@25132
   115
          val thmR = thm RS @{thm cpair_eqD2};
wenzelm@23152
   116
        in (n^"_unfold", thmL) :: unfolds ns thmR end;
wenzelm@23152
   117
    val unfold_thms = unfolds names ctuple_unfold_thm;
wenzelm@23152
   118
    val thms = ctuple_induct_thm :: unfold_thms;
haftmann@29585
   119
    val (_, thy'') = PureThy.add_thms (map (Thm.no_attributes o apfst Binding.name) thms) thy';
wenzelm@23152
   120
  in
wenzelm@23152
   121
    (thy'', names, fixdef_thms, map snd unfold_thms)
wenzelm@23152
   122
  end;
wenzelm@23152
   123
wenzelm@23152
   124
(*************************************************************************)
wenzelm@23152
   125
(*********** monadic notation and pattern matching compilation ***********)
wenzelm@23152
   126
(*************************************************************************)
wenzelm@23152
   127
huffman@30131
   128
structure FixrecMatchData = TheoryDataFun (
huffman@30131
   129
  type T = string Symtab.table;
huffman@30131
   130
  val empty = Symtab.empty;
huffman@30131
   131
  val copy = I;
huffman@30131
   132
  val extend = I;
huffman@30131
   133
  fun merge _ tabs : T = Symtab.merge (K true) tabs;
huffman@30131
   134
);
huffman@30131
   135
huffman@30131
   136
(* associate match functions with pattern constants *)
huffman@30131
   137
fun add_matchers ms = FixrecMatchData.map (fold Symtab.update ms);
huffman@30131
   138
wenzelm@23152
   139
fun add_names (Const(a,_), bs) = insert (op =) (Sign.base_name a) bs
wenzelm@23152
   140
  | add_names (Free(a,_) , bs) = insert (op =) a bs
wenzelm@23152
   141
  | add_names (f $ u     , bs) = add_names (f, add_names(u, bs))
wenzelm@23152
   142
  | add_names (Abs(a,_,t), bs) = add_names (t, insert (op =) a bs)
wenzelm@23152
   143
  | add_names (_         , bs) = bs;
wenzelm@23152
   144
wenzelm@23152
   145
fun add_terms ts xs = foldr add_names xs ts;
wenzelm@23152
   146
wenzelm@23152
   147
(* builds a monadic term for matching a constructor pattern *)
huffman@30131
   148
fun pre_build match_name pat rhs vs taken =
wenzelm@23152
   149
  case pat of
huffman@26045
   150
    Const(@{const_name Rep_CFun},_)$f$(v as Free(n,T)) =>
huffman@30131
   151
      pre_build match_name f rhs (v::vs) taken
huffman@26045
   152
  | Const(@{const_name Rep_CFun},_)$f$x =>
huffman@30131
   153
      let val (rhs', v, taken') = pre_build match_name x rhs [] taken;
huffman@30131
   154
      in pre_build match_name f rhs' (v::vs) taken' end
wenzelm@23152
   155
  | Const(c,T) =>
wenzelm@23152
   156
      let
wenzelm@23152
   157
        val n = Name.variant taken "v";
huffman@26045
   158
        fun result_type (Type(@{type_name "->"},[_,T])) (x::xs) = result_type T xs
wenzelm@23152
   159
          | result_type T _ = T;
wenzelm@23152
   160
        val v = Free(n, result_type T vs);
huffman@30131
   161
        val m = match_name c;
wenzelm@23152
   162
        val k = lambda_ctuple vs rhs;
wenzelm@23152
   163
      in
huffman@26045
   164
        (%%:@{const_name Fixrec.bind}`(%%:m`v)`k, v, n::taken)
wenzelm@23152
   165
      end
wenzelm@23152
   166
  | Free(n,_) => fixrec_err ("expected constructor, found free variable " ^ quote n)
wenzelm@23152
   167
  | _ => fixrec_err "pre_build: invalid pattern";
wenzelm@23152
   168
wenzelm@23152
   169
(* builds a monadic term for matching a function definition pattern *)
wenzelm@23152
   170
(* returns (name, arity, matcher) *)
huffman@30131
   171
fun building match_name pat rhs vs taken =
wenzelm@23152
   172
  case pat of
huffman@26045
   173
    Const(@{const_name Rep_CFun}, _)$f$(v as Free(n,T)) =>
huffman@30131
   174
      building match_name f rhs (v::vs) taken
huffman@26045
   175
  | Const(@{const_name Rep_CFun}, _)$f$x =>
huffman@30131
   176
      let val (rhs', v, taken') = pre_build match_name x rhs [] taken;
huffman@30131
   177
      in building match_name f rhs' (v::vs) taken' end
wenzelm@23152
   178
  | Const(name,_) => (name, length vs, big_lambdas vs rhs)
wenzelm@23152
   179
  | _ => fixrec_err "function is not declared as constant in theory";
wenzelm@23152
   180
huffman@30131
   181
fun match_eq match_name eq = 
wenzelm@23152
   182
  let val (lhs,rhs) = dest_eqs eq;
huffman@30131
   183
  in
huffman@30131
   184
    building match_name lhs (%%:@{const_name Fixrec.return}`rhs) []
huffman@30131
   185
      (add_terms [eq] [])
huffman@30131
   186
  end;
wenzelm@23152
   187
wenzelm@23152
   188
(* returns the sum (using +++) of the terms in ms *)
wenzelm@23152
   189
(* also applies "run" to the result! *)
wenzelm@23152
   190
fun fatbar arity ms =
wenzelm@23152
   191
  let
wenzelm@23152
   192
    fun unLAM 0 t = t
wenzelm@23152
   193
      | unLAM n (_$Abs(_,_,t)) = unLAM (n-1) t
wenzelm@23152
   194
      | unLAM _ _ = fixrec_err "fatbar: internal error, not enough LAMs";
wenzelm@23152
   195
    fun reLAM 0 t = t
huffman@26045
   196
      | reLAM n t = reLAM (n-1) (%%:@{const_name Abs_CFun} $ Abs("",dummyT,t));
huffman@26045
   197
    fun mplus (x,y) = %%:@{const_name Fixrec.mplus}`x`y;
wenzelm@23152
   198
    val msum = foldr1 mplus (map (unLAM arity) ms);
wenzelm@23152
   199
  in
huffman@26045
   200
    reLAM arity (%%:@{const_name Fixrec.run}`msum)
wenzelm@23152
   201
  end;
wenzelm@23152
   202
wenzelm@23152
   203
fun unzip3 [] = ([],[],[])
wenzelm@23152
   204
  | unzip3 ((x,y,z)::ts) =
wenzelm@23152
   205
      let val (xs,ys,zs) = unzip3 ts
wenzelm@23152
   206
      in (x::xs, y::ys, z::zs) end;
wenzelm@23152
   207
wenzelm@23152
   208
(* this is the pattern-matching compiler function *)
huffman@30131
   209
fun compile_pats match_name eqs = 
wenzelm@23152
   210
  let
huffman@30131
   211
    val ((n::names),(a::arities),mats) = unzip3 (map (match_eq match_name) eqs);
wenzelm@23152
   212
    val cname = if forall (fn x => n=x) names then n
wenzelm@23152
   213
          else fixrec_err "all equations in block must define the same function";
wenzelm@23152
   214
    val arity = if forall (fn x => a=x) arities then a
wenzelm@23152
   215
          else fixrec_err "all equations in block must have the same arity";
wenzelm@23152
   216
    val rhs = fatbar arity mats;
wenzelm@23152
   217
  in
wenzelm@23152
   218
    mk_trp (%%:cname === rhs)
wenzelm@23152
   219
  end;
wenzelm@23152
   220
wenzelm@23152
   221
(*************************************************************************)
wenzelm@23152
   222
(********************** Proving associated theorems **********************)
wenzelm@23152
   223
(*************************************************************************)
wenzelm@23152
   224
wenzelm@23152
   225
(* proves a block of pattern matching equations as theorems, using unfold *)
wenzelm@23152
   226
fun make_simps thy (unfold_thm, eqns) =
wenzelm@23152
   227
  let
wenzelm@25132
   228
    val tacs = [rtac (unfold_thm RS @{thm ssubst_lhs}) 1, asm_simp_tac (simpset_of thy) 1];
wenzelm@23152
   229
    fun prove_term t = Goal.prove_global thy [] [] t (K (EVERY tacs));
wenzelm@23152
   230
    fun prove_eqn ((name, eqn_t), atts) = ((name, prove_term eqn_t), atts);
wenzelm@23152
   231
  in
wenzelm@23152
   232
    map prove_eqn eqns
wenzelm@23152
   233
  end;
wenzelm@23152
   234
wenzelm@23152
   235
(*************************************************************************)
wenzelm@23152
   236
(************************* Main fixrec function **************************)
wenzelm@23152
   237
(*************************************************************************)
wenzelm@23152
   238
wenzelm@23152
   239
fun gen_add_fixrec prep_prop prep_attrib strict blocks thy =
wenzelm@23152
   240
  let
wenzelm@23152
   241
    val eqns = List.concat blocks;
wenzelm@23152
   242
    val lengths = map length blocks;
wenzelm@23152
   243
    
wenzelm@28083
   244
    val ((bindings, srcss), strings) = apfst split_list (split_list eqns);
haftmann@29006
   245
    val names = map Binding.base_name bindings;
wenzelm@23152
   246
    val atts = map (map (prep_attrib thy)) srcss;
wenzelm@23152
   247
    val eqn_ts = map (prep_prop thy) strings;
wenzelm@23152
   248
    val rec_ts = map (fn eq => chead_of (fst (dest_eqs (Logic.strip_imp_concl eq)))
wenzelm@23152
   249
      handle TERM _ => fixrec_eq_err thy "not a proper equation" eq) eqn_ts;
haftmann@25557
   250
    val (_, eqn_ts') = OldPrimrecPackage.unify_consts thy rec_ts eqn_ts;
wenzelm@23152
   251
    
wenzelm@23152
   252
    fun unconcat [] _ = []
wenzelm@23152
   253
      | unconcat (n::ns) xs = List.take (xs,n) :: unconcat ns (List.drop (xs,n));
huffman@30131
   254
    val matcher_tab = FixrecMatchData.get thy;
huffman@30131
   255
    fun match_name c =
huffman@30131
   256
          case Symtab.lookup matcher_tab c of SOME m => m
huffman@30131
   257
            | NONE => fixrec_err ("unknown pattern constructor: " ^ c);
huffman@30131
   258
wenzelm@23152
   259
    val pattern_blocks = unconcat lengths (map Logic.strip_imp_concl eqn_ts');
huffman@30131
   260
    val compiled_ts =
huffman@30131
   261
          map (legacy_infer_term thy o compile_pats match_name) pattern_blocks;
wenzelm@23152
   262
    val (thy', cnames, fixdef_thms, unfold_thms) = add_fixdefs compiled_ts thy;
wenzelm@23152
   263
  in
wenzelm@23152
   264
    if strict then let (* only prove simp rules if strict = true *)
wenzelm@23152
   265
      val eqn_blocks = unconcat lengths ((names ~~ eqn_ts') ~~ atts);
haftmann@29585
   266
      val simps = maps (make_simps thy') (unfold_thms ~~ eqn_blocks);
haftmann@29585
   267
      val (simp_thms, thy'') = PureThy.add_thms ((map o apfst o apfst) Binding.name simps) thy';
wenzelm@23152
   268
      
wenzelm@23152
   269
      val simp_names = map (fn name => name^"_simps") cnames;
wenzelm@23152
   270
      val simp_attribute = rpair [Simplifier.simp_add];
wenzelm@23152
   271
      val simps' = map simp_attribute (simp_names ~~ unconcat lengths simp_thms);
wenzelm@23152
   272
    in
haftmann@29585
   273
      (snd o PureThy.add_thmss ((map o apfst o apfst) Binding.name simps')) thy''
wenzelm@23152
   274
    end
wenzelm@23152
   275
    else thy'
wenzelm@23152
   276
  end;
wenzelm@23152
   277
wenzelm@24707
   278
val add_fixrec = gen_add_fixrec Syntax.read_prop_global Attrib.attribute;
wenzelm@23152
   279
val add_fixrec_i = gen_add_fixrec Sign.cert_prop (K I);
wenzelm@23152
   280
wenzelm@23152
   281
wenzelm@23152
   282
(*************************************************************************)
wenzelm@23152
   283
(******************************** Fixpat *********************************)
wenzelm@23152
   284
(*************************************************************************)
wenzelm@23152
   285
wenzelm@23152
   286
fun fix_pat thy t = 
wenzelm@23152
   287
  let
wenzelm@23152
   288
    val T = fastype_of t;
wenzelm@23152
   289
    val eq = mk_trp (HOLogic.eq_const T $ t $ Var (("x",0),T));
wenzelm@23152
   290
    val cname = case chead_of t of Const(c,_) => c | _ =>
wenzelm@23152
   291
              fixrec_err "function is not declared as constant in theory";
wenzelm@26343
   292
    val unfold_thm = PureThy.get_thm thy (cname^"_unfold");
wenzelm@23152
   293
    val simp = Goal.prove_global thy [] [] eq
wenzelm@23152
   294
          (fn _ => EVERY [stac unfold_thm 1, simp_tac (simpset_of thy) 1]);
wenzelm@23152
   295
  in simp end;
wenzelm@23152
   296
wenzelm@23152
   297
fun gen_add_fixpat prep_term prep_attrib ((name, srcs), strings) thy =
wenzelm@23152
   298
  let
wenzelm@23152
   299
    val atts = map (prep_attrib thy) srcs;
wenzelm@23152
   300
    val ts = map (prep_term thy) strings;
wenzelm@23152
   301
    val simps = map (fix_pat thy) ts;
wenzelm@23152
   302
  in
haftmann@29585
   303
    (snd o PureThy.add_thmss [((name, simps), atts)]) thy
wenzelm@23152
   304
  end;
wenzelm@23152
   305
wenzelm@24707
   306
val add_fixpat = gen_add_fixpat Syntax.read_term_global Attrib.attribute;
wenzelm@23152
   307
val add_fixpat_i = gen_add_fixpat Sign.cert_term (K I);
wenzelm@23152
   308
wenzelm@23152
   309
wenzelm@23152
   310
(*************************************************************************)
wenzelm@23152
   311
(******************************** Parsers ********************************)
wenzelm@23152
   312
(*************************************************************************)
wenzelm@23152
   313
wenzelm@23152
   314
local structure P = OuterParse and K = OuterKeyword in
wenzelm@23152
   315
wenzelm@23152
   316
val fixrec_eqn = SpecParse.opt_thm_name ":" -- P.prop;
wenzelm@23152
   317
wenzelm@23152
   318
val fixrec_strict = P.opt_keyword "permissive" >> not;
wenzelm@23152
   319
wenzelm@23152
   320
val fixrec_decl = fixrec_strict -- P.and_list1 (Scan.repeat1 fixrec_eqn);
wenzelm@23152
   321
wenzelm@23152
   322
(* this builds a parser for a new keyword, fixrec, whose functionality 
wenzelm@23152
   323
is defined by add_fixrec *)
wenzelm@24867
   324
val _ =
wenzelm@23152
   325
  OuterSyntax.command "fixrec" "define recursive functions (HOLCF)" K.thy_decl
wenzelm@23152
   326
    (fixrec_decl >> (Toplevel.theory o uncurry add_fixrec));
wenzelm@23152
   327
wenzelm@23152
   328
(* fixpat parser *)
wenzelm@23152
   329
val fixpat_decl = SpecParse.opt_thm_name ":" -- Scan.repeat1 P.prop;
wenzelm@23152
   330
wenzelm@24867
   331
val _ =
wenzelm@23152
   332
  OuterSyntax.command "fixpat" "define rewrites for fixrec functions" K.thy_decl
wenzelm@23152
   333
    (fixpat_decl >> (Toplevel.theory o add_fixpat));
wenzelm@23152
   334
huffman@26045
   335
end; (* local structure *)
wenzelm@23152
   336
huffman@30131
   337
val setup = FixrecMatchData.init;
huffman@30131
   338
wenzelm@24867
   339
end;