Connect++ 0.5.0
A fast, readable connection prover for first-order logic.
Loading...
Searching...
No Matches
Lemmata.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 LEMMATA_HPP
26#define LEMMATA_HPP
27
28#include <iostream>
29#include <vector>
30
31#include "Clause.hpp"
32#include "InferenceItem.hpp"
33
34using std::vector;
35using std::ostream;
36using std::endl;
37using std::cout;
38
49class Lemmata {
50private:
54 vector<Literal> ls;
55 size_t len;
56public:
60 Lemmata() : ls(), len(0) {}
66 void push_back(const Literal&);
70 void clear() { ls.clear(); len = 0; }
87 void find_all_lemmata(vector<InferenceItem>&, Clause&);
97 void find_initial_lemmata(vector<InferenceItem>&, Clause&);
103 string to_string(bool = false) const;
109 string make_LaTeX(bool = false) const;
110
111 friend ostream& operator<<(ostream&, const Lemmata&);
112};
113
114#endif
Representation of clauses.
Definition Clause.hpp:52
Representation of the lemma list.
Definition Lemmata.hpp:49
Lemmata()
You should not need any more complicated constructor.
Definition Lemmata.hpp:60
string make_LaTeX(bool=false) const
Definition Lemmata.cpp:86
void find_initial_lemmata(vector< InferenceItem > &, Clause &)
Find all lemmata that are applicable, but only for the initial Literal in a Clause.
Definition Lemmata.cpp:33
void find_all_lemmata(vector< InferenceItem > &, Clause &)
Find all lemmata that are applicable, given a Clause.
Definition Lemmata.cpp:56
vector< Literal > ls
Lemmata list as appearing in the connection calculus.
Definition Lemmata.hpp:54
string to_string(bool=false) const
Convert to a string.
Definition Lemmata.cpp:82
void clear()
Self-explanatory.
Definition Lemmata.hpp:70
void push_back(const Literal &)
Self-explanatory.
Definition Lemmata.cpp:28
Basic representation of literals, bundling together (pointers to) a Predicate, a collection of argume...
Definition Literal.hpp:50