Connect++ 0.6.0
A fast, readable connection prover for first-order logic.
Loading...
Searching...
No Matches
ProofPrinter.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 PROOFPRINTER_HPP
26#define PROOFPRINTER_HPP
27
28#include<iostream>
29#include<fstream>
30#include<filesystem>
31
32#include "StackItem.hpp"
33
34using std::filesystem::path;
35
36using ProofLine = pair<string, vector<size_t>>;
37using ProofType = vector<ProofLine>;
38
45void show_internal_proof(const ProofType&);
46
62private:
66 vector<StackItem>* p;
75 string make_LaTeX_state(StackItem*) const;
87 string make_LaTeX_subtree(StackItem*) const;
88public:
92 ProofPrinter() : p(nullptr) {};
98 ProofPrinter(vector<StackItem>* _p) : p(_p) {};
104 inline void set_proof(vector<StackItem>* _p) { p = _p; }
108 inline void clear() { p = nullptr; }
116 void make_LaTeX(const path&, const path&, const string&);
123 void make_Prolog(const path&);
127 void show_Prolog();
131 void show_tptp();
140 vector<pair<string, vector<size_t>>> make_internal() const;
141};
142
143#endif
Class for rendering a proof in various formats.
vector< StackItem > * p
Pointer to the output of StackProver.
string make_LaTeX_state(StackItem *) const
Helper for producing LaTeX output.
void make_Prolog(const path &)
Convert to a form suitable for use by the Prolog proof checker and write to a file.
string make_LaTeX_subtree(StackItem *) const
Helper for producing LaTeX output.
ProofPrinter(vector< StackItem > *_p)
The constructor you want.
void set_proof(vector< StackItem > *_p)
Basic set method.
void show_tptp()
Show the proof in a TPTP-friendly format.
void make_LaTeX(const path &, const path &, const string &)
Convert to LaTeX and store in the specified file.
ProofPrinter()
Basic constructor.
void show_Prolog()
Show the proof in Prolog format.
vector< pair< string, vector< size_t > > > make_internal() const
Make a simple data structure representing the proof stack.
void clear()
Basic set method.
Stack items: each contains its own material for generating possible next inferences.
Definition StackItem.hpp:56