| author | desharna | 
| Sun, 17 Mar 2024 19:30:34 +0100 | |
| changeset 79923 | 6fc9c4344df4 | 
| parent 57808 | cf72aed038c8 | 
| permissions | -rw-r--r-- | 
| 46844 | 1 | open TPTP_Syntax | 
| 2 | ||
| 3 | exception UNRECOGNISED_SYMBOL of string * string | |
| 4 | ||
| 5 | exception UNRECOGNISED_ROLE of string | |
| 6 | fun classify_role role = | |
| 7 | case role of | |
| 8 | "axiom" => Role_Axiom | |
| 9 | | "hypothesis" => Role_Hypothesis | |
| 10 | | "definition" => Role_Definition | |
| 11 | | "assumption" => Role_Assumption | |
| 12 | | "lemma" => Role_Lemma | |
| 13 | | "theorem" => Role_Theorem | |
| 14 | | "conjecture" => Role_Conjecture | |
| 15 | | "negated_conjecture" => Role_Negated_Conjecture | |
| 16 | | "plain" => Role_Plain | |
| 17 | | "fi_domain" => Role_Fi_Domain | |
| 18 | | "fi_functors" => Role_Fi_Functors | |
| 19 | | "fi_predicates" => Role_Fi_Predicates | |
| 20 | | "type" => Role_Type | |
| 21 | | "unknown" => Role_Unknown | |
| 22 | | thing => raise (UNRECOGNISED_ROLE thing) | |
| 23 | ||
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 24 | fun extract_quant_info (Quant (quantifier, vars, tptp_formula)) = | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 25 | (quantifier, vars, tptp_formula) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 26 | |
| 46844 | 27 | %% | 
| 28 | %name TPTP | |
| 29 | %term AMPERSAND | AT_SIGN | CARET | COLON | COMMA | EQUALS | EXCLAMATION | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 30 | | LET | ARROW | FI | IFF | IMPLIES | INCLUDE | 
| 46844 | 31 | | LAMBDA | LBRKT | LPAREN | MAP_TO | MMINUS | NAND | 
| 32 | | NEQUALS | XOR | NOR | PERIOD | PPLUS | QUESTION | RBRKT | RPAREN | |
| 33 | | TILDE | TOK_FALSE | TOK_I | TOK_O | TOK_INT | TOK_REAL | TOK_RAT | TOK_TRUE | |
| 34 | | TOK_TYPE | VLINE | EOF | DTHF | DFOF | DCNF | DFOT | DTFF | REAL of string | |
| 35 | | RATIONAL of string | SIGNED_INTEGER of string | UNSIGNED_INTEGER of string | |
| 36 | | DOT_DECIMAL of string | SINGLE_QUOTED of string | UPPER_WORD of string | |
| 37 | | LOWER_WORD of string | COMMENT of string | |
| 38 | | DISTINCT_OBJECT of string | |
| 39 | | DUD | INDEF_CHOICE | DEFIN_CHOICE | |
| 40 | | OPERATOR_FORALL | OPERATOR_EXISTS | |
| 41 | | PLUS | TIMES | GENTZEN_ARROW | DEP_SUM | DEP_PROD | |
| 47358 | 42 | | DOLLAR_WORD of string | DOLLAR_DOLLAR_WORD of string | 
| 46844 | 43 | | SUBTYPE | LET_TERM | 
| 44 | | THF | TFF | FOF | CNF | |
| 45 | | ITE_F | ITE_T | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 46 | | LET_TF | LET_FF | LET_FT | LET_TT | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 47 | |
| 46844 | 48 | %nonterm | 
| 49 | annotations of annotation option | |
| 50 | | name of string | |
| 51 | | name_list of string list | |
| 52 | | formula_selection of string list | |
| 53 | | optional_info of general_term list | |
| 54 | | general_list of general_list | general_terms of general_term list | |
| 55 | | general_term of general_term | |
| 56 | ||
| 57 | | atomic_word of string | |
| 58 | | general_data of general_data | variable_ of string | |
| 59 | | number of number_kind * string | formula_data of general_data | |
| 60 | | integer of string | |
| 61 | | identifier of string | |
| 62 | | general_function of general_data | useful_info of general_list | |
| 63 | | file_name of string | |
| 64 | | functor_ of symbol | |
| 65 | | term of tptp_term | |
| 66 | | arguments of tptp_term list | |
| 67 | | defined_functor of symbol | |
| 68 | | system_functor of symbol | |
| 69 | | system_constant of symbol | |
| 70 | | system_term of symbol * tptp_term list | |
| 71 | | defined_constant of symbol | |
| 72 | | defined_plain_term of symbol * tptp_term list | |
| 73 | | defined_atomic_term of tptp_term | |
| 74 | | defined_atom of tptp_term | |
| 75 | | defined_term of tptp_term | |
| 76 | | constant of symbol | |
| 77 | | plain_term of symbol * tptp_term list | |
| 78 | | function_term of tptp_term | |
| 79 | | conditional_term of tptp_term | |
| 80 | | system_atomic_formula of tptp_formula | |
| 81 | | infix_equality of symbol | |
| 82 | | infix_inequality of symbol | |
| 83 | | defined_infix_pred of symbol | |
| 84 | | defined_infix_formula of tptp_formula | |
| 85 | | defined_prop of string | |
| 86 | | defined_pred of string | |
| 87 | | defined_plain_formula of tptp_formula | |
| 88 | | defined_atomic_formula of tptp_formula | |
| 89 | | plain_atomic_formula of tptp_formula | |
| 90 | | atomic_formula of tptp_formula | |
| 91 | | unary_connective of symbol | |
| 92 | ||
| 93 | | defined_type of tptp_base_type | |
| 94 | | system_type of string | |
| 95 | | assoc_connective of symbol | |
| 96 | | binary_connective of symbol | |
| 97 | | fol_quantifier of quantifier | |
| 98 | | thf_unary_connective of symbol | |
| 99 | | thf_pair_connective of symbol | |
| 100 | | thf_quantifier of quantifier | |
| 101 | | fol_infix_unary of tptp_formula | |
| 102 | | thf_conn_term of symbol | |
| 103 | | literal of tptp_formula | |
| 104 | | disjunction of tptp_formula | |
| 105 | | cnf_formula of tptp_formula | |
| 106 | | fof_tuple_list of tptp_formula list | |
| 107 | | fof_tuple of tptp_formula list | |
| 108 | | fof_sequent of tptp_formula | |
| 109 | | fof_unary_formula of tptp_formula | |
| 110 | | fof_variable_list of string list | |
| 111 | | fof_quantified_formula of tptp_formula | |
| 112 | | fof_unitary_formula of tptp_formula | |
| 113 | | fof_and_formula of tptp_formula | |
| 114 | | fof_or_formula of tptp_formula | |
| 115 | | fof_binary_assoc of tptp_formula | |
| 116 | | fof_binary_nonassoc of tptp_formula | |
| 117 | | fof_binary_formula of tptp_formula | |
| 118 | | fof_logic_formula of tptp_formula | |
| 119 | | fof_formula of tptp_formula | |
| 120 | | tff_tuple of tptp_formula list | |
| 121 | | tff_tuple_list of tptp_formula list | |
| 122 | | tff_sequent of tptp_formula | |
| 123 | | tff_conditional of tptp_formula | |
| 124 | | tff_xprod_type of tptp_type | |
| 125 | | tff_mapping_type of tptp_type | |
| 126 | | tff_atomic_type of tptp_type | |
| 127 | | tff_unitary_type of tptp_type | |
| 128 | | tff_top_level_type of tptp_type | |
| 129 | | tff_untyped_atom of symbol * tptp_type option | |
| 130 | | tff_typed_atom of symbol * tptp_type option | |
| 131 | | tff_unary_formula of tptp_formula | |
| 132 | | tff_typed_variable of string * tptp_type option | |
| 133 | | tff_variable of string * tptp_type option | |
| 134 | | tff_variable_list of (string * tptp_type option) list | |
| 135 | | tff_quantified_formula of tptp_formula | |
| 136 | | tff_unitary_formula of tptp_formula | |
| 137 | | tff_and_formula of tptp_formula | |
| 138 | | tff_or_formula of tptp_formula | |
| 139 | | tff_binary_assoc of tptp_formula | |
| 140 | | tff_binary_nonassoc of tptp_formula | |
| 141 | | tff_binary_formula of tptp_formula | |
| 142 | | tff_logic_formula of tptp_formula | |
| 143 | | tff_formula of tptp_formula | |
| 144 | ||
| 145 | | thf_tuple of tptp_formula list | |
| 146 | | thf_tuple_list of tptp_formula list | |
| 147 | | thf_sequent of tptp_formula | |
| 148 | | thf_conditional of tptp_formula | |
| 149 | | thf_let of tptp_formula | |
| 150 | | thf_atom of tptp_formula | |
| 151 | | thf_union_type of tptp_type | |
| 152 | | thf_xprod_type of tptp_type | |
| 153 | | thf_mapping_type of tptp_type | |
| 154 | | thf_binary_type of tptp_type | |
| 155 | | thf_unitary_type of tptp_type | |
| 156 | | thf_top_level_type of tptp_type | |
| 157 | | thf_subtype of tptp_type | |
| 158 | | thf_typeable_formula of tptp_formula | |
| 159 | | thf_type_formula of tptp_formula * tptp_type | |
| 160 | | thf_unary_formula of tptp_formula | |
| 161 | | thf_typed_variable of string * tptp_type option | |
| 162 | | thf_variable of string * tptp_type option | |
| 163 | | thf_variable_list of (string * tptp_type option) list | |
| 164 | | thf_quantified_formula of tptp_formula | |
| 165 | | thf_unitary_formula of tptp_formula | |
| 166 | | thf_apply_formula of tptp_formula | |
| 167 | | thf_and_formula of tptp_formula | |
| 168 | | thf_or_formula of tptp_formula | |
| 169 | | thf_binary_tuple of tptp_formula | |
| 170 | | thf_binary_pair of tptp_formula | |
| 171 | | thf_binary_formula of tptp_formula | |
| 172 | | thf_logic_formula of tptp_formula | |
| 173 | | thf_formula of tptp_formula | |
| 174 | | formula_role of role | |
| 175 | ||
| 176 | | cnf_annotated of tptp_line | |
| 177 | | fof_annotated of tptp_line | |
| 178 | | tff_annotated of tptp_line | |
| 179 | | thf_annotated of tptp_line | |
| 180 | | annotated_formula of tptp_line | |
| 181 | | include_ of tptp_line | |
| 182 | | tptp_input of tptp_line | |
| 183 | | tptp_file of tptp_problem | |
| 184 | | tptp of tptp_problem | |
| 185 | ||
| 53394 | 186 | | thf_let_term_defn of tptp_let | 
| 187 | | thf_let_formula_defn of tptp_let | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 188 | | tff_let of tptp_formula | 
| 53394 | 189 | | tff_let_term_defn of tptp_let | 
| 190 | | tff_let_term_binding of tptp_term | |
| 191 | | tff_let_formula_defn of tptp_let | |
| 192 | | tff_let_formula_binding of tptp_formula | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 193 | | tff_quantified_type of tptp_type | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 194 | | tff_monotype of tptp_type | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 195 | | tff_type_arguments of tptp_type list | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 196 | | let_term of tptp_term | 
| 47358 | 197 | | atomic_defined_word of string | 
| 198 | | atomic_system_word of string | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 199 | |
| 46844 | 200 | %pos int | 
| 201 | %eop EOF | |
| 202 | %noshift EOF | |
| 47569 
fce9d97a3258
exceptions related to interpreting tptp problems now mention the relevant position in the tptp file;
 sultana parents: 
