1 |
|
/****************************************************************************** |
2 |
|
* Top contributors (to current version): |
3 |
|
* Mathias Preiner, Aina Niemetz |
4 |
|
* |
5 |
|
* This file is part of the cvc5 project. |
6 |
|
* |
7 |
|
* Copyright (c) 2009-2021 by the authors listed in the file AUTHORS |
8 |
|
* in the top-level source directory and their institutional affiliations. |
9 |
|
* All rights reserved. See the file COPYING in the top-level source |
10 |
|
* directory for licensing information. |
11 |
|
* **************************************************************************** |
12 |
|
* |
13 |
|
* Option template for option modules. |
14 |
|
* |
15 |
|
* For each <module>_options.toml configuration file, mkoptions.py |
16 |
|
* expands this template and generates a <module>_options.cpp file. |
17 |
|
*/ |
18 |
|
#include "options/proof_options.h" |
19 |
|
|
20 |
|
#include <iostream> |
21 |
|
|
22 |
|
#include "base/check.h" |
23 |
|
#include "options/option_exception.h" |
24 |
|
|
25 |
|
namespace cvc5::options { |
26 |
|
|
27 |
|
// clang-format off |
28 |
|
std::ostream& operator<<(std::ostream& os, ProofCheckMode mode) |
29 |
|
{ |
30 |
|
switch(mode) |
31 |
|
{ |
32 |
|
case ProofCheckMode::EAGER_SIMPLE: return os << "eager-simple"; |
33 |
|
case ProofCheckMode::LAZY: return os << "lazy"; |
34 |
|
case ProofCheckMode::NONE: return os << "none"; |
35 |
|
case ProofCheckMode::EAGER: return os << "eager"; |
36 |
|
default: Unreachable(); |
37 |
|
} |
38 |
|
return os; |
39 |
|
} |
40 |
9 |
ProofCheckMode stringToProofCheckMode(const std::string& optarg) |
41 |
|
{ |
42 |
9 |
if (optarg == "eager-simple") return ProofCheckMode::EAGER_SIMPLE; |
43 |
9 |
else if (optarg == "lazy") return ProofCheckMode::LAZY; |
44 |
9 |
else if (optarg == "none") return ProofCheckMode::NONE; |
45 |
9 |
else if (optarg == "eager") return ProofCheckMode::EAGER; |
46 |
|
else if (optarg == "help") |
47 |
|
{ |
48 |
|
std::cerr << R"FOOBAR( |
49 |
|
Proof checking modes. |
50 |
|
Available modes for --proof-check are: |
51 |
|
+ eager-simple |
52 |
|
check rule applications during construction |
53 |
|
+ lazy (default) |
54 |
|
check rule applications only during final proof construction |
55 |
|
+ none |
56 |
|
do not check rule applications |
57 |
|
+ eager |
58 |
|
check rule applications and proofs from generators eagerly for local debugging |
59 |
|
)FOOBAR"; |
60 |
|
std::exit(1); |
61 |
|
} |
62 |
|
throw OptionException(std::string("unknown option for --proof-check: `") + |
63 |
|
optarg + "'. Try --proof-check=help."); |
64 |
|
} |
65 |
|
std::ostream& operator<<(std::ostream& os, ProofFormatMode mode) |
66 |
|
{ |
67 |
|
switch(mode) |
68 |
|
{ |
69 |
|
case ProofFormatMode::TPTP: return os << "tptp"; |
70 |
|
case ProofFormatMode::ALETHE: return os << "alethe"; |
71 |
|
case ProofFormatMode::NONE: return os << "none"; |
72 |
|
case ProofFormatMode::LFSC: return os << "lfsc"; |
73 |
|
case ProofFormatMode::DOT: return os << "dot"; |
74 |
|
default: Unreachable(); |
75 |
|
} |
76 |
|
return os; |
77 |
|
} |
78 |
1 |
ProofFormatMode stringToProofFormatMode(const std::string& optarg) |
79 |
|
{ |
80 |
1 |
if (optarg == "tptp") return ProofFormatMode::TPTP; |
81 |
1 |
else if (optarg == "alethe") return ProofFormatMode::ALETHE; |
82 |
1 |
else if (optarg == "none") return ProofFormatMode::NONE; |
83 |
1 |
else if (optarg == "lfsc") return ProofFormatMode::LFSC; |
84 |
|
else if (optarg == "dot") return ProofFormatMode::DOT; |
85 |
|
else if (optarg == "help") |
86 |
|
{ |
87 |
|
std::cerr << R"FOOBAR( |
88 |
|
Proof format modes. |
89 |
|
Available modes for --proof-format-mode are: |
90 |
|
+ tptp |
91 |
|
Output TPTP proof (work in progress) |
92 |
|
+ alethe |
93 |
|
Output Alethe proof |
94 |
|
+ none (default) |
95 |
|
Do not translate proof output |
96 |
|
+ lfsc |
97 |
|
Output LFSC proof |
98 |
|
+ dot |
99 |
|
Output DOT proof |
100 |
|
)FOOBAR"; |
101 |
|
std::exit(1); |
102 |
|
} |
103 |
|
throw OptionException(std::string("unknown option for --proof-format-mode: `") + |
104 |
|
optarg + "'. Try --proof-format-mode=help."); |
105 |
|
} |
106 |
|
std::ostream& operator<<(std::ostream& os, ProofGranularityMode mode) |
107 |
|
{ |
108 |
|
switch(mode) |
109 |
|
{ |
110 |
|
case ProofGranularityMode::DSL_REWRITE: return os << "dsl-rewrite"; |
111 |
|
case ProofGranularityMode::OFF: return os << "off"; |
112 |
|
case ProofGranularityMode::REWRITE: return os << "rewrite"; |
113 |
|
case ProofGranularityMode::THEORY_REWRITE: return os << "theory-rewrite"; |
114 |
|
default: Unreachable(); |
115 |
|
} |
116 |
|
return os; |
117 |
|
} |
118 |
|
ProofGranularityMode stringToProofGranularityMode(const std::string& optarg) |
119 |
|
{ |
120 |
|
if (optarg == "dsl-rewrite") return ProofGranularityMode::DSL_REWRITE; |
121 |
|
else if (optarg == "off") return ProofGranularityMode::OFF; |
122 |
|
else if (optarg == "rewrite") return ProofGranularityMode::REWRITE; |
123 |
|
else if (optarg == "theory-rewrite") return ProofGranularityMode::THEORY_REWRITE; |
124 |
|
else if (optarg == "help") |
125 |
|
{ |
126 |
|
std::cerr << R"FOOBAR( |
127 |
|
Modes for proof granularity. |
128 |
|
Available modes for --proof-granularity are: |
129 |
|
+ dsl-rewrite |
130 |
|
Allow DSL rewrites and evaluation steps, expand macros, rewrite, substitution, |
131 |
|
and theory rewrite steps. |
132 |
|
+ off |
133 |
|
Do not improve the granularity of proofs. |
134 |
|
+ rewrite |
135 |
|
Allow rewrite or substitution steps, expand macros. |
136 |
|
+ theory-rewrite (default) |
137 |
|
Allow theory rewrite steps, expand macros, rewrite and substitution steps. |
138 |
|
)FOOBAR"; |
139 |
|
std::exit(1); |
140 |
|
} |
141 |
|
throw OptionException(std::string("unknown option for --proof-granularity: `") + |
142 |
|
optarg + "'. Try --proof-granularity=help."); |
143 |
|
} |
144 |
|
// clang-format on |
145 |
|
|
146 |
31137 |
} // namespace cvc5::options |