src/HOL/Tools/Quotient/quotient_tacs.ML
changeset 47308 9caab698dbe4
parent 46468 4db76d47b51a
child 51717 9e7d1c139569
equal deleted inserted replaced
47307:5e5ca36692b3 47308:9caab698dbe4
    60 fun equiv_solver_tac ss = equiv_tac (Simplifier.the_context ss)
    60 fun equiv_solver_tac ss = equiv_tac (Simplifier.the_context ss)
    61 val equiv_solver = mk_solver "Equivalence goal solver" equiv_solver_tac
    61 val equiv_solver = mk_solver "Equivalence goal solver" equiv_solver_tac
    62 
    62 
    63 fun quotient_tac ctxt =
    63 fun quotient_tac ctxt =
    64   (REPEAT_ALL_NEW (FIRST'
    64   (REPEAT_ALL_NEW (FIRST'
    65     [rtac @{thm identity_quotient},
    65     [rtac @{thm identity_quotient3},
    66      resolve_tac (Quotient_Info.quotient_rules ctxt)]))
    66      resolve_tac (Quotient_Info.quotient_rules ctxt)]))
    67 
    67 
    68 fun quotient_solver_tac ss = quotient_tac (Simplifier.the_context ss)
    68 fun quotient_solver_tac ss = quotient_tac (Simplifier.the_context ss)
    69 val quotient_solver = mk_solver "Quotient goal solver" quotient_solver_tac
    69 val quotient_solver = mk_solver "Quotient goal solver" quotient_solver_tac
    70 
    70 
   257               val ty_f = range_type (fastype_of f)
   257               val ty_f = range_type (fastype_of f)
   258               val thy = Proof_Context.theory_of context
   258               val thy = Proof_Context.theory_of context
   259               val ty_inst = map (SOME o (ctyp_of thy)) [ty_x, ty_b, ty_f]
   259               val ty_inst = map (SOME o (ctyp_of thy)) [ty_x, ty_b, ty_f]
   260               val t_inst = map (SOME o (cterm_of thy)) [R2, f, g, x, y];
   260               val t_inst = map (SOME o (cterm_of thy)) [R2, f, g, x, y];
   261               val inst_thm = Drule.instantiate' ty_inst
   261               val inst_thm = Drule.instantiate' ty_inst
   262                 ([NONE, NONE, NONE] @ t_inst) @{thm apply_rsp}
   262                 ([NONE, NONE, NONE] @ t_inst) @{thm apply_rspQ3}
   263             in
   263             in
   264               (rtac inst_thm THEN' SOLVED' (quotient_tac context)) 1
   264               (rtac inst_thm THEN' SOLVED' (quotient_tac context)) 1
   265             end
   265             end
   266       | _ => no_tac
   266       | _ => no_tac
   267     end)
   267     end)
   527     val thy =  Proof_Context.theory_of lthy
   527     val thy =  Proof_Context.theory_of lthy
   528     val defs = map (Thm.symmetric o #def) (Quotient_Info.dest_quotconsts_global thy)
   528     val defs = map (Thm.symmetric o #def) (Quotient_Info.dest_quotconsts_global thy)
   529     val prs = Quotient_Info.prs_rules lthy
   529     val prs = Quotient_Info.prs_rules lthy
   530     val ids = Quotient_Info.id_simps lthy
   530     val ids = Quotient_Info.id_simps lthy
   531     val thms =
   531     val thms =
   532       @{thms Quotient_abs_rep Quotient_rel_rep babs_prs all_prs ex_prs ex1_prs} @ ids @ prs @ defs
   532       @{thms Quotient3_abs_rep Quotient3_rel_rep babs_prs all_prs ex_prs ex1_prs} @ ids @ prs @ defs
   533 
   533 
   534     val ss = (mk_minimal_ss lthy) addsimps thms addSolver quotient_solver
   534     val ss = (mk_minimal_ss lthy) addsimps thms addSolver quotient_solver
   535   in
   535   in
   536     EVERY' [
   536     EVERY' [
   537       map_fun_tac lthy,
   537       map_fun_tac lthy,