src/HOL/Tools/recfun_codegen.ML
author wenzelm
Mon, 08 Oct 2007 18:13:06 +0200
changeset 24907 bfb2e82b61fe
parent 24624 b8383b1bbae3
child 25389 3e58c7cb5a73
permissions -rw-r--r--
Codegen.is_instance: raw match, ignore sort constraints;
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
24584
01e83ffa6c54 fixed title
haftmann
parents: 24219
diff changeset
     1
(*  Title:      HOL/Tools/recfun_codegen.ML
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
     2
    ID:         $Id$
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
     3
    Author:     Stefan Berghofer, TU Muenchen
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
     4
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
     5
Code generator for recursive functions.
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
     6
*)
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
     7
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
     8
signature RECFUN_CODEGEN =
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
     9
sig
18728
6790126ab5f6 simplified type attribute;
wenzelm
parents: 18708
diff changeset
    10
  val add: string option -> attribute
24624
b8383b1bbae3 distinction between regular and default code theorems
haftmann
parents: 24584
diff changeset
    11
  val add_default: attribute
18728
6790126ab5f6 simplified type attribute;
wenzelm
parents: 18708
diff changeset
    12
  val del: attribute
18708
4b3dadb4fe33 setup: theory -> theory;
wenzelm
parents: 18702
diff changeset
    13
  val setup: theory -> theory
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    14
end;
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    15
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    16
structure RecfunCodegen : RECFUN_CODEGEN =
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    17
struct
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    18
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    19
open Codegen;
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    20
20597
65fe827aa595 code generation 2 adjustments
haftmann
parents: 19788
diff changeset
    21
structure RecCodegenData = TheoryDataFun
22846
fb79144af9a3 simplified DataFun interfaces;
wenzelm
parents: 22484
diff changeset
    22
(
16645
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
    23
  type T = (thm * string option) list Symtab.table;
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    24
  val empty = Symtab.empty;
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    25
  val copy = I;
16424
18a07ad8fea8 accomodate change of TheoryDataFun;
wenzelm
parents: 15700
diff changeset
    26
  val extend = I;
22360
26ead7ed4f4b moved eq_thm etc. to structure Thm in Pure/more_thm.ML;
wenzelm
parents: 21410
diff changeset
    27
  fun merge _ = Symtab.merge_list (Thm.eq_thm_prop o pairself fst);
22846
fb79144af9a3 simplified DataFun interfaces;
wenzelm
parents: 22484
diff changeset
    28
);
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    29
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    30
val dest_eqn = HOLogic.dest_eq o HOLogic.dest_Trueprop;
15321
694f9d3ce90d Reimplemented some operations on "code lemma" table to avoid that code
berghofe
parents: 15257
diff changeset
    31
val lhs_of = fst o dest_eqn o prop_of;
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    32
val const_of = dest_Const o head_of o fst o dest_eqn;
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    33
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    34
fun warn thm = warning ("RecfunCodegen: Not a proper equation:\n" ^
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    35
  string_of_thm thm);
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    36
24624
b8383b1bbae3 distinction between regular and default code theorems
haftmann
parents: 24584
diff changeset
    37
fun add_thm opt_module thm =
b8383b1bbae3 distinction between regular and default code theorems
haftmann
parents: 24584
diff changeset
    38
  if Pattern.pattern (lhs_of thm) then
b8383b1bbae3 distinction between regular and default code theorems
haftmann
parents: 24584
diff changeset
    39
    RecCodegenData.map
b8383b1bbae3 distinction between regular and default code theorems
haftmann
parents: 24584
diff changeset
    40
      (Symtab.update_list ((fst o const_of o prop_of) thm, (thm, opt_module)))
b8383b1bbae3 distinction between regular and default code theorems
haftmann
parents: 24584
diff changeset
    41
  else tap (fn _ => warn thm)
b8383b1bbae3 distinction between regular and default code theorems
haftmann
parents: 24584
diff changeset
    42
  handle TERM _ => tap (fn _ => warn thm);
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    43
24624
b8383b1bbae3 distinction between regular and default code theorems
haftmann
parents: 24584
diff changeset
    44
