src/HOLCF/Tools/Domain/domain_take_proofs.ML
changeset 40737 2037021f034f
parent 40489 0f37a553bc1a
equal deleted inserted replaced
40736:72857de90621 40737:2037021f034f
    53     theory -> take_induct_info * theory
    53     theory -> take_induct_info * theory
    54 
    54 
    55   val map_of_typ :
    55   val map_of_typ :
    56     theory -> (typ * term) list -> typ -> term
    56     theory -> (typ * term) list -> typ -> term
    57 
    57 
    58   val add_map_function : (string * string * bool list) -> theory -> theory
    58   val add_rec_type : (string * bool list) -> theory -> theory
    59   val get_map_tab : theory -> (string * bool list) Symtab.table
    59   val get_rec_tab : theory -> (bool list) Symtab.table
    60   val add_deflation_thm : thm -> theory -> theory
    60   val add_deflation_thm : thm -> theory -> theory
    61   val get_deflation_thms : theory -> thm list
    61   val get_deflation_thms : theory -> thm list
    62   val map_ID_add : attribute
    62   val map_ID_add : attribute
    63   val get_map_ID_thms : theory -> thm list
    63   val get_map_ID_thms : theory -> thm list
    64   val setup : theory -> theory
    64   val setup : theory -> theory
   117 
   117 
   118 (******************************************************************************)
   118 (******************************************************************************)
   119 (******************************** theory data *********************************)
   119 (******************************** theory data *********************************)
   120 (******************************************************************************)
   120 (******************************************************************************)
   121 
   121 
   122 structure MapData = Theory_Data
   122 structure Rec_Data = Theory_Data
   123 (
   123 (
   124   (* constant names like "foo_map" *)
   124   (* list indicates which type arguments allow indirect recursion *)
   125   (* list indicates which type arguments correspond to map arguments *)
   125   type T = (bool list) Symtab.table;
   126   (* alternatively, which type arguments allow indirect recursion *)
       
   127   type T = (string * bool list) Symtab.table;
       
   128   val empty = Symtab.empty;
   126   val empty = Symtab.empty;
   129   val extend = I;
   127   val extend = I;
   130   fun merge data = Symtab.merge (K true) data;
   128   fun merge data = Symtab.merge (K true) data;
   131 );
   129 );
   132 
   130 
   140 (
   138 (
   141   val name = "domain_map_ID"
   139   val name = "domain_map_ID"
   142   val description = "theorems like foo_map$ID = ID"
   140   val description = "theorems like foo_map$ID = ID"
   143 );
   141 );
   144 
   142 
   145 fun add_map_function (tname, map_name, bs) =
   143 fun add_rec_type (tname, bs) =
   146     MapData.map (Symtab.insert (K true) (tname, (map_name, bs)));
   144     Rec_Data.map (Symtab.insert (K true) (tname, bs));
   147 
   145 
   148 fun add_deflation_thm thm =
   146 fun add_deflation_thm thm =
   149     Context.theory_map (DeflMapData.add_thm thm);
   147     Context.theory_map (DeflMapData.add_thm thm);
   150 
   148 
   151 val get_map_tab = MapData.get;
   149 val get_rec_tab = Rec_Data.get;
   152 fun get_deflation_thms thy = DeflMapData.get (ProofContext.init_global thy);
   150 fun get_deflation_thms thy = DeflMapData.get (ProofContext.init_global thy);
   153 
   151 
   154 val map_ID_add = Map_Id_Data.add;
   152 val map_ID_add = Map_Id_Data.add;
   155 val get_map_ID_thms = Map_Id_Data.get o ProofContext.init_global;
   153 val get_map_ID_thms = Map_Id_Data.get o ProofContext.init_global;
   156 
   154