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/datatypes_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, SygusFairMode mode) |
29 |
|
{ |
30 |
|
switch(mode) |
31 |
|
{ |
32 |
|
case SygusFairMode::NONE: return os << "none"; |
33 |
|
case SygusFairMode::DT_SIZE: return os << "dt-size"; |
34 |
|
case SygusFairMode::DIRECT: return os << "direct"; |
35 |
|
case SygusFairMode::DT_SIZE_PRED: return os << "dt-size-bound"; |
36 |
|
case SygusFairMode::DT_HEIGHT_PRED: return os << "dt-height-bound"; |
37 |
|
default: Unreachable(); |
38 |
|
} |
39 |
|
return os; |
40 |
|
} |
41 |
4 |
SygusFairMode stringToSygusFairMode(const std::string& optarg) |
42 |
|
{ |
43 |
4 |
if (optarg == "none") return SygusFairMode::NONE; |
44 |
4 |
else if (optarg == "dt-size") return SygusFairMode::DT_SIZE; |
45 |
4 |
else if (optarg == "direct") return SygusFairMode::DIRECT; |
46 |
|
else if (optarg == "dt-size-bound") return SygusFairMode::DT_SIZE_PRED; |
47 |
|
else if (optarg == "dt-height-bound") return SygusFairMode::DT_HEIGHT_PRED; |
48 |
|
else if (optarg == "help") |
49 |
|
{ |
50 |
|
std::cerr << R"FOOBAR( |
51 |
|
Modes for enforcing fairness for counterexample guided quantifier instantion. |
52 |
|
Available modes for --sygus-fair are: |
53 |
|
+ none |
54 |
|
Do not enforce fairness. |
55 |
|
+ dt-size (default) |
56 |
|
Enforce fairness using size operator. |
57 |
|
+ direct |
58 |
|
Enforce fairness using direct conflict lemmas. |
59 |
|
+ dt-size-bound |
60 |
|
Enforce fairness by size bound predicate. |
61 |
|
+ dt-height-bound |
62 |
|
Enforce fairness by height bound predicate. |
63 |
|
)FOOBAR"; |
64 |
|
std::exit(1); |
65 |
|
} |
66 |
|
throw OptionException(std::string("unknown option for --sygus-fair: `") + |
67 |
|
optarg + "'. Try --sygus-fair=help."); |
68 |
|
} |
69 |
|
// clang-format on |
70 |
|
|
71 |
31125 |
} // namespace cvc5::options |