src/HOL/Tools/ATP/recon_transfer_proof.ML
changeset 19617 7cb4b67d4b97
parent 19199 b338c218cc6e
child 20139 804927db5311
equal deleted inserted replaced
19616:2545e8ab59a5 19617:7cb4b67d4b97
   129 |   assoc_out_of_order a ((b,c)::t) = if there_out_of_order a c then b else assoc_out_of_order a t;
   129 |   assoc_out_of_order a ((b,c)::t) = if there_out_of_order a c then b else assoc_out_of_order a t;
   130 
   130 
   131 fun get_assoc_snds [] xs assocs= assocs
   131 fun get_assoc_snds [] xs assocs= assocs
   132 |   get_assoc_snds (x::xs) ys assocs = get_assoc_snds xs ys (assocs@[((assoc_out_of_order x ys))])
   132 |   get_assoc_snds (x::xs) ys assocs = get_assoc_snds xs ys (assocs@[((assoc_out_of_order x ys))])
   133 
   133 
   134 fun add_if_not_inlist [] xs newlist = newlist
   134 fun add_if_not_inlist eq [] xs newlist = newlist
   135 |   add_if_not_inlist (y::ys) xs newlist = if (not (y mem xs)) then 
   135 |   add_if_not_inlist eq (y::ys) xs newlist =
   136                                       add_if_not_inlist ys xs (y::newlist)
   136     if not (member eq xs y) then add_if_not_inlist eq ys xs (y::newlist)
   137                                         else add_if_not_inlist ys xs (newlist)
   137     else add_if_not_inlist eq ys xs newlist
   138 
   138 
   139 (*Flattens a list of list of strings to one string*)
   139 (*Flattens a list of list of strings to one string*)
   140 fun onestr ls = String.concat (map String.concat ls);
   140 fun onestr ls = String.concat (map String.concat ls);
   141 
   141 
   142 fun is_clasimp_ax clasimp_num n = n <= clasimp_num 
   142 fun is_clasimp_ax clasimp_num n = n <= clasimp_num 
   243      val ax_metas = get_assoc_snds ax_strs metas_and_strs []
   243      val ax_metas = get_assoc_snds ax_strs metas_and_strs []
   244      val ax_vars = map thm_vars ax_metas
   244      val ax_vars = map thm_vars ax_metas
   245      val ax_with_vars = ListPair.zip (ax_metas,ax_vars)
   245      val ax_with_vars = ListPair.zip (ax_metas,ax_vars)
   246 
   246 
   247      (* get list of extra axioms as thms with their variables *)
   247      (* get list of extra axioms as thms with their variables *)
   248      val extra_metas = add_if_not_inlist metas ax_metas []
   248      val extra_metas = add_if_not_inlist Thm.eq_thm metas ax_metas []
   249      val extra_vars = map thm_vars extra_metas
   249      val extra_vars = map thm_vars extra_metas
   250      val extra_with_vars = if (not (extra_metas = []) ) 
   250      val extra_with_vars = if not (null extra_metas)
   251 			   then ListPair.zip (extra_metas,extra_vars)
   251 			   then ListPair.zip (extra_metas,extra_vars)
   252 			   else []
   252 			   else []
   253  in
   253  in
   254     (distfrees,distvars, extra_with_vars,ax_with_vars, ListPair.zip (step_nums,ax_metas))
   254     (distfrees,distvars, extra_with_vars,ax_with_vars, ListPair.zip (step_nums,ax_metas))
   255  end;
   255  end;
   337       val ax_strs = map ReconOrderClauses.get_meta_lits_bracket (map #2 numcls)
   337       val ax_strs = map ReconOrderClauses.get_meta_lits_bracket (map #2 numcls)
   338       val numcls_strs = ListPair.zip (ax_nums,ax_strs)
   338       val numcls_strs = ListPair.zip (ax_nums,ax_strs)
   339       val num_cls_vars =  map (addvars vars) numcls_strs;
   339       val num_cls_vars =  map (addvars vars) numcls_strs;
   340       val reconIsaAxStr = origAxs_to_string (ListPair.zip (ax_nums,ax_with_vars)) ""
   340       val reconIsaAxStr = origAxs_to_string (ListPair.zip (ax_nums,ax_with_vars)) ""
   341       
   341       
   342       val extra_nums = if (not (extra_with_vars = [])) then (1 upto (length extra_with_vars))
   342       val extra_nums = if not (null extra_with_vars) then (1 upto (length extra_with_vars))
   343                        else []
   343                        else []
   344       val reconExtraAxStr = extraAxs_to_string ( ListPair.zip (extra_nums,extra_with_vars)) ""
   344       val reconExtraAxStr = extraAxs_to_string ( ListPair.zip (extra_nums,extra_with_vars)) ""
   345       val frees_str = "["^(thmvars_to_string frees "")^"]"
   345       val frees_str = "["^(thmvars_to_string frees "")^"]"
   346       val reconstr = (frees_str^reconExtraAxStr^reconIsaAxStr^reconProofStr)
   346       val reconstr = (frees_str^reconExtraAxStr^reconIsaAxStr^reconProofStr)
   347       val _ = trace ("\nReconstruction:\n" ^ reconstr)
   347       val _ = trace ("\nReconstruction:\n" ^ reconstr)