src/Pure/Isar/code_unit.ML
changeset 26330 e493bdd1cff2
parent 26239 e105d24d15c1
child 26354 46c7d00dd4b4
equal deleted inserted replaced
26329:3e58e4c67a2a 26330:e493bdd1cff2
    12   val error_thm: (thm -> thm) -> thm -> thm
    12   val error_thm: (thm -> thm) -> thm -> thm
    13   val warning_thm: (thm -> thm) -> thm -> thm option
    13   val warning_thm: (thm -> thm) -> thm -> thm option
    14   val try_thm: (thm -> thm) -> thm -> thm option
    14   val try_thm: (thm -> thm) -> thm -> thm option
    15 
    15 
    16   (*typ instantiations*)
    16   (*typ instantiations*)
    17   val typ_sort_inst: Sorts.algebra -> typ * sort
       
    18     -> sort Vartab.table -> sort Vartab.table
       
    19   val inst_thm: sort Vartab.table -> thm -> thm
    17   val inst_thm: sort Vartab.table -> thm -> thm
    20   val constrain_thm: sort -> thm -> thm
    18   val constrain_thm: sort -> thm -> thm
    21 
    19 
    22   (*constants*)
    20   (*constants*)
    23   val add_const_ident: thm -> theory -> theory
    21   val add_const_ident: thm -> theory -> theory
   144     val c' :: cs' = map ty_sorts cs;
   142     val c' :: cs' = map ty_sorts cs;
   145     val ((tyco, sorts), cs'') = fold add cs' (apsnd single c');
   143     val ((tyco, sorts), cs'') = fold add cs' (apsnd single c');
   146     val vs = Name.names Name.context Name.aT sorts;
   144     val vs = Name.names Name.context Name.aT sorts;
   147     val cs''' = map (inst vs) cs'';
   145     val cs''' = map (inst vs) cs'';
   148   in (tyco, (vs, cs''')) end;
   146   in (tyco, (vs, cs''')) end;
   149 
       
   150 
       
   151 (* dictionary values *)
       
   152 
       
   153 fun typ_sort_inst algebra =
       
   154   let
       
   155     val inters = Sorts.inter_sort algebra;
       
   156     fun match _ [] = I
       
   157       | match (TVar (v, S)) S' = Vartab.map_default (v, []) (fn S'' => inters (S, inters (S', S'')))
       
   158       | match (Type (a, Ts)) S =
       
   159           fold2 match Ts (Sorts.mg_domain algebra a S)
       
   160   in uncurry match end;
       
   161 
   147 
   162 
   148 
   163 (* rewrite theorems *)
   149 (* rewrite theorems *)
   164 
   150 
   165 fun assert_rew thm =
   151 fun assert_rew thm =