47360diff
changeset | 203 | %arg (this_file_name) : string | 
| 46844 | 204 | |
| 205 | %nonassoc LET | |
| 206 | %nonassoc RPAREN | |
| 207 | %nonassoc DUD | |
| 208 | %right COMMA | |
| 209 | %left COLON | |
| 210 | ||
| 211 | %left AT_SIGN | |
| 212 | %nonassoc IFF XOR | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 213 | %right IMPLIES FI | 
| 46844 | 214 | %nonassoc EQUALS NEQUALS | 
| 215 | %right VLINE NOR | |
| 216 | %left AMPERSAND NAND | |
| 217 | %right ARROW | |
| 218 | %left PLUS | |
| 219 | %left TIMES | |
| 220 | ||
| 221 | %right OPERATOR_FORALL OPERATOR_EXISTS | |
| 222 | ||
| 223 | %nonassoc EXCLAMATION QUESTION LAMBDA CARET | |
| 224 | %nonassoc TILDE | |
| 225 | %pure | |
| 226 | %start tptp | |
| 227 | %verbose | |
| 228 | %% | |
| 229 | ||
| 230 | (* Title: HOL/TPTP/TPTP_Parser/tptp.yacc | |
| 231 | Author: Nik Sultana, Cambridge University Computer Laboratory | |
| 232 | ||
| 233 | Parser for TPTP languages. Latest version of the language spec can | |
| 234 | be obtained from http://www.cs.miami.edu/~tptp/TPTP/SyntaxBNF.html | |
| 53395 
a1a78a271682
updated TPTP parser to conform to version 5.5.0 (but excluding the TPI language since its parser spec is still incomplete);
 sultana parents: 
53394diff
changeset | 235 | Our parser implements version 5.5.0 of that spec, except for the TPI | 
| 
a1a78a271682
updated TPTP parser to conform to version 5.5.0 (but excluding the TPI language since its parser spec is still incomplete);
 sultana parents: 
53394diff
changeset | 236 | language since its (parser) spec is still incomplete. | 
| 46844 | 237 | *) | 
| 238 | ||
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 239 | tptp : tptp_file (( tptp_file )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 240 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 241 | tptp_file : tptp_input tptp_file (( tptp_input :: tptp_file )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 242 | | COMMENT tptp_file (( tptp_file )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 243 | | (( [] )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 244 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 245 | tptp_input : annotated_formula (( annotated_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 246 | | include_ (( include_ )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 247 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 248 | annotated_formula : thf_annotated (( thf_annotated )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 249 | | tff_annotated (( tff_annotated )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 250 | | fof_annotated (( fof_annotated )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 251 | | cnf_annotated (( cnf_annotated )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 252 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 253 | thf_annotated : THF LPAREN name COMMA formula_role COMMA thf_formula annotations RPAREN PERIOD (( | 
| 47569 
fce9d97a3258
exceptions related to interpreting tptp problems now mention the relevant position in the tptp file;
 sultana parents: 
47360diff
changeset | 254 | Annotated_Formula ((this_file_name, THFleft + 1, THFright + 1), | 
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 255 | THF, name, formula_role, thf_formula, annotations) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 256 | )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 257 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 258 | tff_annotated : TFF LPAREN name COMMA formula_role COMMA tff_formula annotations RPAREN PERIOD (( | 
| 47569 
fce9d97a3258
exceptions related to interpreting tptp problems now mention the relevant position in the tptp file;
 sultana parents: 
47360diff
changeset | 259 | Annotated_Formula ((this_file_name, TFFleft + 1, TFFright + 1), | 
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 260 | TFF, name, formula_role, tff_formula, annotations) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 261 | )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 262 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 263 | fof_annotated : FOF LPAREN name COMMA formula_role COMMA fof_formula annotations RPAREN PERIOD (( | 
| 47569 
fce9d97a3258
exceptions related to interpreting tptp problems now mention the relevant position in the tptp file;
 sultana parents: 
47360diff
changeset | 264 | Annotated_Formula ((this_file_name, FOFleft + 1, FOFright + 1), | 
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 265 | FOF, name, formula_role, fof_formula, annotations) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 266 | )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 267 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 268 | cnf_annotated : CNF LPAREN name COMMA formula_role COMMA cnf_formula annotations RPAREN PERIOD (( | 
| 47569 
fce9d97a3258
exceptions related to interpreting tptp problems now mention the relevant position in the tptp file;
 sultana parents: 
47360diff
changeset | 269 | Annotated_Formula ((this_file_name, CNFleft + 1, CNFright + 1), | 
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 270 | CNF, name, formula_role, cnf_formula, annotations) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 271 | )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 272 | |
| 46844 | 273 | annotations : COMMA general_term optional_info (( SOME (general_term, optional_info) )) | 
| 274 | | (( NONE )) | |
| 275 | ||
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 276 | formula_role : LOWER_WORD (( classify_role LOWER_WORD )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 277 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 278 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 279 | (* THF formulas *) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 280 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 281 | thf_formula : thf_logic_formula (( thf_logic_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 282 | | thf_sequent (( thf_sequent )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 283 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 284 | thf_logic_formula : thf_binary_formula (( thf_binary_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 285 | | thf_unitary_formula (( thf_unitary_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 286 | | thf_type_formula (( THF_typing thf_type_formula )) | 
| 47360 | 287 | | thf_subtype (( Type_fmla thf_subtype )) | 
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 288 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 289 | thf_binary_formula : thf_binary_pair (( thf_binary_pair )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 290 | | thf_binary_tuple (( thf_binary_tuple )) | 
| 47360 | 291 | | thf_binary_type (( Type_fmla thf_binary_type )) | 
| 46844 | 292 | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 293 | thf_binary_pair : thf_unitary_formula thf_pair_connective thf_unitary_formula (( | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 294 | Fmla (thf_pair_connective, [thf_unitary_formula1, thf_unitary_formula2]) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 295 | )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 296 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 297 | thf_binary_tuple : thf_or_formula (( thf_or_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 298 | | thf_and_formula (( thf_and_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 299 | | thf_apply_formula (( thf_apply_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 300 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 301 | thf_or_formula : thf_unitary_formula VLINE thf_unitary_formula (( Fmla (Interpreted_Logic Or, [thf_unitary_formula1, thf_unitary_formula2]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 302 | | thf_or_formula VLINE thf_unitary_formula (( Fmla (Interpreted_Logic Or, [thf_or_formula, thf_unitary_formula]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 303 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 304 | thf_and_formula : thf_unitary_formula AMPERSAND thf_unitary_formula (( Fmla (Interpreted_Logic And, [thf_unitary_formula1, thf_unitary_formula2]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 305 | | thf_and_formula AMPERSAND thf_unitary_formula (( Fmla (Interpreted_Logic And, [thf_and_formula, thf_unitary_formula]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 306 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 307 | thf_apply_formula : thf_unitary_formula AT_SIGN thf_unitary_formula (( Fmla (Interpreted_ExtraLogic Apply, [thf_unitary_formula1, thf_unitary_formula2]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 308 | | thf_apply_formula AT_SIGN thf_unitary_formula (( Fmla (Interpreted_ExtraLogic Apply, [thf_apply_formula, thf_unitary_formula]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 309 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 310 | thf_unitary_formula : thf_quantified_formula (( thf_quantified_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 311 | | thf_unary_formula (( thf_unary_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 312 | | thf_atom (( thf_atom )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 313 | | thf_conditional (( thf_conditional )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 314 | | thf_let (( thf_let )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 315 | | LPAREN thf_logic_formula RPAREN (( thf_logic_formula )) | 
| 46844 | 316 | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 317 | thf_quantified_formula : thf_quantifier LBRKT thf_variable_list RBRKT COLON thf_unitary_formula (( | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 318 | Quant (thf_quantifier, thf_variable_list, thf_unitary_formula) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 319 | )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 320 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 321 | thf_variable_list : thf_variable (( [thf_variable] )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 322 | | thf_variable COMMA thf_variable_list (( thf_variable :: thf_variable_list )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 323 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 324 | thf_variable : thf_typed_variable (( thf_typed_variable )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 325 | | variable_ (( (variable_, NONE) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 326 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 327 | thf_typed_variable : variable_ COLON thf_top_level_type (( (variable_, SOME thf_top_level_type) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 328 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 329 | thf_unary_formula : thf_unary_connective LPAREN thf_logic_formula RPAREN (( | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 330 | Fmla (thf_unary_connective, [thf_logic_formula]) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 331 | )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 332 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 333 | thf_atom : term (( Atom (THF_Atom_term term) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 334 | | thf_conn_term (( Atom (THF_Atom_conn_term thf_conn_term) )) | 
| 46844 | 335 | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 336 | thf_conditional : ITE_F LPAREN thf_logic_formula COMMA thf_logic_formula COMMA thf_logic_formula RPAREN (( | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 337 | Conditional (thf_logic_formula1, thf_logic_formula2, thf_logic_formula3) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 338 | )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 339 | |
| 53394 | 340 | (*NOTE support for Let in THF is still broken (cf. the spec). | 
| 341 | When it gets fixed, look at how TFF support is encoded in this file | |
| 342 | (to possibly replicate some of the checks done there)*) | |
| 343 | thf_let : LET_TF LPAREN thf_let_term_defn COMMA thf_formula RPAREN (( Let (thf_let_term_defn, thf_formula) )) | |
| 344 | | LET_FF LPAREN thf_let_formula_defn COMMA thf_formula RPAREN (( Let (thf_let_formula_defn, thf_formula) )) | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 345 | |
| 53394 | 346 | (*FIXME here could check that fmla is of right form (TPTP BNF (v5.3.0) L130-134) | 
| 347 | i.e. it should have "=" or "<=>" at the top level. | |
| 348 | We deviate from the spec by not checking this here, but "Let" support in THF | |
| 349 | is still not fully specified. | |
| 350 | *) | |
| 351 | thf_let_term_defn : thf_quantified_formula (( | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 352 | let | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 353 | val (_, vars, fmla) = extract_quant_info thf_quantified_formula | 
| 53394 | 354 | in Let_fmla (vars, fmla) | 
| 355 | end | |
| 356 | )) | |
| 357 | (*NOTE "thf_let_formula_defn" has the same definition as "thf_let_term_defn" (as per the spec)*) | |
| 358 | thf_let_formula_defn : thf_quantified_formula (( | |
| 359 | let | |
| 360 | val (_, vars, fmla) = extract_quant_info thf_quantified_formula | |
| 361 | in Let_fmla (vars, fmla) | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 362 | end | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 363 | )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 364 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 365 | thf_type_formula : thf_typeable_formula COLON thf_top_level_type (( (thf_typeable_formula, thf_top_level_type) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 366 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 367 | thf_typeable_formula : thf_atom (( thf_atom )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 368 | | LPAREN thf_logic_formula RPAREN (( thf_logic_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 369 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 370 | thf_subtype : constant SUBTYPE constant (( Subtype(constant1, constant2) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 371 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 372 | thf_top_level_type : thf_logic_formula (( Fmla_type thf_logic_formula )) | 
| 46844 | 373 | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 374 | thf_unitary_type : thf_unitary_formula (( Fmla_type thf_unitary_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 375 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 376 | thf_binary_type : thf_mapping_type (( thf_mapping_type )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 377 | | thf_xprod_type (( thf_xprod_type )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 378 | | thf_union_type (( thf_union_type )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 379 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 380 | thf_mapping_type : thf_unitary_type ARROW thf_unitary_type (( Fn_type(thf_unitary_type1, thf_unitary_type2) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 381 | | thf_unitary_type ARROW thf_mapping_type (( Fn_type(thf_unitary_type, thf_mapping_type) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 382 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 383 | thf_xprod_type : thf_unitary_type TIMES thf_unitary_type (( Prod_type(thf_unitary_type1, thf_unitary_type2) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 384 | | thf_xprod_type TIMES thf_unitary_type (( Prod_type(thf_xprod_type, thf_unitary_type) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 385 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 386 | thf_union_type : thf_unitary_type PLUS thf_unitary_type (( Sum_type(thf_unitary_type1, thf_unitary_type2) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 387 | | thf_union_type PLUS thf_unitary_type (( Sum_type(thf_union_type, thf_unitary_type) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 388 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 389 | thf_sequent : thf_tuple GENTZEN_ARROW thf_tuple (( Sequent(thf_tuple1, thf_tuple2) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 390 | | LPAREN thf_sequent RPAREN (( thf_sequent )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 391 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 392 | thf_tuple : LBRKT RBRKT (( [] )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 393 | | LBRKT thf_tuple_list RBRKT (( thf_tuple_list )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 394 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 395 | thf_tuple_list : thf_logic_formula (( [thf_logic_formula] )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 396 | | thf_logic_formula COMMA thf_tuple_list (( thf_logic_formula :: thf_tuple_list )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 397 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 398 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 399 | (* TFF Formulas *) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 400 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 401 | tff_formula : tff_logic_formula (( tff_logic_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 402 | | tff_typed_atom (( Atom (TFF_Typed_Atom tff_typed_atom) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 403 | | tff_sequent (( tff_sequent )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 404 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 405 | tff_logic_formula : tff_binary_formula (( tff_binary_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 406 | | tff_unitary_formula (( tff_unitary_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 407 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 408 | tff_binary_formula : tff_binary_nonassoc (( tff_binary_nonassoc )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 409 | | tff_binary_assoc (( tff_binary_assoc )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 410 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 411 | tff_binary_nonassoc : tff_unitary_formula binary_connective tff_unitary_formula (( Fmla (binary_connective, [tff_unitary_formula1, tff_unitary_formula2]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 412 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 413 | tff_binary_assoc : tff_or_formula (( tff_or_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 414 | | tff_and_formula (( tff_and_formula )) | 
| 46844 | 415 | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 416 | tff_or_formula : tff_unitary_formula VLINE tff_unitary_formula (( Fmla (Interpreted_Logic Or, [tff_unitary_formula1, tff_unitary_formula2]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 417 | | tff_or_formula VLINE tff_unitary_formula (( Fmla (Interpreted_Logic Or, [tff_or_formula, tff_unitary_formula]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 418 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 419 | tff_and_formula : tff_unitary_formula AMPERSAND tff_unitary_formula (( Fmla (Interpreted_Logic And, [tff_unitary_formula1, tff_unitary_formula2]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 420 | | tff_and_formula AMPERSAND tff_unitary_formula (( Fmla (Interpreted_Logic And, [tff_and_formula, tff_unitary_formula]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 421 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 422 | tff_unitary_formula : tff_quantified_formula (( tff_quantified_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 423 | | tff_unary_formula (( tff_unary_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 424 | | atomic_formula (( atomic_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 425 | | tff_conditional (( tff_conditional )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 426 | | tff_let (( tff_let )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 427 | | LPAREN tff_logic_formula RPAREN (( tff_logic_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 428 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 429 | tff_quantified_formula : fol_quantifier LBRKT tff_variable_list RBRKT COLON tff_unitary_formula (( | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 430 | Quant (fol_quantifier, tff_variable_list, tff_unitary_formula) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 431 | )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 432 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 433 | tff_variable_list : tff_variable (( [tff_variable] )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 434 | | tff_variable COMMA tff_variable_list (( tff_variable :: tff_variable_list )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 435 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 436 | tff_variable : tff_typed_variable (( tff_typed_variable )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 437 | | variable_ (( (variable_, NONE) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 438 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 439 | tff_typed_variable : variable_ COLON tff_atomic_type (( (variable_, SOME tff_atomic_type) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 440 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 441 | tff_unary_formula : unary_connective tff_unitary_formula (( Fmla (unary_connective, [tff_unitary_formula]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 442 | | fol_infix_unary (( fol_infix_unary )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 443 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 444 | tff_conditional : ITE_F LPAREN tff_logic_formula COMMA tff_logic_formula COMMA tff_logic_formula RPAREN (( | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 445 | Conditional (tff_logic_formula1, tff_logic_formula2, tff_logic_formula3) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 446 | )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 447 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 448 | tff_let : LET_TF LPAREN tff_let_term_defn COMMA tff_formula RPAREN ((Let (tff_let_term_defn, tff_formula) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 449 | | LET_FF LPAREN tff_let_formula_defn COMMA tff_formula RPAREN (( Let (tff_let_formula_defn, tff_formula) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 450 | |
| 53394 | 451 | |
| 452 | tff_let_term_defn : EXCLAMATION LBRKT tff_variable_list RBRKT COLON tff_let_term_binding (( Let_term (tff_variable_list, tff_let_term_binding) )) | |
| 453 | | tff_let_term_binding (( Let_term ([], tff_let_term_binding) )) | |
| 454 | ||
| 53395 
a1a78a271682
updated TPTP parser to conform to version 5.5.0 (but excluding the TPI language since its parser spec is still incomplete);
 sultana parents: 
53394diff
changeset | 455 | tff_let_term_binding : term EQUALS term (( Term_Func (Interpreted_ExtraLogic Apply, [term1, term2]) )) | 
| 
a1a78a271682
updated TPTP parser to conform to version 5.5.0 (but excluding the TPI language since its parser spec is still incomplete);
 sultana parents: 
53394diff
changeset | 456 | | LPAREN tff_let_term_binding RPAREN (( tff_let_term_binding )) | 
| 46844 | 457 | |
| 53394 | 458 | tff_let_formula_defn : EXCLAMATION LBRKT tff_variable_list RBRKT COLON tff_let_formula_binding (( Let_fmla (tff_variable_list, tff_let_formula_binding) )) | 
| 459 | | tff_let_formula_binding (( Let_fmla ([], tff_let_formula_binding) )) | |
| 460 | ||
| 53395 
a1a78a271682
updated TPTP parser to conform to version 5.5.0 (but excluding the TPI language since its parser spec is still incomplete);
 sultana parents: 
53394diff
changeset | 461 | tff_let_formula_binding : atomic_formula IFF tff_unitary_formula (( Fmla (Interpreted_Logic Iff, [atomic_formula, tff_unitary_formula]) )) | 
| 
a1a78a271682
updated TPTP parser to conform to version 5.5.0 (but excluding the TPI language since its parser spec is still incomplete);
 sultana parents: 
53394diff
changeset | 462 | | LPAREN tff_let_formula_binding RPAREN (( tff_let_formula_binding )) | 
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 463 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 464 | tff_sequent : tff_tuple GENTZEN_ARROW tff_tuple (( Sequent (tff_tuple1, tff_tuple2) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 465 | | LPAREN tff_sequent RPAREN (( tff_sequent )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 466 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 467 | tff_tuple : LBRKT RBRKT (( [] )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 468 | | LBRKT tff_tuple_list RBRKT (( tff_tuple_list )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 469 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 470 | tff_tuple_list : tff_logic_formula COMMA tff_tuple_list (( tff_logic_formula :: tff_tuple_list )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 471 | | tff_logic_formula (( [tff_logic_formula] )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 472 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 473 | tff_typed_atom : tff_untyped_atom COLON tff_top_level_type (( (fst tff_untyped_atom, SOME tff_top_level_type) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 474 | | LPAREN tff_typed_atom RPAREN (( tff_typed_atom )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 475 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 476 | tff_untyped_atom : functor_ (( (functor_, NONE) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 477 | | system_functor (( (system_functor, NONE) )) | 
| 46844 | 478 | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 479 | tff_top_level_type : tff_atomic_type (( tff_atomic_type )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 480 | | tff_mapping_type (( tff_mapping_type )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 481 | | tff_quantified_type (( tff_quantified_type )) | 
| 53395 
a1a78a271682
updated TPTP parser to conform to version 5.5.0 (but excluding the TPI language since its parser spec is still incomplete);
 sultana parents: 
53394diff
changeset | 482 | | LPAREN tff_top_level_type RPAREN (( tff_top_level_type )) | 
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 483 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 484 | tff_quantified_type : DEP_PROD LBRKT tff_variable_list RBRKT COLON tff_monotype (( | 
| 47360 | 485 | Fmla_type (Quant (Dep_Prod, tff_variable_list, Type_fmla tff_monotype)) | 
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 486 | )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 487 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 488 | tff_monotype : tff_atomic_type (( tff_atomic_type )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 489 | | LPAREN tff_mapping_type RPAREN (( tff_mapping_type )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 490 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 491 | tff_unitary_type : tff_atomic_type (( tff_atomic_type )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 492 | | LPAREN tff_xprod_type RPAREN (( tff_xprod_type )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 493 | |
| 57808 | 494 | tff_atomic_type : atomic_word (( Atom_type (atomic_word, []) )) | 
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 495 | | defined_type (( Defined_type defined_type )) | 
| 47360 | 496 | | atomic_word LPAREN tff_type_arguments RPAREN (( Fmla_type (Fmla (Uninterpreted atomic_word, (map Type_fmla tff_type_arguments))) )) | 
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 497 | | variable_ (( Fmla_type (Pred (Interpreted_ExtraLogic Apply, [Term_Var variable_])) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 498 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 499 | tff_type_arguments : tff_atomic_type (( [tff_atomic_type] )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 500 | | tff_atomic_type COMMA tff_type_arguments (( tff_atomic_type :: tff_type_arguments )) | 
| 46844 | 501 | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 502 | tff_mapping_type : tff_unitary_type ARROW tff_atomic_type (( Fn_type(tff_unitary_type, tff_atomic_type) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 503 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 504 | tff_xprod_type : tff_atomic_type TIMES tff_atomic_type (( Prod_type(tff_atomic_type1, tff_atomic_type2) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 505 | | tff_xprod_type TIMES tff_atomic_type (( Prod_type(tff_xprod_type, tff_atomic_type) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 506 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 507 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 508 | (* FOF Formulas *) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 509 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 510 | fof_formula : fof_logic_formula (( fof_logic_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 511 | | fof_sequent (( fof_sequent )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 512 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 513 | fof_logic_formula : fof_binary_formula (( fof_binary_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 514 | | fof_unitary_formula (( fof_unitary_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 515 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 516 | fof_binary_formula : fof_binary_nonassoc (( fof_binary_nonassoc )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 517 | | fof_binary_assoc (( fof_binary_assoc )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 518 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 519 | fof_binary_nonassoc : fof_unitary_formula binary_connective fof_unitary_formula (( | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 520 | Fmla (binary_connective, [fof_unitary_formula1, fof_unitary_formula2] ) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 521 | )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 522 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 523 | fof_binary_assoc : fof_or_formula (( fof_or_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 524 | | fof_and_formula (( fof_and_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 525 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 526 | fof_or_formula : fof_unitary_formula VLINE fof_unitary_formula (( Fmla (Interpreted_Logic Or, [fof_unitary_formula1, fof_unitary_formula2]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 527 | | fof_or_formula VLINE fof_unitary_formula (( Fmla (Interpreted_Logic Or, [fof_or_formula, fof_unitary_formula]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 528 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 529 | fof_and_formula : fof_unitary_formula AMPERSAND fof_unitary_formula (( Fmla (Interpreted_Logic And, [fof_unitary_formula1, fof_unitary_formula2]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 530 | | fof_and_formula AMPERSAND fof_unitary_formula (( Fmla (Interpreted_Logic And, [fof_and_formula, fof_unitary_formula]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 531 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 532 | fof_unitary_formula : fof_quantified_formula (( fof_quantified_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 533 | | fof_unary_formula (( fof_unary_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 534 | | atomic_formula (( atomic_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 535 | | LPAREN fof_logic_formula RPAREN (( fof_logic_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 536 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 537 | fof_quantified_formula : fol_quantifier LBRKT fof_variable_list RBRKT COLON fof_unitary_formula (( | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 538 | Quant (fol_quantifier, map (fn v => (v, NONE)) fof_variable_list, fof_unitary_formula) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 539 | )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 540 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 541 | fof_variable_list : variable_ (( [variable_] )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 542 | | variable_ COMMA fof_variable_list (( variable_ :: fof_variable_list )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 543 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 544 | fof_unary_formula : unary_connective fof_unitary_formula (( Fmla (unary_connective, [fof_unitary_formula]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 545 | | fol_infix_unary (( fol_infix_unary )) | 
| 46844 | 546 | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 547 | fof_sequent : fof_tuple GENTZEN_ARROW fof_tuple (( Sequent (fof_tuple1, fof_tuple2) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 548 | | LPAREN fof_sequent RPAREN (( fof_sequent )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 549 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 550 | fof_tuple : LBRKT RBRKT (( [] )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 551 | | LBRKT fof_tuple_list RBRKT (( fof_tuple_list )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 552 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 553 | fof_tuple_list : fof_logic_formula (( [fof_logic_formula] )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 554 | | fof_logic_formula COMMA fof_tuple_list (( fof_logic_formula :: fof_tuple_list )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 555 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 556 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 557 | (* CNF Formulas *) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 558 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 559 | cnf_formula : LPAREN disjunction RPAREN (( disjunction )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 560 | | disjunction (( disjunction )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 561 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 562 | disjunction : literal (( literal )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 563 | | disjunction VLINE literal (( Fmla (Interpreted_Logic Or, [disjunction, literal]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 564 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 565 | literal : atomic_formula (( atomic_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 566 | | TILDE atomic_formula (( Fmla (Interpreted_Logic Not, [atomic_formula]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 567 | | fol_infix_unary (( fol_infix_unary )) | 
| 46844 | 568 | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 569 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 570 | (* Special Formulas *) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 571 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 572 | thf_conn_term : thf_pair_connective (( thf_pair_connective )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 573 | | assoc_connective (( assoc_connective )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 574 | | thf_unary_connective (( thf_unary_connective )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 575 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 576 | fol_infix_unary : term infix_inequality term (( Pred (infix_inequality, [term1, term2]) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 577 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 578 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 579 | (* Connectives - THF *) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 580 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 581 | thf_quantifier : fol_quantifier (( fol_quantifier )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 582 | | CARET (( Lambda )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 583 | | DEP_PROD (( Dep_Prod )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 584 | | DEP_SUM (( Dep_Sum )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 585 | | INDEF_CHOICE (( Epsilon )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 586 | | DEFIN_CHOICE (( Iota )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 587 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 588 | thf_pair_connective : infix_equality (( infix_equality )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 589 | | infix_inequality (( infix_inequality )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 590 | | binary_connective (( binary_connective )) | 
| 46844 | 591 | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 592 | thf_unary_connective : unary_connective (( unary_connective )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 593 | | OPERATOR_FORALL (( Interpreted_Logic Op_Forall )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 594 | | OPERATOR_EXISTS (( Interpreted_Logic Op_Exists )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 595 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 596 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 597 | (* Connectives - THF and TFF | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 598 | instead of subtype_sign use token SUBTYPE | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 599 | *) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 600 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 601 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 602 | (* Connectives - FOF *) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 603 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 604 | fol_quantifier : EXCLAMATION (( Forall )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 605 | | QUESTION (( Exists )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 606 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 607 | binary_connective : IFF (( Interpreted_Logic Iff )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 608 | | IMPLIES (( Interpreted_Logic If )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 609 | | FI (( Interpreted_Logic Fi )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 610 | | XOR (( Interpreted_Logic Xor )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 611 | | NOR (( Interpreted_Logic Nor )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 612 | | NAND (( Interpreted_Logic Nand )) | 
| 46844 | 613 | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 614 | assoc_connective : VLINE (( Interpreted_Logic Or )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 615 | | AMPERSAND (( Interpreted_Logic And )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 616 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 617 | unary_connective : TILDE (( Interpreted_Logic Not )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 618 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 619 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 620 | (* The sequent arrow | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 621 | use token GENTZEN_ARROW | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 622 | *) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 623 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 624 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 625 | (* Types for THF and TFF *) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 626 | |
| 47358 | 627 | defined_type : atomic_defined_word (( | 
| 628 | case atomic_defined_word of | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 629 | "$oType" => Type_Bool | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 630 | | "$o" => Type_Bool | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 631 | | "$iType" => Type_Ind | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 632 | | "$i" => Type_Ind | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 633 | | "$tType" => Type_Type | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 634 | | "$real" => Type_Real | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 635 | | "$rat" => Type_Rat | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 636 | | "$int" => Type_Int | 
| 57808 | 637 | | "$_" => Type_Dummy | 
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 638 |   | thing => raise UNRECOGNISED_SYMBOL ("defined_type", thing)
 | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 639 | )) | 
| 46844 | 640 | |
| 47358 | 641 | system_type : atomic_system_word (( atomic_system_word )) | 
| 46844 | 642 | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 643 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 644 | (* First-order atoms *) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 645 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 646 | atomic_formula : plain_atomic_formula (( plain_atomic_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 647 | | defined_atomic_formula (( defined_atomic_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 648 | | system_atomic_formula (( system_atomic_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 649 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 650 | plain_atomic_formula : plain_term (( Pred plain_term )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 651 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 652 | defined_atomic_formula : defined_plain_formula (( defined_plain_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 653 | | defined_infix_formula (( defined_infix_formula )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 654 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 655 | defined_plain_formula : defined_plain_term (( Pred defined_plain_term )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 656 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 657 | (*FIXME not used*) | 
| 47358 | 658 | defined_prop : atomic_defined_word (( | 
| 659 | case atomic_defined_word of | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 660 | "$true" => "$true" | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 661 | | "$false" => "$false" | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 662 |   | thing => raise UNRECOGNISED_SYMBOL ("defined_prop", thing)
 | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 663 | )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 664 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 665 | (*FIXME not used*) | 
| 47358 | 666 | defined_pred : atomic_defined_word (( | 
| 667 | case atomic_defined_word of | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 668 | "$distinct" => "$distinct" | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 669 | | "$ite_f" => "$ite_f" | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 670 | | "$less" => "$less" | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 671 | | "$lesseq" => "$lesseq" | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 672 | | "$greater" => "$greater" | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 673 | | "$greatereq" => "$greatereq" | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 674 | | "$is_int" => "$is_int" | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 675 | | "$is_rat" => "$is_rat" | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 676 |   | thing => raise UNRECOGNISED_SYMBOL ("defined_pred", thing)
 | 
| 46844 | 677 | )) | 
| 678 | ||
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 679 | defined_infix_formula : term defined_infix_pred term ((Pred (defined_infix_pred, [term1, term2]))) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 680 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 681 | defined_infix_pred : infix_equality (( infix_equality )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 682 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 683 | infix_equality : EQUALS (( Interpreted_Logic Equals )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 684 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 685 | infix_inequality : NEQUALS (( Interpreted_Logic NEquals )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 686 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 687 | system_atomic_formula : system_term (( Pred system_term )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 688 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 689 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 690 | (* First-order terms *) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 691 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 692 | term : function_term (( function_term )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 693 | | variable_ (( Term_Var variable_ )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 694 | | conditional_term (( conditional_term )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 695 | | let_term (( let_term )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 696 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 697 | function_term : plain_term (( Term_Func plain_term )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 698 | | defined_term (( defined_term )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 699 | | system_term (( Term_Func system_term )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 700 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 701 | plain_term : constant (( (constant, []) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 702 | | functor_ LPAREN arguments RPAREN (( (functor_, arguments) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 703 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 704 | constant : functor_ (( functor_ )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 705 | |
| 46844 | 706 | functor_ : atomic_word (( Uninterpreted atomic_word )) | 
| 707 | ||
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 708 | defined_term : defined_atom (( defined_atom )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 709 | | defined_atomic_term (( defined_atomic_term )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 710 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 711 | defined_atom : number (( Term_Num number )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 712 | | DISTINCT_OBJECT (( Term_Distinct_Object DISTINCT_OBJECT )) | 
| 46844 | 713 | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 714 | defined_atomic_term : defined_plain_term (( Term_Func defined_plain_term )) | 
| 46844 | 715 | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 716 | defined_plain_term : defined_constant (( (defined_constant, []) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 717 | | defined_functor LPAREN arguments RPAREN (( (defined_functor, arguments) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 718 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 719 | defined_constant : defined_functor (( defined_functor )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 720 | |
| 47358 | 721 | (*FIXME would be nicer to split these up*) | 
| 722 | defined_functor : atomic_defined_word (( | |
| 723 | case atomic_defined_word of | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 724 | "$uminus" => Interpreted_ExtraLogic UMinus | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 725 | | "$sum" => Interpreted_ExtraLogic Sum | 
| 46844 | 726 | | "$difference" => Interpreted_ExtraLogic Difference | 
| 727 | | "$product" => Interpreted_ExtraLogic Product | |
| 728 | | "$quotient" => Interpreted_ExtraLogic Quotient | |
| 729 | | "$quotient_e" => Interpreted_ExtraLogic Quotient_E | |
| 730 | | "$quotient_t" => Interpreted_ExtraLogic Quotient_T | |
| 731 | | "$quotient_f" => Interpreted_ExtraLogic Quotient_F | |
| 732 | | "$remainder_e" => Interpreted_ExtraLogic Remainder_E | |
| 733 | | "$remainder_t" => Interpreted_ExtraLogic Remainder_T | |
| 734 | | "$remainder_f" => Interpreted_ExtraLogic Remainder_F | |
| 735 | | "$floor" => Interpreted_ExtraLogic Floor | |
| 736 | | "$ceiling" => Interpreted_ExtraLogic Ceiling | |
| 737 | | "$truncate" => Interpreted_ExtraLogic Truncate | |
| 738 | | "$round" => Interpreted_ExtraLogic Round | |
| 739 | | "$to_int" => Interpreted_ExtraLogic To_Int | |
| 740 | | "$to_rat" => Interpreted_ExtraLogic To_Rat | |
| 741 | | "$to_real" => Interpreted_ExtraLogic To_Real | |
| 742 | ||
| 743 | | "$i" => TypeSymbol Type_Ind | |
| 744 | | "$o" => TypeSymbol Type_Bool | |
| 745 | | "$iType" => TypeSymbol Type_Ind | |
| 746 | | "$oType" => TypeSymbol Type_Bool | |
| 747 | | "$int" => TypeSymbol Type_Int | |
| 748 | | "$real" => TypeSymbol Type_Real | |
| 749 | | "$rat" => TypeSymbol Type_Rat | |
| 750 | | "$tType" => TypeSymbol Type_Type | |
| 57808 | 751 | | "$_" => TypeSymbol Type_Dummy | 
| 46844 | 752 | |
| 753 | | "$true" => Interpreted_Logic True | |
| 754 | | "$false" => Interpreted_Logic False | |
| 755 | ||
| 756 | | "$less" => Interpreted_ExtraLogic Less | |
| 757 | | "$lesseq" => Interpreted_ExtraLogic LessEq | |
| 758 | | "$greatereq" => Interpreted_ExtraLogic GreaterEq | |
| 759 | | "$greater" => Interpreted_ExtraLogic Greater | |
| 760 | | "$evaleq" => Interpreted_ExtraLogic EvalEq | |
| 761 | ||
| 762 | | "$is_int" => Interpreted_ExtraLogic Is_Int | |
| 763 | | "$is_rat" => Interpreted_ExtraLogic Is_Rat | |
| 764 | ||
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 765 | | "$distinct" => Interpreted_ExtraLogic Distinct | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 766 | |
| 46844 | 767 |   | thing => raise UNRECOGNISED_SYMBOL ("defined_functor", thing)
 | 
| 768 | )) | |
| 769 | ||
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 770 | system_term : system_constant (( (system_constant, []) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 771 | | system_functor LPAREN arguments RPAREN (( (system_functor, arguments) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 772 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 773 | system_constant : system_functor (( system_functor )) | 
| 46844 | 774 | |
| 47358 | 775 | system_functor : atomic_system_word (( System atomic_system_word )) | 
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 776 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 777 | variable_ : UPPER_WORD (( UPPER_WORD )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 778 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 779 | arguments : term (( [term] )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 780 | | term COMMA arguments (( term :: arguments )) | 
| 46844 | 781 | |
| 782 | conditional_term : ITE_T LPAREN tff_logic_formula COMMA term COMMA term RPAREN (( | |
| 783 | Term_Conditional (tff_logic_formula, term1, term2) | |
| 784 | )) | |
| 785 | ||
| 786 | ||
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 787 | let_term : LET_FT LPAREN tff_let_formula_defn COMMA term RPAREN ((Term_Let (tff_let_formula_defn, term) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 788 | | LET_TT LPAREN tff_let_term_defn COMMA term RPAREN ((Term_Let (tff_let_term_defn, term) )) | 
| 46844 | 789 | |
| 790 | ||
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 791 | (* Formula sources | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 792 | Don't currently use following non-terminals: | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 793 | source, sources, dag_source, inference_record, inference_rule, parent_list, | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 794 | parent_info, parent_details, internal_source, intro_type, external_source, | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 795 | file_source, file_info, theory, theory_name, creator_source, creator_name. | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 796 | *) | 
| 46844 | 797 | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 798 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 799 | (* Useful info fields *) | 
| 46844 | 800 | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 801 | optional_info : COMMA useful_info (( useful_info )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 802 | | (( [] )) | 
| 46844 | 803 | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 804 | useful_info : general_list (( general_list )) | 
| 46844 | 805 | |
| 806 | include_ : INCLUDE LPAREN file_name formula_selection RPAREN PERIOD (( | |
| 47569 
fce9d97a3258
exceptions related to interpreting tptp problems now mention the relevant position in the tptp file;
 sultana parents: 
47360diff
changeset | 807 | Include ((this_file_name, INCLUDEleft + 1, INCLUDEright + 1), | 
| 
fce9d97a3258
exceptions related to interpreting tptp problems now mention the relevant position in the tptp file;
 sultana parents: 
47360diff
changeset | 808 | file_name, formula_selection) | 
| 46844 | 809 | )) | 
| 810 | ||
| 811 | formula_selection : COMMA LBRKT name_list RBRKT (( name_list )) | |
| 812 | | (( [] )) | |
| 813 | ||
| 814 | name_list : name COMMA name_list (( name :: name_list )) | |
| 815 | | name (( [name] )) | |
| 816 | ||
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 817 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 818 | (* Non-logical data *) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 819 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 820 | general_term : general_data (( General_Data general_data )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 821 | | general_data COLON general_term (( General_Term (general_data, general_term) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 822 | | general_list (( General_List general_list )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 823 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 824 | general_data : atomic_word (( Atomic_Word atomic_word )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 825 | | general_function (( general_function )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 826 | | variable_ (( V variable_ )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 827 | | number (( Number number )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 828 | | DISTINCT_OBJECT (( Distinct_Object DISTINCT_OBJECT )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 829 | | formula_data (( formula_data )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 830 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 831 | general_function: atomic_word LPAREN general_terms RPAREN (( Application (atomic_word, general_terms) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 832 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 833 | formula_data : DTHF LPAREN thf_formula RPAREN (( Formula_Data (THF, thf_formula) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 834 | | DTFF LPAREN tff_formula RPAREN (( Formula_Data (TFF, tff_formula) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 835 | | DFOF LPAREN fof_formula RPAREN (( Formula_Data (FOF, fof_formula) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 836 | | DCNF LPAREN cnf_formula RPAREN (( Formula_Data (CNF, cnf_formula) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 837 | | DFOT LPAREN term RPAREN (( Term_Data term )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 838 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 839 | general_list : LBRKT general_terms RBRKT (( general_terms )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 840 | | LBRKT RBRKT (( [] )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 841 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 842 | general_terms : general_term COMMA general_terms (( general_term :: general_terms )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 843 | | general_term (( [general_term] )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 844 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 845 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 846 | (* General purpose *) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 847 | |
| 46844 | 848 | name : atomic_word (( atomic_word )) | 
| 849 | | integer (( integer )) | |
| 850 | ||
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 851 | atomic_word : LOWER_WORD (( LOWER_WORD )) | 
| 47689 | 852 | | SINGLE_QUOTED (( dequote SINGLE_QUOTED )) | 
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 853 | | THF (( "thf" )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 854 | | TFF (( "tff" )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 855 | | FOF (( "fof" )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 856 | | CNF (( "cnf" )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 857 | | INCLUDE (( "include" )) | 
| 46844 | 858 | |
| 47358 | 859 | atomic_defined_word : DOLLAR_WORD (( DOLLAR_WORD )) | 
| 860 | ||
| 861 | atomic_system_word : DOLLAR_DOLLAR_WORD (( DOLLAR_DOLLAR_WORD )) | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 862 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 863 | integer: UNSIGNED_INTEGER (( UNSIGNED_INTEGER )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 864 | | SIGNED_INTEGER (( SIGNED_INTEGER )) | 
| 46844 | 865 | |
| 47357 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 866 | number : integer (( (Int_num, integer) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 867 | | REAL (( (Real_num, REAL) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 868 | | RATIONAL (( (Rat_num, RATIONAL) )) | 
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 869 | |
| 
15e579392a68
refactored tptp yacc to bring close to official spec;
 sultana parents: 
46844diff
changeset | 870 | file_name : SINGLE_QUOTED (( SINGLE_QUOTED )) |