![]() |
Connect++ 0.5.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 *) | |
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? | |
string | get_tptp_conversion_string () const |
Self-explanatory. | |
Private Member Functions | |
void | read_tptp_from_file (const string &) |
Read the file into a string, while stripping out and collecting comment blocks. | |
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. | |
string | tptp_conversion_string |
Used to build a string containing the TPTP-friendly description of the clause conversion. | |
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 658 of file TPTPParser.hpp.
TPTPParser::TPTPParser | ( | VariableIndex * | new_vip, |
FunctionIndex * | new_fip, | ||
TermIndex * | new_tip, | ||
PredicateIndex * | new_pip, | ||
Matrix * | new_matrix ) |
The only constructor that makes sense.
Definition at line 1406 of file TPTPParser.cpp.
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 1897 of file TPTPParser.cpp.
bool TPTPParser::conjecture_present | ( | ) | const |
Did a conjecture turn up anywhere in the parse?
Definition at line 2103 of file TPTPParser.cpp.
bool TPTPParser::equality_used | ( | ) |
Did equality turn up anywhere in the parse?
Definition at line 1944 of file TPTPParser.cpp.
bool TPTPParser::fof_conjecture_is_false | ( | ) | const |
Self-explanatory.
Definition at line 2126 of file TPTPParser.cpp.
bool TPTPParser::fof_conjecture_is_missing | ( | ) | const |
Was there a conjecture clause in the problem file?
Definition at line 2130 of file TPTPParser.cpp.
bool TPTPParser::fof_conjecture_is_true | ( | ) | const |
Self-explanatory.
Definition at line 2121 of file TPTPParser.cpp.
bool TPTPParser::fof_has_axioms | ( | ) | const |
Where there any axioms for an FOF problem before simplification?
Definition at line 2142 of file TPTPParser.cpp.
bool TPTPParser::fof_negated_conjecture_removed | ( | ) | const |
Was there a conjecture clause that got simplified away?
Definition at line 2134 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 1936 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 1956 of file TPTPParser.cpp.
string TPTPParser::get_problem_status | ( | ) |
The parse tries to identify the problem status.
Definition at line 1952 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 1940 of file TPTPParser.cpp.
|
inline |
Self-explanatory.
Definition at line 836 of file TPTPParser.hpp.
bool TPTPParser::negated_conjecture_present | ( | ) | const |
Did a negated conjecture turn up anywhere in the parse?
Definition at line 2107 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 2111 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 1948 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 1479 of file TPTPParser.cpp.
bool TPTPParser::problem_is_cnf_only | ( | ) | const |
Self-explanatory.
Definition at line 2117 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 1435 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 1885 of file TPTPParser.cpp.
bool TPTPParser::simplified_fof_has_axioms | ( | ) | const |
Where there any axioms for an FOF problem after simplification?
Definition at line 2138 of file TPTPParser.cpp.
|
private |
Each comment is stored here.
Definition at line 669 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 665 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 683 of file TPTPParser.hpp.
|
private |
The class has a pointer to the matrix, and can therefore construct it as it parses.
Definition at line 702 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 697 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 690 of file TPTPParser.hpp.
|
private |
Used to build a string containing the TPTP-friendly description of the clause conversion.
Definition at line 707 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 676 of file TPTPParser.hpp.