| author | bulwahn | 
| Fri, 12 Mar 2010 12:14:30 +0100 | |
| changeset 35756 | cfde251d03a5 | 
| parent 35527 | f4282471461d | 
| child 35840 | 01d7c4ba9050 | 
| permissions | -rw-r--r-- | 
| 33679 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 1 | (* Title: HOLCF/Tools/repdef.ML | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 2 | Author: Brian Huffman | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 3 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 4 | Defining representable domains using algebraic deflations. | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 5 | *) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 6 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 7 | signature REPDEF = | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 8 | sig | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 9 | type rep_info = | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 10 |     { emb_def: thm, prj_def: thm, approx_def: thm, REP: thm }
 | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 11 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 12 | val add_repdef: bool -> binding option -> binding * string list * mixfix -> | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 13 | term -> (binding * binding) option -> theory -> | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 14 | (Typedef.info * Pcpodef.cpo_info * Pcpodef.pcpo_info * rep_info) * theory | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 15 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 16 | val repdef_cmd: (bool * binding) * (binding * string list * mixfix) * string | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 17 | * (binding * binding) option -> theory -> theory | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 18 | end; | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 19 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 20 | structure Repdef :> REPDEF = | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 21 | struct | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 22 | |
| 35527 | 23 | open HOLCF_Library; | 
| 24 | ||
| 25 | infixr 6 ->>; | |
| 26 | infix -->>; | |
| 27 | ||
| 33679 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 28 | (** type definitions **) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 29 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 30 | type rep_info = | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 31 |   { emb_def: thm, prj_def: thm, approx_def: thm, REP: thm };
 | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 32 | |
| 35527 | 33 | (* building types and terms *) | 
| 33679 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 34 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 35 | val udomT = @{typ udom};
 | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 36 | fun alg_deflT T = Type (@{type_name alg_defl}, [T]);
 | 
| 35527 | 37 | fun emb_const T = Const (@{const_name emb}, T ->> udomT);
 | 
| 38 | fun prj_const T = Const (@{const_name prj}, udomT ->> T);
 | |
| 39 | fun approx_const T = Const (@{const_name approx}, natT --> (T ->> T));
 | |
| 33679 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 40 | |
| 35527 | 41 | fun cast_const T = Const (@{const_name cast}, alg_deflT T ->> T ->> T);
 | 
