Basic representation of predicates: here just names, ids and arities.
More...
#include <Predicate.hpp>
|
| | Predicate () |
| | These should only be constructed by PredicateIndex, which is a friend, and the constructors are therefore private.
|
| |
| | Predicate (ID new_id) |
| |
| | Predicate (ID new_id, const string &new_name) |
| |
| | Predicate (ID new_id, const string &new_name, Arity new_arity) |
| |
Basic representation of predicates: here just names, ids and arities.
This really just acts as identification. See the Literal class, which is where Predicate and Term get connected together. (No pun intended.)
Definition at line 51 of file Predicate.hpp.
◆ Predicate() [1/5]
These should only be constructed by PredicateIndex, which is a friend, and the constructors are therefore private.
Definition at line 61 of file Predicate.hpp.
61: id(0), name(), arity(0) {}
◆ Predicate() [2/5]
| Predicate::Predicate |
( |
ID | new_id | ) |
|
|
inlineprivate |
Definition at line 62 of file Predicate.hpp.
62: id(new_id), name(), arity(0) {}
◆ Predicate() [3/5]
| Predicate::Predicate |
( |
ID | new_id, |
|
|
const string & | new_name ) |
|
inlineprivate |
Definition at line 63 of file Predicate.hpp.
64 : id(new_id), name(new_name), arity(0) {}
◆ Predicate() [4/5]
| Predicate::Predicate |
( |
ID | new_id, |
|
|
const string & | new_name, |
|
|
Arity | new_arity ) |
|
inlineprivate |
Definition at line 65 of file Predicate.hpp.
66 : id(new_id), name(new_name), arity(new_arity) {}
◆ Predicate() [5/5]
Don't allow copies of these to be made.
As usual, let the compiler find any errors because you should never need to make copies this way.
◆ get_arity()
| Arity Predicate::get_arity |
( |
| ) |
const |
|
inline |
◆ get_ID()
| ID Predicate::get_ID |
( |
| ) |
const |
|
inline |
◆ get_name()
| string Predicate::get_name |
( |
| ) |
const |
|
inline |
◆ is_compatible_with()
| bool Predicate::is_compatible_with |
( |
const Predicate & | p2 | ) |
const |
Do the name and the arity of a pair of Predicates both match?
- Parameters
-
Definition at line 47 of file Predicate.cpp.
47 {
48 return (name == p2.name) && (arity == p2.arity);
49}
◆ make_Graphviz()
| string Predicate::make_Graphviz |
( |
| ) |
const |
Make a useable Graphviz version.
Definition at line 43 of file Predicate.cpp.
◆ make_LaTeX()
| string Predicate::make_LaTeX |
( |
| ) |
const |
Make a useable LaTeX version.
Assumes you are typesetting in Math Mode.
Definition at line 36 of file Predicate.cpp.
36 {
37 string s ("\\text{");
38 s += latex_escape_characters(name);
39 s += "}";
40 return s;
41}
◆ to_string()
| string Predicate::to_string |
( |
| ) |
const |
Converting to a string just gives you the name.
Definition at line 27 of file Predicate.cpp.
27 {
29 return cs(name).purple();
30}
Simple addition of colour to strings and ostreams.
◆ to_tptp_string()
| string Predicate::to_tptp_string |
( |
| ) |
const |
At present returns only the name.
Definition at line 32 of file Predicate.cpp.
◆ operator<<
| ostream & operator<< |
( |
ostream & | out, |
|
|
const Predicate & | p ) |
|
friend |
Only for debugging.
Use Predicate::to_string if you want something pretty.
Definition at line 56 of file Predicate.cpp.
56 {
57 out << "Predicate: " << setw(params::output_width) << p.id
58 << " Name: " << setw(params::output_width + 15) << p.name
59 << " Arity: " << setw(params::output_width) << p.arity;
60 return out;
61}
◆ PredicateIndex
◆ arity
◆ id
◆ name
The documentation for this class was generated from the following files:
- /Users/sbh11/Desktop/connection-prover/c++/connect++/source/literal/Predicate.hpp
- /Users/sbh11/Desktop/connection-prover/c++/connect++/source/literal/Predicate.cpp