Connect++
0.4.0
A fast, readable connection prover for first-order logic.
Loading...
Searching...
No Matches
Function.cpp
1
/*
2
3
Copyright © 2023-24 Sean Holden. All rights reserved.
4
5
*/
6
/*
7
8
This file is part of Connect++.
9
10
Connect++ is free software: you can redistribute it and/or modify it
11
under the terms of the GNU General Public License as published by the
12
Free Software Foundation, either version 3 of the License, or (at your
13
option) any later version.
14
15
Connect++ is distributed in the hope that it will be useful, but WITHOUT
16
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
17
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
18
more details.
19
20
You should have received a copy of the GNU General Public License along
21
with Connect++. If not, see <https://www.gnu.org/licenses/>.
22
23
*/
24
25
#include "Function.hpp"
26
27
//----------------------------------------------------------------------
28
string
Function::to_string
()
const
{
29
colour_string::ColourString
cs(params::use_colours);
30
return
cs(name).green();
31
}
32
//----------------------------------------------------------------------
33
string
Function::make_LaTeX
()
const
{
34
string
s (
"\\text{"
);
35
s += latex_escape_characters(name);
36
s +=
"}"
;
37
return
s;
38
}
39
//----------------------------------------------------------------------
45
ostream& operator<<(ostream& out,
const
Function
& f) {
46
out <<
"Function: "
<< setw(params::output_width) << f.id
47
<<
" Name: "
<< setw(params::output_width + 20) << f.name
48
<<
" Arity: "
<< setw(params::output_width) << f.arity;
49
return
out;
50
}
Function
Basic representation of functions.
Definition
Function.hpp:54
Function::make_LaTeX
string make_LaTeX() const
Make a useable LaTeX version.
Definition
Function.cpp:33
Function::to_string
string to_string() const
make a useable string representation.
Definition
Function.cpp:28
colour_string::ColourString
Simple addition of colour to strings and ostreams.
Definition
vic_strings.hpp:118
source
terms
Function.cpp
Generated by
1.10.0