--- a/src/HOL/TPTP/TPTP_Parser/tptp.yacc Wed Apr 04 16:29:16 2012 +0100
+++ b/src/HOL/TPTP/TPTP_Parser/tptp.yacc Wed Apr 04 16:29:17 2012 +0100
@@ -280,11 +280,11 @@
thf_logic_formula : thf_binary_formula (( thf_binary_formula ))
| thf_unitary_formula (( thf_unitary_formula ))
| thf_type_formula (( THF_typing thf_type_formula ))
- | thf_subtype (( THF_type thf_subtype ))
+ | thf_subtype (( Type_fmla thf_subtype ))
thf_binary_formula : thf_binary_pair (( thf_binary_pair ))
| thf_binary_tuple (( thf_binary_tuple ))
- | thf_binary_type (( THF_type thf_binary_type ))
+ | thf_binary_type (( Type_fmla thf_binary_type ))
thf_binary_pair : thf_unitary_formula thf_pair_connective thf_unitary_formula ((
Fmla (thf_pair_connective, [thf_unitary_formula1, thf_unitary_formula2])
@@ -468,7 +468,7 @@
| tff_quantified_type (( tff_quantified_type ))
tff_quantified_type : DEP_PROD LBRKT tff_variable_list RBRKT COLON tff_monotype ((
- Fmla_type (Quant (Dep_Prod, tff_variable_list, THF_type tff_monotype))
+ Fmla_type (Quant (Dep_Prod, tff_variable_list, Type_fmla tff_monotype))
))
| LPAREN tff_quantified_type RPAREN (( tff_quantified_type ))
@@ -480,7 +480,7 @@
tff_atomic_type : atomic_word (( Atom_type atomic_word ))
| defined_type (( Defined_type defined_type ))
- | atomic_word LPAREN tff_type_arguments RPAREN (( Fmla_type (Fmla (Uninterpreted atomic_word, (map THF_type tff_type_arguments))) ))
+ | atomic_word LPAREN tff_type_arguments RPAREN (( Fmla_type (Fmla (Uninterpreted atomic_word, (map Type_fmla tff_type_arguments))) ))
| variable_ (( Fmla_type (Pred (Interpreted_ExtraLogic Apply, [Term_Var variable_])) ))
tff_type_arguments : tff_atomic_type (( [tff_atomic_type] ))
--- a/src/HOL/TPTP/TPTP_Parser/tptp_interpret.ML Wed Apr 04 16:29:16 2012 +0100
+++ b/src/HOL/TPTP/TPTP_Parser/tptp_interpret.ML Wed Apr 04 16:29:17 2012 +0100
@@ -13,9 +13,9 @@
type const_map = (string * term) list
type var_types = (string * typ option) list
- (*mapping from THF types to Isabelle/HOL types. This map works over all
- base types (i.e. THF functions must be interpreted as Isabelle/HOL functions).
- The map must be total wrt THF types. Later on there could be a configuration
+ (*mapping from TPTP types to Isabelle/HOL types. This map works over all
+ base types (i.e. TPTP functions must be interpreted as Isabelle/HOL functions).
+ The map must be total wrt TPTP types. Later on there could be a configuration
option to make a map extensible.*)
type type_map = (TPTP_Syntax.tptp_type * typ) list
@@ -33,7 +33,7 @@
directive, may include the meaning of an entire TPTP file, is an extended
Isabelle/HOL theory, an explicit map from constants to their Isabelle/HOL
counterparts and their types, the meaning of any TPTP formulas encountered
- while interpreting that statement, and a map from THF to Isabelle/HOL types
+ while interpreting that statement, and a map from TPTP to Isabelle/HOL types
(these types would have been added to the theory returned in the first position
of the tuple). The last value is NONE when the function which produced the
whole tptp_general_meaning value was given a type_map argument -- since
@@ -53,7 +53,7 @@
generative_type_interpretation : bool,
generative_const_interpretation : bool*)}
- (*map types form THF to Isabelle/HOL*)
+ (*map types form TPTP to Isabelle/HOL*)
val interpret_type : config -> theory -> type_map ->
TPTP_Syntax.tptp_type -> typ
@@ -68,11 +68,11 @@
Arguments:
cautious = indicates whether additional checks are made to check
that all used types have been declared.
- type_map = mapping of THF-types to Isabelle/HOL types. This argument may be
+ type_map = mapping of TPTP-types to Isabelle/HOL types. This argument may be
given to force a specific mapping: this is usually done for using an
- imported THF problem in Isar.
+ imported TPTP problem in Isar.
const_map = as previous, but for constants.
- path_prefix = path where THF problems etc are located (to help the "include"
+ path_prefix = path where TPTP problems etc are located (to help the "include"
directive find the files.
thy = theory where interpreted info will be stored.
*)
@@ -93,8 +93,8 @@
Arguments:
new_basic_types = indicates whether interpretations of $i and $o
types are to be added to the type map (unless it is Given).
- This is "true" if we are running this over a fresh THF problem, but
- "false" if we are calling this _during_ the interpretation of a THF file
+ This is "true" if we are running this over a fresh TPTP problem, but
+ "false" if we are calling this _during_ the interpretation of a TPTP file
(i.e. when interpreting an "include" directive.
config = config
path_prefix = " "
@@ -118,13 +118,13 @@
exception MISINTERPRET_TERM of string * TPTP_Syntax.tptp_term
exception MISINTERPRET_TYPE of string * TPTP_Syntax.tptp_type
- (*Generates a fresh Isabelle/HOL type for interpreting a THF type in a theory.*)
+ (*Generates a fresh Isabelle/HOL type for interpreting a TPTP type in a theory.*)
val declare_type : config -> (TPTP_Syntax.tptp_type * string) -> type_map ->
theory -> type_map * theory
(*Returns the list of all files included in a directory and its
subdirectories. This is only used for testing the parser/interpreter against
- all THF problems.*)
+ all TPTP problems.*)
val get_file_list : Path.T -> Path.T list
type manifest = TPTP_Problem_Name.problem_name * tptp_general_meaning
@@ -245,13 +245,13 @@
Defined_type typ
| fmlatype_to_type (Atom (THF_Atom_term (Term_Func (Uninterpreted str, [])))) =
Atom_type str
- | fmlatype_to_type (THF_type (Fn_type (ty1, ty2))) =
+ | fmlatype_to_type (Type_fmla (Fn_type (ty1, ty2))) =
let
val ty1' = case ty1 of
- Fn_type _ => fmlatype_to_type (THF_type ty1)
+ Fn_type _ => fmlatype_to_type (Type_fmla ty1)
| Fmla_type ty1 => fmlatype_to_type ty1
val ty2' = case ty2 of
- Fn_type _ => fmlatype_to_type (THF_type ty2)
+ Fn_type _ => fmlatype_to_type (Type_fmla ty2)
| Fmla_type ty2 => fmlatype_to_type ty2
in Fn_type (ty1', ty2') end
@@ -327,7 +327,7 @@
(Const (str, Term.dummyT) $ Bound 0 $ Bound 1)
|> (Term.absdummy Term.dummyT #> Term.absdummy Term.dummyT)
-fun dummy_THF () =
+fun dummy_term () =
HOLogic.choice_const Term.dummyT $ Term.absdummy Term.dummyT @{term "True"}
fun interpret_symbol config thy language const_map symb =
@@ -357,7 +357,7 @@
| Remainder_F | Floor | Ceiling | Truncate | Round | To_Int | To_Rat
| To_Real | EvalEq | Is_Int | Is_Rat*)
| Apply => raise MISINTERPRET_SYMBOL ("Malformed term?", symb)
- | _ => dummy_THF ()
+ | _ => dummy_term ()
)
| Interpreted_Logic logic_symbol =>
(case logic_symbol of
@@ -523,7 +523,7 @@
val num_term =
if number_kind = Int_num then
HOLogic.mk_number @{typ "int"} (the (Int.fromString num))
- else dummy_THF () (*FIXME: not yet supporting rationals and reals*)
+ else dummy_term () (*FIXME: not yet supporting rationals and reals*)
in (num_term, thy) end
| Term_Distinct_Object str =>
let
@@ -674,7 +674,7 @@
type_map tptp_term
| THF_Atom_conn_term symbol =>
(interpret_symbol config thy language const_map symbol, thy))
- | THF_type _ => (*FIXME unsupported*)
+ | Type_fmla _ => (*FIXME unsupported*)
raise MISINTERPRET_FORMULA
("Cannot interpret types as formulas", tptp_fmla)
| THF_typing (tptp_formula, _) => (*FIXME ignoring type info*)
@@ -753,7 +753,7 @@
in
case tptp_ty of
Defined_type Type_Type => (*add new type*)
- (*generate an Isabelle/HOL type to interpret this THF type,
+ (*generate an Isabelle/HOL type to interpret this TPTP type,
and add it to both the Isabelle/HOL theory and to the type_map*)
let
val (type_map', thy') =
--- a/src/HOL/TPTP/TPTP_Parser/tptp_lexyacc.ML Wed Apr 04 16:29:16 2012 +0100
+++ b/src/HOL/TPTP/TPTP_Parser/tptp_lexyacc.ML Wed Apr 04 16:29:17 2012 +0100
@@ -3880,7 +3880,7 @@
end
| ( 22, ( ( _, ( MlyValue.thf_subtype thf_subtype, thf_subtype1left,
thf_subtype1right)) :: rest671)) => let val result =
-MlyValue.thf_logic_formula (( THF_type thf_subtype ))
+MlyValue.thf_logic_formula (( Type_fmla thf_subtype ))
in ( LrTable.NT 124, ( result, thf_subtype1left, thf_subtype1right),
rest671)
end
@@ -3898,7 +3898,7 @@
end
| ( 25, ( ( _, ( MlyValue.thf_binary_type thf_binary_type,
thf_binary_type1left, thf_binary_type1right)) :: rest671)) => let val
- result = MlyValue.thf_binary_formula (( THF_type thf_binary_type ))
+ result = MlyValue.thf_binary_formula (( Type_fmla thf_binary_type ))
in ( LrTable.NT 123, ( result, thf_binary_type1left,
thf_binary_type1right), rest671)
end
@@ -4619,7 +4619,7 @@
tff_variable_list, _, _)) :: _ :: ( _, ( _, DEP_PROD1left, _)) ::
rest671)) => let val result = MlyValue.tff_quantified_type (
(
- Fmla_type (Quant (Dep_Prod, tff_variable_list, THF_type tff_monotype))
+ Fmla_type (Quant (Dep_Prod, tff_variable_list, Type_fmla tff_monotype))
)
)
in ( LrTable.NT 140, ( result, DEP_PROD1left, tff_monotype1right),
@@ -4674,7 +4674,7 @@
MlyValue.tff_type_arguments tff_type_arguments, _, _)) :: _ :: ( _, (
MlyValue.atomic_word atomic_word, atomic_word1left, _)) :: rest671))
=> let val result = MlyValue.tff_atomic_type (
-( Fmla_type (Fmla (Uninterpreted atomic_word, (map THF_type tff_type_arguments))) )
+( Fmla_type (Fmla (Uninterpreted atomic_word, (map Type_fmla tff_type_arguments))) )
)
in ( LrTable.NT 79, ( result, atomic_word1left, RPAREN1right),
rest671)
--- a/src/HOL/TPTP/TPTP_Parser/tptp_syntax.ML Wed Apr 04 16:29:16 2012 +0100
+++ b/src/HOL/TPTP/TPTP_Parser/tptp_syntax.ML Wed Apr 04 16:29:17 2012 +0100
@@ -53,14 +53,13 @@
UMinus | Sum | Difference | Product | Quotient | Quotient_E |
Quotient_T | Quotient_F | Remainder_E | Remainder_T | Remainder_F |
Floor | Ceiling | Truncate | Round | To_Int | To_Rat | To_Real |
- (*these should be in defined_pred, but that's not being used in TPTP*)
+ (*FIXME these should be in defined_pred, but that's not being used in TPTP*)
Less | LessEq | Greater | GreaterEq | EvalEq | Is_Int | Is_Rat |
- Distinct |
- Apply (*this is just a matter of convenience*)
+ Distinct | Apply
and logic_symbol = Equals | NEquals | Or | And | Iff | If | Fi | Xor |
Nor | Nand | Not | Op_Forall | Op_Exists |
- (*these should be in defined_pred, but that's not being used in TPTP*)
+ (*FIXME these should be in defined_pred, but that's not being used in TPTP*)
True | False
and quantifier = (*interpreted binders*)
@@ -102,7 +101,7 @@
| Conditional of tptp_formula * tptp_formula * tptp_formula
| Let of tptp_let list * tptp_formula (*FIXME remove list?*)
| Atom of tptp_atom
- | THF_type of tptp_type
+ | Type_fmla of tptp_type
| THF_typing of tptp_formula * tptp_type (*only THF*)
and tptp_let =
@@ -130,7 +129,8 @@
type position = string * int * int
datatype tptp_line =
- Annotated_Formula of position * language * string * role * tptp_formula * annotation option
+ Annotated_Formula of position * language * string * role *
+ tptp_formula * annotation option
| Include of string * string list
type tptp_problem = tptp_line list
@@ -198,14 +198,12 @@
UMinus | Sum | Difference | Product | Quotient | Quotient_E |
Quotient_T | Quotient_F | Remainder_E | Remainder_T | Remainder_F |
Floor | Ceiling | Truncate | Round | To_Int | To_Rat | To_Real |
- (*these should be in defined_pred, but that's not being used in TPTP*)
Less | LessEq | Greater | GreaterEq | EvalEq | Is_Int | Is_Rat |
Distinct |
- Apply (*this is just a matter of convenience*)
+ Apply
and logic_symbol = Equals | NEquals | Or | And | Iff | If | Fi | Xor |
Nor | Nand | Not | Op_Forall | Op_Exists |
- (*these should be in defined_pred, but that's not being used in TPTP*)
True | False
and quantifier = (*interpreted binders*)
@@ -247,21 +245,21 @@
| Conditional of tptp_formula * tptp_formula * tptp_formula
| Let of tptp_let list * tptp_formula
| Atom of tptp_atom
- | THF_type of tptp_type
+ | Type_fmla of tptp_type
| THF_typing of tptp_formula * tptp_type
and tptp_let =
- Let_fmla of (string * tptp_type option) * tptp_formula (*both TFF and THF*)
- | Let_term of (string * tptp_type option) * tptp_term (*only TFF*)
+ Let_fmla of (string * tptp_type option) * tptp_formula
+ | Let_term of (string * tptp_type option) * tptp_term
and tptp_type =
Prod_type of tptp_type * tptp_type
| Fn_type of tptp_type * tptp_type
| Atom_type of string
| Defined_type of tptp_base_type
- | Sum_type of tptp_type * tptp_type (*only THF*)
- | Fmla_type of tptp_formula (*only THF*)
- | Subtype of symbol * symbol (*only THF*)
+ | Sum_type of tptp_type * tptp_type
+ | Fmla_type of tptp_formula
+ | Subtype of symbol * symbol
type general_list = general_term list
type parent_details = general_list
@@ -273,13 +271,6 @@
exception DEQUOTE of string
-(*
-datatype defined_functor =
- ITE_T | UMINUS | SUM | DIFFERENCE | PRODUCT | QUOTIENT | QUOTIENT_E |
- QUOTIENT_T | QUOTIENT_F | REMAINDER_E | REMAINDER_T | REMAINDER_F |
- FLOOR | CEILING | TRUNCATE | ROUND | TO_INT | TO_RAT | TO_REAL
-*)
-
type position = string * int * int
datatype tptp_line =
@@ -474,7 +465,7 @@
| string_of_tptp_formula (Conditional _) = "" (*FIXME*)
| string_of_tptp_formula (Let _) = "" (*FIXME*)
| string_of_tptp_formula (Atom tptp_atom) = string_of_tptp_atom tptp_atom
- | string_of_tptp_formula (THF_type tptp_type) = string_of_tptp_type tptp_type
+ | string_of_tptp_formula (Type_fmla tptp_type) = string_of_tptp_type tptp_type
| string_of_tptp_formula (THF_typing (tptp_formula, tptp_type)) =
string_of_tptp_formula tptp_formula ^ " : " ^ string_of_tptp_type tptp_type