src/Pure/Proof/proof_rewrite_rules.ML
changeset 71777 3875815f5967
parent 71087 77580c977e0c
child 71843 07c85c68ff03
equal deleted inserted replaced
71776:5ef7f374e0f8 71777:3875815f5967
   342       (Hs ~~ Hs' ~~ (k - 1 downto 0)) |>
   342       (Hs ~~ Hs' ~~ (k - 1 downto 0)) |>
   343     mk_prf Q
   343     mk_prf Q
   344   end;
   344   end;
   345 
   345 
   346 
   346 
   347 (**** expand OfClass proofs ****)
   347 (**** expand PClass proofs ****)
   348 
   348 
   349 fun expand_of_sort_proof thy hyps (T, S) =
   349 fun expand_of_sort_proof thy hyps (T, S) =
   350   let
   350   let
   351     val of_class_hyps = map (fn SOME t => try Logic.dest_of_class t | NONE => NONE) hyps;
   351     val of_class_hyps = map (fn SOME t => try Logic.dest_of_class t | NONE => NONE) hyps;
   352     fun of_class_index p =
   352     fun of_class_index p =
   365       Proofterm.expand_proof thy Proofterm.expand_name_empty #>
   365       Proofterm.expand_proof thy Proofterm.expand_name_empty #>
   366       Same.commit (Proofterm.map_proof_same Same.same Same.same of_class_index);
   366       Same.commit (Proofterm.map_proof_same Same.same Same.same of_class_index);
   367   in
   367   in
   368     map2 reconstruct (Logic.mk_of_sort (T, S))
   368     map2 reconstruct (Logic.mk_of_sort (T, S))
   369       (Proofterm.of_sort_proof (Sign.classes_of thy) (Thm.classrel_proof thy) (Thm.arity_proof thy)
   369       (Proofterm.of_sort_proof (Sign.classes_of thy) (Thm.classrel_proof thy) (Thm.arity_proof thy)
   370         (OfClass o apfst Type.strip_sorts) (subst T, S))
   370         (PClass o apfst Type.strip_sorts) (subst T, S))
   371   end;
   371   end;
   372 
   372 
   373 fun expand_of_class_proof thy hyps (T, c) =
   373 fun expand_of_class_proof thy hyps (T, c) =
   374   hd (expand_of_sort_proof thy hyps (T, [c]));
   374   hd (expand_of_sort_proof thy hyps (T, [c]));
   375 
   375 
   376 fun expand_of_class thy (_: typ list) hyps (OfClass (T, c)) =
   376 fun expand_of_class thy (_: typ list) hyps (PClass (T, c)) =
   377       SOME (expand_of_class_proof thy hyps (T, c), Proofterm.no_skel)
   377       SOME (expand_of_class_proof thy hyps (T, c), Proofterm.no_skel)
   378   | expand_of_class _ _ _ _ = NONE;
   378   | expand_of_class _ _ _ _ = NONE;
   379 
   379 
   380 
   380 
   381 (* standard preprocessor *)
   381 (* standard preprocessor *)