Connect++ 0.7.0
A fast, readable connection prover for first-order logic.
Loading...
Searching...
No Matches
Predicate.cpp
1/*
2
3Copyright © 2023-26 Sean Holden. All rights reserved.
4
5*/
6/*
7
8This file is part of Connect++.
9
10Connect++ is free software: you can redistribute it and/or modify it
11under the terms of the GNU General Public License as published by the
12Free Software Foundation, either version 3 of the License, or (at your
13option) any later version.
14
15Connect++ is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18more details.
19
20You should have received a copy of the GNU General Public License along
21with Connect++. If not, see <https://www.gnu.org/licenses/>.
22
23*/
24
25#include "Predicate.hpp"
26//----------------------------------------------------------------------
27string Predicate::to_string() const {
28 colour_string::ColourString cs(params::use_colours);
29 return cs(name).purple();
30}
31//----------------------------------------------------------------------
33 return name;
34}
35//----------------------------------------------------------------------
36string Predicate::make_LaTeX() const {
37 string s ("\\text{");
38 s += latex_escape_characters(name);
39 s += "}";
40 return s;
41}
42//----------------------------------------------------------------------
44 return name;
45}
46//---------------------------------------------------------------------
48 return (name == p2.name) && (arity == p2.arity);
49}
50//---------------------------------------------------------------------
56ostream& operator<<(ostream& out, const Predicate& p) {
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}
Basic representation of predicates: here just names, ids and arities.
Definition Predicate.hpp:51
bool is_compatible_with(const Predicate &) const
Do the name and the arity of a pair of Predicates both match?
Definition Predicate.cpp:47
string to_tptp_string() const
At present returns only the name.
Definition Predicate.cpp:32
string make_LaTeX() const
Make a useable LaTeX version.
Definition Predicate.cpp:36
string to_string() const
Converting to a string just gives you the name.
Definition Predicate.cpp:27
string make_Graphviz() const
Make a useable Graphviz version.
Definition Predicate.cpp:43
Simple addition of colour to strings and ostreams.