src/HOL/Nominal/nominal_thmdecls.ML
changeset 42361 23f352990944
parent 39557 fe5722fce758
child 42616 92715b528e78
equal deleted inserted replaced
42360:da8817d01e7c 42361:23f352990944
    50   then tac THEN' (K (print_tac ("after " ^ msg)))
    50   then tac THEN' (K (print_tac ("after " ^ msg)))
    51   else tac
    51   else tac
    52 
    52 
    53 fun prove_eqvt_tac ctxt orig_thm pi pi' =
    53 fun prove_eqvt_tac ctxt orig_thm pi pi' =
    54   let
    54   let
    55     val thy = ProofContext.theory_of ctxt
    55     val thy = Proof_Context.theory_of ctxt
    56     val mypi = Thm.cterm_of thy pi
    56     val mypi = Thm.cterm_of thy pi
    57     val T = fastype_of pi'
    57     val T = fastype_of pi'
    58     val mypifree = Thm.cterm_of thy (Const (@{const_name "rev"}, T --> T) $ pi')
    58     val mypifree = Thm.cterm_of thy (Const (@{const_name "rev"}, T --> T) $ pi')
    59     val perm_pi_simp = Global_Theory.get_thms thy "perm_pi_simp"
    59     val perm_pi_simp = Global_Theory.get_thms thy "perm_pi_simp"
    60   in
    60   in
    68                        full_simp_tac (HOL_basic_ss addsimps perm_pi_simp))]
    68                        full_simp_tac (HOL_basic_ss addsimps perm_pi_simp))]
    69   end;
    69   end;
    70 
    70 
    71 fun get_derived_thm ctxt hyp concl orig_thm pi typi =
    71 fun get_derived_thm ctxt hyp concl orig_thm pi typi =
    72   let
    72   let
    73     val thy = ProofContext.theory_of ctxt;
    73     val thy = Proof_Context.theory_of ctxt;
    74     val pi' = Var (pi, typi);
    74     val pi' = Var (pi, typi);
    75     val lhs = Const (@{const_name "perm"}, typi --> HOLogic.boolT --> HOLogic.boolT) $ pi' $ hyp;
    75     val lhs = Const (@{const_name "perm"}, typi --> HOLogic.boolT --> HOLogic.boolT) $ pi' $ hyp;
    76     val ([goal_term, pi''], ctxt') = Variable.import_terms false
    76     val ([goal_term, pi''], ctxt') = Variable.import_terms false
    77       [HOLogic.mk_Trueprop (HOLogic.mk_eq (lhs, concl)), pi'] ctxt
    77       [HOLogic.mk_Trueprop (HOLogic.mk_eq (lhs, concl)), pi'] ctxt
    78     val _ = writeln (Syntax.string_of_term ctxt' goal_term);
    78     val _ = writeln (Syntax.string_of_term ctxt' goal_term);
    79   in
    79   in
    80     Goal.prove ctxt' [] [] goal_term
    80     Goal.prove ctxt' [] [] goal_term
    81       (fn _ => prove_eqvt_tac ctxt' orig_thm pi' pi'') |>
    81       (fn _ => prove_eqvt_tac ctxt' orig_thm pi' pi'') |>
    82     singleton (ProofContext.export ctxt' ctxt)
    82     singleton (Proof_Context.export ctxt' ctxt)
    83   end
    83   end
    84 
    84 
    85 (* replaces in t every variable, say x, with pi o x *)
    85 (* replaces in t every variable, say x, with pi o x *)
    86 fun apply_pi trm (pi, typi) =
    86 fun apply_pi trm (pi, typi) =
    87 let
    87 let