src/HOLCF/domain/interface.ML
author oheimb
Thu, 30 Oct 1997 14:17:33 +0100
changeset 4041 4df7f385fe9f
parent 4030 ca44afcc259c
child 4043 35766855f344
permissions -rw-r--r--
domain package: * theorems are stored in the theory * creates hierachical name space * minor changes to some names and values (for consistency), e.g. cases -> casedist, dists_eq -> dist_eqs, [take_lemma] -> take_lemmas * separator between mutual domain definitions changed from "," to "and" * minor debugging of Domain_Library.mk_var_names
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2445
51993fea433f removed Holcfb.thy and Holcfb.ML, moving classical3 to HOL.ML as classical2
oheimb
parents: 2267
diff changeset
     1
(*  Title:      HOLCF/domain/interface.ML
51993fea433f removed Holcfb.thy and Holcfb.ML, moving classical3 to HOL.ML as classical2
oheimb
parents: 2267
diff changeset
     2
    ID:         $Id$
51993fea433f removed Holcfb.thy and Holcfb.ML, moving classical3 to HOL.ML as classical2
oheimb
parents: 2267
diff changeset
     3
    Author : David von Oheimb
51993fea433f removed Holcfb.thy and Holcfb.ML, moving classical3 to HOL.ML as classical2
oheimb
parents: 2267
diff changeset
     4
    Copyright 1995, 1996 TU Muenchen
51993fea433f removed Holcfb.thy and Holcfb.ML, moving classical3 to HOL.ML as classical2
oheimb
parents: 2267
diff changeset
     5
51993fea433f removed Holcfb.thy and Holcfb.ML, moving classical3 to HOL.ML as classical2
oheimb
parents: 2267
diff changeset
     6
parser for domain section
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
     7
*)
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
     8
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
     9
