src/HOL/Tools/record.ML
changeset 59058 a78612c67ec0
parent 58963 26bf09b95dda
child 59164 ff40c53d1af9
equal deleted inserted replaced
59057:5b649fb2f2e1 59058:a78612c67ec0
  1473         [] => (head_of (fst (HOLogic.dest_eq (HOLogic.dest_Trueprop
  1473         [] => (head_of (fst (HOLogic.dest_eq (HOLogic.dest_Trueprop
  1474           (hd (rev (Logic.strip_assums_hyp (hd (prems_of rule')))))))), true)
  1474           (hd (rev (Logic.strip_assums_hyp (hd (prems_of rule')))))))), true)
  1475       | [x] => (head_of x, false));
  1475       | [x] => (head_of x, false));
  1476     val rule'' =
  1476     val rule'' =
  1477       cterm_instantiate
  1477       cterm_instantiate
  1478         (map (pairself cert)
  1478         (map (apply2 cert)
  1479           (case rev params of
  1479           (case rev params of
  1480             [] =>
  1480             [] =>
  1481               (case AList.lookup (op =) (Term.add_frees g []) s of
  1481               (case AList.lookup (op =) (Term.add_frees g []) s of
  1482                 NONE => error "try_param_tac: no such variable"
  1482                 NONE => error "try_param_tac: no such variable"
  1483               | SOME T => [(P, if ca then concl else lambda (Free (s, T)) concl), (x, Free (s, T))])
  1483               | SOME T => [(P, if ca then concl else lambda (Free (s, T)) concl), (x, Free (s, T))])
  1756         rewrite_rule (Proof_Context.init_global thy)
  1756         rewrite_rule (Proof_Context.init_global thy)
  1757           [Axclass.unoverload thy (Thm.symmetric (Simpdata.mk_eq eq_def))] inject;
  1757           [Axclass.unoverload thy (Thm.symmetric (Simpdata.mk_eq eq_def))] inject;
  1758       fun mk_eq_refl thy =
  1758       fun mk_eq_refl thy =
  1759         @{thm equal_refl}
  1759         @{thm equal_refl}
  1760         |> Thm.instantiate
  1760         |> Thm.instantiate
  1761           ([pairself (ctyp_of thy) (TVar (("'a", 0), @{sort equal}), Logic.varifyT_global extT)], [])
  1761           ([apply2 (ctyp_of thy) (TVar (("'a", 0), @{sort equal}), Logic.varifyT_global extT)], [])
  1762         |> Axclass.unoverload thy;
  1762         |> Axclass.unoverload thy;
  1763       val ensure_random_record = ensure_sort_record (@{sort random}, mk_random_eq);
  1763       val ensure_random_record = ensure_sort_record (@{sort random}, mk_random_eq);
  1764       val ensure_exhaustive_record =
  1764       val ensure_exhaustive_record =
  1765         ensure_sort_record (@{sort full_exhaustive}, mk_full_exhaustive_eq);
  1765         ensure_sort_record (@{sort full_exhaustive}, mk_full_exhaustive_eq);
  1766     in
  1766     in