src/Pure/drule.ML
changeset 16720 0c6c67e74391
parent 16682 154a84e1a4f7
child 16787 b6b6e2faaa41
equal deleted inserted replaced
16719:5c5eb939f6eb 16720:0c6c67e74391
   597 
   597 
   598 (*True if the two theorems have the same theory.*)
   598 (*True if the two theorems have the same theory.*)
   599 val eq_thm_thy = eq_thy o pairself Thm.theory_of_thm;
   599 val eq_thm_thy = eq_thy o pairself Thm.theory_of_thm;
   600 
   600 
   601 (*True if the two theorems have the same prop field, ignoring hyps, der, etc.*)
   601 (*True if the two theorems have the same prop field, ignoring hyps, der, etc.*)
   602 val eq_thm_prop = op aconv o pairself Thm.prop_of;
   602 val eq_thm_prop = op aconv o pairself Thm.full_prop_of;
   603 
   603 
   604 (*Useful "distance" function for BEST_FIRST*)
   604 (*Useful "distance" function for BEST_FIRST*)
   605 val size_of_thm = size_of_term o prop_of;
   605 val size_of_thm = size_of_term o Thm.full_prop_of;
   606 
   606 
   607 (*maintain lists of theorems --- preserving canonical order*)
   607 (*maintain lists of theorems --- preserving canonical order*)
   608 fun del_rules rs rules = Library.gen_rems eq_thm_prop (rules, rs);
   608 fun del_rules rs rules = Library.gen_rems eq_thm_prop (rules, rs);
   609 fun add_rules rs rules = rs @ del_rules rs rules;
   609 fun add_rules rs rules = rs @ del_rules rs rules;
   610 val del_rule = del_rules o single;
   610 val del_rule = del_rules o single;
   954 
   954 
   955 (*shorthand for instantiating just one variable in the current theory*)
   955 (*shorthand for instantiating just one variable in the current theory*)
   956 fun inst x t = read_instantiate_sg (the_context()) [(x,t)];
   956 fun inst x t = read_instantiate_sg (the_context()) [(x,t)];
   957 
   957 
   958 
   958 
   959 (* collect vars in left-to-right order *)
   959 (* vars in left-to-right order *)
   960 
   960 
   961 fun tvars_of_terms ts = rev (Library.foldl Term.add_tvars ([], ts));
   961 fun tvars_of_terms ts = rev (Library.foldl Term.add_tvars ([], ts));
   962 fun vars_of_terms ts = rev (Library.foldl Term.add_vars ([], ts));
   962 fun vars_of_terms ts = rev (Library.foldl Term.add_vars ([], ts));
   963 
   963 
   964 fun tvars_of thm = tvars_of_terms [prop_of thm];
   964 fun tvars_of thm = tvars_of_terms [Thm.full_prop_of thm];
   965 fun vars_of thm = vars_of_terms [prop_of thm];
   965 fun vars_of thm = vars_of_terms [Thm.full_prop_of thm];
   966 
   966 
   967 
   967 
   968 (* instantiate by left-to-right occurrence of variables *)
   968 (* instantiate by left-to-right occurrence of variables *)
   969 
   969 
   970 fun instantiate' cTs cts thm =
   970 fun instantiate' cTs cts thm =