local 
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    10
  open ThyParse;
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    11
  open Domain_Library;
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    12
4030
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    13
(* --- generation of bindings for axioms and theorems in .thy.ML - *)
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    14
1637
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    15
  fun gt_ax         name   = "get_axiom thy " ^ quote name;
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    16
  fun gen_val dname name   = "val "^name^" = "^ gt_ax (dname^"_"^name)^";";
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    17
  fun gen_vall      name l = "val "^name^" = "^ mk_list l^";";
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    18
  val rews1 = "iso_rews @ when_rews @\n\
1637
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    19
 	      \con_rews @ sel_rews @ dis_rews @ dists_le @ dists_eq @\n\
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    20
	      \copy_rews";
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    21
4030
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    22
  fun gen_struct thms_str num ((dname,_), cons') = let
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    23
    val axioms1 = ["abs_iso", "rep_iso", "when_def"];
1637
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    24
		   (* con_defs , sel_defs, dis_defs *) 
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    25
    val axioms2 = ["copy_def"];
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    26
    val theorems = 
1637
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    27
	"iso_rews, exhaust, cases, when_rews, con_rews, sel_rews, dis_rews,\n    \
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    28
	\dists_le, dists_eq, inverts, injects, copy_rews";
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    29
    in
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    30
      "structure "^dname^" = struct\n"^
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    31
      cat_lines(map (gen_val dname) axioms1)^"\n"^
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    32
      gen_vall"con_defs"(map(fn (con,_,_) => gt_ax(strip_esc con^"_def")) cons')^"\n"^
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    33
      gen_vall"sel_defs"(flat(map (fn (_,_,args) => map (fn (_,sel,_) => 
1637
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    34
					     gt_ax(sel^"_def")) args)    cons'))^"\n"^
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    35
      gen_vall"dis_defs"(map(fn (con,_,_) => gt_ax(dis_name_ con^"_def")) 
1637
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    36
								          cons')^"\n"^
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    37
      cat_lines(map (gen_val dname) axioms2)^"\n"^
4030
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    38
      "val ("^ theorems ^") = "^thms_str^";\n" ^
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    39
      (if num > 1 then "val rews = " ^rews1 ^";\n" else "")
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    40
    end;
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    41
4008
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
    42
  fun mk_domain eqs'' = let
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
    43
    val num    = length eqs'';
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
    44
    val dtnvs  = map fst eqs'';
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    45
    val dnames = map fst dtnvs;
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    46
    val comp_dname = implode (separate "_" dnames);
2267
b2326aefecbc Replaced map...~~ by ListPair.map
paulson
parents: 2240
diff changeset
    47
    val conss' = ListPair.map 
4008
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
    48
	(fn (dname,cons'') => let fun sel n m = upd_second 
2267
b2326aefecbc Replaced map...~~ by ListPair.map
paulson
parents: 2240
diff changeset
    49
			      (fn None   => dname^"_sel_"^(string_of_int n)^
4008
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
    50
						      "_"^(string_of_int m)
2267
b2326aefecbc Replaced map...~~ by ListPair.map
paulson
parents: 2240
diff changeset
    51
				| Some s => s)
b2326aefecbc Replaced map...~~ by ListPair.map
paulson
parents: 2240
diff changeset
    52
	      fun fill_sels n con = upd_third (mapn (sel n) 1) con;
b2326aefecbc Replaced map...~~ by ListPair.map
paulson
parents: 2240
diff changeset
    53
	  in mapn fill_sels 1 cons'' end)
4008
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
    54
	(dnames, map snd eqs'');
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    55
    val eqs' = dtnvs~~conss';
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    56
1637
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    57
(* ----- string for calling add_domain -------------------------------------- *)
1284
e5b95ee2616b removed incompatibility with sml
regensbu
parents: 1274
diff changeset
    58
1637
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    59
    val thy_ext_string = let
2240
a8c074224e11 Replaced obsolete "makestring" by Bool.toString
paulson
parents: 1637
diff changeset
    60
      fun mk_conslist cons' = 
4030
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    61
	  mk_list (map (fn (c,syn,ts)=> "\n"^
4008
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
    62
		    mk_triple(quote c, syn, mk_list (map (fn (b,s ,tp) =>
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
    63
		    mk_triple(Bool.toString b, quote s, tp)) ts))) cons');
4030
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    64
    in "val (thy, thmss, comp_thms) = thy |> Domain_Extender.add_domain "
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    65
       ^ mk_pair(quote comp_dname, mk_list(map (fn ((n,vs),cs) => "\n"^
4008
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
    66
				   mk_pair (mk_pair (quote n, mk_list vs), 
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
    67
					    mk_conslist cs)) eqs'))
4030
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    68
       ^ ";\n"
1637
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    69
    end;
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    70
4008
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
    71
(* ----- string for calling (comp_)theorems and producing the structures ---- *)
1637
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    72
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    73
    val val_gen_string =  let
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    74
      fun plural s = if num > 1 then s^"s" else "["^s^"]";
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    75
      val comp_axioms   = [(* copy, *) "reach", "take_def", "finite_def"
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    76
			   (*, "bisim_def" *)];
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    77
      val comp_theorems = "take_rews, " ^ implode (separate ", " (map plural
4030
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    78
			   ["take_lemma","finite"]))^", finite_ind, ind, coind";
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    79
      fun thms_str n = "hd (funpow "^string_of_int n^" tl thmss)";
1637
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    80
      fun collect sep name = if num = 1 then name else
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    81
			     implode (separate sep (map (fn s => s^"."^name) dnames));
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
    82
    in
4030
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    83
	implode (separate "end; (* struct *)\n" 
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    84
			  (mapn (fn n => gen_struct (thms_str n) num) 0 eqs')) ^
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    85
	(if num > 1 then "end; (* struct *)\n\n\
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    86
		       \structure "^comp_dname^" = struct\n" else "") ^
1637
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    87
	(if num > 1 then gen_val comp_dname "copy_def" ^"\n" else "") ^
4030
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    88
	implode (map (fn s => gen_vall (plural s)
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    89
			      (map (fn dn => gt_ax(dn ^ "_" ^ s)) dnames) ^"\n")
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    90
		 comp_axioms) ^
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    91
	gen_val comp_dname "bisim_def" ^"\n\
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    92
        \val ("^ comp_theorems ^") = comp_thms;\n\
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    93
	\val rews = "^(if num>1 then collect" @ " "rews"else rews1)^ 
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    94
		    " @ take_rews;\n\
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    95
      \end; (* struct *)\n"
1637
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
    96
    end;
4030
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    97
  in ("local\n"^
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    98
      thy_ext_string^
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
    99
      "in\n"^
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
   100
      "val thy = thy;\n"^
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
   101
      val_gen_string^
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
   102
      "end; (* local *)\n\n"^
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
   103
      "val thy = thy",
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
   104
      "") end;
1637
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
   105
4030
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
   106
(* ----- strings for calling add_gen_by and producing the value binding ----- *)
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
   107
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
   108
  fun mk_gen_by (finite,eqs) = let
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
   109
      val typs    = map fst eqs;
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
   110
      val cnstrss = map snd eqs;
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
   111
      val tname = implode (separate "_" typs) in
1637
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
   112
      ("|> Domain_Extender.add_gen_by "
2240
a8c074224e11 Replaced obsolete "makestring" by Bool.toString
paulson
parents: 1637
diff changeset
   113
       ^ mk_pair(mk_pair(quote tname, Bool.toString finite),
1637
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
   114
		 mk_pair(mk_list(map quote typs), 
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
   115
			 mk_list (map (fn cns => mk_list(map quote cns)) cnstrss))),
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
   116
       "val "^tname^"_induct = " ^gt_ax (tname^"_induct")^";") end;
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
   117
4030
ca44afcc259c debugging concerning sort variables
oheimb
parents: 4008
diff changeset
   118
(* ----- parser for domain declaration equation ----------------------------- *)
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
   119
2445
51993fea433f removed Holcfb.thy and Holcfb.ML, moving classical3 to HOL.ML as classical2
oheimb
parents: 2267
diff changeset
   120
  val name' = name >> strip_quotes;
51993fea433f removed Holcfb.thy and Holcfb.ML, moving classical3 to HOL.ML as classical2
oheimb
parents: 2267
diff changeset
   121
  val type_var' = type_var >> strip_quotes;
4008
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
   122
  fun esc_quote s = let fun esc [] = []
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
   123
			|   esc ("\""::xs) = esc xs
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
   124
			|   esc ("[" ::xs) = "{"::esc xs
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
   125
			|   esc ("]" ::xs) = "}"::esc xs
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
   126
			|   esc (x   ::xs) = x  ::esc xs
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
   127
		    in implode (esc (explode s)) end;
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
   128
  val tvar = (type_var' ^^ optional ($$ "::" ^^ (sort >> esc_quote)) "") >> quote;
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
   129
  fun type_args l = (tvar >> (fn x => [x])
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
   130
                 ||  "(" $$-- !! (list1 tvar --$$ ")")
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
   131
                 ||  empty >> K []) l
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
   132
  fun con_typ l   = (type_args -- name' >> (fn (x,y) => (y,x))) l
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
   133
                      (* here ident may be used instead of name' 
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
   134
                         to avoid ambiguity with standard mixfix option *)
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
   135
  val domain_arg  = "(" $$-- (optional ($$ "lazy" >> K true) false)
2445
51993fea433f removed Holcfb.thy and Holcfb.ML, moving classical3 to HOL.ML as classical2
oheimb
parents: 2267
diff changeset
   136
			  -- (optional ((name' >> Some) --$$ "::") None)
1637
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
   137
			  -- typ --$$ ")" >> (fn ((lazy,sel),tp) => (lazy,sel,tp))
4008
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
   138
		 || typ >> (fn x => (false,None,x)) 
2445
51993fea433f removed Holcfb.thy and Holcfb.ML, moving classical3 to HOL.ML as classical2
oheimb
parents: 2267
diff changeset
   139
  val domain_cons = name' -- !! (repeat domain_arg) 
1637
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
   140
		    -- ThyOps.opt_cmixfix
b8a8ae2e5de1 Updated: 01-Mar-96 when functional strictified, copy_def based on when_def
oheimb
parents: 1461
diff changeset
   141
		    >> (fn ((con,args),syn) => (con,syn,args));
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
   142
in
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
   143
  val domain_decl = (enum1 "," (con_typ --$$ "="  -- !! 
4008
2444085532c6 adapted domain and ax_ops package for name spaces
oheimb
parents: 3622
diff changeset
   144
			       (enum1 "|" domain_cons))) >> mk_domain;
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
   145
  val gen_by_decl = (optional ($$ "finite" >> K true) false) -- 
2445
51993fea433f removed Holcfb.thy and Holcfb.ML, moving classical3 to HOL.ML as classical2
oheimb
parents: 2267
diff changeset
   146
		    (enum1 "," (name'   --$$ "by" -- !!
51993fea433f removed Holcfb.thy and Holcfb.ML, moving classical3 to HOL.ML as classical2
oheimb
parents: 2267
diff changeset
   147
			       (enum1 "|" name'))) >> mk_gen_by;
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
   148
3622
85898be702b2 use ThySyn.add_syntax;
wenzelm
parents: 2446
diff changeset
   149
  val _ = ThySyn.add_syntax
85898be702b2 use ThySyn.add_syntax;
wenzelm
parents: 2446
diff changeset
   150
    ["lazy", "by", "finite"]
85898be702b2 use ThySyn.add_syntax;
wenzelm
parents: 2446
diff changeset
   151
    [("domain", domain_decl), ("generated", gen_by_decl)]
1274
ea0668a1c0ba added 8bit pragmas
regensbu
parents:
diff changeset
   152
3622
85898be702b2 use ThySyn.add_syntax;
wenzelm
parents: 2446
diff changeset
   153
end; (* local *)