| 33679 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 42 | fun mk_cast (t, x) = | 
| 35527 | 43 | capply_const (udomT, udomT) | 
| 44 | $ (capply_const (alg_deflT udomT, udomT ->> udomT) $ cast_const udomT $ t) | |
| 33679 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 45 | $ x; | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 46 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 47 | (* manipulating theorems *) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 48 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 49 | (* proving class instances *) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 50 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 51 | fun declare_type_name a = | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 52 | Variable.declare_constraints (Logic.mk_type (TFree (a, dummyS))); | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 53 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 54 | fun gen_add_repdef | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 55 | (prep_term: Proof.context -> 'a -> term) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 56 | (def: bool) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 57 | (name: binding) | 
| 35129 | 58 | (typ as (tname, vs, mx) : binding * string list * mixfix) | 
| 33679 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 59 | (raw_defl: 'a) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 60 | (opt_morphs: (binding * binding) option) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 61 | (thy: theory) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 62 | : (Typedef.info * Pcpodef.cpo_info * Pcpodef.pcpo_info * rep_info) * theory = | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 63 | let | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 64 | val _ = Theory.requires thy "Representable" "repdefs"; | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 65 | val ctxt = ProofContext.init thy; | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 66 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 67 | (*rhs*) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 68 | val defl = prep_term (ctxt |> fold declare_type_name vs) raw_defl; | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 69 | val deflT = Term.fastype_of defl; | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 70 |     val _ = if deflT = @{typ "udom alg_defl"} then ()
 | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 71 |             else error ("Not type udom alg_defl: " ^ quote (Syntax.string_of_typ ctxt deflT));
 | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 72 | val rhs_tfrees = Term.add_tfrees defl []; | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 73 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 74 | (*lhs*) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 75 | val defS = Sign.defaultS thy; | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 76 | val lhs_tfrees = map (fn v => (v, the_default defS (AList.lookup (op =) rhs_tfrees v))) vs; | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 77 | val lhs_sorts = map snd lhs_tfrees; | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 78 | val full_tname = Sign.full_name thy tname; | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 79 | val newT = Type (full_tname, map TFree lhs_tfrees); | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 80 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 81 | (*morphisms*) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 82 | val morphs = opt_morphs | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 83 | |> the_default (Binding.prefix_name "Rep_" name, Binding.prefix_name "Abs_" name); | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 84 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 85 | (*set*) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 86 |     val in_defl = @{term "in_deflation :: udom => udom alg_defl => bool"};
 | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 87 |     val set = HOLogic.Collect_const udomT $ Abs ("x", udomT, in_defl $ Bound 0 $ defl);
 | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 88 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 89 | (*pcpodef*) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 90 |     val tac1 = rtac @{thm CollectI} 1 THEN rtac @{thm bottom_in_deflation} 1;
 | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 91 |     val tac2 = rtac @{thm adm_mem_Collect_in_deflation} 1;
 | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 92 | val ((info, cpo_info, pcpo_info), thy2) = thy | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 93 | |> Pcpodef.add_pcpodef def (SOME name) typ set (SOME morphs) (tac1, tac2); | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 94 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 95 | (*definitions*) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 96 | val Rep_const = Const (#Rep_name info, newT --> udomT); | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 97 | val Abs_const = Const (#Abs_name info, udomT --> newT); | 
| 35527 | 98 | val emb_eqn = Logic.mk_equals (emb_const newT, cabs_const (newT, udomT) $ Rep_const); | 
| 99 | val prj_eqn = Logic.mk_equals (prj_const newT, cabs_const (udomT, newT) $ | |
| 33679 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 100 |       Abs ("x", udomT, Abs_const $ mk_cast (defl, Bound 0)));
 | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 101 | val repdef_approx_const = | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 102 |       Const (@{const_name repdef_approx}, (newT --> udomT) --> (udomT --> newT)
 | 
| 35527 | 103 | --> alg_deflT udomT --> natT --> (newT ->> newT)); | 
| 33679 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 104 | val approx_eqn = Logic.mk_equals (approx_const newT, | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 105 | repdef_approx_const $ Rep_const $ Abs_const $ defl); | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 106 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 107 | (*instantiate class rep*) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 108 | val name_def = Binding.suffix_name "_def" name; | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 109 | val ([emb_ldef, prj_ldef, approx_ldef], lthy3) = thy2 | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 110 |       |> Theory_Target.instantiation ([full_tname], lhs_tfrees, @{sort rep})
 | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 111 | |> fold_map Specification.definition | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 112 | [ (NONE, ((Binding.prefix_name "emb_" name_def, []), emb_eqn)) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 113 | , (NONE, ((Binding.prefix_name "prj_" name_def, []), prj_eqn)) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 114 | , (NONE, ((Binding.prefix_name "approx_" name_def, []), approx_eqn)) ] | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 115 | |>> map (snd o snd); | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 116 | val ctxt_thy = ProofContext.init (ProofContext.theory_of lthy3); | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 117 | val [emb_def, prj_def, approx_def] = | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 118 | ProofContext.export lthy3 ctxt_thy [emb_ldef, prj_ldef, approx_ldef]; | 
| 33826 | 119 | val type_definition_thm = | 
| 120 | MetaSimplifier.rewrite_rule | |
| 121 | (the_list (#set_def info)) | |
| 122 | (#type_definition info); | |
| 33679 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 123 | val typedef_thms = | 
| 33826 | 124 | [type_definition_thm, #below_def cpo_info, emb_def, prj_def, approx_def]; | 
| 33679 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 125 | val thy4 = lthy3 | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 126 | |> Class.prove_instantiation_instance | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 127 |           (K (Tactic.rtac (@{thm typedef_rep_class} OF typedef_thms) 1))
 | 
| 33681 | 128 | |> Local_Theory.exit_global; | 
| 33679 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 129 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 130 | (*other theorems*) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 131 | val typedef_thms' = map (Thm.transfer thy4) | 
| 33826 | 132 | [type_definition_thm, #below_def cpo_info, emb_def, prj_def]; | 
| 33679 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 133 | val ([REP_thm], thy5) = thy4 | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 134 | |> Sign.add_path (Binding.name_of name) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 135 | |> PureThy.add_thms | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 136 | [((Binding.prefix_name "REP_" name, | 
| 35021 
c839a4c670c6
renamed old-style Drule.standard to Drule.export_without_context, to emphasize that this is in no way a standard operation;
 wenzelm parents: 
33826diff
changeset | 137 |           Drule.export_without_context (@{thm typedef_REP} OF typedef_thms')), [])]
 | 
| 35203 | 138 | ||> Sign.restore_naming thy4; | 
| 33679 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 139 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 140 | val rep_info = | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 141 |       { emb_def = emb_def, prj_def = prj_def, approx_def = approx_def, REP = REP_thm };
 | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 142 | in | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 143 | ((info, cpo_info, pcpo_info, rep_info), thy5) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 144 | end | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 145 | handle ERROR msg => | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 146 |     cat_error msg ("The error(s) above occurred in repdef " ^ quote (Binding.str_of name));
 | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 147 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 148 | fun add_repdef def opt_name typ defl opt_morphs thy = | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 149 | let | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 150 | val name = the_default (#1 typ) opt_name; | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 151 | in | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 152 | gen_add_repdef Syntax.check_term def name typ defl opt_morphs thy | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 153 | end; | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 154 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 155 | fun repdef_cmd ((def, name), typ, A, morphs) = | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 156 | snd o gen_add_repdef Syntax.read_term def name typ A morphs; | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 157 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 158 | (** outer syntax **) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 159 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 160 | local structure P = OuterParse and K = OuterKeyword in | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 161 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 162 | val repdef_decl = | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 163 |   Scan.optional (P.$$$ "(" |--
 | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 164 | ((P.$$$ "open" >> K false) -- Scan.option P.binding || P.binding >> (fn s => (true, SOME s))) | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 165 | --| P.$$$ ")") (true, NONE) -- | 
| 35351 
7425aece4ee3
allow general mixfix syntax for type constructors;
 wenzelm parents: 
35203diff
changeset | 166 | (P.type_args -- P.binding) -- P.opt_mixfix -- (P.$$$ "=" |-- P.term) -- | 
| 33679 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 167 | Scan.option (P.$$$ "morphisms" |-- P.!!! (P.binding -- P.binding)); | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 168 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 169 | fun mk_repdef ((((((def, opt_name), (vs, t)), mx), A), morphs)) = | 
| 35129 | 170 | repdef_cmd ((def, the_default t opt_name), (t, vs, mx), A, morphs); | 
| 33679 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 171 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 172 | val _ = | 
| 33812 | 173 | OuterSyntax.command "repdef" "HOLCF definition of representable domains" K.thy_decl | 
| 33679 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 174 | (repdef_decl >> | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 175 | (Toplevel.print oo (Toplevel.theory o mk_repdef))); | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 176 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 177 | end; | 
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 178 | |
| 
331712879666
automate definition of representable domains from algebraic deflations
 huffman parents: diff
changeset | 179 | end; |