src/HOL/TPTP/TPTP_Parser/tptp_interpret.ML
changeset 56256 1e01c159e7d9
parent 55593 c67c27f0ea94
child 57796 07521fed6071
equal deleted inserted replaced
56255:968667bbb8d2 56256:1e01c159e7d9
   254                \mapping to Isabelle/HOL", thf_ty)
   254                \mapping to Isabelle/HOL", thf_ty)
   255         | SOME ty => ty)
   255         | SOME ty => ty)
   256   in
   256   in
   257     case thf_ty of
   257     case thf_ty of
   258        Prod_type (thf_ty1, thf_ty2) =>
   258        Prod_type (thf_ty1, thf_ty2) =>
   259          Type ("Product_Type.prod",
   259          Type (@{type_name prod},
   260           [interpret_type config thy type_map thf_ty1,
   260           [interpret_type config thy type_map thf_ty1,
   261            interpret_type config thy type_map thf_ty2])
   261            interpret_type config thy type_map thf_ty2])
   262      | Fn_type (thf_ty1, thf_ty2) =>
   262      | Fn_type (thf_ty1, thf_ty2) =>
   263          Type ("fun",
   263          Type (@{type_name fun},
   264           [interpret_type config thy type_map thf_ty1,
   264           [interpret_type config thy type_map thf_ty1,
   265            interpret_type config thy type_map thf_ty2])
   265            interpret_type config thy type_map thf_ty2])
   266      | Atom_type _ =>
   266      | Atom_type _ =>
   267          lookup_type type_map thf_ty
   267          lookup_type type_map thf_ty
   268      | Defined_type tptp_base_type =>
   268      | Defined_type tptp_base_type =>
   396   in (mapply args f', thy') end
   396   in (mapply args f', thy') end
   397 
   397 
   398 (*As above, but for products*)
   398 (*As above, but for products*)
   399 fun mtimes thy =
   399 fun mtimes thy =
   400   fold (fn x => fn y =>
   400   fold (fn x => fn y =>
   401     Sign.mk_const thy
   401     Sign.mk_const thy (@{const_name Pair}, [dummyT, dummyT]) $ y $ x)
   402     ("Product_Type.Pair", [dummyT, dummyT]) $ y $ x)
       
   403 
   402 
   404 fun mtimes' (args, thy) f =
   403 fun mtimes' (args, thy) f =
   405   let
   404   let
   406     val (f', thy') = f thy
   405     val (f', thy') = f thy
   407   in (mtimes thy' args f', thy') end
   406   in (mtimes thy' args f', thy') end
   454     fold (add_interp_symbol_to_thy false) ind_symbols thy
   453     fold (add_interp_symbol_to_thy false) ind_symbols thy
   455     |> fold (add_interp_symbol_to_thy true) bool_symbols
   454     |> fold (add_interp_symbol_to_thy true) bool_symbols
   456   end
   455   end
   457 
   456 
   458 (*Next batch of functions give info about Isabelle/HOL types*)
   457 (*Next batch of functions give info about Isabelle/HOL types*)
   459 fun is_fun (Type ("fun", _)) = true
   458 fun is_fun (Type (@{type_name fun}, _)) = true
   460   | is_fun _ = false
   459   | is_fun _ = false
   461 fun is_prod (Type ("Product_Type.prod", _)) = true
   460 fun is_prod (Type (@{type_name prod}, _)) = true
   462   | is_prod _ = false
   461   | is_prod _ = false
   463 fun dom_type (Type ("fun", [ty1, _])) = ty1
   462 fun dom_type (Type (@{type_name fun}, [ty1, _])) = ty1
   464 fun is_prod_typed thy config symb =
   463 fun is_prod_typed thy config symb =
   465   let
   464   let
   466     fun symb_type const_name =
   465     fun symb_type const_name =
   467       Sign.the_const_type thy (full_name thy config const_name)
   466       Sign.the_const_type thy (full_name thy config const_name)
   468   in
   467   in