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 39 of file Predicate.cpp.
39 {
40 return (name == p2.name) && (arity == p2.arity);
41}
◆ make_LaTeX()
string Predicate::make_LaTeX |
( |
| ) |
const |
Make a useable LaTeX version.
Assumes you are typesetting in Math Mode.
Definition at line 32 of file Predicate.cpp.
32 {
33 string s ("\\text{");
34 s += latex_escape_characters(name);
35 s += "}";
36 return s;
37}
◆ 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.
◆ operator<<
ostream & operator<< |
( |
ostream & | out, |
|
|
const Predicate & | p ) |
|
friend |
Only for debugging.
Use Predicate::to_string if you want something pretty.
Definition at line 48 of file Predicate.cpp.
48 {
49 out << "Predicate: " << setw(params::output_width) << p.id
50 << " Name: " << setw(params::output_width + 15) << p.name
51 << " Arity: " << setw(params::output_width) << p.arity;
52 return out;
53}
◆ 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