![]() |
Connect++ 0.4.0
A fast, readable connection prover for first-order logic.
|
The tptp_parser namespace contains a lot of stuff that's essentially just global. More...
Classes | |
struct | cnf_annotated_grammar |
struct | cnf_annotated_struct |
Parser's representation of a Clause. More... | |
struct | cnf_formula_grammar |
struct | fof_annotated_grammar |
struct | fof_atomic_formula_grammar |
struct | fof_defined_infix_formula_grammar |
struct | fof_formula_grammar |
struct | fof_infix_unary_grammar |
struct | fof_plain_term_struct |
Recursive data structure for Terms. More... | |
struct | fof_term_grammar |
struct | include_grammar |
struct | infix_struct |
Structure for fof_defined_infix_formula and fof_infix_unary. More... | |
struct | literal_grammar |
struct | TPTP_file_grammar |
Typedefs | |
using | Iter = string::const_iterator |
Iterator type for parser rules and grammars. | |
using | fof_arguments_struct |
Variant - Term arguments can be Variables or other Terms. | |
using | fof_atomic_formula_type |
An atomic formula can be infix as well. | |
Functions | |
void | read_tptp_from_file_simple (const string &file_name, string &file_contents) |
void | recursive_tptp_include (const FileIncludeItem &include_item) |
Variables | |
VariableIndex * | var_index_p |
FunctionIndex * | fun_index_p |
TermIndex * | t_index_p |
PredicateIndex * | p_index_p |
vector< FileIncludeItem > | file_includes |
set< string > | to_include |
bool | include_this_item |
fs::path | include_file_path |
bool | is_first_status = true |
string | status |
vector< string > | all_defined |
vector< string > | all_system |
set< string > | distinct_objects |
bool | equals_added |
Predicate * | equals_p |
bool | conjecture_found = false |
bool | negated_conjecture_found = false |
bool | conjecture_true = false |
bool | conjecture_false = false |
bool | found_true_axiom = false |
bool | found_false_axiom = false |
bool | negated_conjecture_exists = false |
bool | has_axioms = false |
bool | has_axioms_remaining = false |
bool | cnf_only = false |
size_t | number_of_negated_conjecture_clauses = 0 |
size_t | number_of_simplified_negated_conjecture_clauses = 0 |
string | current_clause_role |
vector< string > | clause_roles |
string | current_formula_role |
vector< string > | formula_roles |
string | current_formula_name |
vector< string > | formula_names |
bool | neg_lit |
Literal | current_lit |
Clause | current_clause |
vector< Clause > | all_clauses |
FOF | current_formula (FOFType::Empty) |
vector< FOF > | all_formulas |
qi::rule< Iter, char()> | percentage_sign |
qi::rule< Iter, char()> | double_quote |
qi::rule< Iter, char()> | do_char |
qi::rule< Iter, char()> | single_quote |
qi::rule< Iter, char()> | sq_char |
qi::rule< Iter, char()> | sign |
qi::rule< Iter, char()> | dot |
qi::rule< Iter, char()> | exponent |
qi::rule< Iter, char()> | slash_char |
qi::rule< Iter, char()> | slosh_char |
qi::rule< Iter, char()> | zero_numeric |
qi::rule< Iter, char()> | non_zero_numeric |
qi::rule< Iter, char()> | numeric |
qi::rule< Iter, char()> | lower_alpha |
qi::rule< Iter, char()> | upper_alpha |
qi::rule< Iter, char()> | alpha_numeric |
qi::rule< Iter, char()> | dollar |
qi::rule< Iter, char()> | printable_char |
qi::rule< Iter, char()> | viewable_char |
qi::rule< Iter, string()> | slash |
qi::rule< Iter, string()> | slosh |
qi::rule< Iter, string()> | unsigned_exp_integer |
qi::rule< Iter, string()> | signed_exp_integer |
qi::rule< Iter, string()> | exp_integer |
qi::rule< Iter, string()> | dot_decimal |
qi::rule< Iter, string()> | positive_decimal |
qi::rule< Iter, string()> | decimal |
qi::rule< Iter, string()> | decimal_fraction |
qi::rule< Iter, string()> | decimal_exponent |
qi::rule< Iter, string()> | unsigned_integer |
qi::rule< Iter, string()> | signed_integer |
qi::rule< Iter, string()> | integer |
qi::rule< Iter, string()> | unsigned_rational |
qi::rule< Iter, string()> | signed_rational |
qi::rule< Iter, string()> | rational |
qi::rule< Iter, string()> | unsigned_real |
qi::rule< Iter, string()> | signed_real |
qi::rule< Iter, string()> | real |
qi::rule< Iter, string()> | vline |
qi::rule< Iter, string()> | star |
qi::rule< Iter, string()> | plus |
qi::rule< Iter, string()> | arrow |
qi::rule< Iter, string()> | less_sign |
qi::rule< Iter, string()> | hash |
qi::rule< Iter, string()> | lower_word |
qi::rule< Iter, string()> | formula_role |
qi::rule< Iter, string()> | upper_word |
qi::rule< Iter, string()> | variable |
qi::rule< Iter, string()> | dollar_dollar_word |
qi::rule< Iter, string()> | dollar_word |
qi::rule< Iter, string()> | distinct_object |
qi::rule< Iter, string()> | single_quoted |
qi::rule< Iter, string()> | file_name |
qi::rule< Iter > | null |
qi::rule< Iter, string()> | comment_status |
qi::rule< Iter, string(), ascii::space_type > | status_comment |
qi::rule< Iter, string()> | standard_comment |
qi::rule< Iter, string(), ascii::space_type > | comment_line |
qi::rule< Iter, string()> | not_star_slash |
qi::rule< Iter, string()> | comment_block |
qi::rule< Iter, string(), ascii::space_type > | comment |
qi::rule< Iter, string()> | atomic_defined_word |
qi::rule< Iter, string()> | atomic_system_word |
qi::rule< Iter, string()> | system_functor |
qi::rule< Iter, string()> | system_constant |
qi::rule< Iter, string()> | number |
qi::rule< Iter, string()> | atomic_word |
qi::rule< Iter, string()> | predicate |
qi::rule< Iter, string()> | functor |
qi::rule< Iter, string()> | constant |
qi::rule< Iter, string()> | proposition |
qi::rule< Iter, string()> | name |
qi::rule< Iter, string()> | defined_predicate |
qi::rule< Iter, string()> | defined_proposition |
qi::rule< Iter, string()> | defined_functor |
qi::rule< Iter, string()> | defined_constant |
qi::rule< Iter, string()> | defined_term |
qi::rule< Iter, string()> | infix_equality |
qi::rule< Iter, string()> | infix_inequality |
qi::rule< Iter, string()> | defined_infix_pred |
qi::rule< Iter, string()> | fof_quantifier |
qi::rule< Iter, string()> | nonassoc_connective |
qi::rule< Iter, string()> | assoc_connective |
qi::rule< Iter, string()> | unary_connective |
The tptp_parser namespace contains a lot of stuff that's essentially just global.
Corresponds to v8.1.0.0 of the TPTP definition on 2-8-22.
WARNING!
You should probably REALLY not touch this unless you're very familiar indeed with the Spirit library in Boost, which is what's used to build the parser.
The good news is that you should never have to, because I'm a lovely man and have done all the hard work so you don't have to. Essentially the class TPTPParser wraps everything up and a call to TPTPParser::parse_tptp_from_file does a great deal (all!) of the work for you. This happens in StackProver::read_from_tptp_file, and at that point all the indices for Terms etc and the Matrix should be built.
Final note: yes this could be simpler, but the aim is to follow the actual TPTP specification as closely as possible. The naming should support this – names are chosen as much as possible to correspond to the TPTP documentation.
"What is this madness!?" I hear you cry.
Well, writing this is made very straightforward if you allow semantic actions to construct the results of the parse in what are essentially global data structures. Hiding them in a namespace takes some of the sting and uglyness away. Doing it differently is, I claim, just making life more difficult – this way, the TPTPParser class can just pull things out of the eventual globals – the user doesn't have to be any the wiser and they end up using the TermIndex, Matrix and so on quite happily, because those are the actual end result.
The boost library does actually have good support for doing all this in a nice OO way. Yes, I've tried that too. I came to the conclusion that the current approach yields much more readable code.
Variant - Term arguments can be Variables or other Terms.
Definition at line 89 of file TPTPParser.hpp.
An atomic formula can be infix as well.
Definition at line 118 of file TPTPParser.hpp.
using tptp_parser::Iter = string::const_iterator |
Iterator type for parser rules and grammars.
Definition at line 79 of file TPTPParser.hpp.
void tptp_parser::read_tptp_from_file_simple | ( | const string & | file_name, |
string & | file_contents ) |
Definition at line 1963 of file TPTPParser.cpp.
void tptp_parser::recursive_tptp_include | ( | const FileIncludeItem & | include_item | ) |
Definition at line 2008 of file TPTPParser.cpp.
vector<Clause> tptp_parser::all_clauses |
Definition at line 151 of file TPTPParser.cpp.
vector<string> tptp_parser::all_defined |
Definition at line 110 of file TPTPParser.cpp.
vector<FOF> tptp_parser::all_formulas |
Definition at line 156 of file TPTPParser.cpp.
vector<string> tptp_parser::all_system |
Definition at line 111 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::alpha_numeric |
Definition at line 217 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::arrow |
Definition at line 283 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::assoc_connective |
Definition at line 479 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::atomic_defined_word |
Definition at line 380 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::atomic_system_word |
Definition at line 382 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::atomic_word |
Definition at line 393 of file TPTPParser.cpp.
vector<string> tptp_parser::clause_roles |
Definition at line 137 of file TPTPParser.cpp.
bool tptp_parser::cnf_only = false |
Definition at line 130 of file TPTPParser.cpp.
qi::rule<Iter, string(), ascii::space_type> tptp_parser::comment |
Definition at line 378 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::comment_block |
Definition at line 373 of file TPTPParser.cpp.
qi::rule<Iter, string(), ascii::space_type> tptp_parser::comment_line |
Definition at line 364 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::comment_status |
Definition at line 342 of file TPTPParser.cpp.
bool tptp_parser::conjecture_false = false |
Definition at line 124 of file TPTPParser.cpp.
bool tptp_parser::conjecture_found = false |
Definition at line 121 of file TPTPParser.cpp.
bool tptp_parser::conjecture_true = false |
Definition at line 123 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::constant |
Definition at line 400 of file TPTPParser.cpp.
Clause tptp_parser::current_clause |
Definition at line 150 of file TPTPParser.cpp.
string tptp_parser::current_clause_role |
Definition at line 136 of file TPTPParser.cpp.
string tptp_parser::current_formula_name |
Definition at line 143 of file TPTPParser.cpp.
string tptp_parser::current_formula_role |
Definition at line 141 of file TPTPParser.cpp.
Literal tptp_parser::current_lit |
Definition at line 149 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::decimal |
Definition at line 248 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::decimal_exponent |
Definition at line 252 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::decimal_fraction |
Definition at line 250 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::defined_constant |
Definition at line 447 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::defined_functor |
Definition at line 428 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::defined_infix_pred |
Definition at line 455 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::defined_predicate |
Definition at line 406 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::defined_proposition |
Definition at line 420 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::defined_term |
Definition at line 449 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::distinct_object |
Definition at line 325 of file TPTPParser.cpp.
set<string> tptp_parser::distinct_objects |
Definition at line 112 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::do_char |
Definition at line 185 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::dollar |
Definition at line 222 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::dollar_dollar_word |
Definition at line 318 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::dollar_word |
Definition at line 322 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::dot |
Definition at line 199 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::dot_decimal |
Definition at line 244 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::double_quote |
Definition at line 183 of file TPTPParser.cpp.
bool tptp_parser::equals_added |
Definition at line 116 of file TPTPParser.cpp.
Predicate* tptp_parser::equals_p |
Definition at line 117 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::exp_integer |
Definition at line 241 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::exponent |
Definition at line 201 of file TPTPParser.cpp.
vector<FileIncludeItem> tptp_parser::file_includes |
Definition at line 89 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::file_name |
Definition at line 337 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::fof_quantifier |
Definition at line 467 of file TPTPParser.cpp.
vector<string> tptp_parser::formula_names |
Definition at line 144 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::formula_role |
Definition at line 294 of file TPTPParser.cpp.
vector<string> tptp_parser::formula_roles |
Definition at line 142 of file TPTPParser.cpp.
bool tptp_parser::found_false_axiom = false |
Definition at line 126 of file TPTPParser.cpp.
bool tptp_parser::found_true_axiom = false |
Definition at line 125 of file TPTPParser.cpp.
FunctionIndex* tptp_parser::fun_index_p |
Definition at line 82 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::functor |
Definition at line 398 of file TPTPParser.cpp.
bool tptp_parser::has_axioms = false |
Definition at line 128 of file TPTPParser.cpp.
bool tptp_parser::has_axioms_remaining = false |
Definition at line 129 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::hash |
Definition at line 287 of file TPTPParser.cpp.
fs::path tptp_parser::include_file_path |
Definition at line 103 of file TPTPParser.cpp.
bool tptp_parser::include_this_item |
Definition at line 99 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::infix_equality |
Definition at line 451 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::infix_inequality |
Definition at line 453 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::integer |
Definition at line 258 of file TPTPParser.cpp.
bool tptp_parser::is_first_status = true |
Definition at line 107 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::less_sign |
Definition at line 285 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::lower_alpha |
Definition at line 213 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::lower_word |
Definition at line 292 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::name |
Definition at line 404 of file TPTPParser.cpp.
bool tptp_parser::neg_lit |
Definition at line 148 of file TPTPParser.cpp.
bool tptp_parser::negated_conjecture_exists = false |
Definition at line 127 of file TPTPParser.cpp.
bool tptp_parser::negated_conjecture_found = false |
Definition at line 122 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::non_zero_numeric |
Definition at line 209 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::nonassoc_connective |
Definition at line 471 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::not_star_slash |
Definition at line 367 of file TPTPParser.cpp.
qi::rule<Iter> tptp_parser::null |
Definition at line 339 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::number |
Definition at line 388 of file TPTPParser.cpp.
size_t tptp_parser::number_of_negated_conjecture_clauses = 0 |
Definition at line 131 of file TPTPParser.cpp.
size_t tptp_parser::number_of_simplified_negated_conjecture_clauses = 0 |
Definition at line 132 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::numeric |
Definition at line 211 of file TPTPParser.cpp.
PredicateIndex* tptp_parser::p_index_p |
Definition at line 84 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::percentage_sign |
Definition at line 181 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::plus |
Definition at line 281 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::positive_decimal |
Definition at line 246 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::predicate |
Definition at line 396 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::printable_char |
Definition at line 224 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::proposition |
Definition at line 402 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::rational |
Definition at line 264 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::real |
Definition at line 270 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::sign |
Definition at line 197 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::signed_exp_integer |
Definition at line 239 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::signed_integer |
Definition at line 256 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::signed_rational |
Definition at line 262 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::signed_real |
Definition at line 268 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::single_quote |
Definition at line 190 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::single_quoted |
Definition at line 332 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::slash |
Definition at line 232 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::slash_char |
Definition at line 203 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::slosh |
Definition at line 234 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::slosh_char |
Definition at line 205 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::sq_char |
Definition at line 192 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::standard_comment |
Definition at line 359 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::star |
Definition at line 279 of file TPTPParser.cpp.
string tptp_parser::status |
Definition at line 108 of file TPTPParser.cpp.
qi::rule<Iter, string(), ascii::space_type> tptp_parser::status_comment |
Definition at line 351 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::system_constant |
Definition at line 386 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::system_functor |
Definition at line 384 of file TPTPParser.cpp.
TermIndex* tptp_parser::t_index_p |
Definition at line 83 of file TPTPParser.cpp.
set<string> tptp_parser::to_include |
Definition at line 98 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::unary_connective |
Definition at line 483 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::unsigned_exp_integer |
Definition at line 237 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::unsigned_integer |
Definition at line 254 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::unsigned_rational |
Definition at line 260 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::unsigned_real |
Definition at line 266 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::upper_alpha |
Definition at line 215 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::upper_word |
Definition at line 313 of file TPTPParser.cpp.
VariableIndex* tptp_parser::var_index_p |
Definition at line 81 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::variable |
Definition at line 316 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::viewable_char |
Definition at line 227 of file TPTPParser.cpp.
qi::rule<Iter, string()> tptp_parser::vline |
Definition at line 277 of file TPTPParser.cpp.
qi::rule<Iter, char()> tptp_parser::zero_numeric |
Definition at line 207 of file TPTPParser.cpp.