src/HOL/Tools/ATP/atp_proof_reconstruct.ML
changeset 54770 0e354ef1b167
parent 54768 ee0881a54c72
child 54772 f5fd4a34b0e8
equal deleted inserted replaced
54769:3d6ac2f68bf3 54770:0e354ef1b167
   172 
   172 
   173 (* Cope with "tt(X) = X" atoms, where "X" is existentially quantified. *)
   173 (* Cope with "tt(X) = X" atoms, where "X" is existentially quantified. *)
   174 fun loose_aconv (Free (s, _), Free (s', _)) = s = s'
   174 fun loose_aconv (Free (s, _), Free (s', _)) = s = s'
   175   | loose_aconv (t, t') = t aconv t'
   175   | loose_aconv (t, t') = t aconv t'
   176 
   176 
   177 val vampire_skolem_prefix = "sK"
   177 (* SPASS (3.8ds) and Vampire (2.6) pass arguments to Skolem functions in reverse order. *)
       
   178 val rev_skolem_prefixes = ["skf", "sK"]
   178 
   179 
   179 (* First-order translation. No types are known for variables. "HOLogic.typeT"
   180 (* First-order translation. No types are known for variables. "HOLogic.typeT"
   180    should allow them to be inferred. *)
   181    should allow them to be inferred. *)
   181 fun term_of_atp ctxt textual sym_tab =
   182 fun term_of_atp ctxt textual sym_tab =
   182   let
   183   let
   266                end with a digit and "variant_frees" appends letters. *)
   267                end with a digit and "variant_frees" appends letters. *)
   267             fun fresh_up s =
   268             fun fresh_up s =
   268               [(s, ())] |> Variable.variant_frees ctxt [] |> hd |> fst
   269               [(s, ())] |> Variable.variant_frees ctxt [] |> hd |> fst
   269             val term_ts =
   270             val term_ts =
   270               map (do_term [] NONE) us
   271               map (do_term [] NONE) us
   271               (* Vampire (2.6) passes arguments to Skolem functions in reverse
   272               |> exists (fn pre => String.isPrefix pre s) rev_skolem_prefixes ? rev
   272                  order *)
       
   273               |> String.isPrefix vampire_skolem_prefix s ? rev
       
   274             val ts = term_ts @ extra_ts
   273             val ts = term_ts @ extra_ts
   275             val T =
   274             val T =
   276               case opt_T of
   275               case opt_T of
   277                 SOME T => map slack_fastype_of term_ts ---> T
   276                 SOME T => map slack_fastype_of term_ts ---> T
   278               | NONE => map slack_fastype_of ts ---> HOLogic.typeT
   277               | NONE => map slack_fastype_of ts ---> HOLogic.typeT