230 (* Title: HOL/TPTP/TPTP_Parser/tptp.yacc |
230 (* Title: HOL/TPTP/TPTP_Parser/tptp.yacc |
231 Author: Nik Sultana, Cambridge University Computer Laboratory |
231 Author: Nik Sultana, Cambridge University Computer Laboratory |
232 |
232 |
233 Parser for TPTP languages. Latest version of the language spec can |
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 |
234 be obtained from http://www.cs.miami.edu/~tptp/TPTP/SyntaxBNF.html |
235 Our parser implements version 5.4.0 of that spec. |
235 Our parser implements version 5.5.0 of that spec, except for the TPI |
|
236 language since its (parser) spec is still incomplete. |
236 *) |
237 *) |
237 |
238 |
238 tptp : tptp_file (( tptp_file )) |
239 tptp : tptp_file (( tptp_file )) |
239 |
240 |
240 tptp_file : tptp_input tptp_file (( tptp_input :: tptp_file )) |
241 tptp_file : tptp_input tptp_file (( tptp_input :: tptp_file )) |
449 |
450 |
450 |
451 |
451 tff_let_term_defn : EXCLAMATION LBRKT tff_variable_list RBRKT COLON tff_let_term_binding (( Let_term (tff_variable_list, tff_let_term_binding) )) |
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) )) |
452 | tff_let_term_binding (( Let_term ([], tff_let_term_binding) )) |
453 | tff_let_term_binding (( Let_term ([], tff_let_term_binding) )) |
453 |
454 |
454 tff_let_term_binding : term EQUALS term (( |
455 tff_let_term_binding : term EQUALS term (( Term_Func (Interpreted_ExtraLogic Apply, [term1, term2]) )) |
455 Term_Func (Interpreted_ExtraLogic Apply, [term1, term2]) |
456 | LPAREN tff_let_term_binding RPAREN (( tff_let_term_binding )) |
456 )) |
|
457 |
457 |
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) )) |
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) )) |
459 | tff_let_formula_binding (( Let_fmla ([], tff_let_formula_binding) )) |
460 |
460 |
461 tff_let_formula_binding : atomic_formula IFF tff_unitary_formula (( |
461 tff_let_formula_binding : atomic_formula IFF tff_unitary_formula (( Fmla (Interpreted_Logic Iff, [atomic_formula, tff_unitary_formula]) )) |
462 Fmla (Interpreted_Logic Iff, [atomic_formula, tff_unitary_formula]) |
462 | LPAREN tff_let_formula_binding RPAREN (( tff_let_formula_binding )) |
463 )) |
|
464 |
463 |
465 tff_sequent : tff_tuple GENTZEN_ARROW tff_tuple (( Sequent (tff_tuple1, tff_tuple2) )) |
464 tff_sequent : tff_tuple GENTZEN_ARROW tff_tuple (( Sequent (tff_tuple1, tff_tuple2) )) |
466 | LPAREN tff_sequent RPAREN (( tff_sequent )) |
465 | LPAREN tff_sequent RPAREN (( tff_sequent )) |
467 |
466 |
468 tff_tuple : LBRKT RBRKT (( [] )) |
467 tff_tuple : LBRKT RBRKT (( [] )) |
478 | system_functor (( (system_functor, NONE) )) |
477 | system_functor (( (system_functor, NONE) )) |
479 |
478 |
480 tff_top_level_type : tff_atomic_type (( tff_atomic_type )) |
479 tff_top_level_type : tff_atomic_type (( tff_atomic_type )) |
481 | tff_mapping_type (( tff_mapping_type )) |
480 | tff_mapping_type (( tff_mapping_type )) |
482 | tff_quantified_type (( tff_quantified_type )) |
481 | tff_quantified_type (( tff_quantified_type )) |
|
482 | LPAREN tff_top_level_type RPAREN (( tff_top_level_type )) |
483 |
483 |
484 tff_quantified_type : DEP_PROD LBRKT tff_variable_list RBRKT COLON tff_monotype (( |
484 tff_quantified_type : DEP_PROD LBRKT tff_variable_list RBRKT COLON tff_monotype (( |
485 Fmla_type (Quant (Dep_Prod, tff_variable_list, Type_fmla tff_monotype)) |
485 Fmla_type (Quant (Dep_Prod, tff_variable_list, Type_fmla tff_monotype)) |
486 )) |
486 )) |
487 | LPAREN tff_quantified_type RPAREN (( tff_quantified_type )) |
|
488 |
487 |
489 tff_monotype : tff_atomic_type (( tff_atomic_type )) |
488 tff_monotype : tff_atomic_type (( tff_atomic_type )) |
490 | LPAREN tff_mapping_type RPAREN (( tff_mapping_type )) |
489 | LPAREN tff_mapping_type RPAREN (( tff_mapping_type )) |
491 |
490 |
492 tff_unitary_type : tff_atomic_type (( tff_atomic_type )) |
491 tff_unitary_type : tff_atomic_type (( tff_atomic_type )) |
499 |
498 |
500 tff_type_arguments : tff_atomic_type (( [tff_atomic_type] )) |
499 tff_type_arguments : tff_atomic_type (( [tff_atomic_type] )) |
501 | tff_atomic_type COMMA tff_type_arguments (( tff_atomic_type :: tff_type_arguments )) |
500 | tff_atomic_type COMMA tff_type_arguments (( tff_atomic_type :: tff_type_arguments )) |
502 |
501 |
503 tff_mapping_type : tff_unitary_type ARROW tff_atomic_type (( Fn_type(tff_unitary_type, tff_atomic_type) )) |
502 tff_mapping_type : tff_unitary_type ARROW tff_atomic_type (( Fn_type(tff_unitary_type, tff_atomic_type) )) |
504 | LPAREN tff_mapping_type RPAREN (( tff_mapping_type )) |
|
505 |
503 |
506 tff_xprod_type : tff_atomic_type TIMES tff_atomic_type (( Prod_type(tff_atomic_type1, tff_atomic_type2) )) |
504 tff_xprod_type : tff_atomic_type TIMES tff_atomic_type (( Prod_type(tff_atomic_type1, tff_atomic_type2) )) |
507 | tff_xprod_type TIMES tff_atomic_type (( Prod_type(tff_xprod_type, tff_atomic_type) )) |
505 | tff_xprod_type TIMES tff_atomic_type (( Prod_type(tff_xprod_type, tff_atomic_type) )) |
508 | LPAREN tff_xprod_type RPAREN (( tff_xprod_type )) |
|
509 |
506 |
510 |
507 |
511 (* FOF Formulas *) |
508 (* FOF Formulas *) |
512 |
509 |
513 fof_formula : fof_logic_formula (( fof_logic_formula )) |
510 fof_formula : fof_logic_formula (( fof_logic_formula )) |