Connect++ 0.4.0
A fast, readable connection prover for first-order logic.
Loading...
Searching...
No Matches
ProverOutcome.cpp
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#include "ProverOutcome.hpp"
26//----------------------------------------------------------------------
27string outcome_to_string(const ProverOutcome& po) {
28 string result;
29 switch (po) {
30 case ProverOutcome::Valid:
31 result = "Valid";
32 break;
33 case ProverOutcome::False:
34 result = "False";
35 break;
36 case ProverOutcome::PathLenLimit:
37 result = "Path length limit reached";
38 break;
39 case ProverOutcome::Error:
40 result = "Error";
41 break;
42 case ProverOutcome::TimeOut:
43 result = "Timeout";
44 break;
45 default:
46 break;
47 }
48 return result;
49}
50
51//----------------------------------------------------------------------
52ostream& operator<<(ostream& out, const ProverOutcome& po) {
53 out << outcome_to_string(po);
54 return out;
55}