fun add opt_module = Thm.declaration_attribute (fn thm => Context.mapping
b8383b1bbae3 distinction between regular and default code theorems
haftmann
parents: 24584
diff changeset
    45
  (add_thm opt_module thm #> Code.add_liberal_func thm) I);
b8383b1bbae3 distinction between regular and default code theorems
haftmann
parents: 24584
diff changeset
    46
b8383b1bbae3 distinction between regular and default code theorems
haftmann
parents: 24584
diff changeset
    47
val add_default = Thm.declaration_attribute (fn thm => Context.mapping
b8383b1bbae3 distinction between regular and default code theorems
haftmann
parents: 24584
diff changeset
    48
  (add_thm NONE thm #> Code.add_default_func thm) I);
b8383b1bbae3 distinction between regular and default code theorems
haftmann
parents: 24584
diff changeset
    49
b8383b1bbae3 distinction between regular and default code theorems
haftmann
parents: 24584
diff changeset
    50
fun del_thm thm = case try const_of (prop_of thm)
b8383b1bbae3 distinction between regular and default code theorems
haftmann
parents: 24584
diff changeset
    51
 of SOME (s, _) => RecCodegenData.map
b8383b1bbae3 distinction between regular and default code theorems
haftmann
parents: 24584
diff changeset
    52
      (Symtab.map_entry s (remove (Thm.eq_thm o apsnd fst) thm))
b8383b1bbae3 distinction between regular and default code theorems
haftmann
parents: 24584
diff changeset
    53
  | NONE => tap (fn _ => warn thm);
19344
b4e00947c8a1 added hook for codegen_theorems.ML
haftmann
parents: 19202
diff changeset
    54
b4e00947c8a1 added hook for codegen_theorems.ML
haftmann
parents: 19202
diff changeset
    55
val del = Thm.declaration_attribute
24219
e558fe311376 new structure for code generator modules
haftmann
parents: 22921
diff changeset
    56
  (fn thm => Context.mapping (del_thm thm #> Code.del_func thm) I)
14196
be5e838f37bd Added "del" attribute for deleting equations.
berghofe
parents: 13105
diff changeset
    57
15321
694f9d3ce90d Reimplemented some operations on "code lemma" table to avoid that code
berghofe
parents: 15257
diff changeset
    58
fun del_redundant thy eqs [] = eqs
694f9d3ce90d Reimplemented some operations on "code lemma" table to avoid that code
berghofe
parents: 15257
diff changeset
    59
  | del_redundant thy eqs (eq :: eqs') =
694f9d3ce90d Reimplemented some operations on "code lemma" table to avoid that code
berghofe
parents: 15257
diff changeset
    60
    let
694f9d3ce90d Reimplemented some operations on "code lemma" table to avoid that code
berghofe
parents: 15257
diff changeset
    61
      val matches = curry
17203
29b2563f5c11 refer to theory instead of low-level tsig;
wenzelm
parents: 17144
diff changeset
    62
        (Pattern.matches thy o pairself (lhs_of o fst))
15321
694f9d3ce90d Reimplemented some operations on "code lemma" table to avoid that code
berghofe
parents: 15257
diff changeset
    63
    in del_redundant thy (eq :: eqs) (filter_out (matches eq) eqs') end;
694f9d3ce90d Reimplemented some operations on "code lemma" table to avoid that code
berghofe
parents: 15257
diff changeset
    64
16645
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
    65
fun get_equations thy defs (s, T) =
20597
65fe827aa595 code generation 2 adjustments
haftmann
parents: 19788
diff changeset
    66
  (case Symtab.lookup (RecCodegenData.get thy) s of
16645
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
    67
     NONE => ([], "")
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
    68
   | SOME thms => 
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
    69
       let val thms' = del_redundant thy []
24907
bfb2e82b61fe Codegen.is_instance: raw match, ignore sort constraints;
wenzelm
parents: 24624
diff changeset
    70
         (filter (fn (thm, _) => is_instance T
16645
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
    71
           (snd (const_of (prop_of thm)))) thms)
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
    72
       in if null thms' then ([], "")
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
    73
         else (preprocess thy (map fst thms'),
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
    74
           case snd (snd (split_last thms')) of
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
    75
               NONE => (case get_defn thy defs s T of
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
    76
                   NONE => thyname_of_const s thy
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
    77
                 | SOME ((_, (thyname, _)), _) => thyname)
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
    78
             | SOME thyname => thyname)
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
    79
       end);
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    80
16645
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
    81
fun mk_suffix thy defs (s, T) = (case get_defn thy defs s T of
17144
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
    82
  SOME (_, SOME i) => " def" ^ string_of_int i | _ => "");
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    83
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    84
exception EQN of string * typ * string;
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    85
22887
haftmann
parents: 22846
diff changeset
    86
fun cycle g (xs, x : string) =
haftmann
parents: 22846
diff changeset
    87
  if member (op =) xs x then xs
haftmann
parents: 22846
diff changeset
    88
  else Library.foldl (cycle g) (x :: xs, flat (Graph.all_paths (fst g) (x, x)));
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    89
17144
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
    90
fun add_rec_funs thy defs gr dep eqs module =
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    91
  let
16645
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
    92
    fun dest_eq t = (fst (const_of t) ^ mk_suffix thy defs (const_of t),
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
    93
      dest_eqn (rename_term t));
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    94
    val eqs' = map dest_eq eqs;
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    95
    val (dname, _) :: _ = eqs';
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    96
    val (s, T) = const_of (hd eqs);
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
    97
17144
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
    98
    fun mk_fundef module fname prfx gr [] = (gr, [])
21410
haftmann
parents: 21128
diff changeset
    99
      | mk_fundef module fname prfx gr ((fname' : string, (lhs, rhs)) :: xs) =
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   100
      let
17144
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   101
        val (gr1, pl) = invoke_codegen thy defs dname module false (gr, lhs);
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   102
        val (gr2, pr) = invoke_codegen thy defs dname module false (gr1, rhs);
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   103
        val (gr3, rest) = mk_fundef module fname' "and " gr2 xs
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   104
      in
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   105
        (gr3, Pretty.blk (4, [Pretty.str (if fname = fname' then "  | " else prfx),
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   106
           pl, Pretty.str " =", Pretty.brk 1, pr]) :: rest)
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   107
      end;
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   108
17144
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   109
    fun put_code module fundef = map_node dname
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   110
      (K (SOME (EQN ("", dummyT, dname)), module, Pretty.string_of (Pretty.blk (0,
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   111
      separate Pretty.fbrk fundef @ [Pretty.str ";"])) ^ "\n\n"));
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   112
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   113
  in
17144
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   114
    (case try (get_node gr) dname of
15531
08c8dad8e399 Deleted Library.option type.
skalberg
parents: 15321
diff changeset
   115
       NONE =>
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   116
         let
17144
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   117
           val gr1 = add_edge (dname, dep)
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   118
             (new_node (dname, (SOME (EQN (s, T, "")), module, "")) gr);
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   119
           val (gr2, fundef) = mk_fundef module "" "fun " gr1 eqs';
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   120
           val xs = cycle gr2 ([], dname);
17144
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   121
           val cs = map (fn x => case get_node gr2 x of
16645
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
   122
               (SOME (EQN (s, T, _)), _, _) => (s, T)
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   123
             | _ => error ("RecfunCodegen: illegal cyclic dependencies:\n" ^
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   124
                implode (separate ", " xs))) xs
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   125
         in (case xs of
17144
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   126
             [_] => (put_code module fundef gr2, module)
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   127
           | _ =>
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   128
             if not (dep mem xs) then
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   129
               let
16645
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
   130
                 val thmss as (_, thyname) :: _ = map (get_equations thy defs) cs;
17144
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   131
                 val module' = if_library thyname module;
16645
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
   132
                 val eqs'' = map (dest_eq o prop_of) (List.concat (map fst thmss));
17144
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   133
                 val (gr3, fundef') = mk_fundef module' "" "fun "
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   134
                   (add_edge (dname, dep)
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   135
                     (foldr (uncurry new_node) (del_nodes xs gr2)
15574
b1d1b5bfc464 Removed practically all references to Library.foldr.
skalberg
parents: 15570
diff changeset
   136
                       (map (fn k =>
17144
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   137
                         (k, (SOME (EQN ("", dummyT, dname)), module', ""))) xs))) eqs''
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   138
               in (put_code module' fundef' gr3, module') end
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   139
             else (gr2, module))
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   140
         end
17144
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   141
     | SOME (SOME (EQN (_, _, s)), module', _) =>
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   142
         (if s = "" then
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   143
            if dname = dep then gr else add_edge (dname, dep) gr
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   144
          else if s = dep then gr else add_edge (s, dep) gr,
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   145
          module'))
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   146
  end;
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   147
17144
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   148
fun recfun_codegen thy defs gr dep module brack t = (case strip_comb t of
22921
475ff421a6a3 consts in consts_code Isar commands are now referred to by usual term syntax
haftmann
parents: 22887
diff changeset
   149
    (Const (p as (s, T)), ts) => (case (get_equations thy defs p, get_assoc_code thy (s, T)) of
16645
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
   150
       (([], _), _) => NONE
15531
08c8dad8e399 Deleted Library.option type.
skalberg
parents: 15321
diff changeset
   151
     | (_, SOME _) => NONE
17144
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   152
     | ((eqns, thyname), NONE) =>
16645
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
   153
        let
17144
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   154
          val module' = if_library thyname module;
16645
a152d6b21c31 Adapted to modular code generation.
berghofe
parents: 16424
diff changeset
   155
          val (gr', ps) = foldl_map
17144
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   156
            (invoke_codegen thy defs dep module true) (gr, ts);
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   157
          val suffix = mk_suffix thy defs p;
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   158
          val (gr'', module'') =
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   159
            add_rec_funs thy defs gr' dep (map prop_of eqns) module';
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   160
          val (gr''', fname) = mk_const_id module'' (s ^ suffix) gr''
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   161
        in
17144
6642e0f96f44 Implemented incremental code generation.
berghofe
parents: 16645
diff changeset
   162
          SOME (gr''', mk_app brack (Pretty.str (mk_qual_id module fname)) ps)
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   163
        end)
15531
08c8dad8e399 Deleted Library.option type.
skalberg
parents: 15321
diff changeset
   164
  | _ => NONE);
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   165
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   166
18708
4b3dadb4fe33 setup: theory -> theory;
wenzelm
parents: 18702
diff changeset
   167
val setup =
24219
e558fe311376 new structure for code generator modules
haftmann
parents: 22921
diff changeset
   168
  add_codegen "recfun" recfun_codegen
e558fe311376 new structure for code generator modules
haftmann
parents: 22921
diff changeset
   169
  #> Code.add_attribute ("", Args.del |-- Scan.succeed del
21128
7b2624686fc3 introduced CodegenData.add_func_legacy
haftmann
parents: 20951
diff changeset
   170
     || Scan.option (Args.$$$ "target" |-- Args.colon |-- Args.name) >> add);
12447
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   171
e752c9aecdec Code generator for recursive functions.
berghofe
parents:
diff changeset
   172
end;