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 |
|
* Contains code for handling command-line options. |
14 |
|
* |
15 |
|
* For each <module>_options.toml configuration file, mkoptions.py |
16 |
|
* expands this template and generates a <module>_options.h file. |
17 |
|
*/ |
18 |
|
|
19 |
|
#include "cvc5_private.h" |
20 |
|
|
21 |
|
#ifndef CVC5__OPTIONS__PROOF_H |
22 |
|
#define CVC5__OPTIONS__PROOF_H |
23 |
|
|
24 |
|
#include "options/options.h" |
25 |
|
|
26 |
|
// clang-format off |
27 |
|
|
28 |
|
// clang-format on |
29 |
|
|
30 |
|
namespace cvc5 { |
31 |
|
namespace options { |
32 |
|
|
33 |
|
// clang-format off |
34 |
|
|
35 |
|
enum class ProofFormatMode |
36 |
|
{ |
37 |
|
VERIT, |
38 |
|
DOT, |
39 |
|
NONE |
40 |
|
}; |
41 |
|
|
42 |
|
static constexpr size_t ProofFormatMode__numValues = 3; |
43 |
|
|
44 |
|
std::ostream& operator<<(std::ostream& os, ProofFormatMode mode); |
45 |
|
ProofFormatMode stringToProofFormatMode(const std::string& optarg); |
46 |
|
enum class ProofGranularityMode |
47 |
|
{ |
48 |
|
OFF, |
49 |
|
DSL_REWRITE, |
50 |
|
REWRITE, |
51 |
|
THEORY_REWRITE |
52 |
|
}; |
53 |
|
|
54 |
|
static constexpr size_t ProofGranularityMode__numValues = 4; |
55 |
|
|
56 |
|
std::ostream& operator<<(std::ostream& os, ProofGranularityMode mode); |
57 |
|
ProofGranularityMode stringToProofGranularityMode(const std::string& optarg); |
58 |
|
// clang-format on |
59 |
|
|
60 |
|
#if defined(CVC5_MUZZLED) || defined(CVC5_COMPETITION_MODE) |
61 |
|
# define DO_SEMANTIC_CHECKS_BY_DEFAULT false |
62 |
|
#else /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ |
63 |
|
# define DO_SEMANTIC_CHECKS_BY_DEFAULT true |
64 |
|
#endif /* CVC5_MUZZLED || CVC5_COMPETITION_MODE */ |
65 |
|
|
66 |
27397 |
struct HolderPROOF |
67 |
|
{ |
68 |
|
// clang-format off |
69 |
|
bool proofEagerChecking = false; |
70 |
|
bool proofEagerCheckingWasSetByUser = false; |
71 |
|
ProofFormatMode proofFormatMode = ProofFormatMode::NONE; |
72 |
|
bool proofFormatModeWasSetByUser = false; |
73 |
|
ProofGranularityMode proofGranularityMode = ProofGranularityMode::THEORY_REWRITE; |
74 |
|
bool proofGranularityModeWasSetByUser = false; |
75 |
|
uint32_t proofPedantic = 0; |
76 |
|
bool proofPedanticWasSetByUser = false; |
77 |
|
bool proofPrintConclusion = false; |
78 |
|
bool proofPrintConclusionWasSetByUser = false; |
79 |
|
// clang-format on |
80 |
|
}; |
81 |
|
|
82 |
|
#undef DO_SEMANTIC_CHECKS_BY_DEFAULT |
83 |
|
|
84 |
|
// clang-format off |
85 |
|
extern struct proofEagerChecking__option_t |
86 |
|
{ |
87 |
|
typedef bool type; |
88 |
|
type operator()() const; |
89 |
|
} thread_local proofEagerChecking; |
90 |
|
extern struct proofFormatMode__option_t |
91 |
|
{ |
92 |
|
typedef ProofFormatMode type; |
93 |
|
type operator()() const; |
94 |
|
} thread_local proofFormatMode; |
95 |
|
extern struct proofGranularityMode__option_t |
96 |
|
{ |
97 |
|
typedef ProofGranularityMode type; |
98 |
|
type operator()() const; |
99 |
|
} thread_local proofGranularityMode; |
100 |
|
extern struct proofPedantic__option_t |
101 |
|
{ |
102 |
|
typedef uint32_t type; |
103 |
|
type operator()() const; |
104 |
|
} thread_local proofPedantic; |
105 |
|
extern struct proofPrintConclusion__option_t |
106 |
|
{ |
107 |
|
typedef bool type; |
108 |
|
type operator()() const; |
109 |
|
} thread_local proofPrintConclusion; |
110 |
|
// clang-format on |
111 |
|
|
112 |
|
namespace proof |
113 |
|
{ |
114 |
|
// clang-format off |
115 |
|
static constexpr const char* proofEagerChecking__name = "proof-eager-checking"; |
116 |
|
static constexpr const char* proofFormatMode__name = "proof-format-mode"; |
117 |
|
static constexpr const char* proofGranularityMode__name = "proof-granularity"; |
118 |
|
static constexpr const char* proofPedantic__name = "proof-pedantic"; |
119 |
|
static constexpr const char* proofPrintConclusion__name = "proof-print-conclusion"; |
120 |
|
// clang-format on |
121 |
|
} |
122 |
|
|
123 |
|
} // namespace options |
124 |
|
|
125 |
|
// clang-format off |
126 |
|
|
127 |
|
// clang-format on |
128 |
|
|
129 |
|
namespace options { |
130 |
|
// clang-format off |
131 |
14212336 |
inline bool proofEagerChecking__option_t::operator()() const |
132 |
14212336 |
{ return Options::current().proof.proofEagerChecking; } |
133 |
3760 |
inline ProofFormatMode proofFormatMode__option_t::operator()() const |
134 |
3760 |
{ return Options::current().proof.proofFormatMode; } |
135 |
6107 |
inline ProofGranularityMode proofGranularityMode__option_t::operator()() const |
136 |
6107 |
{ return Options::current().proof.proofGranularityMode; } |
137 |
3759 |
inline uint32_t proofPedantic__option_t::operator()() const |
138 |
3759 |
{ return Options::current().proof.proofPedantic; } |
139 |
239556 |
inline bool proofPrintConclusion__option_t::operator()() const |
140 |
239556 |
{ return Options::current().proof.proofPrintConclusion; } |
141 |
|
// clang-format on |
142 |
|
|
143 |
|
namespace proof |
144 |
|
{ |
145 |
|
// clang-format off |
146 |
|
void setDefaultProofEagerChecking(Options& opts, bool value); |
147 |
|
void setDefaultProofFormatMode(Options& opts, ProofFormatMode value); |
148 |
|
void setDefaultProofGranularityMode(Options& opts, ProofGranularityMode value); |
149 |
|
void setDefaultProofPedantic(Options& opts, uint32_t value); |
150 |
|
void setDefaultProofPrintConclusion(Options& opts, bool value); |
151 |
|
// clang-format on |
152 |
|
} |
153 |
|
|
154 |
|
} // namespace options |
155 |
|
} // namespace cvc5 |
156 |
|
|
157 |
|
#endif /* CVC5__OPTIONS__PROOF_H */ |