![]() |
Connect++ 0.7.0
A fast, readable connection prover for first-order logic.
|
Wrap up everything the TPTP parser needs to do inside a single class. More...
#include <TPTPParser.hpp>

Public Member Functions | |
| TPTPParser ()=delete | |
| You definitely don't want this constructor. | |
| TPTPParser (VariableIndex *, FunctionIndex *, TermIndex *, PredicateIndex *, Matrix *, TPTPRecords *) | |
| The only constructor that makes sense. | |
| bool | parse_tptp_from_file (const string &) |
| Main method to parse from a TPTP file to the data structures needed by the prover. | |
| void | show_file_includes () |
| Show any includes present in the TPTP file. | |
| void | clear () |
| Clear everything associated with the TPTP parser. | |
| vector< string > | get_defined_items () |
| Get a copy of tptp_parser::all_defined. | |
| vector< string > | get_system_items () |
| Get a copy of tptp_parser::all_system. | |
| bool | equality_used () |
| Did equality turn up anywhere in the parse? | |
| bool | conjecture_present () const |
| Did a conjecture turn up anywhere in the parse? | |
| bool | negated_conjecture_present () const |
| Did a negated conjecture turn up anywhere in the parse? | |
| bool | no_conjecture_clause () const |
| When you analysed the original problem, did you conclude that it has no conjecture clauses that can be used as a starting point? | |
| size_t | number_of_fof_formulas () const |
| How many first-order formulas turned up in the parse? | |
| string | get_problem_status () |
| The parse tries to identify the problem status. | |
| Predicate * | get_equals_predicate () const |
| If equality turned up anywhere in the parse it will have been turned into an actual Predicate, so this will give you a pointer to it. | |
| bool | problem_is_cnf_only () const |
| Self-explanatory. | |
| bool | fof_conjecture_is_true () const |
| Self-explanatory. | |
| bool | fof_conjecture_is_false () const |
| Self-explanatory. | |
| bool | fof_conjecture_is_missing () const |
| Was there a conjecture clause in the problem file? | |
| bool | fof_negated_conjecture_removed () const |
| Was there a conjecture clause that got simplified away? | |
| bool | simplified_fof_has_axioms () const |
| Where there any axioms for an FOF problem after simplification? | |
| bool | fof_has_axioms () const |
| Where there any axioms for an FOF problem before simplification? | |
Private Member Functions | |
| void | read_tptp_from_file (const string &) |
| Read the file into a string, while stripping out and collecting comment blocks. | |
| void | check_timeout () |
Private Attributes | |
| string | file_contents |
| Contents of the TPTP file, with comments removed. | |
| vector< string > | comment_blocks |
| Each comment is stored here. | |
| VariableIndex * | vip |
| The class has pointers to all the relevant indices. | |
| FunctionIndex * | fip |
| The class has pointers to all the relevant indices. | |
| TermIndex * | tip |
| The class has pointers to all the relevant indices. | |
| PredicateIndex * | pip |
| The class has pointers to all the relevant indices. | |
| Matrix * | matrix |
| The class has a pointer to the matrix, and can therefore construct it as it parses. | |
| TPTPRecords * | tptp_proof_output_p |
| Used to build the complete TPTP description of the proof process that's completed by the parser. | |
Wrap up everything the TPTP parser needs to do inside a single class.
This class needs access to the assorted indices employed by the prover because they are the only things anyone should be using to make Terms, Variables etc.
If you construct this properly and use parse_tptp_from_file, then after a successful parse the indices have everything ready to go.
Definition at line 661 of file TPTPParser.hpp.
| TPTPParser::TPTPParser | ( | VariableIndex * | new_vip, |
| FunctionIndex * | new_fip, | ||
| TermIndex * | new_tip, | ||
| PredicateIndex * | new_pip, | ||
| Matrix * | new_matrix, | ||
| TPTPRecords * | _records_p ) |
The only constructor that makes sense.
Definition at line 1421 of file TPTPParser.cpp.
|
inlineprivate |
Periodically, we need to check whether we've exceeded the global timeout.
Definition at line 725 of file TPTPParser.hpp.
| void TPTPParser::clear | ( | ) |
Clear everything associated with the TPTP parser.
Note that this is slightly messy because it also clears all the supporting stuff that's global in the tptp_parser namespace. Yes, very ugly. What ya gonna do about it!!??
Definition at line 1912 of file TPTPParser.cpp.
| bool TPTPParser::conjecture_present | ( | ) | const |
Did a conjecture turn up anywhere in the parse?
Definition at line 2126 of file TPTPParser.cpp.
| bool TPTPParser::equality_used | ( | ) |
Did equality turn up anywhere in the parse?
Definition at line 1963 of file TPTPParser.cpp.
| bool TPTPParser::fof_conjecture_is_false | ( | ) | const |
Self-explanatory.
Definition at line 2149 of file TPTPParser.cpp.
| bool TPTPParser::fof_conjecture_is_missing | ( | ) | const |
Was there a conjecture clause in the problem file?
Definition at line 2153 of file TPTPParser.cpp.
| bool TPTPParser::fof_conjecture_is_true | ( | ) | const |
Self-explanatory.
Definition at line 2144 of file TPTPParser.cpp.
| bool TPTPParser::fof_has_axioms | ( | ) | const |
Where there any axioms for an FOF problem before simplification?
Definition at line 2165 of file TPTPParser.cpp.
| bool TPTPParser::fof_negated_conjecture_removed | ( | ) | const |
Was there a conjecture clause that got simplified away?
Definition at line 2157 of file TPTPParser.cpp.
| vector< string > TPTPParser::get_defined_items | ( | ) |
Get a copy of tptp_parser::all_defined.
These are gathered during the parse and may be useful.
Definition at line 1955 of file TPTPParser.cpp.
| Predicate * TPTPParser::get_equals_predicate | ( | ) | const |
If equality turned up anywhere in the parse it will have been turned into an actual Predicate, so this will give you a pointer to it.
Definition at line 1975 of file TPTPParser.cpp.
| string TPTPParser::get_problem_status | ( | ) |
The parse tries to identify the problem status.
Definition at line 1971 of file TPTPParser.cpp.
| vector< string > TPTPParser::get_system_items | ( | ) |
Get a copy of tptp_parser::all_system.
These are gathered during the parse and may be useful.
Definition at line 1959 of file TPTPParser.cpp.
| bool TPTPParser::negated_conjecture_present | ( | ) | const |
Did a negated conjecture turn up anywhere in the parse?
Definition at line 2130 of file TPTPParser.cpp.
| bool TPTPParser::no_conjecture_clause | ( | ) | const |
When you analysed the original problem, did you conclude that it has no conjecture clauses that can be used as a starting point?
Definition at line 2134 of file TPTPParser.cpp.
| size_t TPTPParser::number_of_fof_formulas | ( | ) | const |
How many first-order formulas turned up in the parse?
Definition at line 1967 of file TPTPParser.cpp.
| bool TPTPParser::parse_tptp_from_file | ( | const string & | file_name | ) |
Main method to parse from a TPTP file to the data structures needed by the prover.
This first uses read_tptp_from_file to strip out comments. It then uses TPTP_file_grammar with qi::phrase_parse to parse the file.
As a side effect of that, a bunch of things such as all_clauses and clause_roles, which are global in the tptp_parser namespace, get set up. These are then used to populate the matrix etc.
| file_name | Reference to string containing the file name. |
Definition at line 1497 of file TPTPParser.cpp.
| bool TPTPParser::problem_is_cnf_only | ( | ) | const |
Self-explanatory.
Definition at line 2140 of file TPTPParser.cpp.
|
private |
Read the file into a string, while stripping out and collecting comment blocks.
(Yes, better done with a custom skip parser, but writing those is a pain.)
| file_name | Reference to a string containing the file name |
Definition at line 1453 of file TPTPParser.cpp.
| void TPTPParser::show_file_includes | ( | ) |
Show any includes present in the TPTP file.
These are collected as part of the parse.
Definition at line 1900 of file TPTPParser.cpp.
| bool TPTPParser::simplified_fof_has_axioms | ( | ) | const |
Where there any axioms for an FOF problem after simplification?
Definition at line 2161 of file TPTPParser.cpp.
|
private |
Each comment is stored here.
Definition at line 672 of file TPTPParser.hpp.
|
private |
Contents of the TPTP file, with comments removed.
Assuming of course that you used read_tptp_from_file.
Definition at line 668 of file TPTPParser.hpp.
|
private |
The class has pointers to all the relevant indices.
These are used directly to make the actual data structures used by the prover.
Definition at line 686 of file TPTPParser.hpp.
|
private |
The class has a pointer to the matrix, and can therefore construct it as it parses.
Definition at line 705 of file TPTPParser.hpp.
|
private |
The class has pointers to all the relevant indices.
These are used directly to make the actual data structures used by the prover.
Definition at line 700 of file TPTPParser.hpp.
|
private |
The class has pointers to all the relevant indices.
These are used directly to make the actual data structures used by the prover.
Definition at line 693 of file TPTPParser.hpp.
|
private |
Used to build the complete TPTP description of the proof process that's completed by the parser.
Definition at line 710 of file TPTPParser.hpp.
|
private |
The class has pointers to all the relevant indices.
These are used directly to make the actual data structures used by the prover.
Definition at line 679 of file TPTPParser.hpp.