src/HOL/Nominal/nominal_fresh_fun.ML
changeset 58950 d07464875dd4
parent 58318 f95754ca7082
child 58956 a816aa3ff391
equal deleted inserted replaced
58949:e9559088ba29 58950:d07464875dd4
    35   gen_res_inst_tac_term (curry Thm.instantiate);
    35   gen_res_inst_tac_term (curry Thm.instantiate);
    36 
    36 
    37 val res_inst_tac_term' =
    37 val res_inst_tac_term' =
    38   gen_res_inst_tac_term (K Drule.cterm_instantiate) [];
    38   gen_res_inst_tac_term (K Drule.cterm_instantiate) [];
    39 
    39 
    40 fun cut_inst_tac_term' tinst th =
    40 fun cut_inst_tac_term' ctxt tinst th =
    41   res_inst_tac_term' tinst false (Rule_Insts.make_elim_preserve th);
    41   res_inst_tac_term' tinst false (Rule_Insts.make_elim_preserve ctxt th);
    42 
    42 
    43 fun get_dyn_thm thy name atom_name =
    43 fun get_dyn_thm thy name atom_name =
    44   Global_Theory.get_thm thy name handle ERROR _ =>
    44   Global_Theory.get_thm thy name handle ERROR _ =>
    45     error ("The atom type "^atom_name^" is not defined.");
    45     error ("The atom type "^atom_name^" is not defined.");
    46 
    46 
    74    val exists_fresh' = at_name_inst_thm RS at_exists_fresh';
    74    val exists_fresh' = at_name_inst_thm RS at_exists_fresh';
    75 (* find the variable we want to instantiate *)
    75 (* find the variable we want to instantiate *)
    76    val x = hd (Misc_Legacy.term_vars (prop_of exists_fresh'));
    76    val x = hd (Misc_Legacy.term_vars (prop_of exists_fresh'));
    77  in
    77  in
    78    fn st =>
    78    fn st =>
    79    (cut_inst_tac_term' [(x,s)] exists_fresh' 1 THEN
    79    (cut_inst_tac_term' ctxt [(x,s)] exists_fresh' 1 THEN
    80    rtac fs_name_thm 1 THEN
    80    rtac fs_name_thm 1 THEN
    81    etac exE 1) st
    81    etac exE 1) st
    82   handle List.Empty  => all_tac st (* if we collected no variables then we do nothing *)
    82   handle List.Empty  => all_tac st (* if we collected no variables then we do nothing *)
    83  end) 1;
    83  end) 1;
    84 
    84