Connect++ 0.6.0
A fast, readable connection prover for first-order logic.
Loading...
Searching...
No Matches
Function.hpp
1/*
2
3Copyright © 2023-24 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#ifndef FUNCTION_HPP
26#define FUNCTION_HPP
27
28#include<iostream>
29#include<iomanip>
30#include<string>
31
32#include "LaTeXUtilities.hpp"
33#include "BasicTypes.hpp"
34#include "Parameters.hpp"
35#include "vic_strings.hpp"
36#include "cursor.hpp"
37
38using std::string;
39using std::ostream;
40using std::endl;
41using std::setw;
42
54class Function {
55private:
56 ID id;
57 string name;
58 Arity arity;
63 Function() : id(0), name(), arity(0) {}
64 Function(ID new_id) : id(new_id), name(), arity(0) {}
65 Function(ID new_id, const string& new_name)
66 : id(new_id), name(new_name), arity(0) {}
67 Function(ID new_id, const string& new_name, Arity new_arity)
68 : id(new_id), name(new_name), arity(new_arity) {}
69public:
77 Function(const Function&) = delete;
78 Function(const Function&&) = delete;
79 Function& operator=(const Function&) = delete;
80 Function& operator=(const Function&&) = delete;
84 inline string get_name() const { return name; }
88 inline Arity get_arity() const { return arity; }
92 string to_string() const;
101 string make_LaTeX() const;
102
103 friend class FunctionIndex;
104 friend ostream& operator<<(ostream&, const Function&);
105};
106
107#endif
Basic representation of functions.
Definition Function.hpp:54
friend ostream & operator<<(ostream &, const Function &)
Really only for debugging.
Definition Function.cpp:45
string make_LaTeX() const
Make a useable LaTeX version.
Definition Function.cpp:33
string to_string() const
Make a useable string representation.
Definition Function.cpp:28
Arity get_arity() const
Most basic access function.
Definition Function.hpp:88
string get_name() const
Most basic access function.
Definition Function.hpp:84
Function(const Function &)=delete
You want to inforce sharing, so don't allow copies to be made.
Function()
Constructors are private as you only want the FunctionIndex to make these, and it's a friend.
Definition Function.hpp:63
Mechanism for looking after functions.