blob: 57b9661ba3301ae0d26780abb18bcf7908445e4c (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
/********************* */
/*! \file options_handlers.h
** \verbatim
** Original author: Morgan Deters
** Major contributors: none
** Minor contributors (to current version): Kshitij Bansal, Tim King
** This file is part of the CVC4 project.
** Copyright (c) 2009-2014 New York University and The University of Iowa
** See the file COPYING in the top-level source directory for licensing
** information.\endverbatim
**
** \brief Custom handlers and predicates for arithmetic options
**
** Custom handlers and predicates for arithmetic options.
**/
#include "cvc4_private.h"
#ifndef __CVC4__THEORY__ARITH__OPTIONS_HANDLERS_H
#define __CVC4__THEORY__ARITH__OPTIONS_HANDLERS_H
#include <string>
namespace CVC4 {
namespace theory {
namespace arith {
static const std::string arithUnateLemmasHelp = "\
Unate lemmas are generated before SAT search begins using the relationship\n\
of constant terms and polynomials.\n\
Modes currently supported by the --unate-lemmas option:\n\
+ none \n\
+ ineqs \n\
Outputs lemmas of the general form (<= p c) implies (<= p d) for c < d.\n\
+ eqs \n\
Outputs lemmas of the general forms\n\
(= p c) implies (<= p d) for c < d, or\n\
(= p c) implies (not (= p d)) for c != d.\n\
+ all \n\
A combination of inequalities and equalities.\n\
";
static const std::string propagationModeHelp = "\
This decides on kind of propagation arithmetic attempts to do during the search.\n\
+ none\n\
+ unate\n\
use constraints to do unate propagation\n\
+ bi (Bounds Inference)\n\
infers bounds on basic variables using the upper and lower bounds of the\n\
non-basic variables in the tableau.\n\
+both\n\
";
static const std::string errorSelectionRulesHelp = "\
This decides on the rule used by simplex during heuristic rounds\n\
for deciding the next basic variable to select.\n\
Heuristic pivot rules available:\n\
+min\n\
The minimum abs() value of the variable's violation of its bound. (default)\n\
+max\n\
The maximum violation the bound\n\
+varord\n\
The variable order\n\
";
inline ArithUnateLemmaMode stringToArithUnateLemmaMode(std::string option, std::string optarg, SmtEngine* smt) throw(OptionException) {
if(optarg == "all") {
return ALL_PRESOLVE_LEMMAS;
} else if(optarg == "none") {
return NO_PRESOLVE_LEMMAS;
} else if(optarg == "ineqs") {
return INEQUALITY_PRESOLVE_LEMMAS;
} else if(optarg == "eqs") {
return EQUALITY_PRESOLVE_LEMMAS;
} else if(optarg == "help") {
puts(arithUnateLemmasHelp.c_str());
exit(1);
} else {
throw OptionException(std::string("unknown option for --unate-lemmas: `") +
optarg + "'. Try --unate-lemmas help.");
}
}
inline ArithPropagationMode stringToArithPropagationMode(std::string option, std::string optarg, SmtEngine* smt) throw(OptionException) {
if(optarg == "none") {
return NO_PROP;
} else if(optarg == "unate") {
return UNATE_PROP;
} else if(optarg == "bi") {
return BOUND_INFERENCE_PROP;
} else if(optarg == "both") {
return BOTH_PROP;
} else if(optarg == "help") {
puts(propagationModeHelp.c_str());
exit(1);
} else {
throw OptionException(std::string("unknown option for --arith-prop: `") +
optarg + "'. Try --arith-prop help.");
}
}
inline ErrorSelectionRule stringToErrorSelectionRule(std::string option, std::string optarg, SmtEngine* smt) throw(OptionException) {
if(optarg == "min") {
return MINIMUM_AMOUNT;
} else if(optarg == "varord") {
return VAR_ORDER;
} else if(optarg == "max") {
return MAXIMUM_AMOUNT;
} else if(optarg == "help") {
puts(errorSelectionRulesHelp.c_str());
exit(1);
} else {
throw OptionException(std::string("unknown option for --heuristic-pivot-rule: `") +
optarg + "'. Try --heuristic-pivot-rule help.");
}
}
}/* CVC4::theory::arith namespace */
}/* CVC4::theory namespace */
}/* CVC4 namespace */
#endif /* __CVC4__THEORY__ARITH__OPTIONS_HANDLERS_H */
|