src/Pure/Isar/element.ML
changeset 21521 095f4963beed
parent 21497 4d330a487586
child 21528 84e98b5f5af0
     1.1 --- a/src/Pure/Isar/element.ML	Fri Nov 24 22:05:16 2006 +0100
     1.2 +++ b/src/Pure/Isar/element.ML	Fri Nov 24 22:05:17 2006 +0100
     1.3 @@ -114,7 +114,7 @@
     1.4    var = Morphism.var phi,
     1.5    typ = Morphism.typ phi,
     1.6    term = Morphism.term phi,
     1.7 -  fact = map (Morphism.thm phi),
     1.8 +  fact = Morphism.fact phi,
     1.9    attrib = Args.morph_values phi};
    1.10  
    1.11  
    1.12 @@ -327,13 +327,10 @@
    1.13    end;
    1.14  
    1.15  fun hyps_rule rule th =
    1.16 -  let
    1.17 -    val cterm_rule = Drule.mk_term #> rule #> Drule.dest_term;
    1.18 -    val {hyps, ...} = Thm.crep_thm th;
    1.19 -  in
    1.20 +  let val {hyps, ...} = Thm.crep_thm th in
    1.21      Drule.implies_elim_list
    1.22        (rule (Drule.implies_intr_list hyps th))
    1.23 -      (map (Thm.assume o cterm_rule) hyps)
    1.24 +      (map (Thm.assume o Drule.cterm_rule rule) hyps)
    1.25    end;
    1.26  
    1.27  
    1.28 @@ -372,7 +369,7 @@
    1.29    end;
    1.30  
    1.31  fun rename_morphism ren = Morphism.morphism
    1.32 -  {name = I, var = rename_var ren, typ = I, term = rename_term ren, thm = rename_thm ren};
    1.33 +  {name = I, var = rename_var ren, typ = I, term = rename_term ren, fact = map (rename_thm ren)};
    1.34  
    1.35  
    1.36  (* instantiate types *)
    1.37 @@ -398,7 +395,7 @@
    1.38      in if null subst then th else th |> hyps_rule (instantiate_tfrees thy subst) end;
    1.39  
    1.40  fun instT_morphism thy env = Morphism.morphism
    1.41 -  {name = I, var = I, typ = instT_type env, term = instT_term env, thm = instT_thm thy env};
    1.42 +  {name = I, var = I, typ = instT_type env, term = instT_term env, fact = map (instT_thm thy env)};
    1.43  
    1.44  
    1.45  (* instantiate types and terms *)
    1.46 @@ -441,7 +438,8 @@
    1.47      end;
    1.48  
    1.49  fun inst_morphism thy envs = Morphism.morphism
    1.50 -  {name = I, var = I, typ = instT_type (#1 envs), term = inst_term envs, thm = inst_thm thy envs};
    1.51 +  {name = I, var = I, typ = instT_type (#1 envs), term = inst_term envs,
    1.52 +    fact = map (inst_thm thy envs)};
    1.53  
    1.54  
    1.55  (* satisfy hypotheses *)
    1.56 @@ -469,13 +467,13 @@
    1.57      val thy = ProofContext.theory_of inner;
    1.58      val maxidx =
    1.59        fold (fn ((_, atts), bs) => maxidx_atts atts #> fold (maxidx_atts o #2) bs) facts ~1;
    1.60 -    val exp_thm = Thm.adjust_maxidx_thm maxidx #>
    1.61 -      singleton ((if std then ProofContext.export_standard else ProofContext.export) inner outer);
    1.62 -    val exp_term = Drule.term_rule thy exp_thm;
    1.63 -    val exp_typ = Logic.mk_type #> exp_term #> Logic.dest_type;
    1.64 -    val exp_morphism =
    1.65 -      Morphism.morphism {name = I, var = I, typ = exp_typ, term = exp_term, thm = exp_thm};
    1.66 -    val Notes (_, facts') = morph_ctxt exp_morphism (Notes ("", facts));
    1.67 +    val exp_fact = map (Thm.adjust_maxidx_thm maxidx) #>
    1.68 +      ((if std then ProofContext.export_standard else ProofContext.export) inner outer);
    1.69 +    val exp_term = Drule.term_rule thy (singleton exp_fact);
    1.70 +    val exp_typ = Logic.type_map exp_term;
    1.71 +    val morphism =
    1.72 +      Morphism.morphism {name = I, var = I, typ = exp_typ, term = exp_term, fact = exp_fact};
    1.73 +    val Notes (_, facts') = morph_ctxt morphism (Notes ("", facts));
    1.74    in facts' end;
    1.75  
    1.76  in